Skip to content

Commit 98f53a5

Browse files
committed
update storybook styles; rebuild storybook files
1 parent 83fb50f commit 98f53a5

File tree

12 files changed

+45
-43
lines changed

12 files changed

+45
-43
lines changed

.storybook/global-style/global-style.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createGlobalStyle } from 'styled-components';
22
import ReactToastifyCss from './react-toastify-css';
33

4-
export const GlobalStyle = createGlobalStyle`
4+
const GlobalStyle = createGlobalStyle`
55
*,
66
*::before,
77
*::after {
@@ -59,4 +59,6 @@ export const GlobalStyle = createGlobalStyle`
5959
}
6060
6161
${ReactToastifyCss}
62-
`;
62+
`;
63+
64+
export default GlobalStyle;

.storybook/global-style/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { GlobalStyle } from './global-style';
1+
export { default as GlobalStyle } from './global-style';

.storybook/global-style/react-toastify-css.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { css, keyframes } from 'styled-components';
22

3-
const _toastify_trackProgress = keyframes`
3+
const TOASTIFY_TRACK_PROGRESS = keyframes`
44
0% {
55
transform: scaleX(1);
66
} 100% {
77
transform: scaleX(0);
88
}
99
`;
1010

11-
const _toastify_bounceOut = keyframes`
11+
const TOASTIFY_BOUNCE_OUT = keyframes`
1212
20% {
1313
transform: scale3d(0.9, 0.9, 0.9);
1414
} 50%,
@@ -21,7 +21,7 @@ const _toastify_bounceOut = keyframes`
2121
}
2222
`;
2323

24-
const _toastify_bounceIn = keyframes`
24+
const TOASTIFY_BOUNCE_IN = keyframes`
2525
from,
2626
20%,
2727
40%,
@@ -51,11 +51,11 @@ const _toastify_bounceIn = keyframes`
5151

5252
const ReactToastifyCss = css`
5353
.Toastify__animate__bounceIn {
54-
animation: ${_toastify_bounceIn} 1s both;
54+
animation: ${TOASTIFY_BOUNCE_IN} 1s both;
5555
}
5656
5757
.Toastify__animate__bounceOut {
58-
animation: ${_toastify_bounceOut} 0.85s both;
58+
animation: ${TOASTIFY_BOUNCE_OUT} 0.85s both;
5959
}
6060
6161
.Toastify__toast-container {
@@ -163,7 +163,7 @@ const ReactToastifyCss = css`
163163
transform-origin: left;
164164
165165
&--animated {
166-
animation: ${_toastify_trackProgress} linear 1 forwards;
166+
animation: ${TOASTIFY_TRACK_PROGRESS} linear 1 forwards;
167167
}
168168
169169
&--controlled {

.storybook/preview.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import ReactDOM from 'react-dom';
22
import { GlobalStyle } from './global-style';
33

44
// Configure createGlobalStyle for styled-components
5-
const _gsNodeId = 'temp2-global-style';
5+
const GS_NODE_ID = 'temp2-global-style';
66

7-
const _gsNode =
8-
document.getElementById(_gsNodeId) ||
7+
const GS_NODE =
8+
document.getElementById(GS_NODE_ID) ||
99
(() => {
1010
const el = document.createElement('div');
11-
el.id = _gsNodeId;
11+
el.id = GS_NODE_ID;
1212
document.head.appendChild(el);
1313
return el;
1414
})();
1515

1616
// Callback to remove node used to mount GlobalStyle to
1717
const rendererCallbackFn = () => {
18-
_gsNode && document.head.removeChild(_gsNode);
18+
GS_NODE && document.head.removeChild(GS_NODE);
1919
};
2020

2121
// Mount GlobalStyle to gsNode and then execute callback rendererCallbackFn()
22-
ReactDOM.render(<GlobalStyle />, _gsNode, rendererCallbackFn);
22+
ReactDOM.render(<GlobalStyle />, GS_NODE, rendererCallbackFn);

__stories__/helpers/components/Checkbox.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ type CheckboxProps = Readonly<{
99
onCheck: (checked: boolean) => void;
1010
}>;
1111

12-
const _colorCheckMark = '#149DF3';
13-
const _colorBorderChecked = hexToRgba(_colorCheckMark, 0.78);
12+
const CHECK_COLOR = '#149DF3';
13+
const CHECK_BORDER_COLOR = hexToRgba(CHECK_COLOR, 0.78);
1414

1515
const Label = styled.span`
1616
user-select: none;
@@ -26,7 +26,7 @@ const Input = styled.input`
2626
position: absolute;
2727
2828
:checked ~ i {
29-
border-color: ${_colorBorderChecked};
29+
border-color: ${CHECK_BORDER_COLOR};
3030
3131
:after,
3232
:before {
@@ -87,7 +87,7 @@ const CheckIcon = styled.i`
8787
position: absolute;
8888
border-radius: 3px;
8989
transform-origin: left top;
90-
background-color: ${_colorCheckMark};
90+
background-color: ${CHECK_COLOR};
9191
transition: opacity 0.365s ease, height 0s linear 0.365s;
9292
}
9393

__stories__/helpers/constants/theme.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ import { mergeThemes } from '../../../src/utils';
44
import type { Theme } from '../../../src';
55

66
// Normalize animation props as be default they are type of styled-component's "FlattenSimpleInterpolation"
7-
const _bounceKeyframes = 'BOUNCE_KEYFRAMES 1.19s ease-in-out infinite';
8-
const _fadeInKeyframes = 'FADE_IN_KEYFRAMES 0.225s ease-in-out forwards';
7+
const FADE_IN_KEYFRAMES = 'FADE_IN_KEYFRAMES 0.25s ease-in-out';
8+
const BOUNCE_KEYFRAMES = 'BOUNCE_KEYFRAMES 1.19s ease-in-out infinite';
99

10-
const _themeAnimations: Theme = {
10+
const THEME_ANIMATIONS: Theme = {
1111
loader: {
12-
animation: _bounceKeyframes
12+
animation: BOUNCE_KEYFRAMES
1313
},
1414
menu: {
15-
animation: _fadeInKeyframes
15+
animation: FADE_IN_KEYFRAMES
1616
},
1717
multiValue: {
18-
animation: _fadeInKeyframes
18+
animation: FADE_IN_KEYFRAMES
1919
},
2020
icon: {
2121
clear: {
22-
animation: _fadeInKeyframes
22+
animation: FADE_IN_KEYFRAMES
2323
}
2424
}
2525
};
@@ -72,7 +72,7 @@ export const ThemeConfigMap: Theme = {
7272
};
7373

7474
export const THEME_OPTIONS = createThemeOptions(ThemeEnum);
75-
export const THEME_DEFAULTS = mergeThemes(_themeAnimations);
75+
export const THEME_DEFAULTS = mergeThemes(THEME_ANIMATIONS);
7676

7777
export const THEME_CONFIG: Theme = {
7878
menu: {

__stories__/helpers/styled/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const MEDIA_QUERY_IS_TABLET = '@media only screen and (max-width: 991px)
77

88
// Need to implement a div version of Paragraph since PrettyPrintJson contains an <pre> element
99
// ...which cannot be a child of a <p> element
10-
const _paragraphCSS = css`
10+
const PARAGRAPH_BASE_STYLE = css`
1111
margin-top: 0;
1212
display: block;
1313
margin-bottom: 1rem;
@@ -18,11 +18,11 @@ const _paragraphCSS = css`
1818
`;
1919

2020
export const Content = styled.p`
21-
${_paragraphCSS}
21+
${PARAGRAPH_BASE_STYLE}
2222
`;
2323

2424
export const Paragraph = styled.p`
25-
${_paragraphCSS}
25+
${PARAGRAPH_BASE_STYLE}
2626
2727
${MEDIA_QUERY_IS_TABLET_OR_DESKTOP} {
2828
max-width: 85%;
@@ -92,7 +92,7 @@ export const Column = styled.div<{ widthPercent?: number }>`
9292
`;
9393

9494
export const ListWrapper = styled.div`
95-
${_paragraphCSS}
95+
${PARAGRAPH_BASE_STYLE}
9696
9797
${MEDIA_QUERY_IS_TABLET_OR_DESKTOP} {
9898
max-width: 85%;
@@ -138,16 +138,16 @@ export const TextHeader = styled.span`
138138
line-height: 1.65;
139139
font-size: 1.025em;
140140
border-radius: 3px;
141+
padding: .15em .3em;
141142
word-break: break-word;
142143
background-color: #eef0f3;
143-
padding: .15em .45em .15em;
144144
-webkit-font-smoothing: auto;
145145
-moz-osx-font-smoothing: auto;
146146
font-family: SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;
147147
148148
${MEDIA_QUERY_IS_MOBILE_XS} {
149149
line-height: 1.6;
150-
padding: .1em .4em .1em;
150+
padding: .1em .25em;
151151
}
152152
`;
153153

@@ -350,23 +350,23 @@ export const MenuPortalElement = styled.div<{ menuOpen: boolean; }>`
350350
// Advanced story specific
351351
// =======================================
352352

353-
const _spinKeyframes = keyframes`
353+
const SPIN_KEYFRAMES = keyframes`
354354
from {
355355
transform: rotate(0deg);
356356
} to {
357357
transform: rotate(360deg);
358358
}
359359
`;
360360

361-
const _spinAnimationCss = css`animation: ${_spinKeyframes} infinite 8s linear;`;
361+
const SPIN_ANIMATION_CSS = css`animation: ${SPIN_KEYFRAMES} infinite 8s linear;`;
362362

363363
export const ReactSvg = styled.svg<{ isDisabled?: boolean }>`
364364
width: 34px;
365365
height: 34px;
366366
color: #1ea7fd;
367367
fill: currentColor;
368368
display: inline-block;
369-
${({ isDisabled }) => !isDisabled && _spinAnimationCss}
369+
${({ isDisabled }) => !isDisabled && SPIN_ANIMATION_CSS}
370370
`;
371371

372372
export const ChevronDownSvg = styled.svg<{ menuOpen: boolean }>`

docs/asset-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"files": {
3-
"main.js": "./main.ad5f44b6.iframe.bundle.js",
3+
"main.js": "./main.eeb30b91.iframe.bundle.js",
44
"runtime~main.js": "./runtime~main.f398e60b.iframe.bundle.js",
55
"vendors~main.js": "./vendors~main.31a06b8d.iframe.bundle.js",
66
"vendors~main.js.map": "./vendors~main.31a06b8d.iframe.bundle.js.map",
@@ -10,6 +10,6 @@
1010
"entrypoints": [
1111
"runtime~main.f398e60b.iframe.bundle.js",
1212
"vendors~main.31a06b8d.iframe.bundle.js",
13-
"main.ad5f44b6.iframe.bundle.js"
13+
"main.eeb30b91.iframe.bundle.js"
1414
]
1515
}

docs/iframe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@
130130

131131

132132

133-
window['FRAMEWORK_OPTIONS'] = {"fastRefresh":true};</script><script src="runtime~main.f398e60b.iframe.bundle.js"></script><script src="vendors~main.31a06b8d.iframe.bundle.js"></script><script src="main.ad5f44b6.iframe.bundle.js"></script></body></html>
133+
window['FRAMEWORK_OPTIONS'] = {"fastRefresh":true};</script><script src="runtime~main.f398e60b.iframe.bundle.js"></script><script src="vendors~main.31a06b8d.iframe.bundle.js"></script><script src="main.eeb30b91.iframe.bundle.js"></script></body></html>

docs/main.ad5f44b6.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)