Skip to content

Commit

Permalink
fix: provder-all no longer requires default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
bre97-web committed Sep 3, 2024
1 parent d70c54d commit a345550
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/provide-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,31 @@ import { provideShape } from "./tokens/provide-shape";
import { provideSizing } from "./tokens/provide-sizing";
import { provideTypography } from "./tokens/provide-typography";

export function provideAll(params: {
color?: Partial<TColorProviderConstructorParams>,
elevation?: Partial<TElevationProviderConstructorParams>,
motion?: TMotionProviderConstructorParams,
shape?: TShapeProviderConstructorParams,
typography?: TTypographyProviderConstructorParams,
border?: Partial<TBorderProviderConstructorParams>,
sizing?: Partial<TSizingProviderConstructorParams>,
}) {
export function provideAll(params?: Partial<{
color: Partial<TColorProviderConstructorParams>,
elevation: Partial<TElevationProviderConstructorParams>,
motion: TMotionProviderConstructorParams,
shape: TShapeProviderConstructorParams,
typography: TTypographyProviderConstructorParams,
border: Partial<TBorderProviderConstructorParams>,
sizing: Partial<TSizingProviderConstructorParams>,
}>) {
return ({
color: provideColor(params.color),
elevation: provideElevation(params.elevation),
motion: provideMotion(params.motion),
shape: provideShape(params.shape),
typography: provideTypography(params.typography),
border: provideBorder(params.border),
sizing: provideSizing(params.sizing),
color: provideColor(params?.color),
elevation: provideElevation(params?.elevation),
motion: provideMotion(params?.motion),
shape: provideShape(params?.shape),
typography: provideTypography(params?.typography),
border: provideBorder(params?.border),
sizing: provideSizing(params?.sizing),
windowMediaQuery: provideWindowMediaQuery(),
getAllPlugins() {
return ([
this.color.getPlugin(),
this.elevation.getPlugin(),
this.motion.getPlugin(),
this.shape.getPlugin(),
this.sizing.getPlugin(),
this.typography.getPlugin(),
this.border.getPlugin(),
this.windowMediaQuery.getPlugin(),
Expand Down

0 comments on commit a345550

Please sign in to comment.