-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cf507c
commit 4497627
Showing
22 changed files
with
270 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module 'color-contrast-checker'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,22 @@ | ||
import { IconItem, Canvas, Meta, Story } from '@storybook/blocks'; | ||
import { Icons } from '@talend/storybook-docs'; | ||
import { IconsProvider, StackVertical, InlineMessageWarning, Icon } from '../../'; | ||
import { ArgTypes, IconItem, Canvas, Meta, Story } from '@storybook/blocks'; | ||
import { IconsProvider, InlineMessageWarning, Icon } from '../../'; | ||
import * as Stories from './Icon.stories'; | ||
import { AllIconsDocs } from './Icons'; | ||
|
||
<Meta | ||
of={Stories} | ||
parameters={{ | ||
status: { figma: 'ok', storybook: 'ok', react: 'ok', i18n: 'na' }, | ||
}} | ||
decorators={[ | ||
story => ( | ||
<Canvas> | ||
<IconsProvider /> | ||
<Story>{story()}</Story> | ||
</Canvas> | ||
), | ||
]} | ||
/> | ||
|
||
# Icons | ||
# Icon | ||
|
||
All icons can be found below and you can apply transformations on them. | ||
|
||
## All icons | ||
This component is generic and can be seens as a Primitive to display SVG, img, remote or not. | ||
|
||
<Icons /> | ||
<Canvas> | ||
<Story story={Stories.Usage} /> | ||
</Canvas> | ||
|
||
## Remote icon | ||
|
||
|
@@ -34,10 +26,24 @@ Icon can accept a URL as `name` but it must be prefixed by "remote-" | |
<Icon name="remote-https://unpkg.com/@talend/[email protected]/src/svg/core/abc.svg" /> | ||
</IconItem> | ||
|
||
```javascript | ||
<Icon name="remote-https://unpkg.com/@talend/[email protected]/src/svg/core/abc.svg" /> | ||
``` | ||
|
||
## Icon as image | ||
|
||
Icon can accept any type of image but their `name` must be prefixed by "src-". | ||
|
||
<IconItem name="src-url as img"> | ||
<Icon name="src-https://statics-dev.cloud.talend.com/@talend/common/images/favicon-logo-square.ico" /> | ||
</IconItem> | ||
<IconItem name="src-url as img"> | ||
<Icon name="src-https://statics-dev.cloud.talend.com/@talend/common/images/favicon-logo-square.ico" /> | ||
</IconItem> | ||
|
||
```javascript | ||
<Icon name="src-https://statics-dev.cloud.talend.com/@talend/common/images/favicon-logo-square.ico" /> | ||
``` | ||
|
||
## SVG from the bundle all.svg | ||
|
||
All icons can be found below and you can apply transformations on them. | ||
|
||
<AllIconsDocs /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,46 @@ | ||
import { useState, useEffect } from 'react'; | ||
Check warning on line 1 in packages/design-system/src/stories/icons/Icon.stories.tsx GitHub Actions / ESLint Report Analysispackages/design-system/src/stories/icons/Icon.stories.tsx#L1
|
||
import type { ChangeEvent, FormEvent } from 'react'; | ||
Check warning on line 2 in packages/design-system/src/stories/icons/Icon.stories.tsx GitHub Actions / ESLint Report Analysispackages/design-system/src/stories/icons/Icon.stories.tsx#L2
|
||
import { IconGallery, IconItem } from '@storybook/blocks'; | ||
Check warning on line 3 in packages/design-system/src/stories/icons/Icon.stories.tsx GitHub Actions / ESLint Report Analysispackages/design-system/src/stories/icons/Icon.stories.tsx#L3
|
||
|
||
import { StackHorizontal, Icon } from '../../'; | ||
import { AllIconsTemplate } from './Icons'; | ||
|
||
export default { | ||
title: 'Icons/Icon', | ||
}; | ||
|
||
export const Usage = () => ( | ||
type UsageProps = { | ||
name: string; | ||
}; | ||
|
||
export const Usage = (args: UsageProps) => ( | ||
<StackHorizontal gap="XS"> | ||
<Icon name="talend-cross" style={{ width: '1.2rem', height: '1.2rem' }} /> | ||
<Icon name="talend-cross" /> | ||
<Icon name="talend-cross" style={{ width: '2.4rem', height: '2.4rem' }} /> | ||
<Icon name={args.name} style={{ width: '1.2rem', height: '1.2rem' }} /> | ||
<Icon name={args.name} /> | ||
<Icon name={args.name} style={{ width: '2.4rem', height: '2.4rem' }} /> | ||
</StackHorizontal> | ||
); | ||
|
||
Usage.args = { | ||
name: 'talend-cross', | ||
}; | ||
Usage.argTypes = { | ||
name: { | ||
control: 'string', | ||
}, | ||
}; | ||
|
||
export const AllIcons = () => ( | ||
<AllIconsTemplate> | ||
{({ name, size, transform, border, filter, useCurrentColor }) => ( | ||
<Icon | ||
name={name} | ||
size={size} | ||
transform={transform} | ||
border={border} | ||
filter={filter} | ||
useCurrentColor={useCurrentColor} | ||
/> | ||
)} | ||
</AllIconsTemplate> | ||
); |
Oops, something went wrong.