Skip to content

Commit 07642b5

Browse files
committed
feat: Add TransformCard component
1 parent 03cc813 commit 07642b5

File tree

13 files changed

+485
-3
lines changed

13 files changed

+485
-3
lines changed

docs/src/components/DocsTreeView/docTreeData.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export default [{
111111
"titleNode": "Toggle"
112112
}, {
113113
"titleNode": "Tooltip"
114+
}, {
115+
"titleNode": "TransformCard"
114116
}, {
115117
"titleNode": "TreeView"
116118
}, {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Mock
2+
3+
///
4+
5+
### Examples

docs/src/routes/Components/DatePickers/CalendarView/__Mock__/SimpleExample.md

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as React from "react";
2+
import * as PropTypes from "prop-types";
3+
4+
import AutoSuggestBox from "react-uwp/AutoSuggestBox";
5+
6+
export default class SimpleExample extends React.Component {
7+
static contextTypes = { theme: PropTypes.object };
8+
context: { theme: ReactUWP.ThemeType };
9+
10+
render() {
11+
return (
12+
<div>
13+
<AutoSuggestBox />
14+
</div>
15+
);
16+
}
17+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import * as React from "react";
2+
import * as PropTypes from "prop-types";
3+
4+
import ComponentDetail from "components/ComponentDetail";
5+
import * as docEntry from "react-uwp/Mock/index.doc.json";
6+
import * as readmeText from "!raw!./README.md";
7+
8+
import CodeExample from "components/CodeExample";
9+
10+
import SimpleExample from "./SimpleExample";
11+
import * as SimpleExampleCode from "!raw!./SimpleExample";
12+
import * as SimpleExampleDesc from "!raw!./SimpleExample.md";
13+
14+
export default class Mock extends React.Component<any> {
15+
static contextTypes = { theme: PropTypes.object };
16+
17+
render() {
18+
const {
19+
location,
20+
params,
21+
route,
22+
router,
23+
routeParams,
24+
routes,
25+
...attributes
26+
} = this.props;
27+
28+
return (
29+
<ComponentDetail
30+
readmeText={readmeText as any}
31+
docEntry={docEntry}
32+
>
33+
<CodeExample
34+
title="Simple Examples"
35+
code={SimpleExampleCode as any}
36+
description={SimpleExampleDesc as any}
37+
doubleThemeStyle={{ padding: 20 }}
38+
>
39+
<SimpleExample />
40+
</CodeExample>
41+
</ComponentDetail>
42+
);
43+
}
44+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## TransformCard
2+
3+
The CSS3 3D Transform Card that follows the cursor.
4+
5+
### Examples

docs/src/routes/Components/TransformCard/SimpleExample.md

Whitespace-only changes.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import * as React from "react";
2+
import * as PropTypes from "prop-types";
3+
4+
import TransformCard from "react-uwp/TransformCard";
5+
import CalendarDatePicker from "react-uwp/CalendarDatePicker";
6+
import Button from "react-uwp/Button";
7+
8+
import Slider from "../Slider/SimpleExample";
9+
import SplitViewCommand from "../SplitViewCommand/SimpleExample";
10+
import TextBox from "../TextBox/SimpleExample";
11+
import Toggle from "../Toggle/SimpleExample";
12+
import Tooltip from "../Tooltip/SimpleExample";
13+
14+
export default class SimpleExample extends React.Component {
15+
static contextTypes = { theme: PropTypes.object };
16+
context: { theme: ReactUWP.ThemeType };
17+
18+
render() {
19+
const { theme } = this.context;
20+
return (
21+
<div>
22+
<TransformCard defaultRotateY={-7} perspective={1000}>
23+
<div
24+
style={{
25+
display: "flex",
26+
flexDirection: "column",
27+
width: "auto",
28+
minHeight: 520,
29+
padding: "40px 20px",
30+
background: theme.listLow
31+
}}
32+
>
33+
<Slider />
34+
<CalendarDatePicker />
35+
<SplitViewCommand />
36+
<TextBox />
37+
<Toggle />
38+
<Tooltip />
39+
</div>
40+
</TransformCard>
41+
42+
<div>
43+
<TransformCard xMaxRotate={30} yMaxRotate={30} perspective={240}>
44+
<img
45+
style={{
46+
width: 240,
47+
marginTop: 40,
48+
height: "auto"
49+
}}
50+
src={require("../../../assets/images/reveal.png")}
51+
/>
52+
</TransformCard>
53+
</div>
54+
</div>
55+
);
56+
}
57+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import * as React from "react";
2+
import * as PropTypes from "prop-types";
3+
4+
import ComponentDetail from "components/ComponentDetail";
5+
import * as docEntry from "react-uwp/TransformCard/index.doc.json";
6+
import * as readmeText from "!raw!./README.md";
7+
8+
import CodeExample from "components/CodeExample";
9+
10+
import SimpleExample from "./SimpleExample";
11+
import * as SimpleExampleCode from "!raw!./SimpleExample";
12+
import * as SimpleExampleDesc from "!raw!./SimpleExample.md";
13+
14+
export default class TransformCard extends React.Component<any> {
15+
static contextTypes = { theme: PropTypes.object };
16+
17+
render() {
18+
const {
19+
location,
20+
params,
21+
route,
22+
router,
23+
routeParams,
24+
routes,
25+
...attributes
26+
} = this.props;
27+
28+
return (
29+
<ComponentDetail
30+
readmeText={readmeText as any}
31+
docEntry={docEntry}
32+
>
33+
<CodeExample
34+
title="Simple Examples"
35+
code={SimpleExampleCode as any}
36+
description={SimpleExampleDesc as any}
37+
doubleThemeStyle={{ padding: 20 }}
38+
useSingleTheme
39+
>
40+
<SimpleExample />
41+
</CodeExample>
42+
</ComponentDetail>
43+
);
44+
}
45+
}

docs/src/routes/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,13 @@ function getRoutes(path = "/") {
461461
cb(null, require<any>("./Components/Tooltip").default);
462462
}, "react-uwp-Components-Tooltip");
463463
}
464+
}, {
465+
path: "TransformCard",
466+
getComponent: (location: Location, cb: RouterCallback) => {
467+
require.ensure([], (require) => {
468+
cb(null, require<any>("./Components/TransformCard").default);
469+
}, "react-uwp-Components-TransformCard");
470+
}
464471
}, {
465472
path: "TextBox",
466473
getComponent: (location: Location, cb: RouterCallback) => {

0 commit comments

Comments
 (0)