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)}
+ />
+
+
+
+
+
+
+
+
+
+ );
+};
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()}>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
+ e.preventDefault()}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
}
+const Badges = () => (
+
+ Badges
+ Badge 1
+ Badge 2
+
+);
+
+const Alerts = () => (
+
+ Alerts
+
+ Primary
+
+
+ Secondary
+
+
+ Muted
+
+
+);
+
export const Basic = () => {
const [theme, setTheme] = useState('chapo');
return (
-
+
- setTheme(newTheme)} />
+
+ setTheme(newTheme)}
+ />
+
+
+
+
+
- )
-};
\ No newline at end of file
+ );
+};
diff --git a/src/theme.tsx b/src/theme.tsx
index c711420a..97cfcddb 100644
--- a/src/theme.tsx
+++ b/src/theme.tsx
@@ -16,21 +16,23 @@ export const variants = {
cursor: 'pointer',
'&:hover': {
textDecoration: 'none',
+ cursor: 'pointer',
},
'&:disabled': {
opacity: 0.5,
cursor: 'not-allowed',
},
},
- muted: {
- bg: 'muted',
- color: 'text',
- },
secondary: {
color: 'background',
bg: 'secondary',
},
+ muted: {
+ bg: 'muted',
+ color: 'text',
+ },
highlight: {
+ bg: 'highlight',
color: 'text',
'&:hover': {
backgroundColor: 'muted',
@@ -54,6 +56,16 @@ export const variants = {
color: 'text',
},
},
+ alerts: {
+ primary: {
+ color: 'background',
+ bg: 'primary',
+ },
+ muted: {
+ color: 'text',
+ bg: 'muted',
+ },
+ },
};
const defaultTheme: ThemeProviderProps = {
@@ -72,14 +84,37 @@ const defaultTheme: ThemeProviderProps = {
primary: {
...variants.buttons.primary,
color: 'text',
- bg: 'primary'
+ bg: 'primary',
},
secondary: {
...variants.buttons.secondary,
color: 'text',
bg: 'secondary',
- }
- }
+ },
+ highlight: {
+ ...variants.buttons.highlight,
+ color: 'text',
+ bg: lighten('muted', 0.1),
+ },
+ },
+ alerts: {
+ ...variants.alerts,
+ primary: {
+ ...variants.alerts.primary,
+ color: 'text',
+ bg: 'primary',
+ },
+ secondary: {
+ ...variants.alerts.secondary,
+ color: 'text',
+ bg: 'secondary',
+ },
+ highlight: {
+ ...variants.alerts.highlight,
+ color: 'text',
+ bg: lighten('muted', 0.1),
+ },
+ },
};
export const themes = {