Skip to content

Commit

Permalink
fix(clerk-js): Temporarily adding any to the emotion css prop
Browse files Browse the repository at this point in the history
Otherwise, DTS files will fail to be built using the fix(clerk-js): Introduce and use `~ui` alias

In order to be able to switch between /ui and /ui.retheme simply by changing the active tsconfig file.declarations.retheme.json file when `paths` is used. We will revert this change once the components are ready.
  • Loading branch information
nikosdouvlis committed Nov 14, 2023
1 parent 5138e30 commit 4144f25
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Alert = (props: AlertProps): JSX.Element => {
// @ts-ignore
justify='start'
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
>
{props.children}
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/AlertIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const AlertIcon = (props: AlertIconProps): JSX.Element => {
return (
<Icon
{...filterProps(rest)}
css={applyVariants(props)}
css={applyVariants(props) as any}
/>
);
};
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Badge = (props: BadgeProps) => {
{...filterProps(props)}
center
as='span'
css={applyVariants(props)}
css={applyVariants(props) as any}
/>
);
};
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Box = React.forwardRef<HTMLDivElement, BoxProps>((props, ref) => {
return (
<As
{...applyDataStateProps(rest)}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref}
/>
);
Expand Down
5 changes: 3 additions & 2 deletions packages/clerk-js/src/ui.retheme/primitives/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ type OwnProps = PrimitiveProps<'button'> & {
isActive?: boolean;
hoverAsFocus?: boolean;
};

type ButtonProps = OwnProps & StyleVariants<typeof applyVariants>;

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
Expand Down Expand Up @@ -173,7 +174,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) =>
type={undefined}
onClick={onClick}
disabled={isDisabled}
css={applyVariants(parsedProps)}
css={applyVariants(parsedProps) as any}
ref={ref}
>
{isLoading && (
Expand Down Expand Up @@ -217,7 +218,7 @@ const SimpleButton = React.forwardRef<HTMLButtonElement, ButtonProps>((props, re
// the default styles of our components
type={undefined}
onClick={onClick}
css={applyVariants(parsedProps)}
css={applyVariants(parsedProps) as any}
disabled={isDisabled}
ref={ref}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const Flex = React.forwardRef<HTMLDivElement, FlexProps>((props, ref) =>
return (
<Box
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const FormErrorText = forwardRef<HTMLElement, FormErrorTextProps>((props,
aria-live='polite'
id={errorMessageId}
{...rest}
css={applyVariants(props)}
css={applyVariants(props) as any}
>
<Icon
colorScheme={'danger'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const FormInfoText = forwardRef<HTMLElement, FormTextProps>((props, ref)
aria-live='polite'
id={errorMessageId}
{...props}
css={applyVariants(props)}
css={applyVariants(props) as any}
/>
);
});
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/FormLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const FormLabel = (props: FormLabelProps) => {
<label
{...applyDataStateProps(rest)}
htmlFor={htmlForProp ?? id}
css={applyVariants(props)}
css={applyVariants(props) as any}
>
{props.children}
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const FormSuccessText = forwardRef<HTMLElement, FormTextProps>((props, re
colorScheme='neutral'
aria-live='polite'
{...rest}
css={applyVariants(props)}
css={applyVariants(props) as any}
>
<Icon
colorScheme={'success'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const FormWarningText = forwardRef<HTMLElement, FormTextProps>((props, re
colorScheme='neutral'
aria-live='polite'
{...rest}
css={applyVariants(props)}
css={applyVariants(props) as any}
>
<Icon
colorScheme={'warning'}
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const Grid = React.forwardRef<HTMLDivElement, GridProps>((props, ref) =>
return (
<Box
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Heading = (props: HeadingProps) => {
return (
<As
{...filterProps(rest)}
css={applyVariants(props)}
css={applyVariants(props) as any}
/>
);
};
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Icon = (props: IconProps): JSX.Element => {
<Icon
{...filterProps(rest)}
// @ts-expect-error
css={applyVariants(props)}
css={applyVariants(props) as any}
/>
);
};
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref)
aria-describedby={formControlProps.errorMessageId}
aria-required={_required}
aria-disabled={_disabled}
css={applyVariants(propsWithoutVariants)}
css={applyVariants(propsWithoutVariants) as any}
/>
);
});
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const Link = (props: LinkProps): JSX.Element => {
href={href || ''}
target={href && isExternal ? '_blank' : undefined}
rel={href && isExternal ? 'noopener' : undefined}
css={applyVariants(props)}
css={applyVariants(props) as any}
>
{children}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const NotificationBadge = (props: NotificationBadgeProps) => {
center
as='span'
css={[
applyVariants(props),
applyVariants(props) as any,
{
lineHeight: 0,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const Spinner = (props: SpinnerProps) => {
return (
<span
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
aria-busy
aria-live='polite'
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const Table = React.forwardRef<HTMLTableCellElement, TableProps>((props,
<Box
as='table'
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Td.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Td = React.forwardRef<HTMLTableCellElement, TdProps>((props, ref) =
<Box
as='td'
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref}
/>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/clerk-js/src/ui.retheme/primitives/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ export type TextProps = PrimitiveProps<'p'> & { isDisabled?: boolean } & StyleVa
as?: 'p' | 'div' | 'label' | 'code' | 'span' | 'li' | 'a';
};

export const Text = React.forwardRef<HTMLElement, TextProps>((props, ref): JSX.Element => {
export const Text = React.forwardRef<HTMLElement, TextProps>((props, ref) => {
const { as: As = 'p', ...rest } = props;
return (
<As
{...applyDataStateProps(filterProps(rest))}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref as unknown as any}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui.retheme/primitives/Th.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Th = React.forwardRef<HTMLTableCellElement, ThProps>((props, ref) =
<Box
as='th'
{...filterProps(props)}
css={applyVariants(props)}
css={applyVariants(props) as any}
ref={ref}
/>
);
Expand Down

0 comments on commit 4144f25

Please sign in to comment.