-
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.
Merge pull request #12 from perimetre/1.1
1.2.0
- Loading branch information
Showing
8 changed files
with
186 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,6 @@ yarn-error.log* | |
# vercel | ||
.vercel | ||
|
||
storybook-static | ||
storybook-static | ||
|
||
RELEASE.md |
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,70 @@ | ||
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1 | ||
import { Meta, Story } from '@storybook/react/types-6-0'; | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import { gridColumnOptions, gridRowOptions } from '../../prebuiltTailwindTheme'; | ||
|
||
export default { | ||
title: 'Components/Grid', | ||
argTypes: { | ||
columns: { | ||
defaultValue: '4', | ||
control: { | ||
type: 'select', | ||
options: gridColumnOptions | ||
} | ||
}, | ||
rows: { | ||
control: { | ||
type: 'select', | ||
options: gridRowOptions | ||
} | ||
}, | ||
className: { | ||
control: { | ||
type: 'text' | ||
} | ||
} | ||
} | ||
} as Meta; | ||
|
||
/** | ||
* A story that displays a Grid example | ||
* | ||
* @param props the story props | ||
* @param props.columns the columns property set on controls | ||
* @param props.rows the rows property set on controls | ||
* @param props.className the component classes | ||
*/ | ||
const Template: Story = ({ columns, rows, className }) => ( | ||
<div | ||
className={classnames( | ||
'pui-grid', | ||
{ | ||
[`grid-cols-${columns}`]: !!columns, | ||
[`grid-rows-${rows}`]: !!rows, | ||
'grid-flow-col': !!rows | ||
}, | ||
className | ||
)} | ||
> | ||
{Array(10) | ||
.fill(null) | ||
.map((_, i) => ( | ||
<div | ||
key={i} | ||
className="bg-blue-500 h-12 pui-border-radius flex items-center justify-center text-white text-2xl font-bold" | ||
> | ||
{i + 1} | ||
</div> | ||
))} | ||
</div> | ||
); | ||
|
||
export const Grid = Template.bind({}); | ||
|
||
export const GridRows = Template.bind({}); | ||
GridRows.args = { | ||
columns: undefined, | ||
rows: '2' | ||
}; |
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,8 @@ | ||
@layer components { | ||
/* The pui grid is just the default grid with some default gaps based on the breakpoints */ | ||
.pui-grid { | ||
/* Make it a grid */ | ||
/* Apply default gaps */ | ||
@apply grid gap-6 md:gap-8 lg:gap-7 xl:gap-9; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
@import './Dropdown'; | ||
@import './Badge'; | ||
@import './WYSIWYGInput'; | ||
@import './Grid'; |
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