Skip to content

Commit

Permalink
Adding stretch to the align items options (#290)
Browse files Browse the repository at this point in the history
* Adding stretch to the align items options

* Adding docs for container

* Removing unused prop.

* Updating example min and maxWidth

* Adding Layout section of navigation

* Fixing lint error.
  • Loading branch information
gjones authored Jan 4, 2024
1 parent 766345a commit 2573ea9
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
1 change: 1 addition & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const preview: Preview = {
"Introduction",
"Buttons",
"Cards",
"Layout",
"Forms",
"Display",
"Sidebar",
Expand Down
103 changes: 103 additions & 0 deletions src/components/Container/Container.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { Container } from "./Container";
import { Text } from "..";
import styled from "styled-components";

const GridCenter = styled.div`
display: grid;
place-items: center;
width: 100%;
height: 100%;
`;

const ContainerExample = ({ ...props }) => {
return (
<GridCenter>
<Container
{...props}
style={{ border: "1px solid grey" }}
>
<Text>Parent container</Text>
<Container
{...props}
style={{ border: "1px solid grey" }}
>
<Text>Child</Text>
</Container>
<Container
{...props}
style={{ border: "1px solid grey" }}
>
<Text>Child</Text>
</Container>
<Container
{...props}
style={{ border: "1px solid grey" }}
>
<Text>Child</Text>
</Container>
</Container>
</GridCenter>
);
};

export default {
component: ContainerExample,
title: "Layout/Container",
tags: ["container", "autodocs"],
argTypes: {
alignItems: { control: "select", options: ["start", "center", "end", "stretch"] },
fillWidth: { control: "boolean" },
gap: {
control: "select",
options: ["none", "xxs", "xs", "sm", "md", "lg", "xl", "xxl"],
},
grow: {
control: "select",
options: ["0", "1", "2", "3", "4", "5", "6"],
},
shrink: {
control: "select",
options: ["0", "1", "2", "3", "4", "5", "6"],
},
isResponsive: { control: "boolean" },
justifyContent: {
control: "select",
options: [
"center",
"space-between",
"space-around",
"space-evenly",
"start",
"end",
"left",
"right",
],
},
orientation: { control: "radio", options: ["horizontal", "vertical"] },
padding: {
control: "select",
options: ["none", "xxs", "xs", "sm", "md", "lg", "xl", "xxl"],
},
wrap: {
control: "select",
options: ["nowrap", "wrap", "wrap-reverse"],
},
},
};

export const Playground = {
args: {
alignItems: "center",
fillWidth: false,
gap: "none",
grow: "0",
isResponsive: true,
justifyContent: "start",
maxWidth: "auto",
minWidth: "auto",
orientation: "horizontal",
padding: "none",
shrink: "0",
wrap: "nowrap",
},
};
2 changes: 1 addition & 1 deletion src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from "styled-components";
import { HTMLAttributes } from "react";
import { Orientation } from "@/components";

type AlignItemsOptions = "start" | "center" | "end";
type AlignItemsOptions = "start" | "center" | "end" | "stretch";
type GapOptions = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
type GrowShrinkOptions = "0" | "1" | "2" | "3" | "4" | "5" | "6";
type JustifyContentOptions =
Expand Down

1 comment on commit 2573ea9

@vercel
Copy link

@vercel vercel bot commented on 2573ea9 Jan 4, 2024

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:

click-ui – ./

click-ui-git-main-clickhouse.vercel.app
click-ui-clickhouse.vercel.app
click-ui.vercel.app

Please sign in to comment.