Skip to content

Commit a3ade57

Browse files
author
Kubit
committed
Export PillV2 and Badg2V2 props and types
1 parent b7448df commit a3ade57

File tree

7 files changed

+24
-39
lines changed

7 files changed

+24
-39
lines changed

src/components/badgeV2/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// interfaces and type
2-
export type {
3-
BadgeLabelType as BadgeLabelTypeV2,
4-
IBadgeStandAlone as IBadgeStandAloneV2,
5-
IBadge as IBadgeV2,
6-
BadgeVariantStylesType as BadgeVariantStylesTypeV2,
7-
BadgeStylesType as BadgeStylesTypeV2,
8-
} from './types';
9-
10-
// enums
11-
export { BadgeState as BadgeStateV2 } from './types';
1+
export * from './types';
122

133
export { BadgeV2 } from './badge';

src/components/badgeV2/types/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
export type * from './badge';
2-
export type { BadgeVariantStylesType, BadgeStylesType } from './badgeTheme';
1+
export type {
2+
BadgeVariantStylesType as BadgeVariantStylesTypeV2,
3+
BadgeStylesType as BadgeStylesTypeV2,
4+
} from './badgeTheme';
35
export * from './state';
6+
export type {
7+
BadgeLabelType as BadgeLabelTypeV2,
8+
IBadgeStandAlone as IBadgeStandAloneV2,
9+
IBadge as IBadgeV2,
10+
} from './badge';

src/components/pillV2/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
export type {
2-
IPill as IPillV2,
3-
PillStylesType as PillStylesTypeV2,
4-
PillVariantPropsStylesType as PillVariantPropsStylesTypeV2,
5-
PillSizePropsStylesType as PillSizePropsStylesTypeV2,
6-
PillPropsStylesType as PillPropsStylesTypeV2,
7-
PillLabelType as PillLabelTypeV2,
8-
} from './types';
9-
10-
export { PillStateType as PillStateTypeV2 } from './types/pillStateType';
11-
export { PillType as PillTypeV2 } from './types/pillType';
1+
export * from './types';
122
export { Pill as PillV2 } from './pill';

src/components/pillV2/pill.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ const PillComponent = (
2727
: variantStyles?.[Object.keys(variantStyles)[0]]?.[state];
2828

2929
return (
30-
<PillStandAlone
31-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
32-
ref={ref as any}
33-
disabled={disabled}
34-
selected={selected}
35-
styles={styles}
36-
{...props}
37-
/>
30+
<PillStandAlone ref={ref} disabled={disabled} selected={selected} styles={styles} {...props} />
3831
);
3932
};
4033

src/components/pillV2/pillStandAlone.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { PillType } from './types/pillType';
1919

2020
const PillStandAloneComponent = (
2121
{ dataTestId = 'pill', type = PillType.BUTTON, ...props }: IPillStandAlone,
22-
ref: React.ForwardedRef<HTMLButtonElement> | undefined | null
22+
ref: React.ForwardedRef<HTMLDivElement> | undefined | null
2323
): JSX.Element => {
2424
const id = useId('pill');
2525
const pillContentId = `${id}-content`;
@@ -36,7 +36,7 @@ const PillStandAloneComponent = (
3636
type={[PillType.BUTTON, PillType.TAB].includes(type) ? ButtonType.BUTTON : undefined}
3737
onClick={props.onClick}
3838
>
39-
<PillContentContainerStyled id={pillContentId} styles={props.styles}>
39+
<PillContentContainerStyled data-pill-content id={pillContentId} styles={props.styles}>
4040
<ElementOrIcon customIconStyles={props.styles?.leftIcon} {...props.leftIcon} />
4141
<Text
4242
component={TextComponentType.SPAN}

src/components/pillV2/types/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
export * from './pill';
2-
export * from './pillTheme';
3-
export * from './pillStateType';
4-
export * from './pillType';
1+
export type {
2+
PillStylesType as PillStylesTypeV2,
3+
PillVariantPropsStylesType as PillVariantPropsStylesTypeV2,
4+
PillSizePropsStylesType as PillSizePropsStylesTypeV2,
5+
PillPropsStylesType as PillPropsStylesTypeV2,
6+
} from './pillTheme';
7+
export type { IPill as IPillV2, PillLabelType as PillLabelTypeV2 } from './pill';
8+
export { PillStateType as PillStateTypeV2 } from './pillStateType';
9+
export { PillType as PillTypeV2 } from './pillType';

src/components/pillV2/types/pillTheme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type PillPropsStylesType = {
88
rootContainer?: CommonStyleType;
99
contentContainer?: CommonStyleType;
1010
leftIcon?: IconTypes;
11-
label?: TypographyTypes;
11+
label?: TypographyTypes & CommonStyleType;
1212
rightIcon?: IconTypes;
1313
input?: CommonStyleType;
1414
};

0 commit comments

Comments
 (0)