From a345550837a4b1d06a2abd481726e6a3a7222712 Mon Sep 17 00:00:00 2001 From: bre97-web Date: Tue, 3 Sep 2024 11:10:19 +0800 Subject: [PATCH] fix: provder-all no longer requires default parameters --- src/provide-all.ts | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/provide-all.ts b/src/provide-all.ts index 2665b97..fde939e 100644 --- a/src/provide-all.ts +++ b/src/provide-all.ts @@ -14,23 +14,23 @@ import { provideShape } from "./tokens/provide-shape"; import { provideSizing } from "./tokens/provide-sizing"; import { provideTypography } from "./tokens/provide-typography"; -export function provideAll(params: { - color?: Partial, - elevation?: Partial, - motion?: TMotionProviderConstructorParams, - shape?: TShapeProviderConstructorParams, - typography?: TTypographyProviderConstructorParams, - border?: Partial, - sizing?: Partial, -}) { +export function provideAll(params?: Partial<{ + color: Partial, + elevation: Partial, + motion: TMotionProviderConstructorParams, + shape: TShapeProviderConstructorParams, + typography: TTypographyProviderConstructorParams, + border: Partial, + sizing: Partial, +}>) { 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 ([ @@ -38,6 +38,7 @@ export function provideAll(params: { this.elevation.getPlugin(), this.motion.getPlugin(), this.shape.getPlugin(), + this.sizing.getPlugin(), this.typography.getPlugin(), this.border.getPlugin(), this.windowMediaQuery.getPlugin(),