-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃獰 馃帹 馃弫 Headers + Breadcrumbs (#6185)
- Loading branch information
1 parent
fa33d22
commit d424dc4
Showing
35 changed files
with
663 additions
and
196 deletions.
There are no files selected for viewing
11 changes: 1 addition & 10 deletions
11
airbyte-webapp/src/components/ConnectorBlocks/TableItemTitle.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
airbyte-webapp/src/components/connector/ConnectorTitleBlock.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.icon { | ||
width: 50px; | ||
height: 50px; | ||
} |
37 changes: 37 additions & 0 deletions
37
airbyte-webapp/src/components/connector/ConnectorTitleBlock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ConnectorIcon } from "components/common/ConnectorIcon"; | ||
import { ReleaseStageBadge } from "components/ReleaseStageBadge"; | ||
import { FlexContainer } from "components/ui/Flex"; | ||
import { Heading } from "components/ui/Heading"; | ||
import { Text } from "components/ui/Text"; | ||
|
||
import { ConnectorDefinition } from "core/domain/connector"; | ||
import { DestinationRead, SourceRead } from "core/request/AirbyteClient"; | ||
|
||
import styles from "./ConnectorTitleBlock.module.scss"; | ||
|
||
type Connector = SourceRead | DestinationRead; | ||
|
||
interface ConnectorTitleBlockProps<T extends Connector> { | ||
connector: T; | ||
connectorDefinition: ConnectorDefinition; | ||
} | ||
|
||
export const ConnectorTitleBlock = <T extends Connector>({ | ||
connector, | ||
connectorDefinition, | ||
}: ConnectorTitleBlockProps<T>) => { | ||
return ( | ||
<FlexContainer alignItems="center"> | ||
<ConnectorIcon icon={connector.icon} className={styles.icon} /> | ||
<FlexContainer direction="column" gap="sm"> | ||
<Heading as="h1" size="md"> | ||
{connector.name} | ||
</Heading> | ||
<FlexContainer alignItems="center"> | ||
<Text color="grey">{connectorDefinition.name}</Text> | ||
<ReleaseStageBadge stage={connectorDefinition.releaseStage} /> | ||
</FlexContainer> | ||
</FlexContainer> | ||
</FlexContainer> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
airbyte-webapp/src/components/ui/Breadcrumbs/NextBreadcrumbs.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.link { | ||
text-decoration: none; | ||
} |
33 changes: 33 additions & 0 deletions
33
airbyte-webapp/src/components/ui/Breadcrumbs/NextBreadcrumbs.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Meta, StoryFn } from "@storybook/react"; | ||
|
||
import { BreadcrumbsDataItem } from "./Breadcrumbs"; | ||
import { NextBreadcrumbs } from "./NextBreadcrumbs"; | ||
|
||
export default { | ||
title: "UI/NextBreadcrumbs", | ||
component: NextBreadcrumbs, | ||
argTypes: {}, | ||
} as Meta<typeof NextBreadcrumbs>; | ||
|
||
const Template: StoryFn<typeof NextBreadcrumbs> = (args) => { | ||
return <NextBreadcrumbs data={args.data} />; | ||
}; | ||
|
||
const data: BreadcrumbsDataItem[] = [ | ||
{ | ||
label: "Workspace", | ||
to: "/workspace", | ||
}, | ||
{ | ||
label: "Source", | ||
to: "/workspace/source", | ||
}, | ||
{ | ||
label: "Settings", | ||
}, | ||
]; | ||
|
||
export const Primary = Template.bind({}); | ||
Primary.args = { | ||
data, | ||
}; |
42 changes: 42 additions & 0 deletions
42
airbyte-webapp/src/components/ui/Breadcrumbs/NextBreadcrumbs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { Fragment } from "react"; | ||
|
||
import styles from "./NextBreadcrumbs.module.scss"; | ||
import { FlexContainer, FlexItem } from "../Flex"; | ||
import { Link } from "../Link"; | ||
import { Text } from "../Text"; | ||
|
||
export interface NavigationDataItem { | ||
label: string; | ||
to?: string; | ||
} | ||
|
||
export interface NextBreadcrumbsProps { | ||
data: NavigationDataItem[]; | ||
} | ||
|
||
export const NextBreadcrumbs: React.FC<NextBreadcrumbsProps> = ({ data }) => { | ||
return ( | ||
<> | ||
{data.length && ( | ||
<FlexContainer className={styles.container}> | ||
{data.map((item, index) => ( | ||
<Fragment key={item.label}> | ||
<FlexItem> | ||
{item.to ? ( | ||
<Link to={item.to} className={styles.link}> | ||
<Text size="sm" color={index === data.length - 1 ? "darkBlue" : "grey"}> | ||
{item.label} | ||
</Text> | ||
</Link> | ||
) : ( | ||
<Text size="sm">{item.label}</Text> | ||
)} | ||
</FlexItem> | ||
{index !== data.length - 1 && <Text size="sm"> / </Text>} | ||
</Fragment> | ||
))} | ||
</FlexContainer> | ||
)} | ||
</> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
airbyte-webapp/src/components/ui/PageHeader/NextPageHeader.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@use "scss/z-indices"; | ||
@use "scss/variables"; | ||
|
||
.container { | ||
z-index: z-indices.$pageHeader; | ||
padding: variables.$spacing-xl variables.$spacing-xl 0; | ||
} |
22 changes: 22 additions & 0 deletions
22
airbyte-webapp/src/components/ui/PageHeader/NextPageHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
|
||
import styles from "./NextPageHeader.module.scss"; | ||
import { FlexContainer } from "../Flex"; | ||
|
||
interface PageHeaderProps { | ||
leftComponent: string | React.ReactNode; | ||
endComponent?: React.ReactNode; | ||
} | ||
// todo: things aren't lined up right when there is scrollbar in the area below the header (because the header isn't in the scrollable div) | ||
export const NextPageHeader: React.FC<PageHeaderProps> = ({ leftComponent, endComponent }) => ( | ||
<FlexContainer | ||
className={classNames(styles.container)} | ||
alignItems="center" | ||
justifyContent="space-between" | ||
data-testid="page-header-container" | ||
> | ||
{leftComponent} | ||
{endComponent} | ||
</FlexContainer> | ||
); |
10 changes: 10 additions & 0 deletions
10
airbyte-webapp/src/components/ui/PageHeader/NextPageHeaderWithNavigation.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
.container { | ||
background-color: colors.$white; | ||
} | ||
|
||
.section { | ||
border-bottom: variables.$border-thin solid colors.$grey-100; | ||
} |
26 changes: 26 additions & 0 deletions
26
airbyte-webapp/src/components/ui/PageHeader/NextPageHeaderWithNavigation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styles from "./NextPageHeaderWithNavigation.module.scss"; | ||
import { Box } from "../Box"; | ||
import { NavigationDataItem, NextBreadcrumbs } from "../Breadcrumbs/NextBreadcrumbs"; | ||
import { FlexContainer } from "../Flex"; | ||
|
||
interface NextPageHeaderWithNavigationProps { | ||
breadCrumbsData: NavigationDataItem[]; | ||
} | ||
|
||
export const NextPageHeaderWithNavigation: React.FC<React.PropsWithChildren<NextPageHeaderWithNavigationProps>> = ({ | ||
breadCrumbsData, | ||
children, | ||
}) => { | ||
return ( | ||
<FlexContainer direction="column" gap="none" className={styles.container}> | ||
<Box py="lg" px="xl" className={styles.section}> | ||
<NextBreadcrumbs data={breadCrumbsData} /> | ||
</Box> | ||
<Box pt="lg" px="xl" className={styles.section}> | ||
<FlexContainer direction="column" gap="lg"> | ||
{children} | ||
</FlexContainer> | ||
</Box> | ||
</FlexContainer> | ||
); | ||
}; |
Oops, something went wrong.