@superdispatch/ui-lab 0.21.11 → 0.21.13

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.
Files changed (97) hide show
  1. package/.babelrc.js +5 -0
  2. package/.turbo/turbo-version.log +28 -0
  3. package/package.json +39 -13
  4. package/pkg/README.md +10 -0
  5. package/{dist-node → pkg/dist-node}/index.js +2 -4
  6. package/pkg/dist-node/index.js.map +1 -0
  7. package/{dist-src → pkg/dist-src}/alert/Alert.js +2 -4
  8. package/{dist-web → pkg/dist-web}/index.js +2 -4
  9. package/pkg/dist-web/index.js.map +1 -0
  10. package/pkg/package.json +34 -0
  11. package/playroom.ts +23 -0
  12. package/src/alert/Alert.stories.tsx +105 -0
  13. package/src/alert/Alert.tsx +108 -0
  14. package/src/banner/Banner.stories.tsx +64 -0
  15. package/src/banner/Banner.tsx +120 -0
  16. package/src/box/Box.stories.tsx +20 -0
  17. package/src/box/Box.tsx +252 -0
  18. package/src/button/Button.stories.tsx +717 -0
  19. package/src/button/Button.tsx +460 -0
  20. package/src/button-area/ButtonArea.stories.tsx +65 -0
  21. package/src/button-area/ButtonArea.tsx +88 -0
  22. package/src/container/Container.tsx +48 -0
  23. package/src/description-item/DescriptionItem.stories.tsx +163 -0
  24. package/src/description-item/DescriptionItem.tsx +104 -0
  25. package/src/file-drop-zone/FileDropZone.stories.tsx +44 -0
  26. package/src/file-drop-zone/FileDropZone.tsx +170 -0
  27. package/src/file-list-item/FileListItem.stories.tsx +37 -0
  28. package/src/file-list-item/FileListItem.tsx +145 -0
  29. package/src/file-list-item/__tests__/FileListItem.spec.tsx +339 -0
  30. package/src/index.spec.ts +43 -0
  31. package/src/index.ts +28 -0
  32. package/src/linked-text/LinkeText.stories.tsx +42 -0
  33. package/src/linked-text/LinkedText.tsx +47 -0
  34. package/src/multiline-text/MultilineText.stories.tsx +30 -0
  35. package/src/multiline-text/MultilineText.ts +16 -0
  36. package/src/navbar/Navbar.stories.tsx +135 -0
  37. package/src/navbar/Navbar.tsx +111 -0
  38. package/src/navbar/NavbarAccordion.tsx +171 -0
  39. package/src/navbar/NavbarAvatar.tsx +51 -0
  40. package/src/navbar/NavbarBottomBar.tsx +135 -0
  41. package/src/navbar/NavbarContext.tsx +23 -0
  42. package/src/navbar/NavbarItem.tsx +119 -0
  43. package/src/navbar/NavbarList.tsx +225 -0
  44. package/src/navbar/NavbarMenu.tsx +102 -0
  45. package/src/sidebar/Sidebar.stories.tsx +363 -0
  46. package/src/sidebar/Sidebar.tsx +73 -0
  47. package/src/sidebar/SidebarBackButton.tsx +33 -0
  48. package/src/sidebar/SidebarContainer.tsx +114 -0
  49. package/src/sidebar/SidebarContent.tsx +119 -0
  50. package/src/sidebar/SidebarDivider.tsx +15 -0
  51. package/src/sidebar/SidebarMenuItem.tsx +211 -0
  52. package/src/sidebar/SidebarMenuItemAction.tsx +27 -0
  53. package/src/sidebar/SidebarMenuItemAvatar.tsx +59 -0
  54. package/src/sidebar/SidebarMenuItemContext.tsx +33 -0
  55. package/src/sidebar/SidebarSubheader.tsx +38 -0
  56. package/src/styled.d.ts +12 -0
  57. package/src/text-box/TextBox.stories.tsx +108 -0
  58. package/src/text-box/TextBox.tsx +229 -0
  59. package/src/utils/RuleNormalizer.ts +24 -0
  60. package/src/utils/mergeStyles.ts +28 -0
  61. package/tsconfig.json +19 -0
  62. package/LICENSE +0 -21
  63. package/dist-node/index.js.map +0 -1
  64. package/dist-web/index.js.map +0 -1
  65. /package/{dist-src → pkg/dist-src}/banner/Banner.js +0 -0
  66. /package/{dist-src → pkg/dist-src}/box/Box.js +0 -0
  67. /package/{dist-src → pkg/dist-src}/button/Button.js +0 -0
  68. /package/{dist-src → pkg/dist-src}/button-area/ButtonArea.js +0 -0
  69. /package/{dist-src → pkg/dist-src}/container/Container.js +0 -0
  70. /package/{dist-src → pkg/dist-src}/description-item/DescriptionItem.js +0 -0
  71. /package/{dist-src → pkg/dist-src}/file-drop-zone/FileDropZone.js +0 -0
  72. /package/{dist-src → pkg/dist-src}/file-list-item/FileListItem.js +0 -0
  73. /package/{dist-src → pkg/dist-src}/index.js +0 -0
  74. /package/{dist-src → pkg/dist-src}/linked-text/LinkedText.js +0 -0
  75. /package/{dist-src → pkg/dist-src}/multiline-text/MultilineText.js +0 -0
  76. /package/{dist-src → pkg/dist-src}/navbar/Navbar.js +0 -0
  77. /package/{dist-src → pkg/dist-src}/navbar/NavbarAccordion.js +0 -0
  78. /package/{dist-src → pkg/dist-src}/navbar/NavbarAvatar.js +0 -0
  79. /package/{dist-src → pkg/dist-src}/navbar/NavbarBottomBar.js +0 -0
  80. /package/{dist-src → pkg/dist-src}/navbar/NavbarContext.js +0 -0
  81. /package/{dist-src → pkg/dist-src}/navbar/NavbarItem.js +0 -0
  82. /package/{dist-src → pkg/dist-src}/navbar/NavbarList.js +0 -0
  83. /package/{dist-src → pkg/dist-src}/navbar/NavbarMenu.js +0 -0
  84. /package/{dist-src → pkg/dist-src}/sidebar/Sidebar.js +0 -0
  85. /package/{dist-src → pkg/dist-src}/sidebar/SidebarBackButton.js +0 -0
  86. /package/{dist-src → pkg/dist-src}/sidebar/SidebarContainer.js +0 -0
  87. /package/{dist-src → pkg/dist-src}/sidebar/SidebarContent.js +0 -0
  88. /package/{dist-src → pkg/dist-src}/sidebar/SidebarDivider.js +0 -0
  89. /package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItem.js +0 -0
  90. /package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItemAction.js +0 -0
  91. /package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItemAvatar.js +0 -0
  92. /package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItemContext.js +0 -0
  93. /package/{dist-src → pkg/dist-src}/sidebar/SidebarSubheader.js +0 -0
  94. /package/{dist-src → pkg/dist-src}/text-box/TextBox.js +0 -0
  95. /package/{dist-src → pkg/dist-src}/utils/RuleNormalizer.js +0 -0
  96. /package/{dist-src → pkg/dist-src}/utils/mergeStyles.js +0 -0
  97. /package/{dist-types → pkg/dist-types}/index.d.ts +0 -0
@@ -0,0 +1,225 @@
1
+ import { IconButton } from '@material-ui/core';
2
+ import { Menu as MenuIcon, MenuOpen } from '@material-ui/icons';
3
+ import { Color, Inline, useResponsiveValue } from '@superdispatch/ui';
4
+ import {
5
+ ComponentType,
6
+ HTMLAttributes,
7
+ Key,
8
+ MouseEvent,
9
+ ReactElement,
10
+ ReactNode,
11
+ useMemo,
12
+ } from 'react';
13
+ import styled from 'styled-components';
14
+ import { NavbarAccordion, NavbarAccordionProps } from './NavbarAccordion';
15
+ import { useNavbarContext } from './NavbarContext';
16
+ import {
17
+ NavbarBadge,
18
+ NavbarItem,
19
+ NavbarItemProps,
20
+ NavbarLabel,
21
+ } from './NavbarItem';
22
+
23
+ const Header = styled.div`
24
+ margin: 0 16px 8px;
25
+
26
+ display: flex;
27
+ flex-shrink: 0;
28
+ align-items: center;
29
+ justify-content: space-between;
30
+ position: sticky;
31
+ `;
32
+
33
+ const Wrapper = styled.div<{ isMobile: boolean }>`
34
+ display: flex;
35
+ flex: 1;
36
+ flex-direction: column;
37
+
38
+ overflow: hidden;
39
+ padding-top: 16px;
40
+ background: #1b2638;
41
+ transition: width 0.3s linear;
42
+
43
+ height: 100%;
44
+ width: ${({ isMobile }) => (isMobile ? '280px' : 'initial')};
45
+
46
+ &[data-expanded='true'] {
47
+ width: ${({ isMobile }) => (isMobile ? '280px' : '240px')};
48
+ }
49
+
50
+ &[data-expanded='false'] {
51
+ width: ${({ isMobile }) => (isMobile ? '280px' : '72px')};
52
+
53
+ & > ${Header} {
54
+ justify-content: center;
55
+ }
56
+ }
57
+ `;
58
+
59
+ const ExpandIconButton = styled(IconButton)`
60
+ color: ${Color.Silver500};
61
+
62
+ &&:focus {
63
+ background-color: inherit;
64
+ }
65
+ `;
66
+
67
+ const Footer = styled.div`
68
+ flex-grow: 1;
69
+ display: flex;
70
+ align-items: flex-end;
71
+ margin: 16px 0 8px;
72
+ position: sticky;
73
+ `;
74
+
75
+ const Root = styled.div`
76
+ color: inherit;
77
+ background-color: unset;
78
+ border-left: unset;
79
+ font-size: 14px;
80
+ font-weight: 400;
81
+ line-height: 20px;
82
+ text-decoration: none;
83
+ padding: 8px 16px;
84
+
85
+ svg {
86
+ font-size: 24px;
87
+ color: ${Color.Dark100};
88
+ }
89
+ `;
90
+
91
+ interface NavbarMenuItemProps {
92
+ icon?: ReactNode;
93
+ label: ReactNode;
94
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
95
+ component?: ComponentType<HTMLAttributes<HTMLElement>>;
96
+ }
97
+
98
+ export function NavbarMenuItem({
99
+ label,
100
+ icon,
101
+ onClick,
102
+ component,
103
+ }: NavbarMenuItemProps): ReactElement {
104
+ return (
105
+ <Root as={component} onClick={onClick}>
106
+ <Inline space="xsmall" verticalAlign="center">
107
+ {icon}
108
+
109
+ <NavbarLabel>{label}</NavbarLabel>
110
+ </Inline>
111
+ </Root>
112
+ );
113
+ }
114
+
115
+ const Content = styled.div`
116
+ height: 100%;
117
+ min-height: 50px;
118
+ overflow-y: auto;
119
+ overflow-x: hidden;
120
+
121
+ &[aria-expanded='false'] {
122
+ ${NavbarBadge}, ${NavbarLabel} {
123
+ display: none;
124
+ }
125
+ }
126
+ `;
127
+
128
+ export interface NavbarAccordionOptions extends NavbarAccordionProps {
129
+ key: Key;
130
+ groupKey?: Key;
131
+ hide?: boolean;
132
+ }
133
+ export interface NavbarItemOptions extends NavbarItemProps {
134
+ key: Key;
135
+ groupKey?: Key;
136
+ hide?: boolean;
137
+ }
138
+
139
+ interface NavbarListProps {
140
+ header: ReactNode;
141
+ items: Array<NavbarItemOptions | NavbarAccordionOptions>;
142
+ footer?: ReactNode;
143
+ }
144
+
145
+ export function NavbarList({
146
+ header,
147
+ items,
148
+ footer,
149
+ }: NavbarListProps): ReactElement {
150
+ const platform = useResponsiveValue('mobile', 'tablet', 'desktop');
151
+ const isMobile = platform === 'mobile';
152
+
153
+ const { isMenuExpanded, isDrawerOpen, setDrawerOpen, setMenuExpanded } =
154
+ useNavbarContext();
155
+
156
+ const isSidebarOpened = isMobile ? isDrawerOpen : isMenuExpanded;
157
+
158
+ const filteredItems: Array<NavbarItemOptions | NavbarAccordionOptions> =
159
+ useMemo(
160
+ () =>
161
+ items
162
+ .filter((item) => {
163
+ return !item.hide && (isSidebarOpened || !!item.icon);
164
+ })
165
+ .map((item) => ({
166
+ ...item,
167
+ menuGroupKey: item.groupKey,
168
+ })),
169
+ [items, isSidebarOpened],
170
+ );
171
+
172
+ return (
173
+ <Wrapper isMobile={isMobile} data-expanded={isSidebarOpened}>
174
+ <Header>
175
+ {isSidebarOpened && header}
176
+
177
+ {!isMobile && (
178
+ <ExpandIconButton
179
+ disableRipple={true}
180
+ style={isMenuExpanded ? { paddingRight: 0 } : {}}
181
+ onClick={() => {
182
+ setMenuExpanded(!isMenuExpanded);
183
+ }}
184
+ >
185
+ {isMenuExpanded ? <MenuOpen /> : <MenuIcon />}
186
+ </ExpandIconButton>
187
+ )}
188
+ </Header>
189
+
190
+ <Content aria-expanded={isSidebarOpened}>
191
+ {filteredItems.map((item) => {
192
+ const index = filteredItems.indexOf(item);
193
+ const prev = filteredItems[index - 1];
194
+
195
+ if ('items' in item) {
196
+ return (
197
+ <NavbarAccordion
198
+ {...item}
199
+ key={item.key}
200
+ gutter={prev && prev.groupKey !== item.groupKey}
201
+ onClick={item.onClick}
202
+ />
203
+ );
204
+ }
205
+ return (
206
+ <NavbarItem
207
+ {...item}
208
+ key={item.key}
209
+ gutter={prev && prev.groupKey !== item.groupKey}
210
+ onClick={(event) => {
211
+ item.onClick?.(event);
212
+
213
+ if (!event.isDefaultPrevented()) {
214
+ setDrawerOpen(false);
215
+ }
216
+ }}
217
+ />
218
+ );
219
+ })}
220
+ </Content>
221
+
222
+ <Footer>{footer}</Footer>
223
+ </Wrapper>
224
+ );
225
+ }
@@ -0,0 +1,102 @@
1
+ import { Menu, MenuItem, Typography } from '@material-ui/core';
2
+ import { Color, Inline } from '@superdispatch/ui';
3
+ import { Key, MouseEvent, ReactElement, ReactNode, useState } from 'react';
4
+ import styled from 'styled-components';
5
+ import { useNavbarContext } from './NavbarContext';
6
+
7
+ const Divider = styled.div`
8
+ border-bottom: 1px solid ${Color.Silver400};
9
+ margin: 8px -16px;
10
+ `;
11
+
12
+ const StyledMenuItem = styled(MenuItem)`
13
+ & svg {
14
+ font-size: 24px;
15
+ color: ${Color.Dark100};
16
+ }
17
+ `;
18
+
19
+ const Wrapper = styled.div<{ active?: boolean }>`
20
+ width: 100%;
21
+ padding: 8px 16px;
22
+ cursor: pointer;
23
+ background: ${Color.Dark400};
24
+
25
+ border-left: 4px solid
26
+ ${({ active }) => (active ? Color.Blue300 : 'transparent')};
27
+
28
+ &:hover {
29
+ border-left-color: ${Color.Blue300};
30
+ background: ${Color.Dark400};
31
+ }
32
+ `;
33
+
34
+ export interface NavbarMenuItemOption {
35
+ key: Key;
36
+ icon: ReactNode;
37
+ label: ReactNode;
38
+ visible?: boolean;
39
+ onClick: () => void;
40
+ }
41
+
42
+ interface NavbarMenuProps {
43
+ children: ReactNode;
44
+ items: NavbarMenuItemOption[];
45
+ }
46
+
47
+ export function NavbarMenu({ items, children }: NavbarMenuProps): ReactElement {
48
+ const { setDrawerOpen } = useNavbarContext();
49
+ const [anchor, setAnchor] = useState<HTMLElement | null>(null);
50
+
51
+ function showProfileMenu(event: MouseEvent<HTMLElement>): void {
52
+ setAnchor(event.currentTarget);
53
+ }
54
+
55
+ function hideProfileMenu(): void {
56
+ setAnchor(null);
57
+ setDrawerOpen(false);
58
+ }
59
+
60
+ return (
61
+ <>
62
+ <Wrapper onClick={showProfileMenu} active={!!anchor}>
63
+ {children}
64
+ </Wrapper>
65
+
66
+ <Menu
67
+ open={!!anchor}
68
+ anchorEl={anchor}
69
+ onClose={hideProfileMenu}
70
+ onClick={hideProfileMenu}
71
+ anchorOrigin={{
72
+ vertical: 'top',
73
+ horizontal: 'center',
74
+ }}
75
+ transformOrigin={{
76
+ vertical: 'bottom',
77
+ horizontal: 'center',
78
+ }}
79
+ >
80
+ {items
81
+ .filter((item) => item.visible !== false)
82
+ .flatMap((item, index, arr) => {
83
+ return [
84
+ <StyledMenuItem key={item.key} onClick={item.onClick}>
85
+ <Inline space="small" verticalAlign="center">
86
+ {item.icon}
87
+
88
+ <Typography style={{ color: Color.Dark500 }}>
89
+ {item.label}
90
+ </Typography>
91
+ </Inline>
92
+ </StyledMenuItem>,
93
+
94
+ index !== arr.length - 1 && (
95
+ <Divider key={`${item.key}-divider`} />
96
+ ),
97
+ ];
98
+ })}
99
+ </Menu>
100
+ </>
101
+ );
102
+ }
@@ -0,0 +1,363 @@
1
+ import { InputAdornment, TextField } from '@material-ui/core';
2
+ import AddIcon from '@material-ui/icons/Add';
3
+ import DeleteIcon from '@material-ui/icons/Delete';
4
+ import EditIcon from '@material-ui/icons/Edit';
5
+ import NotificationsIcon from '@material-ui/icons/Notifications';
6
+ import NotificationsOffIcon from '@material-ui/icons/NotificationsOff';
7
+ import SearchIcon from '@material-ui/icons/Search';
8
+ import SettingsIcon from '@material-ui/icons/Settings';
9
+ import { Meta } from '@storybook/react';
10
+ import { Button, Stack } from '@superdispatch/ui';
11
+ import { Placeholder } from '../../../__docs__';
12
+ import { Box } from '../box/Box';
13
+ import { Sidebar } from './Sidebar';
14
+ import { SidebarContainer } from './SidebarContainer';
15
+ import { SidebarContent } from './SidebarContent';
16
+ import { SidebarDivider } from './SidebarDivider';
17
+ import { SidebarMenuItem } from './SidebarMenuItem';
18
+ import { SidebarMenuItemAction } from './SidebarMenuItemAction';
19
+ import { SidebarMenuItemAvatar } from './SidebarMenuItemAvatar';
20
+ import { SidebarSubheader } from './SidebarSubheader';
21
+
22
+ export default {
23
+ title: 'Lab/Sidebar',
24
+ component: Sidebar,
25
+ subcomponents: {
26
+ SidebarContainer,
27
+ SidebarDivider,
28
+ SidebarMenuItem,
29
+ SidebarMenuItemAction,
30
+ SidebarMenuItemAvatar,
31
+ SidebarSubheader,
32
+ },
33
+ } as Meta;
34
+
35
+ export const basic = () => (
36
+ <SidebarContainer
37
+ sidebar={
38
+ <Sidebar title="Settings">
39
+ <SidebarMenuItem selected={true}>General</SidebarMenuItem>
40
+ <SidebarMenuItem>Terminals</SidebarMenuItem>
41
+ <SidebarMenuItem>Driver App</SidebarMenuItem>
42
+ <SidebarMenuItem>Billing</SidebarMenuItem>
43
+ <SidebarMenuItem>Factoring</SidebarMenuItem>
44
+ <SidebarMenuItem external={true}>
45
+ Quickbooks Integration
46
+ </SidebarMenuItem>
47
+ <SidebarMenuItem>Subscription Details</SidebarMenuItem>
48
+ <SidebarMenuItem external={true}>Notification Emails</SidebarMenuItem>
49
+ <SidebarMenuItem external={true}>
50
+ Loadboard Notifications
51
+ </SidebarMenuItem>
52
+ </Sidebar>
53
+ }
54
+ >
55
+ <Placeholder height="100%" width="100%" text="Content" />
56
+ </SidebarContainer>
57
+ );
58
+
59
+ export const list = () => (
60
+ <SidebarContainer
61
+ sidebar={
62
+ <Sidebar
63
+ title="Drivers"
64
+ count={9}
65
+ header={
66
+ <Stack space="small">
67
+ <Button
68
+ fullWidth={true}
69
+ variant="contained"
70
+ startIcon={<AddIcon />}
71
+ >
72
+ Create New
73
+ </Button>
74
+
75
+ <TextField
76
+ fullWidth={true}
77
+ placeholder="Search for drivers…"
78
+ InputProps={{
79
+ startAdornment: (
80
+ <InputAdornment position="start">
81
+ <SearchIcon />
82
+ </InputAdornment>
83
+ ),
84
+ }}
85
+ />
86
+ </Stack>
87
+ }
88
+ >
89
+ <SidebarMenuItem
90
+ selected={true}
91
+ openContentOnClick={true}
92
+ avatar={<SidebarMenuItemAvatar>Eirwen Minoo</SidebarMenuItemAvatar>}
93
+ >
94
+ Eirwen Minoo
95
+ </SidebarMenuItem>
96
+ <SidebarMenuItem
97
+ openContentOnClick={true}
98
+ avatar={<SidebarMenuItemAvatar>Ole Kielo</SidebarMenuItemAvatar>}
99
+ >
100
+ Ole Kielo
101
+ </SidebarMenuItem>
102
+ <SidebarMenuItem
103
+ openContentOnClick={true}
104
+ avatar={
105
+ <SidebarMenuItemAvatar>Virve Vivi Wangi</SidebarMenuItemAvatar>
106
+ }
107
+ >
108
+ Virve Vivi Wangi
109
+ </SidebarMenuItem>
110
+ <SidebarMenuItem
111
+ openContentOnClick={true}
112
+ avatar={
113
+ <SidebarMenuItemAvatar>
114
+ Radulf Čedomir Niĉjo Aparna
115
+ </SidebarMenuItemAvatar>
116
+ }
117
+ >
118
+ Radulf Čedomir Niĉjo Aparna
119
+ </SidebarMenuItem>
120
+ <SidebarMenuItem
121
+ openContentOnClick={true}
122
+ avatar={
123
+ <SidebarMenuItemAvatar>Léane Audovacar</SidebarMenuItemAvatar>
124
+ }
125
+ >
126
+ Léane Audovacar
127
+ </SidebarMenuItem>
128
+ <SidebarMenuItem
129
+ avatar={<SidebarMenuItemAvatar>Devon Vesta</SidebarMenuItemAvatar>}
130
+ >
131
+ Devon Vesta
132
+ </SidebarMenuItem>
133
+ <SidebarMenuItem
134
+ avatar={<SidebarMenuItemAvatar>Xenagoras Ares</SidebarMenuItemAvatar>}
135
+ >
136
+ Xenagoras Ares
137
+ </SidebarMenuItem>
138
+ <SidebarMenuItem
139
+ avatar={<SidebarMenuItemAvatar>Nithya Phebe</SidebarMenuItemAvatar>}
140
+ >
141
+ Nithya Phebe
142
+ </SidebarMenuItem>
143
+ <SidebarMenuItem
144
+ avatar={<SidebarMenuItemAvatar>Nitin Paulette</SidebarMenuItemAvatar>}
145
+ >
146
+ Nitin Paulette
147
+ </SidebarMenuItem>
148
+ </Sidebar>
149
+ }
150
+ >
151
+ <SidebarContent
152
+ title="List"
153
+ action={<Button variant="contained">Create</Button>}
154
+ >
155
+ <Placeholder height="100%" width="100%" text="Content" />
156
+ </SidebarContent>
157
+ </SidebarContainer>
158
+ );
159
+
160
+ export const checkbox = () => (
161
+ <SidebarContainer
162
+ sidebar={
163
+ <Sidebar title="Drivers">
164
+ <SidebarMenuItem
165
+ selected={true}
166
+ openContentOnClick={true}
167
+ avatar={
168
+ <SidebarMenuItemAvatar value={false}>
169
+ Eirwen Minoo
170
+ </SidebarMenuItemAvatar>
171
+ }
172
+ >
173
+ Eirwen Minoo
174
+ </SidebarMenuItem>
175
+ <SidebarMenuItem
176
+ openContentOnClick={true}
177
+ avatar={
178
+ <SidebarMenuItemAvatar value={true}>
179
+ Ole Kielo
180
+ </SidebarMenuItemAvatar>
181
+ }
182
+ >
183
+ Ole Kielo
184
+ </SidebarMenuItem>
185
+ <SidebarMenuItem
186
+ openContentOnClick={true}
187
+ avatar={
188
+ <SidebarMenuItemAvatar value={false}>
189
+ Virve Vivi Wangi
190
+ </SidebarMenuItemAvatar>
191
+ }
192
+ >
193
+ Virve Vivi Wangi
194
+ </SidebarMenuItem>
195
+ <SidebarMenuItem
196
+ avatar={
197
+ <SidebarMenuItemAvatar value={false}>
198
+ Radulf Čedomir Niĉjo Aparna
199
+ </SidebarMenuItemAvatar>
200
+ }
201
+ >
202
+ Radulf Čedomir Niĉjo Aparna
203
+ </SidebarMenuItem>
204
+ </Sidebar>
205
+ }
206
+ >
207
+ <SidebarContent title="">
208
+ <Placeholder height="100%" width="100%" text="Content" />
209
+ </SidebarContent>
210
+ </SidebarContainer>
211
+ );
212
+
213
+ export const checkboxMany = () => {
214
+ const items = Array(25)
215
+ .fill(null)
216
+ .map((_, index) => (
217
+ <SidebarMenuItem
218
+ key={index}
219
+ openContentOnClick={true}
220
+ avatar={
221
+ <SidebarMenuItemAvatar value={false}>
222
+ {`Eirwen Minoo (${index})`}
223
+ </SidebarMenuItemAvatar>
224
+ }
225
+ >
226
+ {`Eirwen Minoo (${index})`}
227
+ </SidebarMenuItem>
228
+ ));
229
+
230
+ return (
231
+ <SidebarContainer sidebar={<Sidebar title="Drivers List">{items}</Sidebar>}>
232
+ <SidebarContent title="">
233
+ <Placeholder height="100%" width="100%" text="Content" />
234
+ </SidebarContent>
235
+ </SidebarContainer>
236
+ );
237
+ };
238
+
239
+ export const complex = () => (
240
+ <SidebarContainer
241
+ sidebar={
242
+ <Sidebar title="Super Loadboard">
243
+ <SidebarMenuItem selected={true} badge={320}>
244
+ Available
245
+ </SidebarMenuItem>
246
+ <SidebarMenuItem badge={5}>Requested</SidebarMenuItem>
247
+ <SidebarMenuItem badge={12}>Booked</SidebarMenuItem>
248
+ <SidebarMenuItem badge={56}>Suggested</SidebarMenuItem>
249
+
250
+ <SidebarDivider />
251
+
252
+ <SidebarSubheader
253
+ action={
254
+ <SidebarMenuItemAction
255
+ placement="right"
256
+ title="Loadboard Notifications"
257
+ >
258
+ <SettingsIcon />
259
+ </SidebarMenuItemAction>
260
+ }
261
+ >
262
+ Load Alerts
263
+ </SidebarSubheader>
264
+
265
+ <SidebarMenuItem
266
+ action={
267
+ <SidebarMenuItemAction title="Mute">
268
+ <NotificationsIcon color="primary" />
269
+ </SidebarMenuItemAction>
270
+ }
271
+ secondaryActions={
272
+ <>
273
+ <SidebarMenuItemAction title="Edit">
274
+ <EditIcon />
275
+ </SidebarMenuItemAction>
276
+
277
+ <SidebarMenuItemAction title="Delete">
278
+ <DeleteIcon />
279
+ </SidebarMenuItemAction>
280
+ </>
281
+ }
282
+ >
283
+ New York, NY - Kansas City, MO
284
+ </SidebarMenuItem>
285
+
286
+ <SidebarMenuItem
287
+ action={
288
+ <SidebarMenuItemAction title="Unmute">
289
+ <NotificationsOffIcon />
290
+ </SidebarMenuItemAction>
291
+ }
292
+ >
293
+ Kansas City, MO - New York, NY
294
+ </SidebarMenuItem>
295
+
296
+ <SidebarMenuItem
297
+ action={
298
+ <SidebarMenuItemAction title="Unmute">
299
+ <NotificationsOffIcon />
300
+ </SidebarMenuItemAction>
301
+ }
302
+ >
303
+ New York, NY - Kansas City, KS
304
+ </SidebarMenuItem>
305
+
306
+ <SidebarMenuItem
307
+ action={
308
+ <SidebarMenuItemAction title="Unmute">
309
+ <NotificationsOffIcon />
310
+ </SidebarMenuItemAction>
311
+ }
312
+ >
313
+ Kansas City, MO - New York, NY
314
+ </SidebarMenuItem>
315
+
316
+ <SidebarMenuItem
317
+ action={
318
+ <SidebarMenuItemAction title="Unmute">
319
+ <NotificationsOffIcon />
320
+ </SidebarMenuItemAction>
321
+ }
322
+ >
323
+ New York, NY - Kansas City, KS
324
+ </SidebarMenuItem>
325
+
326
+ <SidebarMenuItem
327
+ action={
328
+ <SidebarMenuItemAction title="Unmute">
329
+ <NotificationsOffIcon />
330
+ </SidebarMenuItemAction>
331
+ }
332
+ >
333
+ Kansas City, MO - New York, NY
334
+ </SidebarMenuItem>
335
+
336
+ <SidebarMenuItem
337
+ action={
338
+ <SidebarMenuItemAction title="Unmute">
339
+ <NotificationsOffIcon />
340
+ </SidebarMenuItemAction>
341
+ }
342
+ >
343
+ New York, NY - Kansas City, KS
344
+ </SidebarMenuItem>
345
+
346
+ <Box
347
+ bottom={0}
348
+ position="sticky"
349
+ paddingTop="small"
350
+ paddingBottom="small"
351
+ paddingLeft="medium"
352
+ paddingRight="medium"
353
+ >
354
+ <Button fullWidth={true} startIcon={<NotificationsOffIcon />}>
355
+ Create Load Alert
356
+ </Button>
357
+ </Box>
358
+ </Sidebar>
359
+ }
360
+ >
361
+ <Placeholder height="100%" width="100%" text="Content" />
362
+ </SidebarContainer>
363
+ );