From d8b44eca0d4d0cecabd2cf20260a99d3d47e425f Mon Sep 17 00:00:00 2001 From: GreatBearShark Date: Sun, 9 Aug 2020 14:38:54 -0500 Subject: [PATCH] Add more items to Theming story, add card story --- package.json | 2 +- src/custom.css | 3 + src/stories/Button.stories.tsx | 37 ++++++--- src/stories/Card.stories.tsx | 74 +++++++++++++++++ src/stories/Theming.stories.tsx | 138 +++++++++++++++++--------------- src/theme.tsx | 49 ++++++++++-- 6 files changed, 219 insertions(+), 84 deletions(-) create mode 100644 src/stories/Card.stories.tsx diff --git a/package.json b/package.json index ba6c029c..2ec3702f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "node generate_translations.js && NODE_ENV=production vite build --base=/static/", "lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src", "start": "node generate_translations.js && vite --port 4444 --open", - "storybook": "start-storybook" + "storybook": "start-storybook -p 9009" }, "keywords": [], "dependencies": { diff --git a/src/custom.css b/src/custom.css index a31cf577..76573a89 100644 --- a/src/custom.css +++ b/src/custom.css @@ -730,3 +730,6 @@ a.text-body { border-bottom-left-radius: 0; } +button:hover [type="button"]:hover { + cursor: pointer; +} \ No newline at end of file diff --git a/src/stories/Button.stories.tsx b/src/stories/Button.stories.tsx index 1a646811..6972d8ea 100644 --- a/src/stories/Button.stories.tsx +++ b/src/stories/Button.stories.tsx @@ -1,12 +1,15 @@ import React, { useState } from 'react'; -import { Box, Label, +import { + Box, + Label, Input, Select, Textarea, Radio, Flex, Checkbox, - Slider, } from 'theme-ui'; + Slider, +} from 'theme-ui'; import Button from '../components/elements/Button'; import { ThemeSystemProvider } from '../components/ThemeSystemProvider'; import { themes } from '../theme'; @@ -21,16 +24,28 @@ export const Basic = () => { - - - - - - + + + + + + - ) + ); })} - ) -} \ No newline at end of file + ); +}; diff --git a/src/stories/Card.stories.tsx b/src/stories/Card.stories.tsx new file mode 100644 index 00000000..c8501043 --- /dev/null +++ b/src/stories/Card.stories.tsx @@ -0,0 +1,74 @@ +import React, { useState } from 'react'; +import { Box, Heading } from 'theme-ui'; +import Card from '../components/elements/Card'; +import { ThemeSystemProvider } from '../components/ThemeSystemProvider'; +import { ThemeSelector } from '../theme'; + +export default { + title: 'Card', +}; + +export const Basic = () => { + const [theme, setTheme] = useState('chapo'); + + return ( + + + setTheme(newTheme)} + /> + + + +
+ + Trending{' '} + + communities + + + +
+
+
+ Subscribed to{' '} + + communities + +
+ +
+
+ + Create a Community + +
+
+
+
+ ); +}; diff --git a/src/stories/Theming.stories.tsx b/src/stories/Theming.stories.tsx index 11d00748..77d5d354 100644 --- a/src/stories/Theming.stories.tsx +++ b/src/stories/Theming.stories.tsx @@ -1,93 +1,101 @@ import React, { useState } from 'react'; -import { Box, Label, +import { + Box, + Label, Input, Select, Textarea, Radio, Flex, Checkbox, - Slider, } from 'theme-ui'; + Slider, + Heading, + Spinner, + Badge, + Alert, +} 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 ( - e.preventDefault()}> - - - - - - - - - - -