-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add Loading and TextArea to playgrounds
- Loading branch information
Showing
12 changed files
with
183 additions
and
30 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
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
11 changes: 11 additions & 0 deletions
11
website/src/components/Playground/DesignSystem/Loading.module.css
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.loading { | ||
display:flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100%; | ||
} | ||
|
||
.loading img { | ||
width:50px; | ||
height:50px; | ||
} |
12 changes: 12 additions & 0 deletions
12
website/src/components/Playground/DesignSystem/Loading.tsx
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
||
import styles from './Loading.module.css'; | ||
|
||
export function Loading() { | ||
const loadingUrl = useBaseUrl('img/loading-logo.svg'); | ||
return ( | ||
<div className={styles.loading}> | ||
<img src={loadingUrl} /> | ||
</div> | ||
); | ||
} |
18 changes: 18 additions & 0 deletions
18
website/src/components/Playground/DesignSystem/TextArea.tsx
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import classnames from 'clsx'; | ||
import React, { type InputHTMLAttributes } from 'react'; | ||
|
||
export function TextArea({ | ||
label, | ||
...props | ||
}: InputHTMLAttributes<HTMLTextAreaElement> & { | ||
label?: React.ReactNode; | ||
}) { | ||
return ( | ||
<div className="rt-TextAreaRoot"> | ||
<textarea className="rt-TextAreaInput" {...props} /> | ||
<label className="rt-TextFieldLabel" htmlFor={props.name}> | ||
{label} | ||
</label> | ||
</div> | ||
); | ||
} |
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,19 +1,19 @@ | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
import React from 'react'; | ||
import { LiveError, LivePreview } from 'react-live'; | ||
|
||
import Boundary from './Boundary'; | ||
import { Loading } from './DesignSystem/Loading'; | ||
import styles from './styles.module.css'; | ||
|
||
export default function PreviewBlock() { | ||
return ( | ||
<> | ||
<Boundary fallback={<LivePreviewLoader />}> | ||
<Boundary fallback={<Loading />}> | ||
<LivePreview /> | ||
</Boundary> | ||
{/* <Loading /> */} | ||
<LiveError className={styles.playgroundError} /> | ||
</> | ||
); | ||
} | ||
function LivePreviewLoader() { | ||
return <div>Loading...</div>; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.