/
ThemeIcon.story.tsx
62 lines (56 loc) · 1.43 KB
/
ThemeIcon.story.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from 'react';
import { MantineProvider } from '@mantine/styles';
import { ThemeIcon } from './ThemeIcon';
import { Group } from '../Group';
import { Box } from '../Box';
import { Text } from '../Text';
import { Center } from '../Center';
export default { title: 'ThemeIcon' };
export function WithHexColor() {
return <ThemeIcon color="#000">$</ThemeIcon>;
}
export function WithoutColor() {
return <ThemeIcon>$</ThemeIcon>;
}
export function Gradient() {
return (
<div style={{ padding: '40px' }}>
<Group>
<Box>
<Text>MantineProvider</Text>
<MantineProvider
theme={{
defaultGradient: {
from: 'red.2',
to: 'orange.8',
deg: 45,
},
}}
>
<Center>
<ThemeIcon variant="gradient" radius="md">
$
</ThemeIcon>
</Center>
</MantineProvider>
</Box>
<Box>
<Text>Default</Text>
<Center>
<ThemeIcon variant="gradient" radius="md">
$
</ThemeIcon>
</Center>
</Box>
<Box>
<Text>Specific</Text>
<Center>
<ThemeIcon variant="gradient" gradient={{ from: 'orange', to: 'red' }} radius="md">
$
</ThemeIcon>
</Center>
</Box>
</Group>
</div>
);
}