Skip to content

Commit

Permalink
docs: v5 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
denkristoffer committed Jan 11, 2024
1 parent cc98332 commit d706d0e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 67 deletions.
2 changes: 1 addition & 1 deletion packages/components/icon/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Forma 36 provides a list of built-in icons that can be used as regular React com

The icon components can be configured in different ways using variations in color and size:

```jsx file=./examples/IconVariantsExample.tsx
```jsx file=./examples/IconColorsExample.tsx

```

Expand Down
18 changes: 18 additions & 0 deletions packages/components/icon/examples/IconColorsExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as React from 'react';
import { CalendarBlankIcon } from '@contentful/f36-icons';
import { Flex } from '@contentful/f36-components';
import tokens from '@contentful/f36-tokens';

export default function IconColorsExample() {
return (
<Flex flexDirection="column">
<CalendarBlankIcon variant={tokens.gray900} />

<CalendarBlankIcon color={tokens.blue500} />

<div style={{ backgroundColor: '#8091a5' }}>
<CalendarBlankIcon color={tokens.colorWhite} />
</div>
</Flex>
);
}
14 changes: 4 additions & 10 deletions packages/components/icon/examples/IconSizesExample.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import * as React from 'react';
import { CalendarIcon } from '@contentful/f36-icons';
import { CalendarBlankIcon } from '@contentful/f36-icons';
import { Stack, Flex, Text } from '@contentful/f36-components';

export default function IconSizesExample() {
return (
<Stack>
<Flex alignItems="center">
<CalendarIcon size="tiny" /> <Text>Tiny</Text>
<CalendarBlankIcon size="tiny" /> <Text>Tiny</Text>
</Flex>
<Flex alignItems="center">
<CalendarIcon size="small" /> <Text>Small</Text>
<CalendarBlankIcon size="small" /> <Text>Small</Text>
</Flex>
<Flex alignItems="center">
<CalendarIcon size="medium" /> <Text>Medium</Text>
</Flex>
<Flex alignItems="center">
<CalendarIcon size="large" /> <Text>Large</Text>
</Flex>
<Flex alignItems="center">
<CalendarIcon size="xlarge" /> <Text>Extra large</Text>
<CalendarBlankIcon size="medium" /> <Text>Medium</Text>
</Flex>
</Stack>
);
Expand Down
56 changes: 0 additions & 56 deletions packages/components/icon/examples/IconVariantsExample.tsx

This file was deleted.

0 comments on commit d706d0e

Please sign in to comment.