Skip to content

Commit

Permalink
Merge pull request #94 from nebula-aac/components-grouped-base
Browse files Browse the repository at this point in the history
[components] Grouped base components and fixed exports
  • Loading branch information
aabidsofi19 authored Sep 10, 2023
2 parents 198dd1d + 52aa78a commit a64be50
Show file tree
Hide file tree
Showing 78 changed files with 195 additions and 133 deletions.
3 changes: 3 additions & 0 deletions packages/components/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.eslintrc.cjs
node_modules
dist
3 changes: 3 additions & 0 deletions packages/components/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.exports = {
'plugin:react/recommended',
'plugin:prettier/recommended'
],
parserOptions: {
project: ['./tsconfig.json']
},
overrides: [
{
env: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppBarProps, AppBar as MuiAppBar } from '@mui/material';
import { AppBar as MuiAppBar, type AppBarProps } from '@mui/material';
import React from 'react';

export function AppBar(props: AppBarProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/AppBar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { AppBar } from './appbar';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AvatarProps, Avatar as MuiAvatar } from '@mui/material';
import { Avatar as MuiAvatar, type AvatarProps } from '@mui/material';
import React from 'react';

export function Avatar(props: AvatarProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AvatarGroupProps, AvatarGroup as MuiAvatarGroup } from '@mui/material';
import { AvatarGroup as MuiAvatarGroup, type AvatarGroupProps } from '@mui/material';
import React from 'react';

export function AvatarGroup(props: AvatarGroupProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BadgeProps, Badge as MuiBadge } from '@mui/material';
import { Badge as MuiBadge, type BadgeProps } from '@mui/material';
import React from 'react';

export function Badge(props: BadgeProps) {
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/base/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { Avatar } from './avatar';
export { AvatarGroup } from './avatargroup';
export { Badge } from './badge';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BoxProps, Box as MuiBox } from '@mui/material';
import { Box as MuiBox, type BoxProps } from '@mui/material';
import React from 'react';

export function Box(props: BoxProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Box/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Box } from './box';
10 changes: 10 additions & 0 deletions packages/components/src/base/Button/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Button as MuiButton, type ButtonProps as MuiButtonProps } from '@mui/material';
import React from 'react';

export interface ButtonProps extends MuiButtonProps {
label?: string;
}

export function Button({ label, ...props }: ButtonProps) {
return <MuiButton {...props}>{label}</MuiButton>;
}
6 changes: 6 additions & 0 deletions packages/components/src/base/Button/buttongroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ButtonGroup as MuiButtonGroup, type ButtonGroupProps } from '@mui/material';
import React from 'react';

export function ButtonGroup(props: ButtonGroupProps) {
return <MuiButtonGroup {...props} />;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IconButtonProps, IconButton as MuiIconButton } from '@mui/material';
import { IconButton as MuiIconButton, type IconButtonProps } from '@mui/material';
import React from 'react';

export function IconButton(props: IconButtonProps) {
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/base/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { Button } from './button';
export { ButtonGroup } from './buttongroup';
export { IconButton } from './iconbutton';
6 changes: 6 additions & 0 deletions packages/components/src/base/Card/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Card as MuiCard, type CardProps } from '@mui/material';
import React from 'react';

export function Card(props: CardProps) {
return <MuiCard {...props} />;
}
6 changes: 6 additions & 0 deletions packages/components/src/base/Card/cardactions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { CardActions as MuiCardActions, type CardActionsProps } from '@mui/material';
import React from 'react';

export function CardActions(props: CardActionsProps) {
return <MuiCardActions {...props} />;
}
6 changes: 6 additions & 0 deletions packages/components/src/base/Card/cardcontent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { CardContent as MuiCardContent, type CardContentProps } from '@mui/material';
import React from 'react';

export function CardContent(props: CardContentProps) {
return <MuiCardContent {...props} />;
}
3 changes: 3 additions & 0 deletions packages/components/src/base/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { Card } from './card';
export { CardActions } from './cardactions';
export { CardContent } from './cardcontent';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CheckboxProps, Checkbox as MuiCheckbox } from '@mui/material';
import { Checkbox as MuiCheckbox, type CheckboxProps } from '@mui/material';
import React from 'react';

export function Checkbox(props: CheckboxProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Checkbox } from './checkbox';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChipProps, Chip as MuiChip } from '@mui/material';
import { Chip as MuiChip, type ChipProps } from '@mui/material';
import React from 'react';

export function Chip(props: ChipProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Chip/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Chip } from './chip';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BackdropProps, Backdrop as MuiBackdrop } from '@mui/material';
import { Backdrop as MuiBackdrop, type BackdropProps } from '@mui/material';
import React from 'react';

export function Backdrop(props: BackdropProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DialogProps, Dialog as MuiDialog } from '@mui/material';
import { Dialog as MuiDialog, type DialogProps } from '@mui/material';
import React from 'react';

export function Dialog(props: DialogProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DialogActionsProps, DialogActions as MuiDialogActions } from '@mui/material';
import { DialogActions as MuiDialogActions, type DialogActionsProps } from '@mui/material';
import React from 'react';

export function DialogActions(props: DialogActionsProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DialogContentProps, DialogContent as MuiDialogContent } from '@mui/material';
import { DialogContent as MuiDialogContent, type DialogContentProps } from '@mui/material';
import React from 'react';

export function DialogContent(props: DialogContentProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { DialogContentTextProps, DialogContentText as MuiDialogContentText } from '@mui/material';
import {
DialogContentText as MuiDialogContentText,
type DialogContentTextProps
} from '@mui/material';
import React from 'react';

export function DialogContentText(props: DialogContentTextProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DialogTitleProps, DialogTitle as MuiDialogTitle } from '@mui/material';
import { DialogTitle as MuiDialogTitle, type DialogTitleProps } from '@mui/material';
import React from 'react';

export function DialogTitle(props: DialogTitleProps) {
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/base/Dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { Backdrop } from './backdrop';
export { Dialog } from './dialog';
export { DialogActions } from './dialogactions';
export { DialogContent } from './dialogcontent';
export { DialogContentText } from './dialogcontenttext';
export { DialogTitle } from './dialogtitle';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DividerProps, Divider as MuiDivider } from '@mui/material';
import { Divider as MuiDivider, type DividerProps } from '@mui/material';
import React from 'react';

export function Divider(props: DividerProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Divider/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Divider } from './divider';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DrawerProps, Drawer as MuiDrawer } from '@mui/material';
import { Drawer as MuiDrawer, type DrawerProps } from '@mui/material';
import React from 'react';

export function Drawer(props: DrawerProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Drawer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Drawer } from './drawer';
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions packages/components/src/base/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { Input } from './input';
export { InputAdornment } from './inputadornment';
export { TextField } from './textfield';
6 changes: 6 additions & 0 deletions packages/components/src/base/Input/input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Input as MuiInput, type InputProps } from '@mui/material';
import React from 'react';

export function Input(props: InputProps): JSX.Element {
return <MuiInput {...props} />;
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/components/src/base/List/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { List } from './list';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListProps, List as MuiList } from '@mui/material';
import { List as MuiList, type ListProps } from '@mui/material';
import React from 'react';

export const List = (props: ListProps) => {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Menu } from './menu';
6 changes: 6 additions & 0 deletions packages/components/src/base/Menu/menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Menu as MuiMenu, type MenuProps } from '@mui/material';
import React from 'react';

export function Menu(props: MenuProps) {
return <MuiMenu {...props} />;
}
1 change: 1 addition & 0 deletions packages/components/src/base/Paper/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Paper } from './paper';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Paper as MuiPaper, PaperProps } from '@mui/material';
import { Paper as MuiPaper, type PaperProps } from '@mui/material';
import React from 'react';

export function Paper(props: PaperProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Radio/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { RadioGroup } from './radiogroup';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RadioGroup as MuiRadioGroup, RadioGroupProps } from '@mui/material';
import { RadioGroup as MuiRadioGroup, type RadioGroupProps } from '@mui/material';
import React from 'react';

export function RadioGroup(props: RadioGroupProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Select/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Select } from './select';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Select as MuiSelect, SelectProps } from '@mui/material';
import { Select as MuiSelect, type SelectProps } from '@mui/material';
import React from 'react';

export const Select = (props: SelectProps) => {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Slide/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Slide } from './slide';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Slide as MuiSlide, SlideProps } from '@mui/material';
import { Slide as MuiSlide, type SlideProps } from '@mui/material';
import React from 'react';

export function Slide(props: SlideProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Stack/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Stack } from './stack';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack as MuiStack, StackProps } from '@mui/material';
import { Stack as MuiStack, type StackProps } from '@mui/material';
import React from 'react';

export function Stack(props: StackProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Switch/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Switch } from './switch';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Switch as MuiSwitch, SwitchProps } from '@mui/material';
import { Switch as MuiSwitch, type SwitchProps } from '@mui/material';
import React from 'react';

export const Switch = (props: SwitchProps) => {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Table/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Table } from './table';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Table as MuiTable, TableProps } from '@mui/material';
import { Table as MuiTable, type TableProps } from '@mui/material';
import React from 'react';

export const Table = (props: TableProps) => {
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/base/Tabs/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Tab } from './tab';
export { Tabs } from './tabs';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tab as MuiTab, TabProps } from '@mui/material';
import { Tab as MuiTab, type TabProps } from '@mui/material';
import React from 'react';

export function Tab(props: TabProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tabs as MuiTabs, TabsProps } from '@mui/material';
import { Tabs as MuiTabs, type TabsProps } from '@mui/material';
import React from 'react';

export function Tabs(props: TabsProps) {
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/base/ToggleButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { ToggleButton } from './togglebutton';
export { ToggleButtonGroup } from './togglebuttongroup';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ToggleButton as MuiToggleButton, ToggleButtonProps } from '@mui/material';
import { ToggleButton as MuiToggleButton, type ToggleButtonProps } from '@mui/material';
import React from 'react';

export function ToggleButton(props: ToggleButtonProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ToggleButtonGroup as MuiToggleButtonGroup, ToggleButtonGroupProps } from '@mui/material';
import {
ToggleButtonGroup as MuiToggleButtonGroup,
type ToggleButtonGroupProps
} from '@mui/material';
import React from 'react';

export function ToggleButtonGroup(props: ToggleButtonGroupProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Toolbar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Toolbar } from './toolbar';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Toolbar as MuiToolbar, ToolbarProps } from '@mui/material';
import { Toolbar as MuiToolbar, type ToolbarProps } from '@mui/material';
import React from 'react';

export function Toolbar(props: ToolbarProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Tooltip } from './tooltip';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tooltip as MuiTooltip, TooltipProps } from '@mui/material';
import { Tooltip as MuiTooltip, type TooltipProps } from '@mui/material';
import React from 'react';

export function Tooltip(props: TooltipProps) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/base/Typography/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Typography } from './typography';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typography as MuiTypography, TypographyProps } from '@mui/material';
import { Typography as MuiTypography, type TypographyProps } from '@mui/material';
import React from 'react';

export function Typography(props: TypographyProps) {
Expand Down
6 changes: 0 additions & 6 deletions packages/components/src/button.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/src/buttongroup.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/src/card.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions packages/components/src/custom/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment, type ChangeEvent, type FC, type ReactNode } from 'react';
import { Box } from '../box';
import { InputAdornment } from '../inputadornment';
import { TextField } from '../textfield';
import {} from '../';
import { Box } from '../base/Box';
import { InputAdornment, TextField } from '../base/Input';

interface SearchBarProps {
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/custom/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type TooltipProps as MuiTooltipProps } from '@mui/material';
import React, { type FC, type MouseEvent, type ReactElement } from 'react';
import { Tooltip } from '../tooltip';
import { Tooltip } from '../base/Tooltip';

type TooltipProps = {
title: string;
Expand Down
Loading

0 comments on commit a64be50

Please sign in to comment.