Skip to content

Commit ca07f9f

Browse files
modified the Text components and lab exports (#74)
* modified the Text components and lab exports * modified library imports and added them in rollup config Signed-off-by: arkajyotiMukherjee <arkajyoti.mukherjee@mayadata.io>
1 parent 96875cc commit ca07f9f

File tree

15 files changed

+73
-43
lines changed

15 files changed

+73
-43
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "kubera-ui",
33
"license": "Apache-2.0",
4-
"version": "0.2.7",
4+
"version": "0.2.8",
55
"private": false,
66
"description": "Component Library for Kubera products",
77
"author": "MayaData, Inc.",

rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const globals = {
88
react: 'React',
99
'react-dom': 'ReactDOM',
1010
'@material-ui/core': 'MaterialUI',
11+
'@material-ui/lab': 'MaterialUILab',
12+
'@visx/visx': 'Visx',
1113
};
1214

1315
export default {
@@ -28,7 +30,7 @@ export default {
2830
format: 'es',
2931
globals,
3032
sourcemap: true,
31-
}
33+
},
3234
],
3335
plugins: [
3436
commonjs(),

src/core/Text/Header/Header.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ interface HeaderProps extends TypographyBaseProps {
88
color?: string;
99
}
1010

11-
const Header: React.FC<HeaderProps> = ({ color, variant, children }) => {
11+
const Header: React.FC<HeaderProps> = ({
12+
color,
13+
variant,
14+
children,
15+
...rest
16+
}) => {
1217
const classes = useStyles({ color });
1318

1419
function getVariant(variant: Variant): string {
@@ -23,7 +28,7 @@ const Header: React.FC<HeaderProps> = ({ color, variant, children }) => {
2328
}
2429

2530
return (
26-
<Typography className={`${classes.root} ${getVariant(variant)}`}>
31+
<Typography className={`${classes.root} ${getVariant(variant)}`} {...rest}>
2732
{children}
2833
</Typography>
2934
);

src/core/Text/Header/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface StyleProps {
66

77
const useStyles = makeStyles((theme: Theme) => ({
88
root: {
9-
fontSize: '2.25rem',
9+
fontSize: '3rem',
1010
color: (props: StyleProps) =>
1111
props ? props.color : theme.palette.text.primary,
1212
},
@@ -17,7 +17,7 @@ const useStyles = makeStyles((theme: Theme) => ({
1717
fontWeight: 'bold',
1818
},
1919
small: {
20-
fontSize: '1.5rem',
20+
fontSize: '2rem',
2121
},
2222
}));
2323

src/core/Text/Paragraph/Paragraph.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ interface ParagraphProps extends TypographyBaseProps {
88
color?: string;
99
}
1010

11-
const Paragraph: React.FC<ParagraphProps> = ({ color, variant, children }) => {
11+
const Paragraph: React.FC<ParagraphProps> = ({
12+
color,
13+
variant,
14+
children,
15+
...rest
16+
}) => {
1217
const classes = useStyles({ color });
1318

1419
function getVarinat(variant: Variant): string {
@@ -23,7 +28,7 @@ const Paragraph: React.FC<ParagraphProps> = ({ color, variant, children }) => {
2328
}
2429

2530
return (
26-
<Typography className={`${classes.root} ${getVarinat(variant)}`}>
31+
<Typography className={`${classes.root} ${getVarinat(variant)}`} {...rest}>
2732
{children}
2833
</Typography>
2934
);

src/core/Text/Paragraph/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface StyleProps {
66

77
const useStyles = makeStyles((theme: Theme) => ({
88
root: {
9-
fontSize: '1rem',
9+
fontSize: '1.33rem',
1010
color: (props: StyleProps) =>
1111
props ? props.color : theme.palette.text.primary,
1212
},
@@ -17,7 +17,7 @@ const useStyles = makeStyles((theme: Theme) => ({
1717
fontWeight: 'bold',
1818
},
1919
small: {
20-
fontSize: '0.75rem',
20+
fontSize: '1rem',
2121
fontWeight: 'normal',
2222
},
2323
}));

src/core/Text/Subtitle/Subtitle.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ interface SubtitleProps extends TypographyBaseProps {
88
color?: string;
99
}
1010

11-
const Subtitle: React.FC<SubtitleProps> = ({ color, variant, children }) => {
11+
const Subtitle: React.FC<SubtitleProps> = ({
12+
color,
13+
variant,
14+
children,
15+
...rest
16+
}) => {
1217
const classes = useStyles({ color });
1318

1419
function getVariant(variant: Variant): string {
@@ -23,7 +28,7 @@ const Subtitle: React.FC<SubtitleProps> = ({ color, variant, children }) => {
2328
}
2429

2530
return (
26-
<Typography className={`${classes.root} ${getVariant(variant)}`}>
31+
<Typography className={`${classes.root} ${getVariant(variant)}`} {...rest}>
2732
{children}
2833
</Typography>
2934
);

src/core/Text/Subtitle/styles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ interface StyleProps {
66

77
const useStyles = makeStyles((theme: Theme) => ({
88
root: {
9-
fontSize: '1rem',
9+
fontSize: '1.33rem',
1010
color: (props: StyleProps) =>
11-
props ? props.color : theme.palette.text.primary,
11+
props ? props.color : theme.palette.text.hint,
1212
},
1313
primary: {
1414
fontWeight: 'normal',
@@ -17,7 +17,7 @@ const useStyles = makeStyles((theme: Theme) => ({
1717
fontWeight: 'bold',
1818
},
1919
small: {
20-
fontSize: '0.75rem',
20+
fontSize: '1rem',
2121
fontWeight: 'normal',
2222
},
2323
}));

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './core';
2+
export * from './lab';
23
export * from './theme';

src/lab/Graphs/LineAreaGraph/LegendTable.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import {
2+
Table,
3+
TableBody,
4+
TableCell,
5+
TableContainer,
6+
TableHead,
7+
TableRow,
8+
Typography,
9+
} from '@material-ui/core';
110
import React from 'react';
2-
import Table from '@material-ui/core/Table';
3-
import TableBody from '@material-ui/core/TableBody';
4-
import TableCell from '@material-ui/core/TableCell';
5-
import TableContainer from '@material-ui/core/TableContainer';
6-
import TableHead from '@material-ui/core/TableHead';
7-
import TableRow from '@material-ui/core/TableRow';
811
import { LegendData } from './base';
912
import { useStyles } from './styles';
10-
import Typography from '@material-ui/core/Typography';
1113
const colorCount = 10;
1214
const colorArr: string[] = ['#08BBD7', '#F6B92B', '#E73939', '#AD51C3', '#FFF'];
1315
export type LegendProps = {

src/lab/Graphs/LineAreaGraph/LineAreaGraph.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import { Brush } from '@visx/brush';
21
import { Bounds } from '@visx/brush/lib/types';
3-
import { localPoint } from '@visx/event';
4-
import { scaleLinear, scaleTime } from '@visx/scale';
5-
import { Line } from '@visx/shape';
6-
import { defaultStyles, Tooltip, useTooltip } from '@visx/tooltip';
2+
import {
3+
Brush,
4+
defaultStyles,
5+
Line,
6+
localPoint,
7+
scaleLinear,
8+
scaleTime,
9+
Tooltip,
10+
useTooltip,
11+
} from '@visx/visx';
712
import { bisector, extent, max } from 'd3-array';
813
import React, { useCallback, useMemo, useState } from 'react';
9-
import { PlotLineAreaGraph } from './PlotLineAreaGraph';
10-
import { LegendTable } from './LegendTable';
1114
import { AreaGrapher, DataValue, LegendData } from './base';
15+
import { LegendTable } from './LegendTable';
16+
import { PlotLineAreaGraph } from './PlotLineAreaGraph';
1217
import { useStyles } from './styles';
1318
type TooltipData = Array<AreaGrapher>;
1419
// Initialize some variables

src/lab/Graphs/LineAreaGraph/PlotLineAreaGraph.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
import { AxisBottom, AxisLeft, AxisRight, AxisScale } from '@visx/axis';
2-
import { curveMonotoneX } from '@visx/curve';
3-
import { LinearGradient } from '@visx/gradient';
4-
import { GridColumns, GridRows } from '@visx/grid';
5-
import { Group } from '@visx/group';
6-
import { MarkerCircle } from '@visx/marker';
7-
import { AreaClosed, LinePath } from '@visx/shape';
1+
import {
2+
AreaClosed,
3+
AxisBottom,
4+
AxisLeft,
5+
AxisRight,
6+
AxisScale,
7+
curveMonotoneX,
8+
GridColumns,
9+
GridRows,
10+
Group,
11+
LinearGradient,
12+
LinePath,
13+
MarkerCircle,
14+
} from '@visx/visx';
815
import React from 'react';
916
import { AreaGrapher, DataValue } from './base';
1017
import { useStyles } from './styles';

src/lab/Graphs/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './LineAreaGraph';

src/lab/Tabs/Tabs.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import AppBar from '@material-ui/core/AppBar';
2-
import Tab from '@material-ui/core/Tab';
3-
import TabContext from '@material-ui/lab/TabContext';
4-
import TabList from '@material-ui/lab/TabList';
5-
import TabPanel from '@material-ui/lab/TabPanel';
1+
import { AppBar, Tab } from '@material-ui/core';
2+
import { TabContext, TabList, TabPanel } from '@material-ui/lab';
63
import React from 'react';
74
import { TabBaseProps } from './base';
85
import { useStyles } from './styles';

src/lab/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './Graphs/LineAreaGraph';
2-
export * from './Tabs/Tabs';
1+
export * from './Graphs';
2+
export * from './Tabs';

0 commit comments

Comments
 (0)