Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update summary and export ui (#428) #435

Merged
merged 1 commit into from
Oct 26, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import styled from "@emotion/styled";
import {
mediaTabletDown,
mediaTabletUp,
} from "../../../../../../styles/common/mixins/breakpoints";
import { Dot as DXDot } from "../../../../../common/Dot/dot";

export const Summary = styled.div`
display: flex;
flex: 1;
flex-direction: column;
gap: 4px;

.MuiTypography-text-body-small-400 {
-webkit-box-orient: vertical;
display: -webkit-box;
-webkit-line-clamp: 1;
overflow: hidden;
}

${mediaTabletUp} {
flex: none;
flex-direction: row;
}
`;

export const Dot = styled(DXDot)`
${mediaTabletDown} {
display: none;
}
`;
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Typography } from "@mui/material";
import React, { Fragment } from "react";
import { Dot } from "../../../../../common/Dot/dot";
import { Stack } from "../../../../../common/Stack/stack";
import React, { Fragment, ReactNode } from "react";
import {
TEXT_BODY_SMALL_400,
TEXT_BODY_SMALL_500,
} from "../../../../../../theme/common/typography";
import { Dot, Summary } from "./summaries.styles";

export interface Summary {
count: string;
label: string;
label: ReactNode;
}

export interface SummariesProps {
Expand All @@ -19,12 +22,12 @@ export const Summaries = ({ summaries }: SummariesProps): JSX.Element => {
summaries.map(({ count, label }, c) => (
<Fragment key={`${label}${c}`}>
{c !== 0 && <Dot />}
<Stack direction="row" gap={1}>
<Typography variant="text-body-small-500">{count}</Typography>
<Typography color="ink.light" variant="text-body-small-400">
<Summary>
<Typography variant={TEXT_BODY_SMALL_500}>{count}</Typography>
<Typography color="ink.light" variant={TEXT_BODY_SMALL_400}>
{label}
</Typography>
</Stack>
</Summary>
</Fragment>
))}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import styled from "@emotion/styled";
import { mediaDesktopSmallUp } from "../../../../styles/common/mixins/breakpoints";
import {
mediaDesktopSmallUp,
mediaTabletUp,
} from "../../../../styles/common/mixins/breakpoints";
import { ButtonPrimary } from "../../../common/Button/components/ButtonPrimary/buttonPrimary";

interface Props {
Expand All @@ -9,35 +12,56 @@ interface Props {
export const HeroLayout = styled.div`
align-items: center;
display: grid;
grid-template-columns: 1fr auto;
gap: 16px;
grid-template-columns: 1fr;
padding: 0 16px;

${mediaTabletUp} {
grid-template-columns: 1fr auto;
padding: 0;
}
`;

export const Widgets = styled.div`
align-items: center;
display: flex;
height: 40px;
justify-self: flex-start;
height: 60px;

${mediaTabletUp} {
height: 40px;
justify-self: flex-start;
}

${mediaDesktopSmallUp} {
grid-column: 2;
justify-self: flex-end;
}
`;

export const SummaryWidget = styled.div<Props>`
align-items: center;
border: 1px solid ${({ theme }) => theme.palette.smoke.main};
border-radius: ${({ buttonWidget }) =>
buttonWidget ? "4px 0 0 4px" : "4px"};
display: grid;
border-radius: 4px;
display: flex;
gap: 0 8px;
grid-auto-flow: column;
flex: 1;
height: inherit;
padding: 0 16px;
padding: 12px 16px;

${mediaTabletUp} {
border-radius: ${({ buttonWidget }) =>
buttonWidget ? "4px 0 0 4px" : "4px"};
flex: none;
}
`;

export const ExportButton = styled(ButtonPrimary)`
border-bottom-left-radius: 0;
border-top-left-radius: 0;
display: none;
margin-left: -1px;

${mediaTabletUp} {
display: block;
}
`;
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import styled from "@emotion/styled";
import { mediaTabletUp } from "../../styles/common/mixins/breakpoints";

export const Index = styled.div`
display: grid;
flex: 1;
gap: 16px;
padding: 24px;
padding: 24px 0;

${mediaTabletUp} {
padding: 24px;
}
`;
7 changes: 3 additions & 4 deletions packages/data-explorer-ui/src/components/Table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { ListViewConfig } from "../../config/entities";
import { useExploreState } from "../../hooks/useExploreState";
import { useScroll } from "../../hooks/useScroll";
import { EntityView, ExploreActionKind } from "../../providers/exploreState";
import { GridPaper, RoundedPaper } from "../common/Paper/paper.styles";
import { FluidPaper, GridPaper } from "../common/Paper/paper.styles";
import { NoResults } from "../NoResults/noResults";
import {
buildCategoryViews,
Expand Down Expand Up @@ -315,7 +315,7 @@ TableProps<T>): JSX.Element => {
return noResults ? (
<NoResults title={"No Results found"} />
) : (
<RoundedPaper>
<FluidPaper>
<GridPaper>
{editColumnOptions && (
<TableToolbar>
Expand Down Expand Up @@ -427,10 +427,9 @@ TableProps<T>): JSX.Element => {
/>
)}
</GridPaper>
</RoundedPaper>
</FluidPaper>
);
};

// TODO(Dave) review whether memo is necessary - flash between tabs / loading state.
export const Table = React.memo(TableComponent) as typeof TableComponent;
//export const Table = TableComponent as typeof TableComponent;
8 changes: 6 additions & 2 deletions packages/data-explorer-ui/src/components/common/Dot/dot.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from "react";
import { DotSeparator } from "./dot.styles";

export const Dot = (): JSX.Element => {
return <DotSeparator />;
export interface DotProps {
className?: string;
}

export const Dot = ({ className }: DotProps): JSX.Element => {
return <DotSeparator className={className} />;
};
Loading