Skip to content

Commit

Permalink
[core] Replace global JSX (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai authored Jul 19, 2024
1 parent 0151858 commit ae72eea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion apps/local-ui-lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type * as React from 'react';

export const bounceAnim: string;
export const Button: React.ComponentType<
JSX.IntrinsicElements['button'] & {
React.JSX.IntrinsicElements['button'] & {
isRed?: boolean;
sx?: unknown;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/pigment-css-react/src/Box.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type * as React from 'react';
import type { BaseDefaultProps, Substitute, NoInfer } from './base';
import type { SxProp } from './sx';

Expand Down Expand Up @@ -33,7 +34,7 @@ export interface PolymorphicComponent<BaseProps extends BaseDefaultProps>
extends React.ForwardRefExoticComponent<BaseProps> {
<AsTarget extends React.ElementType | undefined = undefined>(
props: PolymorphicComponentProps<BaseProps, AsTarget>,
): JSX.Element;
): React.JSX.Element;
}

declare const Box: PolymorphicComponent<{}>;
Expand Down
3 changes: 2 additions & 1 deletion packages/pigment-css-react/src/base.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type * as React from 'react';
import type * as CSS from 'csstype';
import { OverridableStringUnion } from '@mui/types';

Expand Down Expand Up @@ -63,7 +64,7 @@ export interface PolymorphicComponent<SxProp, BaseProps extends BaseDefaultProps
extends React.ForwardRefExoticComponent<BaseProps> {
<AsTarget extends React.ElementType | undefined = undefined>(
props: PolymorphicComponentProps<SxProp, BaseProps, AsTarget>,
): JSX.Element;
): React.JSX.Element;
}

export interface BreakpointOverrides {}
Expand Down
5 changes: 4 additions & 1 deletion packages/pigment-css-react/src/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export interface CreateStyled {
}

export type CreateStyledIndex = {
[Key in keyof JSX.IntrinsicElements]: CreateStyledComponent<Key, JSX.IntrinsicElements[Key]>;
[Key in keyof React.JSX.IntrinsicElements]: CreateStyledComponent<
Key,
React.JSX.IntrinsicElements[Key]
>;
};

declare const styled: CreateStyled & CreateStyledIndex;
Expand Down

0 comments on commit ae72eea

Please sign in to comment.