Remove storybook (#4535)

This commit is contained in:
David Marby 2022-03-01 13:52:10 +01:00 committed by GitHub
parent 9dc0c804de
commit 1092940947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 24 additions and 19058 deletions

View File

@ -15,5 +15,4 @@ screenshots/
**/dist/
**/.cache/
**/svgr/
**/storybook-static/
*.md
*.md

View File

@ -31,8 +31,6 @@
"app-build": "npm run build --prefix packages/insomnia-app",
"app-package": "npm run package --prefix packages/insomnia-app",
"app-release": "npm run release --prefix packages/insomnia-app",
"storybook-start": "npm run storybook --prefix packages/insomnia-components",
"storybook-legacy-start": "npm run storybook --prefix packages/insomnia-app",
"preinstall": "node ./scripts/check-version.js",
"app-build:smoke": "cross-env npm run app-build",
"app-package:smoke": "cross-env npm run app-package",

View File

@ -1,4 +1,3 @@
dist
storybook-static
assets/svgr
src/assets/svgr
src/assets/svgr

View File

@ -1,5 +1,4 @@
.cache
storybook-static
src/assets/svgr
assets/svgr
dist

View File

@ -1,2 +0,0 @@
/** @type { import('@babel/core').TransformOptions } */
module.exports = require('../../insomnia-app/.babelrc.js')

View File

@ -1,28 +0,0 @@
import React from 'react';
const ThemeProvider = props => {
// Apply theme later because storybook adds its own `<body theme="...">` attribute too.
// TODO: Eventually change ours to `insomnia-theme` or something more specific.
setTimeout(() => document.body.setAttribute('theme', props.theme), 500);
return props.children;
};
export const contexts = [
{
icon: 'box', // a icon displayed in the Storybook toolbar to control contextual props
title: 'Themes', // an unique name of a contextual environment
components: [
ThemeProvider,
],
params: [
{ name: 'Designer Light', props: { theme: 'studio-light' }, default: true },
{ name: 'Designer Dark', props: { theme: 'studio-colorful' } },
],
options: {
deep: true, // pass the `props` deeply into all wrapping components
disable: false, // disable this contextual environment completely
cancelable: false, // allow this contextual environment to be opt-out optionally in toolbar
},
},
];

View File

@ -1,16 +0,0 @@
module.exports = {
addons: [
'@storybook/addon-knobs/register',
'@storybook/addon-contexts/register',
'storybook-addon-designs/register',
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
};

File diff suppressed because one or more lines are too long

View File

@ -1,490 +0,0 @@
<script>
window.onload = function() {
document.body.setAttribute('theme', 'default');
};
</script>
<style>
/* reset.css */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: normal;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
</style>
<style>
html {
--font-monospace: Menlo, Monaco, Consolas, 'Droid Sans Mono', 'Courier New', monospace,
'Droid Sans Fallback';
--font-default: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI',
'HelveticaNeue-Light', 'Ubuntu', 'Droid Sans', sans-serif;
--font-ligatures: normal;
}
body {
padding: 40px;
overflow: auto;
font-family: var(--font-default);
font-size: var(--font-size);
}
#root {
max-width: 70rem;
margin-left: auto;
margin-right: auto;
}
#story-root,
#dropdowns-container {
background-color: var(--color-bg);
color: var(--color-font);
}
#story-root {
padding: 0.5rem 40px;
}
.storybook-skinny {
max-width: 40rem;
margin-left: auto;
margin-right: auto;
}
.simplebar-content pre {
font-size: 0.8rem;
}
</style>
<!-- Default Theme Variables -->
<style>
html {
/* Font Size */
--font-size-xxs: 10px;
--font-size-xs: 11px;
--font-size-sm: 12px;
--font-size-md: 13px;
--font-size-lg: 14px;
--font-size-xl: 16px;
--font-size-xxl: 18px;
--font-size-xxxl: 22px;
--font-size: var(--font-size-md);
/* Font Weight */
--font-weight-regular: 400;
--font-weight-medium: 600;
--font-weight-bold: 700;
/* Line Height */
--font-line-height-sm: calc(var(--font-size) * 1);
--font-line-height-md: calc(var(--font-size) * 1.25);
--font-line-height-lg: calc(var(--font-size) * 1.4);
--font-line-height-xl: calc(var(--font-size) * 1.75);
--font-line-height-xxl: calc(var(--font-size) * 2);
--font-line-height-xxxl: calc(var(--font-size) * 2.25);
/* Spacing */
--spacing-xs: calc(var(--font-size) * 0.4);
--spacing-sm: calc(var(--font-size) * 0.6);
--spacing-md: calc(var(--font-size) * 1);
--spacing-lg: calc(var(--font-size) * 1.25);
--spacing-xl: calc(var(--font-size) * 1.5);
--spacing-xxl: calc(var(--font-size) * 2);
--spacing-xxxl: calc(var(--font-size) * 3);
--spacing-xxxxl: calc(var(--font-size) * 4);
/* Colors */
--color-border: var(--hl-md);
--color-sidebar: var(--color-bg);
--color-text: var(--color-font);
/* Padding */
--padding-md: calc(var(--font-size) * 1.2);
--padding-sm: calc(var(--font-size) * 0.6);
--padding-xs: calc(var(--font-size) * 0.4);
--padding-xxs: calc(var(--font-size) * 0.2);
--padding-lg: calc(var(--font-size) * 2.5);
--padding-xl: calc(var(--font-size) * 5);
/* Wrapper */
--line-height-lg: calc(var(--font-size) * 4.5);
--line-height-md: calc(var(--font-size) * 3.6);
--line-height-sm: calc(var(--font-size) * 2.88);
--line-height-xs: calc(var(--font-size) * 2.448);
--line-height-xxs: calc(var(--font-size) * 2.08);
/* Breakpoints */
--breakpoint-lg: 1100px;
--breakpoint-md: 880px;
--breakpoint-sm: 660px;
/* Radius */
--radius-sm: calc(var(--font-size) * 0.2);
--radius-md: calc(var(--font-size) * 0.3);
/* Scrollbars */
--scrollbar-width: calc(var(--font-size) * 0.6);
/* Modals */
--modal-width: calc(var(--font-size) * 60);
--modal-width-wide: calc(var(--font-size) * 70);
--modal-width-skinny: calc(var(--font-size) * 30);
/* Other */
--drag-width: calc(var(--font-size) * 0.5);
--height-nav: var(--line-height-md);
}
</style>
<style data-theme-name="studio-light">[theme="studio-light"] ,
[subtheme="studio-light"] {
/* Background */
--color-bg: rgb(255, 255, 255);
--color-bg-rgb: 255, 255, 255;
--color-success: rgb(61, 156, 98);
--color-success-rgb: 61, 156, 98;
--color-notice: rgb(187, 151, 0);
--color-notice-rgb: 187, 151, 0;
--color-warning: rgb(214, 128, 62);
--color-warning-rgb: 214, 128, 62;
--color-danger: rgb(218, 91, 86);
--color-danger-rgb: 218, 91, 86;
--color-surprise: rgb(96, 48, 191);
--color-surprise-rgb: 96, 48, 191;
--color-info: rgb(0, 48, 82);
--color-info-rgb: 0, 48, 82;
/* Foreground */
--color-font: rgb(85, 85, 85);
--color-font-rgb: 85, 85, 85;
--color-font-success: rgb(255, 255, 255);
--color-font-success-rgb: 255, 255, 255;
--color-font-notice: rgb(255, 255, 255);
--color-font-notice-rgb: 255, 255, 255;
--color-font-warning: rgb(255, 255, 255);
--color-font-warning-rgb: 255, 255, 255;
--color-font-danger: rgb(255, 255, 255);
--color-font-danger-rgb: 255, 255, 255;
--color-font-surprise: rgb(255, 255, 255);
--color-font-surprise-rgb: 255, 255, 255;
--color-font-info: rgb(255, 255, 255);
--color-font-info-rgb: 255, 255, 255;
/* Highlight */
--hl: rgb(130, 130, 130);
--hl-rgb: 130, 130, 130;
--hl-xxs: rgba(130, 130, 130, 0.05);
--hl-xxs-rgb: 130, 130, 130, 0.05;
--hl-xs: rgba(130, 130, 130, 0.1);
--hl-xs-rgb: 130, 130, 130, 0.1;
--hl-sm: rgba(130, 130, 130, 0.25);
--hl-sm-rgb: 130, 130, 130, 0.25;
--hl-md: rgba(130, 130, 130, 0.35);
--hl-md-rgb: 130, 130, 130, 0.35;
--hl-lg: rgba(130, 130, 130, 0.5);
--hl-lg-rgb: 130, 130, 130, 0.5;
--hl-xl: rgba(130, 130, 130, 0.8);
--hl-xl-rgb: 130, 130, 130, 0.8;
}
[theme="studio-light"] .theme--dropdown__menu,
[subtheme="studio-light"] .theme--dropdown__menu--sub {
/* Background */
--color-info: rgb(0, 91, 158);
--color-info-rgb: 0, 91, 158;
}
[theme="studio-light"] .theme--tooltip,
[subtheme="studio-light"] .theme--tooltip--sub {
/* Background */
--color-info: rgb(0, 91, 158);
--color-info-rgb: 0, 91, 158;
}
[theme="studio-light"] .theme--transparent-overlay,
[subtheme="studio-light"] .theme--transparent-overlay--sub {
/* Background */
--color-bg: rgba(230, 240, 250, 0.8);
--color-bg-rgb: 230, 240, 250, 0.8;
/* Foreground */
--color-font: rgb(85, 85, 85);
--color-font-rgb: 85, 85, 85;
}
[theme="studio-light"] .theme--dialog,
[subtheme="studio-light"] .theme--dialog--sub {
/* Background */
--color-info: rgb(0, 91, 158);
--color-info-rgb: 0, 91, 158;
}
[theme="studio-light"] .theme--sidebar,
[subtheme="studio-light"] .theme--sidebar--sub {
/* Background */
--color-bg: rgb(247, 250, 252);
--color-bg-rgb: 247, 250, 252;
--color-success: rgb(80, 161, 79);
--color-success-rgb: 80, 161, 79;
--color-notice: rgb(193, 132, 1);
--color-notice-rgb: 193, 132, 1;
--color-warning: rgb(193, 132, 1);
--color-warning-rgb: 193, 132, 1;
--color-danger: rgb(228, 86, 73);
--color-danger-rgb: 228, 86, 73;
--color-surprise: rgb(96, 48, 191);
--color-surprise-rgb: 96, 48, 191;
--color-info: rgb(1, 132, 188);
--color-info-rgb: 1, 132, 188;
/* Foreground */
--color-font: rgb(68, 68, 68);
--color-font-rgb: 68, 68, 68;
/* Highlight */
}
[theme="studio-light"] .theme--link,
[subtheme="studio-light"] .theme--link--sub {
/* Foreground */
--color-font: rgb(104, 169, 162);
--color-font-rgb: 104, 169, 162;
}
[theme="studio-light"] .theme--editor,
[subtheme="studio-light"] .theme--editor--sub {
/* Background */
--color-surprise: rgb(0, 48, 82);
--color-surprise-rgb: 0, 48, 82;
--color-info: rgb(96, 48, 191);
--color-info-rgb: 96, 48, 191;
}
[theme="studio-light"] .CodeMirror-info,
[subtheme="studio-light"] .CodeMirror-info--sub {
/* Background */
--color-info: rgb(0, 91, 158);
--color-info-rgb: 0, 91, 158;
}
</style>
<style data-theme-name="studio-colorful">[theme="studio-colorful"] ,
[subtheme="studio-colorful"] {
/* Background */
--color-bg: rgb(0, 48, 82);
--color-bg-rgb: 0, 48, 82;
--color-success: rgb(105, 199, 144);
--color-success-rgb: 105, 199, 144;
--color-notice: rgb(237, 203, 2);
--color-notice-rgb: 237, 203, 2;
--color-warning: rgb(232, 156, 66);
--color-warning-rgb: 232, 156, 66;
--color-danger: rgb(239, 110, 110);
--color-danger-rgb: 239, 110, 110;
--color-surprise: rgb(191, 163, 249);
--color-surprise-rgb: 191, 163, 249;
--color-info: rgb(106, 199, 230);
--color-info-rgb: 106, 199, 230;
/* Foreground */
--color-font: rgb(230, 239, 245);
--color-font-rgb: 230, 239, 245;
--color-font-success: rgb(255, 255, 255);
--color-font-success-rgb: 255, 255, 255;
--color-font-notice: rgb(255, 255, 255);
--color-font-notice-rgb: 255, 255, 255;
--color-font-warning: rgb(255, 255, 255);
--color-font-warning-rgb: 255, 255, 255;
--color-font-danger: rgb(255, 255, 255);
--color-font-danger-rgb: 255, 255, 255;
--color-font-surprise: rgb(255, 255, 255);
--color-font-surprise-rgb: 255, 255, 255;
--color-font-info: rgb(255, 255, 255);
--color-font-info-rgb: 255, 255, 255;
/* Highlight */
--hl: rgb(133, 157, 176);
--hl-rgb: 133, 157, 176;
--hl-xxs: rgba(133, 157, 176, 0.05);
--hl-xxs-rgb: 133, 157, 176, 0.05;
--hl-xs: rgba(133, 157, 176, 0.1);
--hl-xs-rgb: 133, 157, 176, 0.1;
--hl-sm: rgba(133, 157, 176, 0.2);
--hl-sm-rgb: 133, 157, 176, 0.2;
--hl-md: rgba(133, 157, 176, 0.3);
--hl-md-rgb: 133, 157, 176, 0.3;
--hl-lg: rgba(133, 157, 176, 0.5);
--hl-lg-rgb: 133, 157, 176, 0.5;
--hl-xl: rgba(133, 157, 176, 0.8);
--hl-xl-rgb: 133, 157, 176, 0.8;
}
[theme="studio-colorful"] .theme--dropdown__menu,
[subtheme="studio-colorful"] .theme--dropdown__menu--sub {
/* Background */
--color-bg: rgb(0, 70, 114);
--color-bg-rgb: 0, 70, 114;
}
[theme="studio-colorful"] .theme--tooltip,
[subtheme="studio-colorful"] .theme--tooltip--sub {
/* Background */
--color-bg: rgb(0, 70, 114);
--color-bg-rgb: 0, 70, 114;
}
[theme="studio-colorful"] .theme--transparent-overlay,
[subtheme="studio-colorful"] .theme--transparent-overlay--sub {
/* Background */
--color-bg: rgba(0, 37, 64, 0.8);
--color-bg-rgb: 0, 37, 64, 0.8;
}
[theme="studio-colorful"] .theme--dialog,
[subtheme="studio-colorful"] .theme--dialog--sub {
/* Background */
--color-bg: rgb(0, 70, 114);
--color-bg-rgb: 0, 70, 114;
}
[theme="studio-colorful"] .theme--sidebar,
[subtheme="studio-colorful"] .theme--sidebar--sub {
/* Background */
--color-bg: rgb(0, 57, 97);
--color-bg-rgb: 0, 57, 97;
/* Foreground */
--color-font: rgb(255, 255, 255);
--color-font-rgb: 255, 255, 255;
}
[theme="studio-colorful"] .theme--link,
[subtheme="studio-colorful"] .theme--link--sub {
/* Foreground */
--color-font: rgb(104, 169, 162);
--color-font-rgb: 104, 169, 162;
}
[theme="studio-colorful"] .CodeMirror-info,
[subtheme="studio-colorful"] .CodeMirror-info--sub {
/* Background */
--color-bg: rgb(0, 70, 114);
--color-bg-rgb: 0, 70, 114;
}
</style>

View File

@ -1,7 +0,0 @@
import { configure, addDecorator } from '@storybook/react';
import { withContexts } from '@storybook/addon-contexts/react';
import { contexts } from './configs/contexts';
addDecorator(withContexts(contexts));
configure(require.context('../src', true, /\.stories\.tsx?$/), module);

View File

@ -1,6 +1,6 @@
# insomnia-components
`insomnia-components` is a React component library of UI elements needed to build [Insomnia](https://insomnia.rest). Explore the components via [Storybook](https://storybook.insomnia.rest)!
`insomnia-components` is a React component library of UI elements needed to build [Insomnia](https://insomnia.rest).
## SVGs
@ -12,5 +12,3 @@ The generated icons can automatically be bound to the theme library built into I
1. All foreground colors should be white (#FFF)
SVGR converts these colors to `fill=''` and `fill='currentColor'` respectively. These icons are exposed via `svg-icon.js`, which sets the css `fill` and `color` of the SVG according to the required theme.
You can view the current icons available [here](https://storybook.insomnia.rest/?path=/story/svgicon--reference).

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,7 @@
"scripts": {
"prebuild": "npm run convert-svg",
"build": "webpack --config webpack/webpack.prod.js --display errors-only",
"build-storybook": "build-storybook --quiet",
"clean": "rimraf dist storybook-static && npm run clean:svg",
"clean": "rimraf dist && npm run clean:svg",
"clean:svg": "rimraf src/assets/svgr",
"clean:svg:index": "rimraf src/assets/svgr/index.tsx",
"convert-svg": "npm run clean:svg && svgr --config-file svgr.config.js --out-dir src/assets/svgr src/assets && npm run clean:svg:index",
@ -26,7 +25,6 @@
"lint": "eslint . --ext .js,.ts,.tsx --cache",
"lint:fix": "npm run lint -- --fix",
"prepare": "npm run build",
"storybook": "start-storybook --port 3223",
"test": "jest",
"watch": "webpack --config webpack/webpack.dev.js --watch"
},
@ -35,9 +33,7 @@
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/plugin-transform-runtime": "^7.12.10",
"@storybook/addon-contexts": "^5.3.21",
"@storybook/addon-knobs": "^6.2.9",
"@storybook/react": "^6.2.9",
"@svgr/cli": "^5.5.0",
"@testing-library/dom": "^7.30.4",
"@testing-library/jest-dom": "^5.12.0",
@ -61,7 +57,6 @@
"react-docgen-typescript": "^1.22.0",
"react-dom": "^16.8.3",
"react-use": "^17.2.4",
"storybook-addon-designs": "^5.4.1",
"styled-components": "^4.4.1",
"ts-loader": "^8.2.0",
"type-fest": "^1.0.2",

View File

@ -1,14 +0,0 @@
import React from 'react';
import { Breadcrumb } from './breadcrumb';
export default {
title: 'Navigation | Breadcrumb',
};
export const _default = () => (
<Breadcrumb
className="breadcrumb"
crumbs={[{ id: '1', node: 'Documents' }, { id: '2', node: 'Deployment', onClick: () => {} }, { id: '3', node: 'Another' }]}
/>
);

View File

@ -1,33 +0,0 @@
import { select, withKnobs } from '@storybook/addon-knobs';
import React from 'react';
import { AsyncButton } from './async-button';
import { ButtonSizeEnum, ButtonThemeEnum, ButtonVariantEnum } from './button';
export default {
title: 'Buttons | Async Button',
decorators: [withKnobs],
};
export const _default = () => (
<AsyncButton
onClick={() => new Promise(resolve => setTimeout(resolve, 3000))}
variant={select('Variant', ButtonVariantEnum, 'outlined')}
size={select('Size', ButtonSizeEnum, 'default')}
bg={select('Background', ButtonThemeEnum, 'default')}
>
Do stuff for 3 seconds
</AsyncButton>
);
export const customLoader = () => (
<AsyncButton
onClick={() => new Promise(resolve => setTimeout(resolve, 3000))}
variant={select('Variant', ButtonVariantEnum, 'outlined')}
size={select('Size', ButtonSizeEnum, 'default')}
bg={select('Background', ButtonThemeEnum, 'default')}
loadingNode={'Doing stuff...'}
>
Do stuff for 3 seconds
</AsyncButton>
);

View File

@ -1,109 +0,0 @@
import { number, select, withKnobs } from '@storybook/addon-knobs';
import React, { Fragment } from 'react';
import styled from 'styled-components';
import { IconEnum, SvgIcon } from '../svg-icon';
import { ButtonSizeEnum, ButtonThemeEnum, ButtonVariantEnum } from './button';
import { Button } from './index';
export default {
title: 'Buttons | Button',
decorators: [withKnobs],
};
const Wrapper = styled.div`
display: flex;
& > * {
margin-right: 0.5rem;
margin-top: 0.8rem;
}
`;
Wrapper.displayName = '...';
const Padded = styled.div`
margin: 2rem auto;
`;
Padded.displayName = '...';
const selectRadius = () => `${number('Radius (px)', 3)}px`;
export const outlined = () => (
<Button
variant={select('Variant', ButtonVariantEnum, 'outlined')}
size={select('Size', ButtonSizeEnum, 'default')}
radius={selectRadius()}
onClick={() => window.alert('Clicked!')}
bg={select('Background', ButtonThemeEnum, 'default')}
>
Outlined
</Button>
);
export const text = () => (
<Button
variant={select('Variant', ButtonVariantEnum, ButtonVariantEnum.Text)}
radius={selectRadius()}
onClick={() => window.alert('Clicked!')}
bg={select('Background', ButtonThemeEnum, 'default')}
>
Text
</Button>
);
export const contained = () => (
<Button
variant={select('Variant', ButtonVariantEnum, ButtonVariantEnum.Contained)}
onClick={() => window.alert('Clicked!')}
bg={select('Background', ButtonThemeEnum, 'default')}
>
Contained
</Button>
);
export const disabled = () => (
<Button
onClick={() => window.alert('Clicked!')}
bg={select('Background', ButtonThemeEnum, 'default')}
radius={selectRadius()}
disabled
>
Can't Touch This
</Button>
);
export const withIcon = () => (
<Button
onClick={() => window.alert('Clicked!')}
bg={select('Background', ButtonThemeEnum, 'default')}
radius={selectRadius()}
>
Expand <SvgIcon icon={IconEnum.chevronDown} />
</Button>
);
export const reference = () => {
const radius = selectRadius();
return (
<Fragment>
{Object.values(ButtonSizeEnum).map(s => (
<Padded key={s}>
<h2>
<code>size={s as any}</code>
</h2>
{Object.values(ButtonVariantEnum).map(v => (
<Wrapper key={v}>
{Object.values(ButtonThemeEnum).map(b => (
<Button key={b} bg={b} variant={v} size={s} radius={radius}>
{b || 'Default'}
</Button>
))}
</Wrapper>
))}
</Padded>
))}
</Fragment>
);
};

View File

@ -1,43 +0,0 @@
import { number, select, withKnobs } from '@storybook/addon-knobs';
import React from 'react';
import { IconEnum, SvgIcon } from '../svg-icon';
import { ButtonThemeEnum, ButtonVariantEnum } from './button';
import { CircleButton } from './circle-button';
export default {
title: 'Buttons | Circle Button',
decorators: [withKnobs],
};
const selectWidth = () => `${number('Width (px)', 32)}px`;
const selectHeight = () => `${number('Height (px)', 32)}px`;
export const disabled = () => (
<CircleButton onClick={() => window.alert('Clicked!')} disabled>
<SvgIcon icon={IconEnum.gear} />
</CircleButton>
);
export const _default = () => {
return (
<CircleButton onClick={() => window.alert('Clicked!')}>
<SvgIcon icon={IconEnum.gear} />
</CircleButton>
);
};
export const dimensions = () => {
return (
<CircleButton
onClick={() => window.alert('Clicked!')}
width={selectWidth()}
height={selectHeight()}
variant={select('Variant', ButtonVariantEnum, 'outlined')}
bg={select('Background', ButtonThemeEnum, 'default')}
>
<SvgIcon icon={select('Icon', IconEnum, IconEnum.gear)} />
</CircleButton>
);
};

View File

@ -1,138 +0,0 @@
import { boolean, text, withKnobs } from '@storybook/addon-knobs';
import React from 'react';
import { Card } from './card';
import { CardContainer } from './card-container';
import { IconEnum, SvgIcon } from './svg-icon';
export default {
title: 'Navigation | Card',
decorators: [withKnobs],
};
export const _default = () => (
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
/>
);
export const _selectable = () => (
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable
/>
);
export const _deck = () => (
<CardContainer>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
<Card
tagLabel={text('Label', 'OpenAPI 3.0')}
docTitle={text('Title', 'Cloud OS Login')}
docVersion={text('Version', 'v2.8.4')}
docBranch={text('Branch', 'feat/small-changes')}
docLog={text('Log', '2 hours ago by gschier')}
docMenu={<SvgIcon icon={IconEnum.ellipsis} />}
selectable={boolean('Selectable?', false)}
/>
</CardContainer>
);

View File

@ -1,72 +0,0 @@
import { number, withKnobs } from '@storybook/addon-knobs';
import React from 'react';
import { Button } from '../button';
import { SvgIcon } from '../svg-icon';
import { Dropdown } from './dropdown';
import { DropdownDivider } from './dropdown-divider';
import { DropdownItem } from './dropdown-item';
export default {
title: 'Navigation | Dropdown',
decorators: [withKnobs],
};
export const _default = () => (
<Dropdown
renderButton={({ open }) => (
<Button>
Dropdown <SvgIcon icon={open ? 'chevron-up' : 'chevron-down'} />
</Button>
)}
>
<DropdownDivider>Awesome Dropdown</DropdownDivider>
<DropdownItem icon={<SvgIcon icon="clock" />}>Check Time</DropdownItem>
<DropdownItem icon={<SvgIcon icon="git-branch" />} right="CTRL+A">
Create Branch
</DropdownItem>
<DropdownItem icon={<SvgIcon icon="github" />} disabled>
Disabled Action
</DropdownItem>
<DropdownItem icon={<SvgIcon icon="empty" />}>Other Action</DropdownItem>
<DropdownDivider />
<DropdownItem icon={<SvgIcon icon="warning" />}>Don't Do it!</DropdownItem>
</Dropdown>
);
export const rightAlign = () => (
<Dropdown
right
renderButton={() => (
<Button>
Right Align <SvgIcon icon="chevron-down" />
</Button>
)}
>
<DropdownItem>Item 1</DropdownItem>
<DropdownItem>Item 2</DropdownItem>
<DropdownItem>Item 3</DropdownItem>
</Dropdown>
);
export const manyItems = () => {
const items = [];
const numItems = number('Num Items', 100);
for (let i = 0; i < numItems; i++) {
items.push(<DropdownItem key={i}>Item {i + 1}</DropdownItem>);
}
return (
<Dropdown
right
renderButton={() => (
<Button>
{numItems} Items <SvgIcon icon="chevron-down" />
</Button>
)}
>
{items}
</Dropdown>
);
};

View File

@ -1,29 +0,0 @@
import React, { Fragment } from 'react';
import { Breadcrumb } from './breadcrumb';
import { Header } from './header';
import { Switch } from './switch';
export default {
title: 'Layout | Header',
};
export const _default = () => <Header />;
export const _primary = () => (
<Header
gridLeft={
<Fragment>
<Breadcrumb
crumbs={[{ id: '1', node: 'Documents' }, { id: '2', node: 'Deployment' }]}
/>
</Fragment>
}
gridCenter={<Switch />}
gridRight={
<Fragment>
<div>right</div>
</Fragment>
}
/>
);

View File

@ -1,46 +0,0 @@
import React from 'react';
import { HelpTooltip } from './help-tooltip';
export default {
title: 'Helpers | Help Tooltip',
};
export const _question = () => (
<div>
Hover over the question mark to view <HelpTooltip>This is the help message</HelpTooltip>
</div>
);
export const _info = () => (
<div>
Hover over the info mark to view <HelpTooltip info>This is the help message</HelpTooltip>
</div>
);
export const _onTop = () => (
<div>
Hover over the info mark to view <HelpTooltip info>This is the help message</HelpTooltip>
</div>
);
export const _onRight = () => (
<div>
Hover over the info mark to view{' '}
<HelpTooltip position="right">This is the help message</HelpTooltip>
</div>
);
export const _onLeft = () => (
<div>
Hover over the info mark to view{' '}
<HelpTooltip position="left">This is the help message</HelpTooltip>
</div>
);
export const _withDelay = () => (
<div>
Hover over the info mark to view{' '}
<HelpTooltip delay={900}> This tooltip had a 900ms delay</HelpTooltip>
</div>
);

View File

@ -1,289 +0,0 @@
import React, { useState } from 'react';
import { ListGroup } from './list-group';
import { ListGroupItem } from './list-group-item';
import { UnitTestItem } from './unit-test-item';
import { UnitTestResultItem } from './unit-test-result-item';
export default {
title: 'Lists | List Group',
};
export const _default = () => (
<div
style={{
width: '350px',
}}
>
<ListGroup>
<ListGroupItem>List</ListGroupItem>
<ListGroupItem>of</ListGroupItem>
<ListGroupItem>things...</ListGroupItem>
</ListGroup>
</div>
);
export const _bordered = () => (
<div
style={{
width: '350px',
}}
>
<ListGroup bordered>
<ListGroupItem>Bordered</ListGroupItem>
<ListGroupItem>list</ListGroupItem>
<ListGroupItem>of</ListGroupItem>
<ListGroupItem>things...</ListGroupItem>
</ListGroup>
</div>
);
export const _indented = () => (
<div
style={{
width: '350px',
}}
>
<ListGroup bordered>
<ListGroupItem indentLevel={0}>Indent 0</ListGroupItem>
<ListGroupItem indentLevel={1}>Indent 1</ListGroupItem>
<ListGroupItem indentLevel={2}>Indent 2</ListGroupItem>
<ListGroupItem indentLevel={3}>Indent 3</ListGroupItem>
<ListGroupItem indentLevel={4}>Indent 4</ListGroupItem>
<ListGroupItem indentLevel={3}>Indent 3</ListGroupItem>
<ListGroupItem indentLevel={2}>Indent 2</ListGroupItem>
<ListGroupItem indentLevel={1}>Indent 1</ListGroupItem>
<ListGroupItem indentLevel={0}>Indent 0</ListGroupItem>
</ListGroup>
</div>
);
export const _selectable = () => {
const [selected, setSelected] = useState(-1);
return (
<div
style={{
width: '350px',
}}
>
<ListGroup>
<ListGroupItem selectable isSelected={selected === 0} onClick={() => setSelected(0)}>
Selectable
</ListGroupItem>
<ListGroupItem selectable isSelected={selected === 1} onClick={() => setSelected(1)}>
list
</ListGroupItem>
<ListGroupItem selectable isSelected={selected === 2} onClick={() => setSelected(2)}>
of
</ListGroupItem>
<ListGroupItem selectable isSelected={selected === 3} onClick={() => setSelected(3)}>
things...
</ListGroupItem>
</ListGroup>
</div>
);
};
const unitTestResults = [
{
_id: 'ut_A',
title: 'Title of my test',
duration: '23',
err: {
message: '',
},
},
{
_id: 'ut_B',
title: 'Title of my test',
duration: '201',
err: {
message: 'expected 200 to equal 200',
},
},
{
_id: 'ut_C',
title: 'Title of my test',
duration: '87',
err: {
message: 'expected 200 to equal 200',
},
},
{
_id: 'ut_D',
title: 'Title of my test',
duration: '300',
err: {
message: 'expected 200 to equal 200',
},
},
];
const unitTests = [
{
_id: 'ut_2225a18649504b008b94d726f3dfa19A',
type: 'UnitTest',
parentId: 'uts_1ef3b15dbf844b349a309c41b652472a',
modified: 1599660181045,
created: 1598532257797,
requestId: 'req_wrk_3f5704e2fc744ac8b1a3c343791dbee9f2d8c170',
name: 'Returns 200',
code:
'const response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);',
},
{
_id: 'ut_2225a18649504b008b94d726f3dfa19d',
type: 'UnitTest',
parentId: 'uts_1ef3b15dbf844b349a309c41b652472a',
modified: 1599660181045,
created: 1598532257797,
requestId: 'req_wrk_3f5704e2fc744ac8b1a3c343791dbee9f2d8c170',
name: 'Returns 200',
code:
'const response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);\nconst response1 = await insomnia.send();\nexpect(response1.status).to.equal(404);',
},
];
const unitTestRequests = [
{
name: 'Tags / [GET] List Tags',
request: {
_id: 'req_wrk_758bf05cec5940bfb172e29449412220f2d8c170',
type: 'Request',
parentId: 'fld_wrk_758bf05cec5940bfb172e29449412220848eed0f',
modified: 1599149817249,
created: 1588864830793,
url: '{{ base_url }}/tags',
name: 'List Tags',
description: '',
method: 'GET',
body: {},
parameters: [],
headers: [],
authentication: {},
metaSortKey: -1588864830793,
isPrivate: false,
settingStoreCookies: true,
settingSendCookies: true,
settingDisableRenderRequestBody: false,
settingEncodeUrl: true,
settingRebuildPath: true,
settingFollowRedirects: 'global',
},
},
{
name: 'Tags / [GET] List Tags by Tag Name',
request: {
_id: 'req_wrk_758bf05cec5940bfb172e29449412220969d3aeb',
type: 'Request',
parentId: 'fld_wrk_758bf05cec5940bfb172e29449412220848eed0f',
modified: 1599149817246,
created: 1588864830792,
url: '{{ base_url }}/tags/{{ tag }}',
name: 'List Tags by Tag Name',
description: '',
method: 'GET',
body: {},
parameters: [],
headers: [],
},
},
{
name: ' [GET] asdf asdsadasfd',
request: {
_id: 'req_3dfdad515dc84962baaacd769088fffa',
type: 'Request',
parentId: 'wrk_758bf05cec5940bfb172e29449412220',
modified: 1599149244361,
created: 1599149176770,
url: '',
name: 'asdf asdsadasfd',
description: '',
method: 'GET',
body: {},
parameters: [],
headers: [],
},
},
{
name: ' [GET] List Services',
request: {
_id: 'req_wrk_758bf05cec5940bfb172e2944941222096633c4a',
type: 'Request',
parentId: 'wrk_758bf05cec5940bfb172e29449412220',
modified: 1599149817244,
created: 1588864830790,
url: '{{ base_url }}/services',
name: 'List Services',
description: '',
method: 'GET',
body: {},
parameters: [
{
name: 'offset',
disabled: true,
value: 'string',
},
{
name: 'size',
disabled: true,
value: '100',
},
{
name: 'tags',
disabled: true,
value: 'string',
},
],
headers: [],
},
},
];
const _handleRequestSelected = () => {
console.log('Request selected...');
};
export const _unitTests = () => (
<div
style={{
width: '100%',
}}
>
<ListGroup>
{unitTests.map(test => (
<UnitTestItem
testNameEditable={test.name}
item={test}
key={test._id}
onSetActiveRequest={_handleRequestSelected}
// @ts-expect-error -- TSCONVERSION
selectableRequests={unitTestRequests}
>
<div
style={{
padding: '10px 15px',
border: '1px solid #eee',
margin: '10px',
}}
>
CodeMirror instance.
</div>
</UnitTestItem>
))}
</ListGroup>
</div>
);
export const _unitTestResults = () => (
<div
style={{
width: '350px',
}}
>
<ListGroup>
{unitTestResults.map(test => (
<UnitTestResultItem item={test} key={test._id} />
))}
</ListGroup>
</div>
);

View File

@ -1,32 +0,0 @@
import React, { useState } from 'react';
import { MultiSwitch } from './multi-switch';
export default {
title: 'Navigation | Sliding Switch',
};
export const _default = () => {
const [selectedValue, setSelectedValue] = useState('debug');
return (
<MultiSwitch
name="activity"
onChange={setSelectedValue}
choices={[
{
label: 'Design',
value: 'design',
},
{
label: 'Debug',
value: 'debug',
},
{
label: 'Test',
value: 'test',
},
]}
selectedValue={selectedValue}
/>
);
};

View File

@ -1,61 +0,0 @@
import React from 'react';
import { Notice, NoticeTable } from './notice-table';
export default {
title: 'Tables | NoticeTable',
};
const notices: Notice[] = [
{
type: 'error',
line: 3,
message: 'This must be fixed now!',
},
{
type: 'warning',
line: 10,
message: 'This is a small nitpick',
},
{
type: 'warning',
line: 40,
message: "Another small warning because you didn't the right thing",
},
{
type: 'error',
line: 3212,
message:
'This is a really, really, really, long error message and I hope it makes sense ' +
"because it's just made up of random thoughts and things. But, don't let that fool you " +
"it's really important and you should fix it as soon as possible!",
},
];
export const _default = () => (
<NoticeTable
notices={notices}
onClick={n => window.alert(n.message)}
onVisibilityToggle={v => console.log('Visible?', v)}
/>
);
export const manyItems = () => {
const notices: Notice[] = [];
for (let i = 0; i < 100; i++) {
notices.push({
type: 'error',
line: i,
message: 'This is message ' + i,
});
}
return (
<NoticeTable
notices={notices}
onClick={n => window.alert(n.message)}
onVisibilityToggle={v => console.log('Visible?', v)}
/>
);
};

View File

@ -1,36 +0,0 @@
import React, { useState } from 'react';
import { RadioButtonGroup } from './radio-button-group';
export default {
title: 'Navigation | Radio Button Group',
};
export const _default = () => {
const [selectedValue, setSelectedValue] = useState('scratch');
return (
<RadioButtonGroup
name="dummy"
onChange={setSelectedValue}
choices={[
{
label: 'From Scratch',
value: 'scratch',
},
{
label: 'From Repository',
value: 'repo',
},
{
label: 'From Clipboard',
value: 'clip',
},
{
label: 'From Spec',
value: 'spec',
},
]}
selectedValue={selectedValue}
/>
);
};

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
import { text, withKnobs } from '@storybook/addon-knobs';
import React, { Fragment } from 'react';
import styled from 'styled-components';
import { IconEnum, IconId, SvgIcon } from './svg-icon';
import { Table, TableBody, TableData, TableHead, TableHeader, TableRow } from './table';
export default {
title: 'Iconography | Core Icons',
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 = () => (
<Fragment>
<Table striped outlined>
<TableHead>
<TableRow>
<TableHeader>Icon</TableHeader>
<TableHeader>1rem</TableHeader>
<TableHeader>1.5rem</TableHeader>
</TableRow>
</TableHead>
<TableBody>
{(Object.keys(SvgIcon.icons) as IconId[])
.sort()
.map(name => (
<TableRow key={name}>
<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>
</Fragment>
);

View File

@ -1,37 +0,0 @@
import React from 'react';
import { Switch } from './switch';
export default {
title: 'Navigation | Sliding Switch',
};
export const _design = () => (
<Switch
optionItems={[
{
label: 'DESIGN',
selected: true,
},
{
label: 'DEBUG',
selected: false,
},
]}
/>
);
export const _debug = () => (
<Switch
optionItems={[
{
label: 'DESIGN',
selected: false,
},
{
label: 'DEBUG',
selected: true,
},
]}
/>
);

View File

@ -1,91 +0,0 @@
import React from 'react';
import { Table, TableBody, TableData, TableHead, TableHeader, TableRow } from './table';
export default {
title: 'Tables | Table',
};
export const _default = () => (
<Table>
<TableHead>
<TableRow>
<TableHeader>Col 1</TableHeader>
<TableHeader>Col 2</TableHeader>
<TableHeader>Col 3</TableHeader>
</TableRow>
</TableHead>
<TableBody>
{[1, 2, 3].map(i => (
<TableRow key={i}>
<TableData>Column 1</TableData>
<TableData>Column 2</TableData>
<TableData>Column 3</TableData>
</TableRow>
))}
</TableBody>
</Table>
);
export const striped = () => (
<Table striped>
<TableHead>
<TableRow>
<TableHeader>Col 1</TableHeader>
<TableHeader>Col 2</TableHeader>
<TableHeader>Col 3</TableHeader>
</TableRow>
</TableHead>
<TableBody>
{[1, 2, 3].map(i => (
<TableRow key={i}>
<TableData>Column 1</TableData>
<TableData>Column 2</TableData>
<TableData>Column 3</TableData>
</TableRow>
))}
</TableBody>
</Table>
);
export const stripedAndOutlined = () => (
<Table striped outlined>
<TableHead>
<TableRow>
<TableHeader>Col 1</TableHeader>
<TableHeader>Col 2</TableHeader>
<TableHeader>Col 3</TableHeader>
</TableRow>
</TableHead>
<TableBody>
{[1, 2, 3].map(i => (
<TableRow key={i}>
<TableData>Column 1</TableData>
<TableData>Column 2</TableData>
<TableData>Column 3</TableData>
</TableRow>
))}
</TableBody>
</Table>
);
export const compactAndOutlined = () => (
<Table outlined compact>
<TableHead>
<TableRow>
<TableHeader>Col 1</TableHeader>
<TableHeader>Col 2</TableHeader>
<TableHeader>Col 3</TableHeader>
</TableRow>
</TableHead>
<TableBody>
{[1, 2, 3].map(i => (
<TableRow key={i}>
<TableData>Column 1</TableData>
<TableData>Column 2</TableData>
<TableData>Column 3</TableData>
</TableRow>
))}
</TableBody>
</Table>
);

View File

@ -1,31 +0,0 @@
import React from 'react';
import { ToggleSwitch } from './toggle-switch';
export default {
title: 'Form Elements | Toggle Switch',
};
const defaultOnChange = () => {};
export const Checked = () => <ToggleSwitch checked onChange={defaultOnChange} />;
export const Unchecked = () => <ToggleSwitch onChange={defaultOnChange} />;
export const Disabled = () => (
<>
<p>
<ToggleSwitch disabled checked onChange={defaultOnChange} />
</p>
<p>
<ToggleSwitch disabled onChange={defaultOnChange} />
</p>
</>
);
export const WithLabel = () => (
<ToggleSwitch
onChange={defaultOnChange}
label="text label"
/>
);

View File

@ -1,58 +0,0 @@
import React, { Fragment } from 'react';
import { Tooltip } from './tooltip';
export default {
title: 'Helpers | Tooltip',
};
export const onTop = () => (
<div className="text-center">
<Tooltip message="Here is some extra info on top" position="top">
<button className="btn btn--clicky">Hover Me</button>
</Tooltip>
</div>
);
export const onRight = () => (
<div className="text-center">
<Tooltip message="Here is some extra info on the right" position="right">
<button className="btn btn--clicky">Hover Me</button>
</Tooltip>
</div>
);
export const onLeft = () => (
<div className="text-center">
<Tooltip message="Here is some extra info on the left" position="left">
<button className="btn btn--clicky">Hover Me</button>
</Tooltip>
</div>
);
export const withDelay = () => (
<div className="text-center">
<Tooltip message="This tooltip had a 900ms delay" delay={900}>
<button className="btn btn--clicky">Hover Me</button>
</Tooltip>
</div>
);
export const withChildren = () => {
const message = (
<Fragment>
This is a{' '}
<a href="#" onClick={e => e.preventDefault()}>
Link
</a>
.
</Fragment>
);
return (
<div className="text-center">
<Tooltip message={message}>
<button className="btn btn--clicky">Hover Me</button>
</Tooltip>
</div>
);
};

View File

@ -1,5 +0,0 @@
{
"github": {
"silent": true
}
}

View File

@ -6639,19 +6639,6 @@
"integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
"dev": true
},
"paseto2": {
"version": "npm:paseto@2.1.3",
"resolved": "https://registry.npmjs.org/paseto/-/paseto-2.1.3.tgz",
"integrity": "sha512-BNkbvr0ZFDbh3oV13QzT5jXIu8xpFc9r0o5mvWBhDU1GBkVt1IzHK1N6dcYmN7XImrUmPQ0HCUXmoe2WPo8xsg==",
"dev": true
},
"paseto3": {
"version": "npm:paseto@3.1.0",
"resolved": "https://registry.npmjs.org/paseto/-/paseto-3.1.0.tgz",
"integrity": "sha512-oVSKoCH89M0WU3I+13NoCP9wGRel0BlQumwxsDZPk1yJtqS76PWKRM7vM9D4bz4PcScT0aIiAipC7lW6hSgkBQ==",
"dev": true,
"optional": true
},
"raw-body": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz",
@ -6814,6 +6801,19 @@
"integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
"dev": true
},
"paseto2": {
"version": "npm:paseto@2.1.3",
"resolved": "https://registry.npmjs.org/paseto/-/paseto-2.1.3.tgz",
"integrity": "sha512-BNkbvr0ZFDbh3oV13QzT5jXIu8xpFc9r0o5mvWBhDU1GBkVt1IzHK1N6dcYmN7XImrUmPQ0HCUXmoe2WPo8xsg==",
"dev": true
},
"paseto3": {
"version": "npm:paseto@3.1.0",
"resolved": "https://registry.npmjs.org/paseto/-/paseto-3.1.0.tgz",
"integrity": "sha512-oVSKoCH89M0WU3I+13NoCP9wGRel0BlQumwxsDZPk1yJtqS76PWKRM7vM9D4bz4PcScT0aIiAipC7lW6hSgkBQ==",
"dev": true,
"optional": true
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",