Skip to content

Commit

Permalink
feat(pill): update types
Browse files Browse the repository at this point in the history
  • Loading branch information
acpcor committed Jun 26, 2024
1 parent 3af9aa5 commit 53214e1
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions malty/atoms/Pill/Pill.helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const usePillStyles = ({ size }: UsePillStylesProps) => {
const theme = useContext(ThemeContext) || defaultTheme;

const pillStyles = {
[PillSize.XSmall]: {
[PillSize.XS]: {
numSize: theme.sizesV2.s,
fontWeight: theme.typographyV2.montserrat.body[10].semibold.fontWeight,
lineHeight: theme.typographyV2.montserrat.body[10].semibold.lineHeight,
Expand All @@ -17,7 +17,7 @@ export const usePillStyles = ({ size }: UsePillStylesProps) => {
padding: `${theme.sizesV2['4xs']} ${theme.sizesV2['3xs']}`,
gap: theme.sizesV2['5xs']
},
[PillSize.Small]: {
[PillSize.S]: {
numSize: theme.sizesV2.m,
fontWeight: theme.typographyV2.montserrat.body[10].semibold.fontWeight,
lineHeight: theme.typographyV2.montserrat.body[10].semibold.lineHeight,
Expand All @@ -26,7 +26,7 @@ export const usePillStyles = ({ size }: UsePillStylesProps) => {
padding: `${theme.sizesV2['4xs']} ${theme.sizesV2['3xs']}`,
gap: theme.sizesV2['4xs']
},
[PillSize.Medium]: {
[PillSize.M]: {
numSize: theme.sizesV2.xl,
fontWeight: theme.typographyV2.montserrat.body[14].semibold.fontWeight,
lineHeight: theme.typographyV2.montserrat.body[14].semibold.lineHeight,
Expand Down
2 changes: 1 addition & 1 deletion malty/atoms/Pill/Pill.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const Base: Story = {
args: {
text: 'Text',
type: PillType.Primary,
size: PillSize.Medium,
size: PillSize.M,
isUppercase: false
}
};
Expand Down
6 changes: 3 additions & 3 deletions malty/atoms/Pill/Pill.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export const StyledPill = styled.div<StyledPillProps>`
let gap;
if ($hasIcon && !$hasText) {
if ($pillSize === PillSize.XSmall) {
if ($pillSize === PillSize.XS) {
padding = theme.sizesV2['4xs'];
gap = theme.sizesV2['5xs'];

Check warning on line 30 in malty/atoms/Pill/Pill.styled.ts

View check run for this annotation

Codecov / codecov/patch

malty/atoms/Pill/Pill.styled.ts#L29-L30

Added lines #L29 - L30 were not covered by tests
}
if ($pillSize === PillSize.Small) {
if ($pillSize === PillSize.S) {
padding = theme.sizesV2['4xs'];
gap = theme.sizesV2['4xs'];

Check warning on line 34 in malty/atoms/Pill/Pill.styled.ts

View check run for this annotation

Codecov / codecov/patch

malty/atoms/Pill/Pill.styled.ts#L33-L34

Added lines #L33 - L34 were not covered by tests
}
if ($pillSize === PillSize.Medium) {
if ($pillSize === PillSize.M) {
padding = theme.sizesV2['4xs'];
gap = theme.sizesV2['3xs'];
}
Expand Down
2 changes: 1 addition & 1 deletion malty/atoms/Pill/Pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Pill = ({
text,
icon,
type = PillType.Primary,
size = PillSize.Medium,
size = PillSize.M,
iconPosition = IconPosition.Leading,
isUppercase = false,
dataTestId,
Expand Down
6 changes: 3 additions & 3 deletions malty/atoms/Pill/Pill.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export interface PillProps extends React.HTMLAttributes<HTMLElement>, SpaceProps
}

export enum PillSize {
XSmall = 'xs',
Small = 's',
Medium = 'm'
XS = 'xs',
S = 's',
M = 'm'
}

export enum PillType {
Expand Down
2 changes: 1 addition & 1 deletion malty/molecules/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Banner = ({
const labelProps: PillProps = {
text: label && typeof label === 'string' ? label : '',
type: negative ? PillType.Archive : PillType.Primary,
size: PillSize.Medium,
size: PillSize.M,
icon: undefined
};
if (label && typeof label === 'object') {
Expand Down
6 changes: 3 additions & 3 deletions malty/molecules/ProductCard/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const ProductCard = ({
<Pill
text={discountPill?.text}
type={discountPill?.type}
size={isMobile ? PillSize.XSmall : PillSize.Small}
size={isMobile ? PillSize.XS : PillSize.S}
icon={discountPill?.icon}
/>
</StyledDiscountPill>
Expand All @@ -124,7 +124,7 @@ export const ProductCard = ({
<Pill
text={promoPill?.text}
type={promoPill?.type}
size={isMobile ? PillSize.XSmall : PillSize.Small}
size={isMobile ? PillSize.XS : PillSize.S}
icon={promoPill?.icon}
/>
) : null}
Expand All @@ -133,7 +133,7 @@ export const ProductCard = ({
<Pill
text={cartPill?.text}
type={cartPill?.type}
size={isMobile ? PillSize.XSmall : PillSize.Small}
size={isMobile ? PillSize.XS : PillSize.S}
icon={cartPill?.icon}
/>
) : null}
Expand Down

0 comments on commit 53214e1

Please sign in to comment.