Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Commit 523b22c

Browse files
Merge pull request #12 from commitd/sh-develop
2 parents f84d062 + 3bb44b7 commit 523b22c

File tree

14 files changed

+2134
-905
lines changed

14 files changed

+2134
-905
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules
66
.rts2_cache_esm
77
.rts2_cache_umd
88
dist
9+
.vscode

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"@types/react": "^16.9.11",
2525
"@types/react-dom": "^16.8.4",
2626
"parcel": "^1.12.3",
27-
"typescript": "^3.8.3"
27+
"typescript": "^4.0.5"
2828
}
2929
}

example/yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,9 +1345,9 @@ caniuse-api@^3.0.0:
13451345
lodash.uniq "^4.5.0"
13461346

13471347
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001043:
1348-
version "1.0.30001048"
1349-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz#4bb4f1bc2eb304e5e1154da80b93dee3f1cf447e"
1350-
integrity sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg==
1348+
version "1.0.30001156"
1349+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001156.tgz"
1350+
integrity sha512-z7qztybA2eFZTB6Z3yvaQBIoJpQtsewRD74adw2UbRWwsRq3jIPvgrQGawBMbfafekQaD21FWuXNcywtTDGGCw==
13511351

13521352
caseless@~0.12.0:
13531353
version "0.12.0"
@@ -5002,10 +5002,10 @@ typedarray@^0.0.6:
50025002
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
50035003
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
50045004

5005-
typescript@^3.8.3:
5006-
version "3.8.3"
5007-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
5008-
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
5005+
typescript@^4.0.5:
5006+
version "4.0.5"
5007+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389"
5008+
integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==
50095009

50105010
uncss@^0.17.2:
50115011
version "0.17.3"

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@committed/layout",
3-
"version": "2.1.1",
3+
"version": "4.0.0",
44
"description": "Committed layout library",
55
"author": "Committed",
66
"license": "MIT",
@@ -29,8 +29,9 @@
2929
"deploy-storybook": "storybook-to-ghpages"
3030
},
3131
"peerDependencies": {
32-
"@committed/components": ">=3.0.2",
32+
"@committed/components": ">=4.0.0",
3333
"@material-ui/core": "4.x",
34+
"@material-ui/icons": "4.x",
3435
"react": ">=16"
3536
},
3637
"husky": {
@@ -57,6 +58,7 @@
5758
"@types/react": "^16.9.34",
5859
"@types/react-dom": "^16.9.7",
5960
"babel-loader": "^8.1.0",
61+
"eslint-plugin-prettier": "^3.1.4",
6062
"husky": "^4.2.5",
6163
"lorem-ipsum": "^2.0.3",
6264
"prettier": "^2.0.5",
@@ -65,8 +67,8 @@
6567
"react-dom": "^16.13.1",
6668
"react-is": "^16.13.1",
6769
"ts-loader": "^7.0.2",
68-
"tsdx": "^0.13.2",
69-
"tslib": "^1.11.1",
70-
"typescript": "^3.8.3"
70+
"tsdx": "^0.14.1",
71+
"tslib": "^2.0.3",
72+
"typescript": "^4.0.5"
7173
}
7274
}

src/Header.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import React, { ReactNode, CSSProperties } from 'react'
2-
import { PropTypes } from '@material-ui/core'
31
import {
42
AppBar,
5-
Toolbar,
63
IconButton,
7-
Icons,
4+
IconButtonProps,
85
makeStyles,
9-
useTheme,
6+
Toolbar,
107
ToolbarProps,
11-
IconButtonProps,
8+
useTheme,
129
} from '@committed/components'
10+
import { PropTypes } from '@material-ui/core'
1311
import useScrollTrigger from '@material-ui/core/useScrollTrigger'
12+
import React, { CSSProperties, ReactNode } from 'react'
13+
import { Icons } from './Icons'
1414
import { useLayout } from './Root'
1515
import { Layout, Position } from './types'
1616

src/Icons.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
2+
import ChevronLeft from '@material-ui/icons/ChevronLeftSharp'
3+
import ChevronRight from '@material-ui/icons/ChevronRightSharp'
4+
import Menu from '@material-ui/icons/MenuSharp'
5+
6+
export type { SvgIconProps as IconProps }
7+
type SvgIconComponent = typeof SvgIcon
8+
9+
/**
10+
* Icons component exports relevant icons for the project
11+
*/
12+
export const Icons: {
13+
[key: string]: SvgIconComponent
14+
} = {
15+
ChevronLeft,
16+
ChevronRight,
17+
Menu,
18+
}

stories/Example.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {
33
Card,
44
Container,
55
IconButton,
6-
Icons,
76
List,
87
ThemeProvider,
98
Typography,
109
} from '@committed/components'
10+
import AccountCircle from '@material-ui/icons/AccountCircleSharp'
1111
import { LoremIpsum } from 'lorem-ipsum'
1212
import React, { FC, ReactNode } from 'react'
1313
import {
@@ -53,26 +53,14 @@ export const Example: FC<{
5353
<Typography variant="h5">Application Name</Typography>
5454
<Box flexGrow={1} />
5555
<IconButton color="inherit">
56-
<Icons.AccountCircle />
56+
<AccountCircle />
5757
</IconButton>
5858
</Header>
5959
<Nav collapseIcon={collapseIcon} expandIcon={expandIcon}>
6060
<List>
61-
<NavListItem
62-
key="1"
63-
text="Menu Item 1"
64-
icon={<Icons.AccountCircle />}
65-
/>
66-
<NavListItem
67-
key="2"
68-
text="Menu Item 2"
69-
icon={<Icons.AccountCircle />}
70-
/>
71-
<NavListItem
72-
key="3"
73-
text="Menu Item 3"
74-
icon={<Icons.AccountCircle />}
75-
/>
61+
<NavListItem key="1" text="Menu Item 1" icon={<AccountCircle />} />
62+
<NavListItem key="2" text="Menu Item 2" icon={<AccountCircle />} />
63+
<NavListItem key="3" text="Menu Item 3" icon={<AccountCircle />} />
7664
</List>
7765
</Nav>
7866
<Content>

stories/Icons.stories.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { Typography } from '@committed/components'
2+
import Check from '@material-ui/icons/CheckSharp'
3+
import FormatAlignJustify from '@material-ui/icons/FormatAlignJustifySharp'
4+
import KeyboardBackspace from '@material-ui/icons/KeyboardBackspaceSharp'
15
import React from 'react'
2-
import { Typography, Icons } from '@committed/components'
36
import { Example } from './Example'
47

58
export const SuppliedIcons = () => {
@@ -12,9 +15,9 @@ export const SuppliedIcons = () => {
1215
required Try changing the size of your window.
1316
</Typography>
1417
}
15-
closeMenuIcon={<Icons.KeyboardBackspace />}
16-
openMenuIcon={<Icons.FormatAlignJustify />}
17-
collapseIcon={<Icons.Check />}
18+
closeMenuIcon={<KeyboardBackspace />}
19+
openMenuIcon={<FormatAlignJustify />}
20+
collapseIcon={<Check />}
1821
expandIcon={<Typography>></Typography>}
1922
/>
2023
)

stories/Nav.stories.tsx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
import { Divider, List, ThemeProvider, Typography } from '@committed/components'
2+
import Backup from '@material-ui/icons/BackupSharp'
3+
import Clear from '@material-ui/icons/ClearSharp'
4+
import Delete from '@material-ui/icons/DeleteSharp'
5+
import Folder from '@material-ui/icons/FolderSharp'
6+
import Forward from '@material-ui/icons/ForwardSharp'
7+
import OfflinePin from '@material-ui/icons/OfflinePinSharp'
8+
import People from '@material-ui/icons/PeopleSharp'
9+
import Publish from '@material-ui/icons/PublishSharp'
10+
import Schedule from '@material-ui/icons/ScheduleSharp'
11+
import Settings from '@material-ui/icons/SettingsSharp'
12+
import Star from '@material-ui/icons/StarSharp'
113
import React from 'react'
2-
import { Root, Nav, NavListItem } from '../src'
3-
import {
4-
ThemeProvider,
5-
Typography,
6-
Icons,
7-
List,
8-
Divider,
9-
} from '@committed/components'
14+
import { Nav, NavListItem, Root } from '../src'
1015

1116
export const Use = () => {
1217
return (
@@ -29,7 +34,7 @@ export const CustomIcons = () => {
2934
return (
3035
<ThemeProvider>
3136
<Root fullscreen={false} style={{ minHeight: '50vh' }}>
32-
<Nav collapseIcon={<Icons.Clear />} expandIcon={<Icons.Forward />}>
37+
<Nav collapseIcon={<Clear />} expandIcon={<Forward />}>
3338
<Typography>This is the Nav</Typography>
3439
</Nav>
3540
</Root>
@@ -41,35 +46,35 @@ export const WithContent = () => {
4146
const list = [
4247
{
4348
primaryText: 'My Files',
44-
icon: <Icons.Folder />,
49+
icon: <Folder />,
4550
},
4651
{
4752
primaryText: 'Shared with me',
48-
icon: <Icons.People />,
53+
icon: <People />,
4954
},
5055
{
5156
primaryText: 'Starred',
52-
icon: <Icons.Star />,
57+
icon: <Star />,
5358
},
5459
{
5560
primaryText: 'Recent',
56-
icon: <Icons.Schedule />,
61+
icon: <Schedule />,
5762
},
5863
{
5964
primaryText: 'Offline',
60-
icon: <Icons.OfflinePin />,
65+
icon: <OfflinePin />,
6166
},
6267
{
6368
primaryText: 'Uploads',
64-
icon: <Icons.Publish />,
69+
icon: <Publish />,
6570
},
6671
{
6772
primaryText: 'Backups',
68-
icon: <Icons.Backup />,
73+
icon: <Backup />,
6974
},
7075
{
7176
primaryText: 'Trash',
72-
icon: <Icons.Delete />,
77+
icon: <Delete />,
7378
},
7479
]
7580
return (
@@ -86,10 +91,7 @@ export const WithContent = () => {
8691
/>
8792
))}
8893
<Divider style={{ margin: '12px 0' }} />
89-
<NavListItem
90-
icon={<Icons.Settings />}
91-
text={'Settings & account'}
92-
/>
94+
<NavListItem icon={<Settings />} text={'Settings & account'} />
9395
</List>
9496
</Nav>
9597
</Root>

stories/NavListItem.stories.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React from 'react'
22
import { Root, Header, Nav, NavListItem } from '../src'
3-
import { ThemeProvider, Icons, List } from '@committed/components'
3+
import People from '@material-ui/icons/PeopleSharp'
4+
import { ThemeProvider, List } from '@committed/components'
45

56
export const Use = () => {
67
return (
78
<ThemeProvider>
89
<Root fullscreen={false} style={{ minHeight: '50vh' }}>
910
<Nav>
1011
<List>
11-
<NavListItem icon={<Icons.People />} text="Shared with me" />
12+
<NavListItem icon={<People />} text="Shared with me" />
1213
</List>
1314
</Nav>
1415
</Root>
@@ -27,8 +28,8 @@ export const Selected = () => {
2728
<Root fullscreen={false} style={{ minHeight: '50vh' }}>
2829
<Nav>
2930
<List>
30-
<NavListItem icon={<Icons.People />} text="Selected" selected />
31-
<NavListItem icon={<Icons.People />} text="Unselected" />
31+
<NavListItem icon={<People />} text="Selected" selected />
32+
<NavListItem icon={<People />} text="Unselected" />
3233
</List>
3334
</Nav>
3435
</Root>
@@ -47,8 +48,8 @@ export const CloseTemporary = () => {
4748
<Header />
4849
<Nav>
4950
<List>
50-
<NavListItem icon={<Icons.People />} text="Selected" selected />
51-
<NavListItem icon={<Icons.People />} text="Unselected" />
51+
<NavListItem icon={<People />} text="Selected" selected />
52+
<NavListItem icon={<People />} text="Unselected" />
5253
</List>
5354
</Nav>
5455
</Root>
@@ -69,13 +70,13 @@ export const ClosePersistent = () => {
6970
<List>
7071
<NavListItem
7172
closeFor={['persistent']}
72-
icon={<Icons.People />}
73+
icon={<People />}
7374
text="Selected"
7475
selected
7576
/>
7677
<NavListItem
7778
closeFor={['persistent']}
78-
icon={<Icons.People />}
79+
icon={<People />}
7980
text="Unselected"
8081
/>
8182
</List>
@@ -96,8 +97,8 @@ export const LeavePersistent = () => {
9697
<Header />
9798
<Nav>
9899
<List>
99-
<NavListItem icon={<Icons.People />} text="Selected" selected />
100-
<NavListItem icon={<Icons.People />} text="Unselected" />
100+
<NavListItem icon={<People />} text="Selected" selected />
101+
<NavListItem icon={<People />} text="Unselected" />
101102
</List>
102103
</Nav>
103104
</Root>

0 commit comments

Comments
 (0)