forked from premieroctet/openchakra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
174 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ const CodePanel = () => { | |
|
||
return ( | ||
<Box | ||
zIndex={40} | ||
p={4} | ||
fontSize="sm" | ||
backgroundColor="#011627" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import React from "react"; | ||
import { Badge, BadgeProps } from "@chakra-ui/core"; | ||
import { Badge } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const BadgePreview: React.FC<{ component: IComponent }> = ({ component }) => { | ||
const { props }: { props: BadgeProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Badge {...props}>{component.props.children || "Lorem Ipsum"}</Badge>; | ||
return ( | ||
<Badge ref={ref} {...props}> | ||
{component.props.children || "Lorem Ipsum"} | ||
</Badge> | ||
); | ||
}; | ||
|
||
export default BadgePreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import React from "react"; | ||
import { Button, ButtonProps } from "@chakra-ui/core"; | ||
import { Button } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const ButtonPreview: React.FC<{ component: IComponent }> = ({ component }) => { | ||
const { props }: { props: ButtonProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Button {...props}>{props.children || "Lorem Ipsum"}</Button>; | ||
return ( | ||
<Button ref={ref} {...props}> | ||
{props.children || "Lorem Ipsum"} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default ButtonPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import React from "react"; | ||
import { Checkbox, CheckboxProps } from "@chakra-ui/core"; | ||
import { Checkbox } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const CheckboxPreview: React.FC<{ component: IComponent }> = ({ | ||
component | ||
}) => { | ||
const { props }: { props: CheckboxProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Checkbox {...props}>{props.children || "Lorem Ipsum"}</Checkbox>; | ||
return ( | ||
<Checkbox ref={ref} {...props}> | ||
{props.children || "Lorem Ipsum"} | ||
</Checkbox> | ||
); | ||
}; | ||
|
||
export default CheckboxPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React from "react"; | ||
import { CloseButton, CloseButtonProps } from "@chakra-ui/core"; | ||
import { CloseButton } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const CloseButtonPreview: React.FC<{ component: IComponent }> = ({ | ||
component | ||
}) => { | ||
const { props }: { props: CloseButtonProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <CloseButton {...props} />; | ||
return <CloseButton ref={ref} {...props} />; | ||
}; | ||
|
||
export default CloseButtonPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React from "react"; | ||
import { IconButton, IconButtonProps } from "@chakra-ui/core"; | ||
import { IconButton } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const IconButtonPreview: React.FC<{ component: IComponent }> = ({ | ||
component | ||
}) => { | ||
const { props }: { props: IconButtonProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <IconButton {...props} />; | ||
return <IconButton ref={ref} {...props} />; | ||
}; | ||
|
||
export default IconButtonPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import React from "react"; | ||
import { Link, LinkProps } from "@chakra-ui/core"; | ||
import { Link } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const LinkPreview: React.FC<{ component: IComponent }> = ({ component }) => { | ||
const { props }: { props: LinkProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Link {...props}>{component.props.children || "Link"}</Link>; | ||
return ( | ||
<Link ref={ref} {...props}> | ||
{component.props.children || "Link"} | ||
</Link> | ||
); | ||
}; | ||
|
||
export default LinkPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React from "react"; | ||
import { Progress, ProgressProps } from "@chakra-ui/core"; | ||
import { Progress } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const ProgressPreview: React.FC<{ component: IComponent }> = ({ | ||
component | ||
}) => { | ||
const { props }: { props: ProgressProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Progress {...props} />; | ||
return <Progress ref={ref} {...props} />; | ||
}; | ||
|
||
export default ProgressPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from "react"; | ||
import { Spinner, SpinnerProps } from "@chakra-ui/core"; | ||
import { Spinner } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const SpinnerPreview: React.FC<{ component: IComponent }> = ({ component }) => { | ||
const { props }: { props: SpinnerProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Spinner {...props} />; | ||
return <Spinner ref={ref} {...props} />; | ||
}; | ||
|
||
export default SpinnerPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import React from "react"; | ||
import { Text, BoxProps } from "@chakra-ui/core"; | ||
import { Text } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const TextPreview: React.FC<{ component: IComponent }> = ({ component }) => { | ||
const { props }: { props: BoxProps } = useInteractive(component); | ||
const { props, ref } = useInteractive(component); | ||
|
||
return <Text {...props}>{component.props.children || "Lorem Ipsum"}</Text>; | ||
return ( | ||
<Text ref={ref} {...props}> | ||
{component.props.children || "Lorem Ipsum"} | ||
</Text> | ||
); | ||
}; | ||
|
||
export default TextPreview; |
Oops, something went wrong.