@gpichot/spectacle-deck 1.1.1 → 1.1.3

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 (66) hide show
  1. package/{dist/index.cjs → index.cjs} +200 -148
  2. package/{dist/index.mjs → index.mjs} +199 -147
  3. package/layouts/BaseLayout.d.ts +5 -0
  4. package/package.json +16 -20
  5. package/dist/package.json +0 -30
  6. package/scripts/bundle.ts +0 -84
  7. package/src/components/CodeStepper/CodeStepper.tsx +0 -223
  8. package/src/components/CodeStepper/code-directives.test.ts +0 -58
  9. package/src/components/CodeStepper/code-directives.ts +0 -129
  10. package/src/components/DocumentationItem.tsx +0 -85
  11. package/src/components/FilePane.tsx +0 -18
  12. package/src/components/HorizontalList.tsx +0 -140
  13. package/src/components/IconBox.tsx +0 -31
  14. package/src/components/Image.tsx +0 -34
  15. package/src/components/ItemsColumn.tsx +0 -56
  16. package/src/components/Timeline.styled.tsx +0 -24
  17. package/src/components/Timeline.tsx +0 -159
  18. package/src/components/map.tsx +0 -115
  19. package/src/components/styled.tsx +0 -73
  20. package/src/front.png +0 -0
  21. package/src/index.tsx +0 -109
  22. package/src/layouts/CenteredLayout.tsx +0 -40
  23. package/src/layouts/Default3Layout.tsx +0 -159
  24. package/src/layouts/MainSectionLayout.tsx +0 -31
  25. package/src/layouts/QuoteLayout.tsx +0 -99
  26. package/src/layouts/SectionLayout.tsx +0 -14
  27. package/src/layouts/SideCodeLayout.tsx +0 -44
  28. package/src/layouts/SideImageLayout.tsx +0 -72
  29. package/src/layouts/SideLayout.tsx +0 -31
  30. package/src/layouts/columns.tsx +0 -56
  31. package/src/layouts/index.tsx +0 -19
  32. package/src/layouts/styled.ts +0 -7
  33. package/src/layouts/utils.ts +0 -65
  34. package/src/node.d.ts +0 -5
  35. package/src/style.d.ts +0 -10
  36. package/src/template.tsx +0 -25
  37. package/src/theme.ts +0 -24
  38. package/test.js +0 -106
  39. package/tsconfig.json +0 -29
  40. /package/{dist/components → components}/CodeStepper/CodeStepper.d.ts +0 -0
  41. /package/{dist/components → components}/CodeStepper/code-directives.d.ts +0 -0
  42. /package/{dist/components → components}/DocumentationItem.d.ts +0 -0
  43. /package/{dist/components → components}/FilePane.d.ts +0 -0
  44. /package/{dist/components → components}/HorizontalList.d.ts +0 -0
  45. /package/{dist/components → components}/IconBox.d.ts +0 -0
  46. /package/{dist/components → components}/Image.d.ts +0 -0
  47. /package/{dist/components → components}/ItemsColumn.d.ts +0 -0
  48. /package/{dist/components → components}/Timeline.d.ts +0 -0
  49. /package/{dist/components → components}/Timeline.styled.d.ts +0 -0
  50. /package/{dist/components → components}/map.d.ts +0 -0
  51. /package/{dist/components → components}/styled.d.ts +0 -0
  52. /package/{dist/index.d.ts → index.d.ts} +0 -0
  53. /package/{dist/layouts → layouts}/CenteredLayout.d.ts +0 -0
  54. /package/{dist/layouts → layouts}/Default3Layout.d.ts +0 -0
  55. /package/{dist/layouts → layouts}/MainSectionLayout.d.ts +0 -0
  56. /package/{dist/layouts → layouts}/QuoteLayout.d.ts +0 -0
  57. /package/{dist/layouts → layouts}/SectionLayout.d.ts +0 -0
  58. /package/{dist/layouts → layouts}/SideCodeLayout.d.ts +0 -0
  59. /package/{dist/layouts → layouts}/SideImageLayout.d.ts +0 -0
  60. /package/{dist/layouts → layouts}/SideLayout.d.ts +0 -0
  61. /package/{dist/layouts → layouts}/columns.d.ts +0 -0
  62. /package/{dist/layouts → layouts}/index.d.ts +0 -0
  63. /package/{dist/layouts → layouts}/styled.d.ts +0 -0
  64. /package/{dist/layouts → layouts}/utils.d.ts +0 -0
  65. /package/{dist/template.d.ts → template.d.ts} +0 -0
  66. /package/{dist/theme.d.ts → theme.d.ts} +0 -0
package/src/index.tsx DELETED
@@ -1,109 +0,0 @@
1
- import React from "react";
2
- import { MDXProvider } from "@mdx-js/react";
3
- import { Deck as SpectacleDeck, Slide } from "spectacle";
4
-
5
- import Layouts from "./layouts";
6
- import theme from "./theme";
7
- import { template } from "./template";
8
- import customComponents from "./components/map";
9
-
10
- export { default as FilePane } from "./components/FilePane";
11
- export { ItemsColumn } from "./components/ItemsColumn";
12
- export { Doc, DocItem } from "./components/DocumentationItem";
13
- export { Image } from "./components/Image";
14
- export {
15
- default as HorizontalList,
16
- HorizontalListItem,
17
- } from "./components/HorizontalList";
18
- export { default as Timeline, TimelineItem } from "./components/Timeline";
19
- export { IconBox } from "./components/IconBox";
20
-
21
- export type SlideType = {
22
- metadata: Record<string, unknown> & { layout?: string };
23
- slideComponent: React.ElementType<unknown>;
24
- };
25
-
26
- export type DeckType = {
27
- metadata: Record<string, unknown>;
28
- slides: SlideType[];
29
- };
30
-
31
- export function PassThrough({ children }: { children: React.ReactNode }) {
32
- return <>{children}</>;
33
- }
34
-
35
- export function Layout({
36
- children,
37
- frontmatter,
38
- }: {
39
- children: React.ReactNode;
40
- frontmatter: { layout?: string };
41
- }) {
42
- const layout = frontmatter?.layout || "default";
43
- const Layout = layout in Layouts ? Layouts[layout] : null;
44
-
45
- if (layout && !Layout) {
46
- console.warn(`Layout ${layout} not found`);
47
- }
48
-
49
- if (Layout) {
50
- return <Layout {...frontmatter}>{children}</Layout>;
51
- }
52
-
53
- return <>{children}</>;
54
- }
55
-
56
- const componentsMap = {
57
- ...customComponents,
58
- wrapper: Layout,
59
- };
60
- export function Deck({ deck }: { deck: DeckType }) {
61
- React.useEffect(() => {
62
- document.title = (deck.metadata.title as string) || "Untitled";
63
- }, [deck.metadata.title]);
64
- return (
65
- <React.StrictMode>
66
- <MDXProvider components={componentsMap}>
67
- <SpectacleDeck theme={theme} template={template}>
68
- {deck.slides.map((slide, i) => {
69
- const Component = slide.slideComponent;
70
- return (
71
- <Slide key={i}>
72
- <Component />
73
- </Slide>
74
- );
75
- })}
76
- </SpectacleDeck>
77
- </MDXProvider>
78
- </React.StrictMode>
79
- );
80
- }
81
-
82
- export function Danger({ children }: { children: React.ReactNode }) {
83
- return <div style={{ color: "red" }}>{children}</div>;
84
- }
85
-
86
- export function Information({ children }: { children: React.ReactNode }) {
87
- return <div style={{ color: "orange" }}>{children}</div>;
88
- }
89
-
90
- export function Success({ children }: { children: React.ReactNode }) {
91
- return <div style={{ color: "green" }}>{children}</div>;
92
- }
93
- export function Warning({ children }: { children: React.ReactNode }) {
94
- return <div style={{ color: "yellow" }}>{children}</div>;
95
- }
96
-
97
- export function Side({ children }: { children: React.ReactNode }) {
98
- return <div>{children}</div>;
99
- }
100
-
101
- Side.mdxType = "Side";
102
-
103
- export function Documentation({ children }: { children: React.ReactNode }) {
104
- return <div>{children}</div>;
105
- }
106
-
107
- export function Box({ children }: { children: React.ReactNode }) {
108
- return <div>{children}</div>;
109
- }
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import { Margins, getHeading } from "./utils";
4
-
5
- const CenteredLayoutContent = styled.div`
6
- h2,
7
- h3 {
8
- }
9
- `;
10
- export const CenteredLayout = (
11
- props: React.ComponentPropsWithoutRef<"div">
12
- ) => {
13
- const [heading, rest] = getHeading(props.children);
14
- return (
15
- <div
16
- {...props}
17
- style={{
18
- height: "100%",
19
- display: "flex",
20
- flexFlow: "column",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- margin: `0 ${Margins.horizontal}`,
24
- }}
25
- >
26
- {rest}
27
- <CenteredLayoutContent
28
- style={{
29
- position: "absolute",
30
- opacity: 0.8,
31
- marginBottom: "2rem",
32
- marginTop: "2rem",
33
- bottom: 0,
34
- }}
35
- >
36
- {heading}
37
- </CenteredLayoutContent>
38
- </div>
39
- );
40
- };
@@ -1,159 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import { Margins } from "./utils";
4
-
5
- function MultipleHexagons({ position }: { position: "left" | "right" }) {
6
- return (
7
- <svg
8
- viewBox={`${position === "left" ? "0" : "2"} 0 12 20`}
9
- width="12"
10
- height="20"
11
- fill="none"
12
- xmlns="http://www.w3.org/2000/svg"
13
- >
14
- <path
15
- d="M 3.913 5.381 L 2.063 4.314 L 2.063 2.173 L 3.913 1.103 L 5.761 2.173 L 5.761 4.314 L 3.913 5.381 Z M 2.38 4.128 L 3.913 5.014 L 5.444 4.128 L 5.444 2.356 L 3.913 1.47 L 2.38 2.356 L 2.38 4.128 Z"
16
- fill="#F49676"
17
- />
18
- <path
19
- d="M 8.047 5.401 L 6.197 4.334 L 6.197 2.193 L 8.047 1.123 L 9.895 2.193 L 9.895 4.334 L 8.047 5.401 Z M 6.514 4.148 L 8.047 5.034 L 9.578 4.148 L 9.578 2.376 L 8.047 1.49 L 6.514 2.376 L 6.514 4.148 Z"
20
- fill="#F49676"
21
- />
22
- <path
23
- d="M 8.071 4.548 L 6.956 3.905 L 6.956 2.615 L 8.071 1.97 L 9.184 2.615 L 9.184 3.905 L 8.071 4.548 Z"
24
- fill="#F49676"
25
- />
26
- <path
27
- d="M 5.982 8.898 L 4.132 7.831 L 4.132 5.69 L 5.982 4.62 L 7.83 5.69 L 7.83 7.831 L 5.982 8.898 Z M 4.449 7.645 L 5.982 8.531 L 7.513 7.645 L 7.513 5.873 L 5.982 4.987 L 4.449 5.873 L 4.449 7.645 Z"
28
- fill="#F49676"
29
- />
30
- <path
31
- d="M 6.006 8.045 L 4.891 7.402 L 4.891 6.112 L 6.006 5.467 L 7.119 6.112 L 7.119 7.402 L 6.006 8.045 Z"
32
- fill="#F49676"
33
- />
34
- <path
35
- d="M 8.056 12.323 L 6.206 11.256 L 6.206 9.115 L 8.056 8.045 L 9.904 9.115 L 9.904 11.256 L 8.056 12.323 Z M 6.523 11.07 L 8.056 11.956 L 9.587 11.07 L 9.587 9.298 L 8.056 8.412 L 6.523 9.298 L 6.523 11.07 Z"
36
- fill="#F49676"
37
- />
38
- <path
39
- d="M 8.08 11.47 L 6.965 10.827 L 6.965 9.537 L 8.08 8.892 L 9.193 9.537 L 9.193 10.827 L 8.08 11.47 Z"
40
- fill="#F49676"
41
- />
42
- <path
43
- d="M 10.101 8.878 L 8.251 7.811 L 8.251 5.67 L 10.101 4.6 L 11.949 5.67 L 11.949 7.811 L 10.101 8.878 Z M 8.568 7.625 L 10.101 8.511 L 11.632 7.625 L 11.632 5.853 L 10.101 4.967 L 8.568 5.853 L 8.568 7.625 Z"
44
- fill="#F49676"
45
- />
46
- <path
47
- d="M 10.125 8.025 L 9.01 7.382 L 9.01 6.092 L 10.125 5.447 L 11.238 6.092 L 11.238 7.382 L 10.125 8.025 Z"
48
- fill="#F49676"
49
- />
50
- <path
51
- d="M 12.077 12.301 L 10.227 11.234 L 10.227 9.093 L 12.077 8.023 L 13.925 9.093 L 13.925 11.234 L 12.077 12.301 Z M 10.544 11.048 L 12.077 11.934 L 13.608 11.048 L 13.608 9.276 L 12.077 8.39 L 10.544 9.276 L 10.544 11.048 Z"
52
- fill="#F49676"
53
- />
54
- <path
55
- d="M 12.101 11.448 L 10.986 10.805 L 10.986 9.515 L 12.101 8.87 L 13.214 9.515 L 13.214 10.805 L 12.101 11.448 Z"
56
- fill="#F49676"
57
- />
58
- <path
59
- d="M 10.062 15.781 L 8.212 14.714 L 8.212 12.573 L 10.062 11.503 L 11.91 12.573 L 11.91 14.714 L 10.062 15.781 Z M 8.529 14.528 L 10.062 15.414 L 11.593 14.528 L 11.593 12.756 L 10.062 11.87 L 8.529 12.756 L 8.529 14.528 Z"
60
- fill="#F49676"
61
- />
62
- <path
63
- d="M 8.029 19.193 L 6.179 18.126 L 6.179 15.985 L 8.029 14.915 L 9.877 15.985 L 9.877 18.126 L 8.029 19.193 Z M 6.496 17.94 L 8.029 18.826 L 9.56 17.94 L 9.56 16.168 L 8.029 15.282 L 6.496 16.168 L 6.496 17.94 Z"
64
- fill="#F49676"
65
- />
66
- <path
67
- d="M 6.068 15.716 L 4.218 14.649 L 4.218 12.508 L 6.068 11.438 L 7.916 12.508 L 7.916 14.649 L 6.068 15.716 Z M 4.535 14.463 L 6.068 15.349 L 7.599 14.463 L 7.599 12.691 L 6.068 11.805 L 4.535 12.691 L 4.535 14.463 Z"
68
- fill="#F49676"
69
- />
70
- <path
71
- d="M 6.092 14.863 L 4.977 14.22 L 4.977 12.93 L 6.092 12.285 L 7.205 12.93 L 7.205 14.22 L 6.092 14.863 Z"
72
- fill="#F49676"
73
- />
74
- <path
75
- d="M 4.011 12.393 L 2.161 11.326 L 2.161 9.185 L 4.011 8.115 L 5.859 9.185 L 5.859 11.326 L 4.011 12.393 Z M 2.478 11.14 L 4.011 12.026 L 5.542 11.14 L 5.542 9.368 L 4.011 8.482 L 2.478 9.368 L 2.478 11.14 Z"
76
- fill="#F49676"
77
- />
78
- <path
79
- d="M 2.083 15.773 L 0.233 14.706 L 0.233 12.565 L 2.083 11.495 L 3.931 12.565 L 3.931 14.706 L 2.083 15.773 Z M 0.55 14.52 L 2.083 15.406 L 3.614 14.52 L 3.614 12.748 L 2.083 11.862 L 0.55 12.748 L 0.55 14.52 Z"
80
- fill="#F49676"
81
- />
82
- <path
83
- d="M 2.107 14.92 L 0.992 14.277 L 0.992 12.987 L 2.107 12.342 L 3.22 12.987 L 3.22 14.277 L 2.107 14.92 Z"
84
- fill="#F49676"
85
- />
86
- <path
87
- d="M 3.966 19.231 L 2.116 18.164 L 2.116 16.023 L 3.966 14.953 L 5.814 16.023 L 5.814 18.164 L 3.966 19.231 Z M 2.433 17.978 L 3.966 18.864 L 5.497 17.978 L 5.497 16.206 L 3.966 15.32 L 2.433 16.206 L 2.433 17.978 Z"
88
- fill="#F49676"
89
- />
90
- <path
91
- d="M 3.99 18.378 L 2.875 17.735 L 2.875 16.445 L 3.99 15.8 L 5.103 16.445 L 5.103 17.735 L 3.99 18.378 Z"
92
- fill="#F49676"
93
- />
94
- </svg>
95
- );
96
- }
97
-
98
- const Default3SideContainer = styled.div`
99
- svg {
100
- height: 100%;
101
- width: auto;
102
- path {
103
- fill: #ffffff22;
104
- transition: fill 3s;
105
- &:hover {
106
- fill: #ffffffbb;
107
- }
108
- }
109
- }
110
- `;
111
- const Default2LayoutContainer = styled.div`
112
- h2,
113
- h3 {
114
- text-align: left;
115
- color: white;
116
- }
117
- `;
118
- export const Default3Layout = ({
119
- children,
120
- position = "right",
121
- }: {
122
- children: React.ReactNode;
123
- position?: "left" | "right";
124
- }) => {
125
- const isReversed = position === "left";
126
- return (
127
- <Default2LayoutContainer
128
- style={{
129
- display: "flex",
130
- position: "absolute",
131
- flexDirection: isReversed ? "row-reverse" : "row",
132
- inset: 0,
133
- alignItems: "center",
134
- }}
135
- >
136
- <Default3SideContainer
137
- style={{
138
- flex: 1,
139
- height: "100%",
140
- padding: "2rem",
141
- transform: isReversed
142
- ? "scale(2) translate(25%, 4%)"
143
- : "scale(2) translate(-25%, 15%)",
144
- }}
145
- >
146
- <MultipleHexagons position={position} />
147
- </Default3SideContainer>
148
- <div
149
- style={{
150
- flex: 4,
151
- marginLeft: isReversed ? Margins.horizontal : "2rem",
152
- marginRight: isReversed ? "2rem" : Margins.horizontal,
153
- }}
154
- >
155
- {children}
156
- </div>
157
- </Default2LayoutContainer>
158
- );
159
- };
@@ -1,31 +0,0 @@
1
- import React from "react";
2
-
3
- import { FlexBox } from "spectacle";
4
-
5
- import frontImage from "../front.png";
6
-
7
- export const MainSectionLayout = ({
8
- children,
9
- }: {
10
- children: React.ReactNode;
11
- }) => {
12
- return (
13
- <FlexBox
14
- height="100%"
15
- width="100%"
16
- flexDirection="row"
17
- style={{
18
- position: "absolute",
19
- inset: "none",
20
- right: 0,
21
- top: 0,
22
- bottom: 0,
23
- }}
24
- >
25
- <div style={{ paddingLeft: "8rem", flex: 1 }}>{children}</div>
26
- <div style={{ flex: "0 0", height: "100%", paddingLeft: "5rem" }}>
27
- <img src={frontImage} alt="Front" style={{ height: "100%" }} />
28
- </div>
29
- </FlexBox>
30
- );
31
- };
@@ -1,99 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import { getMatchingMdxType } from "./utils";
4
-
5
- function invariant(condition: any, message: string) {
6
- if (!condition) {
7
- throw new Error(message);
8
- }
9
- }
10
-
11
- const QuoteBaseLayout = styled.div `
12
- .blockquote > * {
13
- border-left: 0;
14
- }
15
- .blockquote {
16
- position: relative;
17
- }
18
- .blockquote > :first-child {
19
- &:before {
20
- content: "“";
21
- position: absolute;
22
- font-size: 16rem;
23
- left: -9rem;
24
- font-family: serif;
25
- top: 2rem;
26
- color: #ffffff22;
27
- }
28
- &:after {
29
- content: "”";
30
- position: absolute;
31
- font-size: 16rem;
32
- right: 3rem;
33
- bottom: -5rem;
34
- font-family: serif;
35
- color: #ffffff22;
36
- pointer-events: none;
37
- }
38
- }
39
- .blockquote * {
40
- line-height: 3.5rem !important;
41
- font-size: 2.5rem;
42
- }
43
- .source {
44
- font-family: Bitter, "Helvetica Neue", Helvetica, Arial, sans-serif;
45
- box-sizing: border-box;
46
- width: 100%;
47
- margin-top: 4rem;
48
- text-align: right;
49
- font-size: 2rem;
50
- a {
51
- text-decoration: none;
52
- color: #ffffff77;
53
- }
54
- }
55
- `;
56
- export function QuoteLayout({
57
- children,
58
- author,
59
- url,
60
- }: {
61
- children: React.ReactNode;
62
- author: string;
63
- url?: string;
64
- }) {
65
- const [blockquote, rest] = getMatchingMdxType(children, "blockquote");
66
- invariant(rest, "QuoteLayout can only have one blockquote");
67
- return (
68
- <QuoteBaseLayout>
69
- <div
70
- style={{
71
- display: "flex",
72
- flexDirection: "column",
73
- alignItems: "flex-start",
74
- justifyContent: "center",
75
- textAlign: "center",
76
- margin: "0 10%",
77
- }}
78
- >
79
- <div
80
- style={{
81
- flex: 1,
82
- padding: "0 8rem 0 0",
83
- boxSizing: "border-box",
84
- }}
85
- className="blockquote"
86
- >
87
- {blockquote}
88
- </div>
89
- <div className="source" style={{ flex: 1, padding: "0 2rem" }}>
90
- {
91
- <a href={url} target="_blank" rel="noopener noreferrer">
92
- {author}
93
- </a>
94
- }
95
- </div>
96
- </div>
97
- </QuoteBaseLayout>
98
- );
99
- }
@@ -1,14 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const SectionLayout = styled.div`
4
- display: flex;
5
- flex-direction: row;
6
- align-items: center;
7
- justify-content: space-between;
8
- height: 100%;
9
- padding-left: 9rem;
10
-
11
- h2 {
12
- color: white;
13
- }
14
- `;
@@ -1,44 +0,0 @@
1
- import React from "react";
2
- import { ColumnsLayout } from "./columns";
3
- import { Margins, getCodeChildren } from "./utils";
4
- import styled from "styled-components";
5
-
6
- const CodeSide = styled.div`
7
- pre {
8
- font-size: 0.9rem;
9
- }
10
- `;
11
-
12
- export function SidedCodeLayout({
13
- children,
14
- position = "right",
15
- }: {
16
- children: React.ReactNode;
17
- position?: "left" | "right";
18
- }) {
19
- const [code, rest] = getCodeChildren(children);
20
-
21
- return (
22
- <ColumnsLayout reverse={position === "left"}>
23
- <div
24
- style={{
25
- marginLeft: Margins.horizontal,
26
- paddingRight: Margins.horizontalInternal,
27
- }}
28
- >
29
- {rest}
30
- </div>
31
- <CodeSide
32
- style={{
33
- backgroundColor: "#1d2021",
34
- height: "100%",
35
- display: "flex",
36
- flexDirection: "column",
37
- justifyContent: "center",
38
- }}
39
- >
40
- {code}
41
- </CodeSide>
42
- </ColumnsLayout>
43
- );
44
- }
@@ -1,72 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import { SVGObject } from "./styled";
4
- import { getMatchingMdxType } from "./utils";
5
- import { Image } from "../components/Image";
6
-
7
- const DivWithHeading = styled.div`
8
- h2 {
9
- margin-top: 0;
10
- }
11
- h2 strong {
12
- color: #f49676;
13
- font-weight: 400;
14
- }
15
- `;
16
-
17
- export const SidedImageLayout = ({
18
- children,
19
- image,
20
- position,
21
- height,
22
- }: {
23
- children: React.ReactNode;
24
- image?: string;
25
- position?: "left" | "right";
26
- height?: number;
27
- }) => {
28
- const isReversed = position === "left";
29
- const [component, rest] = getMatchingMdxType(children, "Image") || image;
30
-
31
- if (!image && !component.length) {
32
- console.error("No image provided for SidedImageLayout");
33
- return null;
34
- }
35
- return (
36
- <DivWithHeading
37
- style={{
38
- display: "flex",
39
- flexDirection: isReversed ? "row-reverse" : "row",
40
- position: "absolute",
41
- left: 0,
42
- right: 0,
43
- bottom: 0,
44
- top: 0,
45
- }}
46
- >
47
- <div
48
- style={{
49
- flex: 1,
50
- display: "flex",
51
- flexDirection: "column",
52
- justifyContent: "center",
53
- padding: isReversed ? "0 7rem 0 4rem" : "0 4rem 0 7rem",
54
- }}
55
- >
56
- {rest}
57
- </div>
58
- <div
59
- style={{
60
- flex: 1,
61
- maxWidth: "40vw",
62
- display: "flex",
63
- flexDirection: "column",
64
- justifyContent: "center",
65
- backgroundColor: "white",
66
- }}
67
- >
68
- {component || <Image src={image} />}
69
- </div>
70
- </DivWithHeading>
71
- );
72
- };
@@ -1,31 +0,0 @@
1
- import React from "react";
2
- import { ColumnsLayout } from "./columns";
3
- import { Margins, getMatchingMdxType } from "./utils";
4
-
5
- export function SideLayout({
6
- children,
7
- position = "right",
8
- }: {
9
- children: React.ReactNode;
10
- position?: "right" | "left";
11
- }) {
12
- const [side, rest] = getMatchingMdxType(children, "Side");
13
- return (
14
- <ColumnsLayout reverse={position === "left"}>
15
- <div style={{ marginLeft: Margins.horizontal }}>{rest}</div>
16
- <div
17
- style={{
18
- marginLeft: Margins.horizontalInternal,
19
- padding: `0 ${Margins.vertical}`,
20
- backgroundColor: "#00000044",
21
- display: "flex",
22
- flexDirection: "column",
23
- justifyContent: "center",
24
- height: "100%",
25
- }}
26
- >
27
- {side}
28
- </div>
29
- </ColumnsLayout>
30
- );
31
- }
@@ -1,56 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
-
4
- const DivWithHeading = styled.div`
5
- h2 {
6
- margin-top: 0;
7
- }
8
- h2 strong {
9
- color: #f49676;
10
- font-weight: 400;
11
- }
12
- `;
13
-
14
- const ColumnsContainer = styled(DivWithHeading)`
15
- display: flex;
16
- flex-direction: row;
17
- position: absolute;
18
- left: 0;
19
- right: 0;
20
- top: 0;
21
- bottom: 0;
22
- alignitems: center;
23
- `;
24
-
25
- export function ColumnsLayout({
26
- children,
27
- reverse,
28
- }: {
29
- children: React.ReactNode;
30
- reverse?: boolean;
31
- }) {
32
- const childrenArray = React.Children.toArray(children);
33
- return (
34
- <ColumnsContainer
35
- style={{
36
- flexDirection: reverse ? "row-reverse" : "row",
37
- }}
38
- >
39
- {childrenArray.map((child, i) => (
40
- <div
41
- key={i}
42
- style={{
43
- flex: 1,
44
- height: "100%",
45
- display: "flex",
46
- flexFlow: "column",
47
- justifyContent: "center",
48
- boxSizing: "border-box",
49
- }}
50
- >
51
- {child}
52
- </div>
53
- ))}
54
- </ColumnsContainer>
55
- );
56
- }
@@ -1,19 +0,0 @@
1
- import { CenteredLayout } from "./CenteredLayout";
2
- import { Default3Layout } from "./Default3Layout";
3
- import { MainSectionLayout } from "./MainSectionLayout";
4
- import { QuoteLayout } from "./QuoteLayout";
5
- import { SectionLayout } from "./SectionLayout";
6
- import { SidedCodeLayout } from "./SideCodeLayout";
7
- import { SidedImageLayout } from "./SideImageLayout";
8
- import { SideLayout } from "./SideLayout";
9
-
10
- export default {
11
- mainSection: MainSectionLayout,
12
- centered: CenteredLayout,
13
- default3: Default3Layout,
14
- quote: QuoteLayout,
15
- sidedCode: SidedCodeLayout,
16
- sidedImage: SidedImageLayout,
17
- side: SideLayout,
18
- section: SectionLayout,
19
- };
@@ -1,7 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export const SVGObject = styled.object`
4
- padding: 3rem 2rem;
5
- box-sizing: border-box;
6
- background-color: white;
7
- `;