Skip to content

Commit

Permalink
Merge pull request #78 from lyytioy/next
Browse files Browse the repository at this point in the history
Release 1.0.10
  • Loading branch information
kacperkosinski committed Jun 9, 2022
2 parents 5be3f4b + 1316653 commit aa08957
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@lyyti/design-system",
"description": "Lyyti Design System",
"homepage": "https://lyytioy.github.io/lyyti-design-system",
"version": "1.0.9",
"version": "1.0.10",
"engines": {
"node": "^16",
"npm": "^8"
Expand Down
5 changes: 3 additions & 2 deletions src/components/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type OptionsType = {
export interface AutocompleteProps<T = OptionsType>
extends Omit<
MuiAutocompleteProps<T, boolean | undefined, boolean | undefined, boolean | undefined>,
'hiddenLabel' | 'startAdornment' | 'endAdornment' | 'variant' | 'renderInput'
'hiddenLabel' | 'startAdornment' | 'endAdornment' | 'variant' | 'renderInput' | 'ref'
> {
adornment?: string | JSX.Element;
label?: string;
Expand All @@ -40,6 +40,7 @@ export interface AutocompleteProps<T = OptionsType>
error?: boolean;
helperText?: string;
'data-testid'?: string;
ref?: Ref<HTMLDivElement>;
}

const Autocomplete = (
Expand All @@ -59,7 +60,7 @@ const Autocomplete = (
sx = {},
...props
}: AutocompleteProps,
ref: Ref<unknown>
ref: Ref<HTMLDivElement>
): JSX.Element => {
return (
<MuiAutocomplete
Expand Down
6 changes: 4 additions & 2 deletions src/components/Box.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Box as MuiBox, BoxProps as MuiBoxProps } from '@mui/material';
import { forwardRef, Ref } from 'react';

export type BoxProps = MuiBoxProps;
export interface BoxProps extends MuiBoxProps {
ref?: Ref<HTMLElement>;
}

const Box = (props: BoxProps, ref: Ref<unknown>): JSX.Element => {
const Box = (props: BoxProps, ref: Ref<HTMLElement>): JSX.Element => {
return <MuiBox ref={ref} {...props} />;
};

Expand Down
3 changes: 2 additions & 1 deletion src/components/CircularProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CircularProgressProps as MuiCircularProgressProps,
} from '@mui/material';
import { forwardRef, Ref } from 'react';

export interface CircularProgressProps extends MuiCircularProgressProps {
color: 'primary' | 'secondary';
size?: number | string;
Expand All @@ -20,7 +21,7 @@ const CircularProgress = (
sx = {},
...props
}: CircularProgressProps,
ref: Ref<unknown>
ref: Ref<HTMLSpanElement>
): JSX.Element => {
return (
<MuiCircularProgress
Expand Down
6 changes: 4 additions & 2 deletions src/components/FormControlLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import {
} from '@mui/material';
import { forwardRef, Ref } from 'react';

export type FormControlLabelProps = MuiFormControlLabelProps;
export interface FormControlLabelProps extends MuiFormControlLabelProps {
ref?: Ref<HTMLLabelElement>;
}

const FormControlLabel = (
{ sx = {}, ...props }: FormControlLabelProps,
ref: Ref<unknown>
ref: Ref<HTMLLabelElement>
): JSX.Element => {
return (
<MuiFormControlLabel
Expand Down
6 changes: 4 additions & 2 deletions src/components/FormGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { FormGroup as MuiFormGroup, FormGroupProps as MuiFormGroupProps } from '@mui/material';
import { forwardRef, Ref } from 'react';

export type FormGroupProps = MuiFormGroupProps;
export interface FormGroupProps extends MuiFormGroupProps{
ref?: Ref<HTMLDivElement>
};

const FormGroup = (props: FormGroupProps, ref: Ref<unknown>): JSX.Element => {
const FormGroup = (props: FormGroupProps, ref: Ref<HTMLDivElement>): JSX.Element => {
return <MuiFormGroup ref={ref} {...props} />;
};

Expand Down
3 changes: 2 additions & 1 deletion src/components/LinearProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ export interface LinearProgressProps extends MuiLinearProgressProps {
value?: number;
variant: 'buffer' | 'determinate' | 'indeterminate' | 'query';
'data-testid'?: string;
ref?: Ref<HTMLSpanElement>
}

const LinearProgress = (
{ color = 'primary', value, variant = 'indeterminate', sx = {}, ...props }: LinearProgressProps,
ref: Ref<unknown>
ref: Ref<HTMLSpanElement>
): JSX.Element => {
return (
<MuiLinearProgress
Expand Down
6 changes: 4 additions & 2 deletions src/components/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Pagination as MuiPagination, PaginationProps as MuiPaginationProps } from '@mui/material';
import { forwardRef, Ref } from 'react';

export type PaginationProps = MuiPaginationProps;
export interface PaginationProps extends MuiPaginationProps {
ref?: Ref<HTMLElement>;
}

const Pagination = ({ sx = {}, ...props }: PaginationProps, ref: Ref<unknown>): JSX.Element => {
const Pagination = ({ sx = {}, ...props }: PaginationProps, ref: Ref<HTMLElement>): JSX.Element => {
return (
<MuiPagination
ref={ref}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface ProgressProps extends Omit<LinearProgressProps, 'color' | 'vari
value?: number;
variant?: 'determinate' | 'indeterminate';
'data-testid'?: string;
ref?: Ref<HTMLSpanElement>;
}

const Progress = (
Expand All @@ -20,7 +21,7 @@ const Progress = (
variant = 'indeterminate',
...props
}: ProgressProps,
ref: Ref<unknown>
ref: Ref<HTMLSpanElement>
): JSX.Element => {
return (
<>
Expand Down
10 changes: 10 additions & 0 deletions src/components/RadioGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { RadioGroup as MuiRadioGroup, RadioGroupProps as MuiRadioGroupProps } from '@mui/material';
import { forwardRef, Ref } from 'react';

export interface RadioGroupProps extends MuiRadioGroupProps {}

const RadioGroup = (props: RadioGroupProps, ref: Ref<HTMLDivElement>): JSX.Element => {
return <MuiRadioGroup ref={ref} {...props} />;
};

export default forwardRef(RadioGroup);
3 changes: 2 additions & 1 deletion src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type CommonProps = {
adornment?: AutocompleteProps<OptionsType>['adornment'];
multiple?: boolean;
'data-testid'?: string;
ref?: Ref<HTMLDivElement>;
};

export type MultipleSelectProps = Omit<AutocompleteProps, 'options'> & CommonProps;
Expand All @@ -21,7 +22,7 @@ export type SelectProps = MultipleSelectProps | SingleSelectProps;

const Select = (
{ adornment, options = [], multiple = false, 'data-testid': testid, ...props }: SelectProps,
ref: Ref<unknown>
ref: Ref<HTMLDivElement>
): JSX.Element => {
if (multiple) {
return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/Snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface SnackbarProps extends MuiSnackbarProps {
direction?: 'right' | 'left' | 'up' | 'down';
severity?: 'success' | 'info' | 'warning' | 'error';
variant?: 'standard' | 'filled' | 'outlined';
ref?: Ref<HTMLDivElement>
}

const Snackbar = (
Expand All @@ -29,7 +30,7 @@ const Snackbar = (
variant = 'standard',
...props
}: SnackbarProps,
ref: Ref<unknown>
ref: Ref<HTMLDivElement>
): JSX.Element => {
return (
<MuiSnackbar
Expand Down
3 changes: 2 additions & 1 deletion src/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export interface TooltipProps extends MuiTooltipProps {
| 'top';
title: NonNullable<React.ReactNode>;
'data-testid'?: string;
ref?: Ref<HTMLDivElement>
}

const Tooltip = (
{ arrow = false, placement = 'bottom', children, title, ...props }: TooltipProps,
ref: Ref<unknown>
ref: Ref<HTMLDivElement>
): JSX.Element => {
return (
<MuiTooltip
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export { default as Tabs } from './components/Tabs';
export { default as TextField } from './components/TextField';
export { default as TimePicker } from './components/TimePicker';
export { default as Tooltip } from './components/Tooltip';
export { default as RadioGroup } from './components/RadioGroup';
export { default as TreeView } from '@mui/lab/TreeView';
export { default as TreeItem } from '@mui/lab/TreeItem';
export type { TreeItemProps } from '@mui/lab/TreeItem';
Expand Down

0 comments on commit aa08957

Please sign in to comment.