Skip to content

Commit

Permalink
feat: expanded documentation for Carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-aberg authored May 9, 2023
1 parent b1dad16 commit 6911bd4
Show file tree
Hide file tree
Showing 15 changed files with 1,143 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const Code = (props) => {
minHeight: "$500",
maxWidth: "100%",
width: "100%",
display: "grid",
backgroundColor: theme.colors.gray500,
overflow: "scroll",
}}
Expand All @@ -25,6 +24,7 @@ const Code = (props) => {
isGuide={props.isGuide}
withPreview={props.withPreview}
hideNavBar={props.hideNavBar}
demoHeight={props.demoHeight}
>
{props.children.trim()}
</Sandbox>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React from "react";
import { theme, Box } from "@washingtonpost/wpds-ui-kit";

const Pre = ({ children, withPreview, isGuide = "none", hideNavBar }) => {
const Pre = ({
children,
withPreview,
isGuide = "none",
hideNavBar,
demoHeight,
}) => {
return (
<Box
as="pre"
Expand All @@ -21,6 +27,7 @@ const Pre = ({ children, withPreview, isGuide = "none", hideNavBar }) => {
withPreview,
isGuide,
hideNavBar,
demoHeight,
})}
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const useDebounce = (value, delay) => {
return debouncedValue;
};

const Preview = ({ isGuide }) => {
const Preview = ({ isGuide, demoHeight }) => {
const { code } = useActiveCode();
const [firstRenderCode, setFirstRenderCode] = useState(null);
const iframeRef = React.useRef(null);
Expand Down Expand Up @@ -115,6 +115,7 @@ const Preview = ({ isGuide }) => {
background: theme.colors.gray500,
border: 0,
width: "100%",
height: demoHeight ? `${demoHeight}px` : "auto",
minHeight: 325,
overflow: "hidden",
}}
Expand Down Expand Up @@ -156,6 +157,7 @@ const CustomSandpack = ({
isGuide,
withPreview = false,
hideNavBar = false,
demoHeight,
children,
}) => {
const [showCode, setShowCode] = useState(!withPreview);
Expand Down Expand Up @@ -190,7 +192,7 @@ const CustomSandpack = ({
borderRadius: 0,
}}
>
{withPreview && <Preview isGuide={isGuide} />}
{withPreview && <Preview isGuide={isGuide} demoHeight={demoHeight} />}
{showCode && (
<SandpackCodeEditor
style={{
Expand Down
Loading

4 comments on commit 6911bd4

@vercel
Copy link

@vercel vercel bot commented on 6911bd4 May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wpds-ui-kit-vitejs-example – ./apps/vite-project

wpds-ui-kit-vitejs-example-git-main.preview.now.washingtonpost.com
wpds-ui-kit-vitejs-example.preview.now.washingtonpost.com

@vercel
Copy link

@vercel vercel bot commented on 6911bd4 May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wpds-ui-kit – ./build.washingtonpost.com

wpds-ui-kit.preview.now.washingtonpost.com
build.washingtonpost.com
wpds-ui-kit-git-main.preview.now.washingtonpost.com

@vercel
Copy link

@vercel vercel bot commented on 6911bd4 May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 6911bd4 May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wpds-ui-kit-storybook – ./

wpds-ui-kit-storybook.preview.now.washingtonpost.com
wpds-ui-kit-storybook-git-main.preview.now.washingtonpost.com

Please sign in to comment.