Skip to content

Commit

Permalink
add jsdoc for util
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Sep 22, 2023
1 parent 3f8038a commit 53f626e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CssVarsValuesType } from '../utils/CssVarsType';
import { CssVarsType } from '../utils/CssVarsType';

const circularProgressCssVars = {
thickness: '--CircularProgress-thickness',
Expand All @@ -13,7 +13,7 @@ const circularProgressCssVars = {
circulation: '--CircularProgress-circulation',
} as const;

export type CircularProgressCssVarsType = CssVarsValuesType<
export type CircularProgressCssVarsType = CssVarsType<
keyof typeof circularProgressCssVars,
'CircularProgress'
>;
Expand Down
11 changes: 10 additions & 1 deletion packages/mui-joy/src/utils/CssVarsType.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
export type CssVarsValuesType<Keys extends string, Component extends string> = Partial<
/**
* A type which generates CSS Variables.
* @example
* type ButtonCssVars = CssVarsType<'color' | 'size', 'Button'>;
* ButtonCssVars = {
* '--Button-color'?: string | number;
* '--Button-size'?: string | number;
* }
*/
export type CssVarsType<Keys extends string, Component extends string> = Partial<
Record<`--${Component}-${Keys}`, string | number>
>;

0 comments on commit 53f626e

Please sign in to comment.