Skip to content

Commit

Permalink
Merge pull request #213 from reaviz/Extend-sizes-and-variants-prop-types
Browse files Browse the repository at this point in the history
Extend size and variant prop types
  • Loading branch information
amcdnl committed May 24, 2024
2 parents 404e894 + 9f07966 commit 4b71ad8
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/elements/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export interface ButtonProps
/**
* Style variant of the button.
*/
variant?: 'filled' | 'outline' | 'text';
variant?: 'filled' | 'outline' | 'text' | string;

/**
* The size variation of the button.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* If true, the button will take up the full width of its container.
Expand Down
2 changes: 2 additions & 0 deletions src/elements/Button/ButtonTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ export interface ButtonTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
variants: {
filled: string;
outline: string;
text: string;
[key: string]: string;
};
colors: {
default: {
Expand Down
4 changes: 2 additions & 2 deletions src/elements/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Size variant for the chip.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Style variant for the chip.
*/
variant?: 'filled' | 'outline';
variant?: 'filled' | 'outline' | string;

/**
* Whether the chip is selected.
Expand Down
3 changes: 3 additions & 0 deletions src/elements/Chip/ChipTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface ChipTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
variants: {
Expand All @@ -49,6 +50,7 @@ export interface ChipTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
focus: string;
deleteButton: {
Expand All @@ -57,6 +59,7 @@ export interface ChipTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
disabled: string;
Expand Down
2 changes: 1 addition & 1 deletion src/elements/Loader/DotsLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface DotsLoaderProps {
/**
* The size of the loader.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Theme for the DotsLoader.
Expand Down
1 change: 1 addition & 0 deletions src/elements/Loader/DotsLoaderTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface DotsLoaderTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/form/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface CheckboxProps {
/**
* Size of the checkbox.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Additional class names to apply to the checkbox.
Expand Down
2 changes: 2 additions & 0 deletions src/form/Checkbox/CheckboxTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface CheckboxTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
border: string;
Expand All @@ -19,6 +20,7 @@ export interface CheckboxTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
boxVariants: {
hover: {
Expand Down
2 changes: 1 addition & 1 deletion src/form/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface InputProps
/**
* Size of the input.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Content to display before the input.
Expand Down
1 change: 1 addition & 0 deletions src/form/Input/InputTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface InputTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
adornment: {
base: string;
Expand Down
2 changes: 1 addition & 1 deletion src/form/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface RadioProps {
/**
* Size of the radio.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Event handler for when the radio is changed.
Expand Down
2 changes: 2 additions & 0 deletions src/form/Radio/RadioTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface RadioTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
label: {
Expand All @@ -24,6 +25,7 @@ export interface RadioTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/form/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface TextareaProps extends TextareaAutosizeProps {
/**
* Size of the field.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Theme for the Textarea.
Expand Down
1 change: 1 addition & 0 deletions src/form/Textarea/TextareaTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface TextareaTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/form/Toggle/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ToggleProps {
/**
* The size of the toggle.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* When the toggle is changed.
Expand Down
2 changes: 2 additions & 0 deletions src/form/Toggle/ToggleTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface ToggleTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
disabled: string;
disabledAndChecked: string;
Expand All @@ -17,6 +18,7 @@ export interface ToggleTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/layout/Tabs/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface TabProps extends PropsWithChildren {
*
* @private
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Theme for the Tabs.
Expand Down
2 changes: 1 addition & 1 deletion src/layout/Tabs/TabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface TabListProps extends PropsWithChildren {
* The size of the tabs.
* @private
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* Theme for the Tabs.
Expand Down
2 changes: 1 addition & 1 deletion src/layout/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface TabsProps extends PropsWithChildren {
/**
* The size of the tabs.
*/
size?: 'small' | 'medium' | 'large';
size?: 'small' | 'medium' | 'large' | string;

/**
* The callback to be called when a tab is selected.
Expand Down
2 changes: 2 additions & 0 deletions src/layout/Tabs/TabsTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface TabsTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
divider: string;
Expand All @@ -28,6 +29,7 @@ export interface TabsTheme {
small: string;
medium: string;
large: string;
[key: string]: string;
};
};
};
Expand Down
9 changes: 8 additions & 1 deletion src/layout/VerticalSpacer/VerticalSpacer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export interface VerticalSpacerProps extends HTMLAttributes<HTMLDivElement> {
theme?: VerticalSpacerTheme;
}

export type VerticalSpaceType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
export type VerticalSpaceType =
| 'xs'
| 'sm'
| 'md'
| 'lg'
| 'xl'
| 'xxl'
| string;

export interface VerticalSpacerRef {
/**
Expand Down
1 change: 1 addition & 0 deletions src/layout/VerticalSpacer/VerticalSpacerTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface VerticalSpacerTheme {
lg: string;
xl: string;
xxl: string;
[key: string]: string;
};
}

Expand Down

0 comments on commit 4b71ad8

Please sign in to comment.