Skip to content

Commit

Permalink
feature: Toast component
Browse files Browse the repository at this point in the history
fix dependencies

fix framer-motion

fix storybook webpack
  • Loading branch information
hervedombya committed Sep 13, 2023
1 parent ac443f3 commit 575d5d6
Show file tree
Hide file tree
Showing 11 changed files with 795 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@ module.exports = {
'@storybook/addon-storysource',
'@storybook/addon-knobs',
],
webpackFinal: async (config, { configType }) => {
// Resolve error when webpack-ing storybook:
// Can't import the named export 'Children' from non EcmaScript module (only
// default export is available)
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});

return config;
},
};
173 changes: 173 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"downshift": "^7.0.5",
"eslint": "^8.15.0",
"eslint-config-react-app": "^7.0.1",
"framer-motion": "^5.6.0",
"husky": "^3.0.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
Expand Down Expand Up @@ -95,12 +96,12 @@
"vega-tooltip": "^0.27.0"
},
"peerDependencies": {
"@js-temporal/polyfill": "^0.4.3",
"@fortawesome/fontawesome-free": "^5.10.2",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-regular-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@js-temporal/polyfill": "^0.4.3",
"polished": "3.4.1",
"pretty-bytes": "^5.6.0",
"react": "^17.0.2",
Expand Down
13 changes: 11 additions & 2 deletions src/lib/components/progressbar/ProgressBar.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as defaultTheme from '../../style/theme';
import { Size } from '../constants';
export type ProgressBarProps = {
percentage: number;
size?: Size;
size?: Size | 'custom';
color?: string;
// The color of unfill bar
backgroundColor?: string;
Expand All @@ -15,12 +15,14 @@ export type ProgressBarProps = {
buildinLabel?: string;
// The animation to full the progress bar
isAnimation?: boolean;
height?: React.CSSProperties['height'];
};
const Container = styled.div``;
const ProgressBarContainer = styled.div<{
backgroundColor: string;
size: keyof typeof defaultTheme.fontSize;
size: keyof typeof defaultTheme.fontSize | 'custom';
buildinLabel?: string;
height?: React.CSSProperties['height'];
}>`
display: flex;
border-radius: 4px;
Expand Down Expand Up @@ -52,6 +54,11 @@ const ProgressBarContainer = styled.div<{
height: 20px;
`;
case 'custom':
return css`
height: ${props.height};
font-size: ${props.height};
`;
default:
return css`
height: ${defaultTheme.fontSize.base};
Expand Down Expand Up @@ -148,6 +155,7 @@ function ProgressBar({
bottomRightLabel,
buildinLabel,
isAnimation = false,
height,
...rest
}: ProgressBarProps) {
return (
Expand All @@ -171,6 +179,7 @@ function ProgressBar({
size={size}
buildinLabel={buildinLabel}
backgroundColor={backgroundColor}
height={height}
>
<FilledAreaContainer
color={color}
Expand Down
Loading

0 comments on commit 575d5d6

Please sign in to comment.