2020-04-26 20:33:39 +00:00
|
|
|
// @flow
|
|
|
|
import * as React from 'react';
|
|
|
|
import { text, withKnobs } from '@storybook/addon-knobs';
|
|
|
|
import SvgIcon, { IconEnum } from './svg-icon';
|
|
|
|
import { Table, TableBody, TableData, TableHead, TableHeader, TableRow } from './table';
|
|
|
|
import styled from 'styled-components';
|
|
|
|
|
|
|
|
export default {
|
Storybook Sidebar Provisioning & WIP Implementation (#2125)
* Migrating dimensions, latest SVG, stubbing sidebar
* Revert "Migrating dimensions, latest SVG, stubbing sidebar"
This reverts commit 5014a68f52ac50fc62db5d42d2b49abda28efaea.
* Revert "Revert "Migrating dimensions, latest SVG, stubbing sidebar""
This reverts commit 28c130c8d8b3993f91f072de106d3ff223d6c55b.
* Post merge bootstrap & build
* Linting
* Updating Story Heirarchy
* Migrating legacy tooltip component
* Reverting spacing integration into core dimensions
* Cleaning up comments, tweaking CSS var usage
* Removing static height
* Cleaning up static CSS values, re-organizing sliding panel, fixing search icon
* adding flow def for autobind in new SB instance
* PR feedback, removing new vars/updating markup
* Fixing lint > flow error on type
2020-05-14 18:00:29 +00:00
|
|
|
title: '1st Party | SvgIcon',
|
2020-04-26 20:33:39 +00:00
|
|
|
decorators: [withKnobs],
|
|
|
|
};
|
|
|
|
|
|
|
|
const Wrapper = styled.div`
|
|
|
|
font-size: 1.5rem;
|
|
|
|
& > * {
|
|
|
|
margin-right: 0.5rem;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
Wrapper.displayName = '...';
|
|
|
|
|
|
|
|
export const _default = () => <SvgIcon icon={IconEnum.arrowRight} />;
|
|
|
|
|
|
|
|
export const labelled = () => <SvgIcon icon={IconEnum.warning} label={text('Label', '3 Warnings')} />;
|
|
|
|
|
|
|
|
export const reference = () => (
|
|
|
|
<React.Fragment>
|
|
|
|
<Table striped outlined>
|
|
|
|
<TableHead>
|
|
|
|
<TableRow>
|
|
|
|
<TableHeader>Icon</TableHeader>
|
|
|
|
<TableHeader>1rem</TableHeader>
|
|
|
|
<TableHeader>1.5rem</TableHeader>
|
|
|
|
</TableRow>
|
|
|
|
</TableHead>
|
|
|
|
<TableBody>
|
|
|
|
{Object.keys(SvgIcon.icons)
|
|
|
|
.sort()
|
|
|
|
.map(name => (
|
|
|
|
<TableRow>
|
|
|
|
<TableData>
|
|
|
|
<code>{name}</code>
|
|
|
|
</TableData>
|
|
|
|
<TableData style={{ fontSize: '1rem' }}>
|
|
|
|
<SvgIcon icon={name} />
|
|
|
|
</TableData>
|
|
|
|
<TableData style={{ fontSize: '1.5rem' }}>
|
|
|
|
<SvgIcon icon={name} />
|
|
|
|
</TableData>
|
|
|
|
</TableRow>
|
|
|
|
))}
|
|
|
|
</TableBody>
|
|
|
|
</Table>
|
|
|
|
</React.Fragment>
|
|
|
|
);
|