-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from sillsdev/additional_component_slot_story
add prop for an additional component on the right side, storybook (#23)
- Loading branch information
Showing
7 changed files
with
489 additions
and
89 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
84 changes: 84 additions & 0 deletions
84
.../language-chooser/react/language-chooser-react-mui/src/demos/DummyRightPanelComponent.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,84 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import { css } from "@emotion/react"; | ||
import { OptionCard } from "../OptionCard"; | ||
import { Typography } from "@mui/material"; | ||
|
||
// Just a quick dummy to demonstrate the right panel slot | ||
export const DummyRightPanelComponent: React.FunctionComponent<{}> = () => { | ||
const darkColor = "#800303"; | ||
const lightColor = "#e3dada"; | ||
return ( | ||
<div | ||
css={css` | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
color: ${darkColor}; | ||
padding: 15px; | ||
`} | ||
> | ||
<Typography> | ||
Space here to add another component. For example, a font picker. | ||
</Typography> | ||
<Typography variant="h1">Font:</Typography> | ||
<OptionCard | ||
isSelected={false} | ||
backgroundColorWhenSelected={lightColor} | ||
backgroundColorWhenNotSelected={"#FFFFFF"} | ||
css={css` | ||
color: ${darkColor}; | ||
border: 1px solid ${darkColor}; | ||
`} | ||
> | ||
<div | ||
css={css` | ||
font-family: "Roboto Mono", monospace; | ||
font-size: 1.25rem; | ||
font-weight: 700; | ||
`} | ||
> | ||
Roboto Mono | ||
</div> | ||
</OptionCard> | ||
<OptionCard | ||
isSelected={true} | ||
backgroundColorWhenSelected={lightColor} | ||
backgroundColorWhenNotSelected={"#FFFFFF"} | ||
css={css` | ||
color: ${darkColor}; | ||
border: 1px solid ${darkColor}; | ||
`} | ||
> | ||
<div | ||
css={css` | ||
font-family: serif; | ||
font-size: 1.25rem; | ||
font-weight: 700; | ||
`} | ||
> | ||
Serif | ||
</div> | ||
</OptionCard> | ||
<OptionCard | ||
isSelected={false} | ||
backgroundColorWhenSelected={lightColor} | ||
backgroundColorWhenNotSelected={"#FFFFFF"} | ||
css={css` | ||
color: ${darkColor}; | ||
border: 1px solid ${darkColor}; | ||
`} | ||
> | ||
<div | ||
css={css` | ||
font-family: sans-serif; | ||
font-size: 1.25rem; | ||
font-weight: 700; | ||
`} | ||
> | ||
Sans-serif | ||
</div> | ||
</OptionCard> | ||
</div> | ||
); | ||
}; |
11 changes: 11 additions & 0 deletions
11
components/language-chooser/react/language-chooser-react-mui/src/demos/PageDemo.stories.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,11 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { PageDemo } from "./PageDemo"; | ||
|
||
const meta: Meta<typeof PageDemo> = { | ||
component: PageDemo, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof PageDemo>; | ||
|
||
export const Primary: Story = {}; |
Oops, something went wrong.