@storybook/components 5.2.1 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html.js +1 -1
- package/dist/typography/DocumentFormatting.js +2 -1
- package/dist/typography/DocumentWrapper.js +2 -2
- package/package.json +11 -5
- package/src/ActionBar/ActionBar.stories.tsx +0 -41
- package/src/ActionBar/ActionBar.tsx +0 -75
- package/src/Badge/Badge.stories.tsx +0 -11
- package/src/Badge/Badge.tsx +0 -68
- package/src/Button/Button.stories.tsx +0 -53
- package/src/Button/Button.tsx +0 -256
- package/src/ScrollArea/ScrollArea.stories.tsx +0 -85
- package/src/ScrollArea/ScrollArea.tsx +0 -62
- package/src/ScrollArea/ScrollAreaStyles.tsx +0 -166
- package/src/addon-panel/addon-panel.tsx +0 -33
- package/src/bar/bar.tsx +0 -93
- package/src/bar/button.ts +0 -89
- package/src/bar/separator.tsx +0 -39
- package/src/blocks/BlockBackgroundStyles.tsx +0 -9
- package/src/blocks/ColorPalette.stories.tsx +0 -29
- package/src/blocks/ColorPalette.tsx +0 -168
- package/src/blocks/Description.stories.tsx +0 -15
- package/src/blocks/Description.tsx +0 -18
- package/src/blocks/DocsPage.stories.tsx +0 -67
- package/src/blocks/DocsPage.tsx +0 -81
- package/src/blocks/DocsPageExampleCaption.md +0 -93
- package/src/blocks/DocsPageExampleCaption.mdx +0 -93
- package/src/blocks/EmptyBlock.stories.tsx +0 -9
- package/src/blocks/EmptyBlock.tsx +0 -23
- package/src/blocks/IFrame.tsx +0 -60
- package/src/blocks/IconGallery.stories.tsx +0 -32
- package/src/blocks/IconGallery.tsx +0 -72
- package/src/blocks/Preview.stories.tsx +0 -96
- package/src/blocks/Preview.tsx +0 -162
- package/src/blocks/PropsTable/PropDef.ts +0 -7
- package/src/blocks/PropsTable/PropRow.stories.tsx +0 -113
- package/src/blocks/PropsTable/PropRow.tsx +0 -102
- package/src/blocks/PropsTable/PropsTable.stories.tsx +0 -14
- package/src/blocks/PropsTable/PropsTable.tsx +0 -169
- package/src/blocks/Source.stories.tsx +0 -36
- package/src/blocks/Source.tsx +0 -72
- package/src/blocks/Story.stories.tsx +0 -25
- package/src/blocks/Story.tsx +0 -115
- package/src/blocks/Toolbar.tsx +0 -85
- package/src/blocks/Typeset.stories.tsx +0 -16
- package/src/blocks/Typeset.tsx +0 -68
- package/src/blocks/ZoomContext.tsx +0 -5
- package/src/blocks/index.ts +0 -10
- package/src/brand/StorybookIcon.stories.tsx +0 -6
- package/src/brand/StorybookIcon.tsx +0 -26
- package/src/brand/StorybookLogo.stories.tsx +0 -10
- package/src/brand/StorybookLogo.tsx +0 -33
- package/src/form/field/field.tsx +0 -42
- package/src/form/form.stories.tsx +0 -133
- package/src/form/index.tsx +0 -18
- package/src/form/input/input.tsx +0 -178
- package/src/html.tsx +0 -12
- package/src/icon/icon.stories.tsx +0 -77
- package/src/icon/icon.tsx +0 -22
- package/src/icon/icons.tsx +0 -310
- package/src/icon/svg.tsx +0 -24
- package/src/index.ts +0 -37
- package/src/placeholder/placeholder.stories.tsx +0 -24
- package/src/placeholder/placeholder.tsx +0 -25
- package/src/spaced/Spaced.stories.tsx +0 -72
- package/src/spaced/Spaced.tsx +0 -69
- package/src/syntaxhighlighter/formatter.test.js +0 -90
- package/src/syntaxhighlighter/formatter.ts +0 -26
- package/src/syntaxhighlighter/syntaxhighlighter.stories.tsx +0 -136
- package/src/syntaxhighlighter/syntaxhighlighter.tsx +0 -165
- package/src/tabs/tabs.stories.tsx +0 -207
- package/src/tabs/tabs.tsx +0 -252
- package/src/tooltip/ListItem.stories.tsx +0 -35
- package/src/tooltip/ListItem.tsx +0 -245
- package/src/tooltip/Tooltip.stories.tsx +0 -42
- package/src/tooltip/Tooltip.tsx +0 -146
- package/src/tooltip/TooltipLinkList.stories.tsx +0 -52
- package/src/tooltip/TooltipLinkList.tsx +0 -49
- package/src/tooltip/TooltipMessage.stories.tsx +0 -37
- package/src/tooltip/TooltipMessage.tsx +0 -67
- package/src/tooltip/TooltipNote.stories.tsx +0 -15
- package/src/tooltip/TooltipNote.tsx +0 -25
- package/src/tooltip/WithTooltip.stories.tsx +0 -85
- package/src/tooltip/WithTooltip.tsx +0 -159
- package/src/typings.d.ts +0 -4
- package/src/typography/DocumentFormatting.tsx +0 -355
- package/src/typography/DocumentFormattingSample.md +0 -127
- package/src/typography/DocumentWrapper.stories.tsx +0 -190
- package/src/typography/DocumentWrapper.tsx +0 -441
- package/src/typography/link/link.stories.tsx +0 -67
- package/src/typography/link/link.test.tsx +0 -108
- package/src/typography/link/link.tsx +0 -223
- package/src/typography/typography.stories.tsx +0 -111
- package/src/typography/withReset.tsx +0 -12
- package/tsconfig.json +0 -18
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import { styled } from '@storybook/theming';
|
|
3
|
-
import { ScrollArea } from './ScrollArea';
|
|
4
|
-
|
|
5
|
-
const Block = styled.span({
|
|
6
|
-
display: 'inline-block',
|
|
7
|
-
height: 40,
|
|
8
|
-
width: 40,
|
|
9
|
-
marginTop: 5,
|
|
10
|
-
marginRight: 5,
|
|
11
|
-
background: 'silver',
|
|
12
|
-
lineHeight: '40px',
|
|
13
|
-
textAlign: 'center',
|
|
14
|
-
fontSize: 9,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const Wrapper = styled.div({
|
|
18
|
-
whiteSpace: 'nowrap',
|
|
19
|
-
lineHeight: '0px',
|
|
20
|
-
width: 500,
|
|
21
|
-
height: 500,
|
|
22
|
-
overflow: 'hidden',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const list = (filler: (data: number) => JSX.Element) => {
|
|
26
|
-
const data = [];
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line no-plusplus
|
|
29
|
-
for (let i = 0; i < 20; i++) {
|
|
30
|
-
data.push(filler(i));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return data;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default {
|
|
37
|
-
component: ScrollArea,
|
|
38
|
-
title: 'Basics|ScrollArea',
|
|
39
|
-
decorators: [(storyFn: () => any) => <Wrapper>{storyFn()}</Wrapper>],
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const vertical = () => (
|
|
43
|
-
<ScrollArea vertical>
|
|
44
|
-
{list(i => (
|
|
45
|
-
<Fragment key={i}>
|
|
46
|
-
<Block>{i}</Block>
|
|
47
|
-
<br />
|
|
48
|
-
</Fragment>
|
|
49
|
-
))}
|
|
50
|
-
</ScrollArea>
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
export const horizontal = () => (
|
|
54
|
-
<ScrollArea horizontal>
|
|
55
|
-
{list(i => (
|
|
56
|
-
<Block key={i}>{i}</Block>
|
|
57
|
-
))}
|
|
58
|
-
</ScrollArea>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
export const both = () => (
|
|
62
|
-
<ScrollArea horizontal vertical>
|
|
63
|
-
{list(i => (
|
|
64
|
-
<Fragment key={i}>
|
|
65
|
-
{list(ii => (
|
|
66
|
-
<Block key={ii}>{ii * i}</Block>
|
|
67
|
-
))}
|
|
68
|
-
<br />
|
|
69
|
-
</Fragment>
|
|
70
|
-
))}
|
|
71
|
-
</ScrollArea>
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
export const withOuterBorder = () => (
|
|
75
|
-
<ScrollArea horizontal vertical>
|
|
76
|
-
<div
|
|
77
|
-
style={{
|
|
78
|
-
width: 2000,
|
|
79
|
-
height: 2000,
|
|
80
|
-
border: '10px solid orangered',
|
|
81
|
-
background: `url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAM4klEQVR4Xu2d224ktxGGayTN6LTrOO//PMmlAfvOgIEkFwEcZ71a7ep8muBjd2k4re4eVpHsaS1CeKH1is1u1s86slhcrP/261r62oGInB6LLBbNb8+PRQ75x/+3bArcPYh8vu4dZjEMyELk7Hjz0Jw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
|
|
|
1
|
-
// Storybook's implementation of SimpleBar https://github.com/Grsmto/simplebar
|
|
2
|
-
// Note: "SimpleBar can't be used on the <body>, <textarea> or <iframe> elements."
|
|
3
|
-
|
|
4
|
-
import React, { Fragment, FunctionComponent } from 'react';
|
|
5
|
-
import { styled, Global } from '@storybook/theming';
|
|
6
|
-
|
|
7
|
-
import SimpleBar from 'simplebar-react';
|
|
8
|
-
import { getScrollAreaStyles } from './ScrollAreaStyles';
|
|
9
|
-
|
|
10
|
-
export interface ScrollProps {
|
|
11
|
-
horizontal?: boolean;
|
|
12
|
-
vertical?: boolean;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Scroll = styled(({ vertical, horizontal, ...rest }: ScrollProps) => <SimpleBar {...rest} />)<
|
|
17
|
-
ScrollProps
|
|
18
|
-
>(
|
|
19
|
-
({ vertical }) =>
|
|
20
|
-
!vertical
|
|
21
|
-
? {
|
|
22
|
-
overflowY: 'hidden',
|
|
23
|
-
}
|
|
24
|
-
: {
|
|
25
|
-
overflowY: 'auto',
|
|
26
|
-
height: '100%',
|
|
27
|
-
},
|
|
28
|
-
({ horizontal }) =>
|
|
29
|
-
!horizontal
|
|
30
|
-
? {
|
|
31
|
-
overflowX: 'hidden',
|
|
32
|
-
}
|
|
33
|
-
: {
|
|
34
|
-
overflowX: 'auto',
|
|
35
|
-
width: '100%',
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export interface ScrollAreaProps {
|
|
40
|
-
horizontal?: boolean;
|
|
41
|
-
vertical?: boolean;
|
|
42
|
-
className?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const ScrollArea: FunctionComponent<ScrollAreaProps> = ({
|
|
46
|
-
children,
|
|
47
|
-
vertical,
|
|
48
|
-
horizontal,
|
|
49
|
-
...props
|
|
50
|
-
}) => (
|
|
51
|
-
<Fragment>
|
|
52
|
-
<Global styles={getScrollAreaStyles} />
|
|
53
|
-
<Scroll vertical={vertical} horizontal={horizontal} {...props}>
|
|
54
|
-
{children}
|
|
55
|
-
</Scroll>
|
|
56
|
-
</Fragment>
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
ScrollArea.defaultProps = {
|
|
60
|
-
horizontal: false,
|
|
61
|
-
vertical: false,
|
|
62
|
-
};
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { Theme, Interpolation } from '@storybook/theming';
|
|
2
|
-
|
|
3
|
-
export const getScrollAreaStyles: (theme: Theme) => Interpolation = (theme: Theme) => ({
|
|
4
|
-
'[data-simplebar]': {
|
|
5
|
-
position: 'relative',
|
|
6
|
-
flexDirection: 'column',
|
|
7
|
-
flexWrap: 'wrap',
|
|
8
|
-
justifyContent: 'flex-start',
|
|
9
|
-
alignContent: 'flex-start',
|
|
10
|
-
alignItems: 'flex-start',
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
'.simplebar-wrapper': {
|
|
14
|
-
overflow: 'hidden',
|
|
15
|
-
width: 'inherit',
|
|
16
|
-
height: 'inherit',
|
|
17
|
-
maxWidth: 'inherit',
|
|
18
|
-
maxHeight: 'inherit',
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
'.simplebar-mask': {
|
|
22
|
-
direction: 'inherit',
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
overflow: 'hidden',
|
|
25
|
-
padding: 0,
|
|
26
|
-
margin: 0,
|
|
27
|
-
left: 0,
|
|
28
|
-
top: 0,
|
|
29
|
-
bottom: 0,
|
|
30
|
-
right: 0,
|
|
31
|
-
width: 'auto !important',
|
|
32
|
-
height: 'auto !important',
|
|
33
|
-
zIndex: 0,
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
'.simplebar-offset': {
|
|
37
|
-
direction: 'inherit !important' as 'inherit',
|
|
38
|
-
resize: 'none !important' as 'none',
|
|
39
|
-
position: 'absolute',
|
|
40
|
-
top: 0,
|
|
41
|
-
left: 0,
|
|
42
|
-
bottom: 0,
|
|
43
|
-
right: 0,
|
|
44
|
-
padding: 0,
|
|
45
|
-
margin: 0,
|
|
46
|
-
WebkitOverflowScrolling: 'touch',
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
'.simplebar-content-wrapper': {
|
|
50
|
-
direction: 'inherit',
|
|
51
|
-
position: 'relative',
|
|
52
|
-
display: 'block',
|
|
53
|
-
visibility: 'visible',
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
'.simplebar-placeholder': {
|
|
57
|
-
maxHeight: '100%',
|
|
58
|
-
maxWidth: '100%',
|
|
59
|
-
width: '100%',
|
|
60
|
-
pointerEvents: 'none',
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
'.simplebar-height-auto-observer-wrapper': {
|
|
64
|
-
height: '100%',
|
|
65
|
-
width: 'inherit',
|
|
66
|
-
maxWidth: 1,
|
|
67
|
-
position: 'relative',
|
|
68
|
-
float: 'left',
|
|
69
|
-
maxHeight: 1,
|
|
70
|
-
overflow: 'hidden',
|
|
71
|
-
zIndex: -1,
|
|
72
|
-
padding: 0,
|
|
73
|
-
margin: 0,
|
|
74
|
-
pointerEvents: 'none',
|
|
75
|
-
flexGrow: 'inherit',
|
|
76
|
-
flexShrink: 0,
|
|
77
|
-
flexBasis: 0,
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
'.simplebar-height-auto-observer': {
|
|
81
|
-
display: 'block',
|
|
82
|
-
opacity: 0,
|
|
83
|
-
position: 'absolute',
|
|
84
|
-
top: 0,
|
|
85
|
-
left: 0,
|
|
86
|
-
height: '1000%',
|
|
87
|
-
width: '1000%',
|
|
88
|
-
minHeight: 1,
|
|
89
|
-
minWidth: 1,
|
|
90
|
-
overflow: 'hidden',
|
|
91
|
-
pointerEvents: 'none',
|
|
92
|
-
zIndex: -1,
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
'.simplebar-track': {
|
|
96
|
-
zIndex: 1,
|
|
97
|
-
position: 'absolute',
|
|
98
|
-
right: 0,
|
|
99
|
-
bottom: 0,
|
|
100
|
-
pointerEvents: 'none',
|
|
101
|
-
overflow: 'hidden',
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
'[data-simplebar].simplebar-dragging .simplebar-track': {
|
|
105
|
-
pointerEvents: 'all',
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
'.simplebar-scrollbar': {
|
|
109
|
-
position: 'absolute',
|
|
110
|
-
right: 2,
|
|
111
|
-
width: 7,
|
|
112
|
-
minHeight: 10,
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
'.simplebar-scrollbar:before': {
|
|
116
|
-
position: 'absolute',
|
|
117
|
-
content: '""',
|
|
118
|
-
borderRadius: 7,
|
|
119
|
-
left: 0,
|
|
120
|
-
right: 0,
|
|
121
|
-
opacity: 0,
|
|
122
|
-
transition: 'opacity 0.2s linear',
|
|
123
|
-
background: theme.base === 'light' ? theme.color.darkest : theme.color.lightest,
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
'.simplebar-track .simplebar-scrollbar.simplebar-visible:before': {
|
|
127
|
-
opacity: 0.5,
|
|
128
|
-
transition: 'opacity 0s linear',
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
'.simplebar-track.simplebar-vertical': {
|
|
132
|
-
top: 0,
|
|
133
|
-
width: 11,
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
'.simplebar-track.simplebar-vertical .simplebar-scrollbar:before': {
|
|
137
|
-
top: 2,
|
|
138
|
-
bottom: 2,
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
'.simplebar-track.simplebar-horizontal': {
|
|
142
|
-
left: 0,
|
|
143
|
-
height: 11,
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
'.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before': {
|
|
147
|
-
height: '100%',
|
|
148
|
-
left: 2,
|
|
149
|
-
right: 2,
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
'.simplebar-track.simplebar-horizontal .simplebar-scrollbar': {
|
|
153
|
-
right: 'auto',
|
|
154
|
-
left: 0,
|
|
155
|
-
top: 2,
|
|
156
|
-
height: 7,
|
|
157
|
-
minHeight: 0,
|
|
158
|
-
minWidth: 10,
|
|
159
|
-
width: 'auto',
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
'[data-simplebar-direction="rtl"] .simplebar-track.simplebar-vertical': {
|
|
163
|
-
right: 'auto',
|
|
164
|
-
left: 0,
|
|
165
|
-
},
|
|
166
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
const usePrevious = (value: any) => {
|
|
4
|
-
const ref = useRef();
|
|
5
|
-
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
// happens after return
|
|
8
|
-
ref.current = value;
|
|
9
|
-
}, [value]);
|
|
10
|
-
|
|
11
|
-
return ref.current;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const useUpdate = (update: boolean, value: any) => {
|
|
15
|
-
const previousValue = usePrevious(value);
|
|
16
|
-
|
|
17
|
-
return update ? value : previousValue;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export interface AddonPanelProps {
|
|
21
|
-
active: boolean;
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const AddonPanel = ({ active, children }: AddonPanelProps) => {
|
|
26
|
-
return (
|
|
27
|
-
// the transform is to prevent a bug where the content would be invisible
|
|
28
|
-
// the hidden attribute is an valid html element that's both accessible and works to visually hide content
|
|
29
|
-
<div hidden={!active} style={{ transform: 'translateX(0px)' }}>
|
|
30
|
-
{useUpdate(active, children)}
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
};
|
package/src/bar/bar.tsx
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { Children, FunctionComponent } from 'react';
|
|
2
|
-
import { styled } from '@storybook/theming';
|
|
3
|
-
|
|
4
|
-
import { ScrollArea } from '../ScrollArea/ScrollArea';
|
|
5
|
-
|
|
6
|
-
export interface SideProps {
|
|
7
|
-
left?: boolean;
|
|
8
|
-
right?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Side = styled.div<SideProps>(
|
|
12
|
-
{
|
|
13
|
-
display: 'flex',
|
|
14
|
-
whiteSpace: 'nowrap',
|
|
15
|
-
flexBasis: 'auto',
|
|
16
|
-
flexShrink: 0,
|
|
17
|
-
},
|
|
18
|
-
({ left }) =>
|
|
19
|
-
left
|
|
20
|
-
? {
|
|
21
|
-
'& > *': {
|
|
22
|
-
marginLeft: 15,
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
: {},
|
|
26
|
-
({ right }) =>
|
|
27
|
-
right
|
|
28
|
-
? {
|
|
29
|
-
marginLeft: 30,
|
|
30
|
-
'& > *': {
|
|
31
|
-
marginRight: 15,
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
: {}
|
|
35
|
-
);
|
|
36
|
-
Side.displayName = 'Side';
|
|
37
|
-
|
|
38
|
-
export const Bar = styled(({ children, className }) => (
|
|
39
|
-
<ScrollArea horizontal className={className}>
|
|
40
|
-
{children}
|
|
41
|
-
</ScrollArea>
|
|
42
|
-
))(
|
|
43
|
-
({ theme }) => ({
|
|
44
|
-
color: theme.barTextColor,
|
|
45
|
-
width: '100%',
|
|
46
|
-
height: 40,
|
|
47
|
-
flexShrink: 0,
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
({ theme, border }) =>
|
|
51
|
-
border
|
|
52
|
-
? {
|
|
53
|
-
boxShadow: `${theme.appBorderColor} 0 -1px 0 0 inset`,
|
|
54
|
-
background: theme.barBg,
|
|
55
|
-
}
|
|
56
|
-
: {}
|
|
57
|
-
);
|
|
58
|
-
Bar.displayName = 'Bar';
|
|
59
|
-
|
|
60
|
-
const BarInner = styled.div<{ bgColor: string }>(({ bgColor }) => ({
|
|
61
|
-
display: 'flex',
|
|
62
|
-
justifyContent: 'space-between',
|
|
63
|
-
position: 'relative',
|
|
64
|
-
flexWrap: 'nowrap',
|
|
65
|
-
flexShrink: 0,
|
|
66
|
-
height: 40,
|
|
67
|
-
backgroundColor: bgColor || '',
|
|
68
|
-
}));
|
|
69
|
-
|
|
70
|
-
export interface FlexBarProps {
|
|
71
|
-
border?: boolean;
|
|
72
|
-
children?: any;
|
|
73
|
-
backgroundColor?: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const FlexBar: FunctionComponent<FlexBarProps> = ({
|
|
77
|
-
children,
|
|
78
|
-
backgroundColor,
|
|
79
|
-
...rest
|
|
80
|
-
}) => {
|
|
81
|
-
const [left, right] = Children.toArray(children);
|
|
82
|
-
return (
|
|
83
|
-
<div>
|
|
84
|
-
<Bar {...rest}>
|
|
85
|
-
<BarInner bgColor={backgroundColor}>
|
|
86
|
-
<Side left>{left}</Side>
|
|
87
|
-
{right ? <Side right>{right}</Side> : null}
|
|
88
|
-
</BarInner>
|
|
89
|
-
</Bar>
|
|
90
|
-
</div>
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
FlexBar.displayName = 'FlexBar';
|
package/src/bar/button.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { styled } from '@storybook/theming';
|
|
2
|
-
|
|
3
|
-
export interface TabButtonProps {
|
|
4
|
-
active?: boolean;
|
|
5
|
-
textColor?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const TabButton = styled.button<TabButtonProps>(
|
|
9
|
-
{
|
|
10
|
-
whiteSpace: 'normal',
|
|
11
|
-
display: 'inline-flex',
|
|
12
|
-
overflow: 'hidden',
|
|
13
|
-
verticalAlign: 'top',
|
|
14
|
-
justifyContent: 'center',
|
|
15
|
-
alignItems: 'center',
|
|
16
|
-
textAlign: 'center',
|
|
17
|
-
textDecoration: 'none',
|
|
18
|
-
|
|
19
|
-
'&:empty': {
|
|
20
|
-
display: 'none',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
({ theme }) => ({
|
|
24
|
-
padding: '0 15px',
|
|
25
|
-
textTransform: 'capitalize',
|
|
26
|
-
transition: 'color 0.2s linear, border-bottom-color 0.2s linear',
|
|
27
|
-
height: 40,
|
|
28
|
-
lineHeight: '12px',
|
|
29
|
-
cursor: 'pointer',
|
|
30
|
-
background: 'transparent',
|
|
31
|
-
border: '0 solid transparent',
|
|
32
|
-
borderTop: '3px solid transparent',
|
|
33
|
-
borderBottom: '3px solid transparent',
|
|
34
|
-
fontWeight: 'bold',
|
|
35
|
-
fontSize: 13,
|
|
36
|
-
|
|
37
|
-
'&:focus': {
|
|
38
|
-
outline: '0 none',
|
|
39
|
-
borderBottomColor: theme.color.secondary,
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
({ active, textColor, theme }) =>
|
|
43
|
-
active
|
|
44
|
-
? {
|
|
45
|
-
color: textColor || theme.barSelectedColor,
|
|
46
|
-
borderBottomColor: theme.barSelectedColor,
|
|
47
|
-
}
|
|
48
|
-
: {
|
|
49
|
-
color: textColor || 'inherit',
|
|
50
|
-
borderBottomColor: 'transparent',
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
TabButton.displayName = 'TabButton';
|
|
54
|
-
|
|
55
|
-
export interface IconButtonProps {
|
|
56
|
-
active?: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const IconButton = styled.button<IconButtonProps>(
|
|
60
|
-
({ theme }) => ({
|
|
61
|
-
height: 40,
|
|
62
|
-
background: 'none',
|
|
63
|
-
color: 'inherit',
|
|
64
|
-
padding: 0,
|
|
65
|
-
cursor: 'pointer',
|
|
66
|
-
|
|
67
|
-
border: '0 solid transparent',
|
|
68
|
-
borderTop: '3px solid transparent',
|
|
69
|
-
borderBottom: '3px solid transparent',
|
|
70
|
-
|
|
71
|
-
transition: 'color 0.2s linear, border-bottom-color 0.2s linear',
|
|
72
|
-
|
|
73
|
-
'&:hover, &:focus': {
|
|
74
|
-
outline: '0 none',
|
|
75
|
-
color: theme.color.secondary,
|
|
76
|
-
},
|
|
77
|
-
'& > svg': {
|
|
78
|
-
width: 15,
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
({ active, theme }) =>
|
|
82
|
-
active
|
|
83
|
-
? {
|
|
84
|
-
outline: '0 none',
|
|
85
|
-
borderBottomColor: theme.color.secondary,
|
|
86
|
-
}
|
|
87
|
-
: {}
|
|
88
|
-
);
|
|
89
|
-
IconButton.displayName = 'IconButton';
|
package/src/bar/separator.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import { styled } from '@storybook/theming';
|
|
3
|
-
|
|
4
|
-
export const Separator = styled.span<SeparatorProps>(
|
|
5
|
-
({ theme }) => ({
|
|
6
|
-
width: 1,
|
|
7
|
-
height: 24,
|
|
8
|
-
background: theme.appBorderColor,
|
|
9
|
-
marginTop: 8,
|
|
10
|
-
}),
|
|
11
|
-
({ force }) =>
|
|
12
|
-
force
|
|
13
|
-
? {}
|
|
14
|
-
: {
|
|
15
|
-
'& + &': {
|
|
16
|
-
display: 'none',
|
|
17
|
-
},
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
Separator.displayName = 'Separator';
|
|
21
|
-
|
|
22
|
-
export const interleaveSeparators = (list: any[]) =>
|
|
23
|
-
list.reduce(
|
|
24
|
-
(acc, item, index) =>
|
|
25
|
-
item ? (
|
|
26
|
-
<Fragment key={item.id || item.key || `f-${index}`}>
|
|
27
|
-
{acc}
|
|
28
|
-
{/* eslint-disable-next-line react/no-array-index-key */}
|
|
29
|
-
{index > 0 ? <Separator key={`s-${index}`} /> : null}
|
|
30
|
-
{item.render() || item}
|
|
31
|
-
</Fragment>
|
|
32
|
-
) : (
|
|
33
|
-
acc
|
|
34
|
-
),
|
|
35
|
-
null
|
|
36
|
-
);
|
|
37
|
-
export interface SeparatorProps {
|
|
38
|
-
force?: boolean;
|
|
39
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Theme } from '@storybook/theming';
|
|
2
|
-
|
|
3
|
-
export const getBlockBackgroundStyle: (theme: Theme) => object = (theme: Theme) => ({
|
|
4
|
-
borderRadius: theme.appBorderRadius,
|
|
5
|
-
background: theme.background.content,
|
|
6
|
-
boxShadow:
|
|
7
|
-
theme.base === 'light' ? 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' : 'rgba(0, 0, 0, 0.20) 0 2px 5px 0',
|
|
8
|
-
border: `1px solid ${theme.appBorderColor}`,
|
|
9
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ColorItem, ColorPalette } from './ColorPalette';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Docs|ColorPalette',
|
|
6
|
-
component: ColorPalette,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const defaultStyle = () => (
|
|
10
|
-
<ColorPalette>
|
|
11
|
-
<ColorItem
|
|
12
|
-
title="theme.color.greyscale"
|
|
13
|
-
subtitle="Some of the greys"
|
|
14
|
-
colors={['#FFFFFF', '#F8F8F8', '#F3F3F3']}
|
|
15
|
-
/>
|
|
16
|
-
<ColorItem title="theme.color.primary" subtitle="Coral" colors={['#FF4785']} />
|
|
17
|
-
<ColorItem title="theme.color.secondary" subtitle="Ocean" colors={['#1EA7FD']} />
|
|
18
|
-
<ColorItem
|
|
19
|
-
title="theme.color.positive"
|
|
20
|
-
subtitle="Green"
|
|
21
|
-
colors={[
|
|
22
|
-
'rgba(102,191,60,1)',
|
|
23
|
-
'rgba(102,191,60,.8)',
|
|
24
|
-
'rgba(102,191,60,.6)',
|
|
25
|
-
'rgba(102,191,60,.3)',
|
|
26
|
-
]}
|
|
27
|
-
/>
|
|
28
|
-
</ColorPalette>
|
|
29
|
-
);
|