|
| 1 | +import { provideWindowMediaQuery } from "./media-queries"; |
| 2 | +import type { TBorderProviderConstructorParams } from "./tokens/internal/border"; |
| 3 | +import type { TColorProviderConstructorParams } from "./tokens/internal/color"; |
| 4 | +import type { TElevationProviderConstructorParams } from "./tokens/internal/elevation"; |
| 5 | +import type { TMotionProviderConstructorParams } from "./tokens/internal/motion"; |
| 6 | +import type { TShapeProviderConstructorParams } from "./tokens/internal/shape"; |
| 7 | +import type { TSizingProviderConstructorParams } from "./tokens/internal/sizing"; |
| 8 | +import type { TTypographyProviderConstructorParams } from "./tokens/internal/typography"; |
| 9 | +import { provideBorder } from "./tokens/provide-border"; |
| 10 | +import { provideColor } from "./tokens/provide-color"; |
| 11 | +import { provideElevation } from "./tokens/provide-elevation"; |
| 12 | +import { provideMotion } from "./tokens/provide-motion"; |
| 13 | +import { provideShape } from "./tokens/provide-shape"; |
| 14 | +import { provideSizing } from "./tokens/provide-sizing"; |
| 15 | +import { provideTypography } from "./tokens/provide-typography"; |
| 16 | + |
| 17 | +export function provideAll(params: { |
| 18 | + color?: Partial<TColorProviderConstructorParams>, |
| 19 | + elevation?: Partial<TElevationProviderConstructorParams>, |
| 20 | + motion?: TMotionProviderConstructorParams, |
| 21 | + shape?: TShapeProviderConstructorParams, |
| 22 | + typography?: TTypographyProviderConstructorParams, |
| 23 | + border?: Partial<TBorderProviderConstructorParams>, |
| 24 | + sizing?: Partial<TSizingProviderConstructorParams>, |
| 25 | +}) { |
| 26 | + return ({ |
| 27 | + color: provideColor(params.color), |
| 28 | + elevation: provideElevation(params.elevation), |
| 29 | + motion: provideMotion(params.motion), |
| 30 | + shape: provideShape(params.shape), |
| 31 | + typography: provideTypography(params.typography), |
| 32 | + border: provideBorder(params.border), |
| 33 | + sizing: provideSizing(params.sizing), |
| 34 | + windowMediaQuery: provideWindowMediaQuery(), |
| 35 | + getAllPlugins() { |
| 36 | + return ([ |
| 37 | + this.color.getPlugin(), |
| 38 | + this.elevation.getPlugin(), |
| 39 | + this.motion.getPlugin(), |
| 40 | + this.shape.getPlugin(), |
| 41 | + this.typography.getPlugin(), |
| 42 | + this.border.getPlugin(), |
| 43 | + this.windowMediaQuery.getPlugin(), |
| 44 | + ]) |
| 45 | + } |
| 46 | + }) |
| 47 | +} |
0 commit comments