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

Commit 2a91edd

Browse files
author
Matt Goo
committed
feat(drawer): typescript support (#494)
1 parent c9665bc commit 2a91edd

30 files changed

+847
-731
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"testdouble": "^3.6.0",
143143
"ts-loader": "^3.5.0",
144144
"ts-node": "^7.0.1",
145-
"typescript": "^3.2.1",
145+
"typescript": "^3.2.2",
146146
"typescript-eslint-parser": "^21.0.1",
147147
"utility-types": "^2.1.0",
148148
"uuid": "^3.3.2",

packages/drawer/AppContent.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/drawer/AppContent.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// The MIT License
2+
//
3+
// Copyright (c) 2018 Google, Inc.
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
import * as React from 'react';
24+
import * as classnames from 'classnames';
25+
26+
export interface DrawerAppContentProps {
27+
tag?: string,
28+
className?: string,
29+
};
30+
31+
const DrawerAppContent: React.FunctionComponent<DrawerAppContentProps> = ({
32+
tag: Tag = 'div', children, className = '', ...otherProps // eslint-disable-line react/prop-types
33+
}) => {
34+
return (
35+
// https://github.com/Microsoft/TypeScript/issues/28892
36+
// @ts-ignore
37+
<Tag
38+
className={classnames('mdc-drawer-app-content', className)}
39+
{...otherProps}
40+
>
41+
{children}
42+
</Tag>
43+
);
44+
};
45+
46+
export default DrawerAppContent;

packages/drawer/Content.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/drawer/Content.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// The MIT License
2+
//
3+
// Copyright (c) 2018 Google, Inc.
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
import * as React from 'react';
24+
import * as classnames from 'classnames';
25+
26+
export interface DrawerContentProps {
27+
tag?: string,
28+
className?: string
29+
};
30+
31+
const DrawerContent: React.FunctionComponent<DrawerContentProps> = ({
32+
tag: Tag = 'div', children, className = '', ...otherProps // eslint-disable-line react/prop-types
33+
}) => {
34+
return (
35+
// https://github.com/Microsoft/TypeScript/issues/28892
36+
// @ts-ignore
37+
<Tag
38+
className={classnames('mdc-drawer__content', className)}
39+
{...otherProps}
40+
>
41+
{children}
42+
</Tag>
43+
);
44+
};
45+
46+
export default DrawerContent;

packages/drawer/Header.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/drawer/Header.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// The MIT License
2+
//
3+
// Copyright (c) 2018 Google, Inc.
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
import * as React from 'react';
24+
import * as classnames from 'classnames';
25+
26+
export interface DrawerHeaderProps {
27+
tag?: string,
28+
className?: string
29+
};
30+
31+
const DrawerHeader: React.FunctionComponent<DrawerHeaderProps> = ({
32+
tag: Tag = 'div', children, className = '', ...otherProps // eslint-disable-line react/prop-types
33+
}) => {
34+
return (
35+
// https://github.com/Microsoft/TypeScript/issues/28892
36+
// @ts-ignore
37+
<Tag
38+
className={classnames('mdc-drawer__header', className)}
39+
{...otherProps}
40+
>
41+
{children}
42+
</Tag>
43+
);
44+
};
45+
46+
export default DrawerHeader;

packages/drawer/Subtitle.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/drawer/Subtitle.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as React from 'react';
2+
import * as classnames from 'classnames';
3+
4+
export interface DrawerSubTitleProps {
5+
tag?: string;
6+
className?: string;
7+
};
8+
9+
const DrawerSubTitle: React.FunctionComponent<DrawerSubTitleProps> = ({
10+
tag: Tag = 'h6', children, className = '', ...otherProps // eslint-disable-line react/prop-types
11+
}) => {
12+
return (
13+
// https://github.com/Microsoft/TypeScript/issues/28892
14+
// @ts-ignore
15+
<Tag
16+
className={classnames('mdc-drawer__subtitle', className)}
17+
{...otherProps}
18+
>
19+
{children}
20+
</Tag>
21+
);
22+
};
23+
24+
export default DrawerSubTitle;

0 commit comments

Comments
 (0)