-
Notifications
You must be signed in to change notification settings - Fork 2
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 #48 from abusix/pla-711-create-panel-component-in-…
…hailstorm Pla 711 create panel component
- Loading branch information
Showing
13 changed files
with
92 additions
and
27 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Panel } from "./panel"; |
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,44 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import React from "react"; | ||
import { Panel } from "./panel"; | ||
import { Button } from "../button/button"; | ||
import { getStoryDescription } from "../../util/storybook-utils"; | ||
import { Toggle } from "../toggle"; | ||
|
||
const meta: Meta<typeof Panel> = { | ||
title: "Panel", | ||
parameters: { | ||
...getStoryDescription("Simple container used to group and organize elements in the UI."), | ||
backgrounds: { | ||
default: "light", | ||
}, | ||
}, | ||
component: Panel, | ||
args: { | ||
className: "", | ||
children: "Panel with text content", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Panel>; | ||
|
||
export const Default: Story = {}; | ||
|
||
const noop = () => undefined; | ||
export const WithComponents: Story = { | ||
args: { | ||
children: ( | ||
<> | ||
<Button variant="primary" onClick={noop}> | ||
Button A | ||
</Button> | ||
<Toggle checked ariaLabel="test" onChange={noop} /> | ||
<Button variant="secondary" onClick={noop}> | ||
Button B | ||
</Button> | ||
<p> Paragraph content</p> | ||
</> | ||
), | ||
}, | ||
}; |
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,13 @@ | ||
import React, { FC, ReactNode } from "react"; | ||
import { classNames } from "../../util/class-names"; | ||
|
||
interface PanelProps { | ||
children: ReactNode; | ||
className?: string; | ||
} | ||
|
||
export const Panel: FC<PanelProps> = ({ children, className }) => ( | ||
<div className={classNames("rounded border border-neutral-300 bg-neutral-0 p-5", className)}> | ||
{children} | ||
</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