Skip to content

Commit

Permalink
fix: fix hardcoded width
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-kleszcz committed Jul 31, 2023
1 parent 31494e1 commit 835c52d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { stylesBuilder } from './stylesBuilder/stylesBuilder';
import { ButtonAppearance } from './types/ButtonAppearance.type';
import { ButtonVariant } from './types/ButtonType.type';
import { tet } from '../../tetrisly';
import { ProgressCircle } from '../Loader';
import { Loader } from '../Loader';

import { MarginProps } from '@/types/MarginProps';

Expand Down Expand Up @@ -37,7 +37,7 @@ export const Button = <
style={{ textUnderlineOffset: '3px', textDecorationThickness: '1px' }}
{...rest}
>
{state === 'loading' && <ProgressCircle />}
{state === 'loading' && <Loader size="small" shape="circle" />}
{beforeIcon && state !== 'loading' && <Icon name={beforeIcon} />}
{label}
{dropdown && <Icon name="20-chevron-down" />}
Expand Down
8 changes: 5 additions & 3 deletions src/components/Loader/AnimatedPath.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ const animationCircle = keyframes`

const animationBar = keyframes`
0% {
transform: translate(-64px, 0px);
transform: translate(-50%, 0px);
}
100% {
transform: translate(192px, 0px);
transform: translate(150%, 0px);
}
`;

export const AnimatedPath = styled(tet.path)<{ shape: string }>`
export const AnimatedPath = styled(tet.path)<{
shape: string;
}>`
aspect-ratio: 1;
transform-origin: center center;
animation: ${({ shape }) =>
Expand Down
3 changes: 0 additions & 3 deletions src/components/Loader/Loader.props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ export type LoaderProps = {
shape: LoaderShape;
custom?: DeepPartial<SystemProps<Theme> & typeof config>;
};

export type ProgressCircleProps = Omit<LoaderProps, 'shape'>;
export type ProgressBarProps = Omit<LoaderProps, 'shape'>;
File renamed without changes.
7 changes: 0 additions & 7 deletions src/components/Loader/Progress.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/Loader/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { ProgressBar, ProgressCircle } from './Progress';
export type { ProgressProps } from './Progress';
export { Loader } from './Loader';
export type { LoaderProps } from './Loader.props';
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Button } from './components/Button';
export { ProgressBar, ProgressCircle } from './components/Loader';
export { Loader } from './components/Loader';
export { StatusDot } from './components/StatusDot';
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"moduleResolution": "node",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down

0 comments on commit 835c52d

Please sign in to comment.