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

update framer-motion

downgrade framer-motion

modify toast styles

modify export
  • Loading branch information
hervedombya committed Sep 18, 2023
1 parent ac443f3 commit 69bfe30
Show file tree
Hide file tree
Showing 11 changed files with 733 additions and 13 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;
},
};
115 changes: 106 additions & 9 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,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 Expand Up @@ -137,6 +137,7 @@
}
},
"dependencies": {
"@floating-ui/dom": "^0.1.10"
"@floating-ui/dom": "^0.1.10",
"framer-motion": "^4.1.17"
}
}
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 69bfe30

Please sign in to comment.