Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const { resolve } = require('node:path');

const project = resolve(process.cwd(), 'tsconfig.json');

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ['eslint:recommended', 'prettier', 'eslint-config-turbo'],
plugins: ['only-warn'],
globals: {
React: true,
JSX: true,
},
env: {
node: true,
},
settings: {
'import/resolver': {
typescript: {
project,
},
},
},
ignorePatterns: [
'.*.js',
'node_modules/',
'dist/',
],
overrides: [
{
files: ['*.js?(x)', '*.ts?(x)'],
},
],
};
6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pnpm-lock.yaml
.vscode
pnpm-workspace.yaml
*.js
.prettierrc
tailwind.config.ts
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"semi": true,
"trailingComma": "all"
}
22 changes: 11 additions & 11 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import type { StorybookConfig } from "@storybook/nextjs";
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: [
"../stories/**/*.mdx",
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
'../stories/**/*.mdx',
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
{
name: "@storybook/addon-styling",
name: '@storybook/addon-styling',
options: {
postCss: {
implementation: require.resolve("postcss"),
implementation: require.resolve('postcss'),
},
},
},
],
framework: {
name: "@storybook/nextjs",
name: '@storybook/nextjs',
options: {},
},
docs: {
autodocs: "tag",
autodocs: 'tag',
},
};
export default config;
16 changes: 8 additions & 8 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Preview } from "@storybook/react";
import type { Preview } from '@storybook/react';

import { withThemeByClassName } from "@storybook/addon-styling";
import { withThemeByClassName } from '@storybook/addon-styling';

import "../theme/index.css";
import "../index";
import '../theme/index.css';
import '../index';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
Expand All @@ -21,10 +21,10 @@ const preview: Preview = {
// NOTE: requires setting "darkMode" to "class" in your tailwind config
withThemeByClassName({
themes: {
light: "light",
dark: "dark",
light: 'light',
dark: 'dark',
},
defaultTheme: "light",
defaultTheme: 'light',
}),
],
};
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"conventionalCommits.scopes": ["library", "configuration"]
"conventionalCommits.scopes": ["library", "configuration"],
"editor.formatOnSave": true,
}
16 changes: 8 additions & 8 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import React from 'react'
const inter = Inter({ subsets: ['latin'] })
import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import React from 'react';
const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
};

export default function RootLayout({
children,
}: {
children: React.ReactNode
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
);
}
6 changes: 3 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image from 'next/image'
import React from 'react'
import Image from 'next/image';
import React from 'react';

export default function Home() {
return (
Expand Down Expand Up @@ -110,5 +110,5 @@ export default function Home() {
</a>
</div>
</main>
)
);
}
28 changes: 15 additions & 13 deletions components/accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ import AccordionSummary from '@mui/material/AccordionSummary';
import Typography from '@mui/material/Typography';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

interface IAcordeonChildren {
interface AccordionChildren {
title: string;
subtitle: string;
content: string | React.ReactNode;
}

interface IAcordeonProps {
elements: IAcordeonChildren[];
interface AccordionProps {
elements: AccordionChildren[];
}


export const Accordion = ({ elements }: IAcordeonProps) => {
export const Accordion = ({ elements }: AccordionProps) => {
const [expanded, setExpanded] = React.useState<string | false>(false);

const handleChange =
Expand All @@ -26,8 +25,12 @@ export const Accordion = ({ elements }: IAcordeonProps) => {

return (
<div>
{(elements || []).map((child: IAcordeonChildren, index: number) => (
<MUIAccordion key={index} expanded={expanded === 'panel' + index} onChange={handleChange('panel' + index)}>
{(elements || []).map((child: AccordionChildren, index: number) => (
<MUIAccordion
key={index}
expanded={expanded === 'panel' + index}
onChange={handleChange('panel' + index)}
>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1bh-content"
Expand All @@ -36,20 +39,19 @@ export const Accordion = ({ elements }: IAcordeonProps) => {
<Typography sx={{ width: '33%', flexShrink: 0 }}>
{child?.title}
</Typography>
<Typography sx={{ color: 'text.secondary' }}>{child?.subtitle}</Typography>
<Typography sx={{ color: 'text.secondary' }}>
{child?.subtitle}
</Typography>
</AccordionSummary>
<AccordionDetails>
{typeof child.content === 'string' ? (
<Typography>
{child.content}
</Typography>
<Typography>{child.content}</Typography>
) : (
child.content
)}

</AccordionDetails>
</MUIAccordion>
))}
</div>
);
}
};
9 changes: 4 additions & 5 deletions components/alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as React from 'react';
import MUIAlert from '@mui/material/Alert';
import { AlertTitle } from '@mui/material';

export interface IProps {
severity?: 'info' | 'success' | 'warning' | 'error'
export interface AlertProps {
severity?: 'info' | 'success' | 'warning' | 'error';
variant?: 'filled' | 'outlined' | 'standard';
text: string;
title?: string;
Expand All @@ -14,12 +14,11 @@ export const Alert = ({
variant = 'filled',
text,
title,
}: IProps) => {

}: AlertProps) => {
return (
<MUIAlert variant={variant} severity={severity}>
{title && <AlertTitle>{title}</AlertTitle>}
{text}
</MUIAlert>
);
}
};
12 changes: 6 additions & 6 deletions components/badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import * as React from 'react';
import Chip from '@mui/material/Chip';
import Stack from '@mui/material/Stack';

export interface IBadgeProps {
color?: 'info' | 'success' | 'warning' | 'error' | 'primary'
export interface BadgeProps {
color?: 'info' | 'success' | 'warning' | 'error' | 'primary';
variant?: 'outlined' | 'filled';
size?: 'small' | 'medium'
size?: 'small' | 'medium';
label: string;
}

export const Badge = ({
color = 'info',
variant = 'outlined',
size = 'medium',
label
}: IBadgeProps) => {
label,
}: BadgeProps) => {
return (
<Stack direction="row" spacing={1}>
<Chip label={label} variant={variant} size={size} color={color} />
</Stack>
);
}
};
50 changes: 24 additions & 26 deletions components/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import React from 'react';
import MUIButton from '@mui/material/Button';

export interface IButtonProps {
export interface ButtonProps {
disabled?: boolean;
submit?: boolean;
onClick?: () => void;
Expand All @@ -11,13 +11,13 @@ export interface IButtonProps {
endIcon?: any;
size?: 'small' | 'medium' | 'large' | undefined;
color?:
| 'inherit'
| 'primary'
| 'secondary'
| 'success'
| 'error'
| 'info'
| 'warning';
| 'inherit'
| 'primary'
| 'secondary'
| 'success'
| 'error'
| 'info'
| 'warning';
variant?: 'text' | 'outlined' | 'contained';
}

Expand All @@ -32,20 +32,18 @@ export const Button = ({
startIcon = null,
endIcon = null,
color,
}: IButtonProps) => {
return (
<MUIButton
size={size}
variant={variant}
disabled={disabled}
type={submit ? 'submit' : 'button'}
onClick={onClick}
color={color ? color : 'primary'}
fullWidth={notFullWidth ? false : true}
startIcon={startIcon}
endIcon={endIcon}
>
{children}
</MUIButton>
);
};
}: ButtonProps) => (
<MUIButton
size={size}
variant={variant}
disabled={disabled}
type={submit ? 'submit' : 'button'}
onClick={onClick}
color={color ? color : 'primary'}
fullWidth={notFullWidth ? false : true}
startIcon={startIcon}
endIcon={endIcon}
>
{children}
</MUIButton>
);
Loading