Skip to content

Commit

Permalink
chore: import styled-components instead styled-components/macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ickas committed Apr 4, 2024
1 parent 24af521 commit df3060a
Show file tree
Hide file tree
Showing 24 changed files with 58 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/atoms/avatar-image/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors } from '../../ions/variables';

Expand Down
6 changes: 3 additions & 3 deletions src/atoms/button-dropdown/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { field, misc } from '../../ions/variables';

Expand Down Expand Up @@ -39,8 +39,8 @@ export const ActionsMenuStyle = styled.div<ActionsMenuInterface>`
opacity: 1;
// prettier-ignore
height: calc(${rem('45px')} * ${props => props.visibleActions} + ${rem(
'2px'
)});
'2px'
)});
max-height: ${rem('1280px')};
}
Expand Down
10 changes: 5 additions & 5 deletions src/atoms/button-link/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { ButtonColor, ButtonVariant } from '../button/types';
import { colors, typography, button, misc } from '../../ions/variables';
Expand All @@ -23,8 +23,8 @@ export const ButtonLinkStyle = styled.a<ButtonStyleProps>`
props.color === 'white'
? colors.grey100
: props.color === 'black'
? colors.grey900
: useColor(props.color ?? 'black').hover};
? colors.grey900
: useColor(props.color ?? 'black').hover};
border-width: ${props =>
props.variant === 'outline' ? button.borderWidth : 0};
Expand All @@ -34,8 +34,8 @@ export const ButtonLinkStyle = styled.a<ButtonStyleProps>`
props.variant === 'text'
? 0
: props.rounded
? '999px'
: button.borderRadius};
? '999px'
: button.borderRadius};
background-color: ${props =>
props.variant === 'solid' ? 'var(--bg)' : 'transparent'};
width: min-content;
Expand Down
10 changes: 5 additions & 5 deletions src/atoms/button/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { ButtonColor, ButtonVariant } from './types';
import { colors, typography, button, misc } from '../../ions/variables';
Expand All @@ -23,8 +23,8 @@ export const ButtonWrapper = styled.button<ButtonProps>`
props.color === 'white'
? colors.grey100
: props.color === 'black'
? colors.grey900
: useColor(props.color ?? 'black').hover};
? colors.grey900
: useColor(props.color ?? 'black').hover};
margin: 0;
border-width: ${props =>
Expand All @@ -35,8 +35,8 @@ export const ButtonWrapper = styled.button<ButtonProps>`
props.variant === 'text'
? 0
: props.rounded
? '999px'
: button.borderRadius};
? '999px'
: button.borderRadius};
background-color: ${props =>
props.variant === 'solid' ? 'var(--bg)' : 'transparent'};
width: min-content;
Expand Down
18 changes: 9 additions & 9 deletions src/atoms/checkbox-button/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, field, misc } from '../../ions/variables';

Expand All @@ -13,15 +13,15 @@ export const CheckboxWrapper = styled.label<CheckboxWrapperProps>`
props.disabled
? field.borderColor
: props.checked
? field.successBorderColor
: field.borderColor};
? field.successBorderColor
: field.borderColor};
border-radius: ${field.borderRadius};
background-color: ${props =>
props.disabled
? field.disabledBackgroundColor
: props.checked
? field.successBackgroundColor
: field.backgroundColor};
? field.successBackgroundColor
: field.backgroundColor};
height: ${field.height};
display: flex;
align-items: center;
Expand All @@ -42,17 +42,17 @@ export const CheckboxWrapper = styled.label<CheckboxWrapperProps>`
props.disabled
? field.disabledBackgroundColor
: props.checked
? field.successBackgroundColor
: field.borderColor};
? field.successBackgroundColor
: field.borderColor};
}
span {
color: ${props =>
props.disabled
? field.disabledColor
: props.checked
? colors.white
: null};
? colors.white
: null};
transition-duration: ${misc.transitionDuration};
}
`;
Expand Down
6 changes: 3 additions & 3 deletions src/atoms/checkbox/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, field, misc } from '../../ions/variables';

Expand Down Expand Up @@ -29,8 +29,8 @@ export const CheckboxWrapper = styled.label<CheckboxWrapperProps>`
props.disabled
? field.disabledColor
: props.error
? field.errorBorderColor
: null};
? field.errorBorderColor
: null};
border-color: ${props => (props.error ? field.errorBorderColor : null)};
}
`;
Expand Down
2 changes: 1 addition & 1 deletion src/atoms/error-field/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ErrorFieldColor } from './types';
import { field } from '../../ions/variables';
import { rem } from 'polished';
Expand Down
2 changes: 1 addition & 1 deletion src/atoms/icon/stories/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors } from '../../../ions/variables';

Expand Down
2 changes: 1 addition & 1 deletion src/atoms/label/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, typography } from '../../ions/variables';

Expand Down
2 changes: 1 addition & 1 deletion src/atoms/tag-number/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { TagColor } from '../tag/types';
import { useColor } from '../../utils/hooks/use-color';
Expand Down
2 changes: 1 addition & 1 deletion src/atoms/tag/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { TagVariant, TagColor } from './types';
import { typography } from '../../ions/variables';
Expand Down
6 changes: 3 additions & 3 deletions src/atoms/text-field/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from 'styled-components/macro';
import styled, { css } from 'styled-components';
import { rem } from 'polished';
import { field, misc, typography } from '../../ions/variables';
import icons from '../../ions/icons';
Expand Down Expand Up @@ -66,8 +66,8 @@ export const TextFieldInputStyle = styled.input<InputStyleProps>`
props.error
? 'rgb(235,87,87)'
: 'rgb(217,212,237)'}" d=${JSON.stringify(
icons[props.icon]
)} /></svg>');
icons[props.icon]
)} /></svg>');
padding-left: ${rem('40px')};
&:focus {
Expand Down
2 changes: 1 addition & 1 deletion src/atoms/truncate-line/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';

export const TruncateWrapper = styled.div`
display: table;
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/actions-menu/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from 'styled-components/macro';
import styled, { css } from 'styled-components';
import { rem } from 'polished';
import { field } from '../../ions/variables';

Expand Down
2 changes: 1 addition & 1 deletion src/molecules/card-value/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, field, typography } from '../../ions/variables';

Expand Down
2 changes: 1 addition & 1 deletion src/molecules/empty-table/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem, rgba } from 'polished';
import { colors, field, typography } from '../../ions/variables';
import { device } from '../../ions/breakpoints';
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/form-group/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, field } from '../../ions/variables';
interface WrapperProps {
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/modal-footer/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { device } from '../../ions/breakpoints';

Expand Down
2 changes: 1 addition & 1 deletion src/molecules/note-card/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from 'styled-components/macro';
import styled, { css } from 'styled-components';
import { NoteColor } from './types';
import { rem } from 'polished';
import { device } from '../../ions/breakpoints';
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/number-input-spinner/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, field, misc, typography } from '../../ions/variables';

Expand Down
2 changes: 1 addition & 1 deletion src/molecules/table-dnd/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { colors, field, misc, typography } from '../../ions/variables';
import { device } from '../../ions/breakpoints';
Expand Down
22 changes: 13 additions & 9 deletions src/molecules/table/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from 'styled-components/macro';
import styled, { css } from 'styled-components';
import { rem } from 'polished';
import { colors, field, misc, typography } from '../../ions/variables';
import { device } from '../../ions/breakpoints';
Expand All @@ -16,11 +16,8 @@ export const OverflowWrapper = styled.div`
@media ${device.s} {
display: block;
border-radius: ${field.borderRadius};
background: linear-gradient(
to right,
${colors.white} 30%,
rgba(255, 255, 255, 0)
),
background:
linear-gradient(to right, ${colors.white} 30%, rgba(255, 255, 255, 0)),
linear-gradient(to right, rgba(255, 255, 255, 0), ${colors.white} 70%) 0
100%,
radial-gradient(
Expand All @@ -36,9 +33,16 @@ export const OverflowWrapper = styled.div`
0 100%;
background-repeat: no-repeat;
background-color: ${colors.white};
background-size: ${rem('40px')} 100%, ${rem('40px')} 100%,
${rem('14px')} 100%, ${rem('14px')} 100%;
background-position: 0 0, 100%, 0 0, 100%;
background-size:
${rem('40px')} 100%,
${rem('40px')} 100%,
${rem('14px')} 100%,
${rem('14px')} 100%;
background-position:
0 0,
100%,
0 0,
100%;
background-attachment: local, local, scroll, scroll;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/wizard-steps/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem } from 'polished';
import { device } from '../../ions/breakpoints';
import { colors, field, typography } from '../../ions/variables';
Expand Down
2 changes: 1 addition & 1 deletion src/organisms/modal/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { rem, rgba } from 'polished';
import { colors, field, misc, typography } from '../../ions/variables';
import { device } from '../../ions/breakpoints';
Expand Down

0 comments on commit df3060a

Please sign in to comment.