Skip to content

Commit

Permalink
fix sx types
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Aug 8, 2024
1 parent 5b3f475 commit a5a1d0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/pigment-css-react/src/sx.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { CSSObjectNoCallback } from './base';
import type { ThemeArgs } from './theme';

type GetTheme<Argument> = Argument extends { theme: infer Theme } ? Theme : never;

export type SxProp =
| CSSObjectNoCallback
| ((themeArgs: ThemeArgs['theme']) => CSSObjectNoCallback)
| ReadonlyArray<CSSObjectNoCallback | ((themeArgs: ThemeArgs['theme']) => CSSObjectNoCallback)>;
| ((theme: GetTheme<ThemeArgs>) => CSSObjectNoCallback)
| ReadonlyArray<CSSObjectNoCallback | ((theme: GetTheme<ThemeArgs>) => CSSObjectNoCallback)>;

export default function sx(arg: SxProp | Array<SxProp>, componentClass?: string): string;
export default function sx(arg: SxProp, componentClass?: string): string;

0 comments on commit a5a1d0e

Please sign in to comment.