forked from hexbear-collective/hexbear-frontend
12 changed files with 6808 additions and 238 deletions
-
14.storybook/main.js
-
9package.json
-
18src/components/ThemeSystemProvider.tsx
-
14src/components/data-type-select.tsx
-
16src/components/listing-type-select.tsx
-
3src/components/main.tsx
-
40src/components/user.tsx
-
13src/custom.css
-
36src/stories/Button.stories.tsx
-
93src/stories/Theming.stories.tsx
-
56src/theme.tsx
-
6734yarn.lock
@ -0,0 +1,14 @@ |
|||
module.exports = { |
|||
stories: ['../src/**/*.stories.tsx'], |
|||
webpackFinal: async config => { |
|||
config.module.rules.push({ |
|||
test: /\.(ts|tsx)$/, |
|||
loader: require.resolve('babel-loader'), |
|||
options: { |
|||
presets: [['react-app', { flow: false, typescript: true }]], |
|||
}, |
|||
}); |
|||
config.resolve.extensions.push('.ts', '.tsx'); |
|||
return config; |
|||
}, |
|||
}; |
@ -0,0 +1,36 @@ |
|||
import React, { useState } from 'react'; |
|||
import { Box, Label, |
|||
Input, |
|||
Select, |
|||
Textarea, |
|||
Radio, |
|||
Flex, |
|||
Checkbox, |
|||
Slider, } from 'theme-ui'; |
|||
import Button from '../components/elements/Button'; |
|||
import { ThemeSystemProvider } from '../components/ThemeSystemProvider'; |
|||
import { themes } from '../theme'; |
|||
|
|||
export default { title: 'Buttons' }; |
|||
|
|||
export const Basic = () => { |
|||
return ( |
|||
<div> |
|||
{Object.keys(themes).map(theme => { |
|||
return ( |
|||
<ThemeSystemProvider key={theme} initialTheme={theme}> |
|||
<Box bg="background" p={2}> |
|||
<Button mx={1}>Primary</Button> |
|||
<Button variant="secondary" mx={1}>Secondary</Button> |
|||
<Button variant="highlight" mx={1}>Highlight</Button> |
|||
<Button variant="muted" mx={1}>Muted</Button> |
|||
<Button disabled mx={1}>Disabled</Button> |
|||
<Button variant="danger" mx={1}>Danger</Button> |
|||
<Button variant="outline" mx={1}>Outline</Button> |
|||
</Box> |
|||
</ThemeSystemProvider> |
|||
) |
|||
})} |
|||
</div> |
|||
) |
|||
} |
@ -0,0 +1,93 @@ |
|||
import React, { useState } from 'react'; |
|||
import { Box, Label, |
|||
Input, |
|||
Select, |
|||
Textarea, |
|||
Radio, |
|||
Flex, |
|||
Checkbox, |
|||
Slider, } from 'theme-ui'; |
|||
import Button from '../components/elements/Button'; |
|||
import { ThemeSystemProvider } from '../components/ThemeSystemProvider'; |
|||
import { ThemeSelector } from '../theme'; |
|||
// import { Button } from '@storybook/react/demo';
|
|||
|
|||
|
|||
export default { title: 'Themes' }; |
|||
|
|||
function Form() { |
|||
return ( |
|||
<Box |
|||
as='form' |
|||
onSubmit={e => e.preventDefault()}> |
|||
<Label htmlFor='username'>Username</Label> |
|||
<Input |
|||
name='username' |
|||
id='username' |
|||
mb={3} |
|||
/> |
|||
<Label htmlFor='password'>Password</Label> |
|||
<Input |
|||
type='password' |
|||
name='password' |
|||
id='password' |
|||
mb={3} |
|||
/> |
|||
<Box> |
|||
<Label mb={3}> |
|||
<Checkbox /> |
|||
Remember me |
|||
</Label> |
|||
</Box> |
|||
<Label htmlFor='sound'>Sound</Label> |
|||
<Select name='sound' id='sound' mb={3}> |
|||
<option>Beep</option> |
|||
<option>Boop</option> |
|||
<option>Blip</option> |
|||
</Select> |
|||
<Label htmlFor='comment'>Comment</Label> |
|||
<Textarea |
|||
name='comment' |
|||
id='comment' |
|||
rows='6' |
|||
mb={3} |
|||
/> |
|||
<Flex mb={3}> |
|||
<Label> |
|||
<Radio name='letter' /> Alpha |
|||
</Label> |
|||
<Label> |
|||
<Radio name='letter' /> Bravo |
|||
</Label> |
|||
<Label> |
|||
<Radio name='letter' /> Charlie |
|||
</Label> |
|||
</Flex> |
|||
<Label> |
|||
Slider |
|||
</Label> |
|||
<Slider mb={3} /> |
|||
<Button variant="primary"> |
|||
Submit |
|||
</Button> |
|||
<Button variant='secondary'> |
|||
Cancel |
|||
</Button> |
|||
</Box> |
|||
) |
|||
} |
|||
|
|||
export const Basic = () => { |
|||
const [theme, setTheme] = useState('chapo'); |
|||
|
|||
return ( |
|||
<ThemeSystemProvider> |
|||
<Box m={4}> |
|||
<Box mb={2}> |
|||
<ThemeSelector value={theme} onChange={newTheme => setTheme(newTheme)} /> |
|||
</Box> |
|||
<Form /> |
|||
</Box> |
|||
</ThemeSystemProvider> |
|||
) |
|||
}; |
6734
yarn.lock
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue