-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🎨 Refining BulkEditPanel component (#20474)
* Adds handling for source defined and unavailable stream paths inside PillSelect * Adds handling of unavailable cursor and primary key field for PillButton components * Adds useMemo to SyncPathSelect component * Add InfoText component for cursor field and primary key to match table design in Figma * Removes animation for BulkEditPanel; Adds StreamPathSelect new property pillIfChangeUnavailable for cases when we need or not to render pill under unavailable to change path text * Disables pointer event while PillButton is disabled * Adds renderDisabledState property to control PillSelect content while disabled * Changes renderDisabledState -> disabledLabel
- Loading branch information
1 parent
8c35783
commit 94fcb13
Showing
12 changed files
with
158 additions
and
27 deletions.
There are no files selected for viewing
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
6 changes: 0 additions & 6 deletions
6
airbyte-webapp/src/components/connection/CatalogTree/next/StreamPathSelect.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
50 changes: 50 additions & 0 deletions
50
airbyte-webapp/src/components/ui/InfoText/InfoText.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,50 @@ | ||
@use "scss/colors"; | ||
@use "scss/variables"; | ||
|
||
.container { | ||
height: 19px; | ||
max-width: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding: 0; | ||
border: none; | ||
border-radius: variables.$border-radius-pill; | ||
cursor: pointer; | ||
|
||
&.grey { | ||
.text { | ||
color: colors.$grey-600; | ||
} | ||
} | ||
|
||
&.blue { | ||
.text { | ||
color: colors.$blue-600; | ||
} | ||
} | ||
|
||
&.green { | ||
.text { | ||
color: colors.$green-600; | ||
} | ||
} | ||
|
||
&.red { | ||
.text { | ||
color: colors.$red-600; | ||
} | ||
} | ||
|
||
&.lightGrey { | ||
.text { | ||
color: colors.$grey; | ||
} | ||
} | ||
|
||
&.lightBlue { | ||
.text { | ||
color: colors.$blue-50; | ||
} | ||
} | ||
} |
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,31 @@ | ||
import classNames from "classnames"; | ||
|
||
import { Text } from "../Text"; | ||
import styles from "./InfoText.module.scss"; | ||
|
||
export type InfoTextVariant = "grey" | "light-grey" | "red" | "green" | "blue" | "light-blue"; | ||
|
||
const STYLES_BY_VARIANT: Readonly<Record<InfoTextVariant, string>> = { | ||
grey: styles.grey, | ||
blue: styles.blue, | ||
green: styles.green, | ||
red: styles.red, | ||
"light-blue": styles.lightBlue, | ||
"light-grey": styles.lightGrey, | ||
}; | ||
|
||
interface InfoTextProps { | ||
variant?: InfoTextVariant; | ||
className?: string; | ||
} | ||
|
||
export const InfoText: React.FC<InfoTextProps> = ({ children, variant = "grey", className }) => { | ||
const containerClassName = classNames(styles.container, STYLES_BY_VARIANT[variant], className); | ||
return ( | ||
<div className={containerClassName}> | ||
<Text as="span" size="xs" className={styles.text}> | ||
{children} | ||
</Text> | ||
</div> | ||
); | ||
}; |
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,11 @@ | ||
import { PillButtonVariant } from "../PillSelect"; | ||
import { InfoTextVariant } from "./InfoText"; | ||
|
||
export const INFO_TEXT_VARIANT_BY_PILL_VARIANT: Record<PillButtonVariant, InfoTextVariant> = { | ||
blue: "blue", | ||
grey: "grey", | ||
red: "red", | ||
green: "green", | ||
"strong-red": "red", | ||
"strong-blue": "blue", | ||
}; |
20 changes: 20 additions & 0 deletions
20
airbyte-webapp/src/components/ui/InfoText/index.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,20 @@ | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
|
||
import { InfoText } from "./InfoText"; | ||
|
||
export default { | ||
title: "UI/InfoText", | ||
component: InfoText, | ||
} as ComponentMeta<typeof InfoText>; | ||
|
||
const Template: ComponentStory<typeof InfoText> = (args) => ( | ||
<div style={{ width: "300px" }}> | ||
<InfoText {...args} /> | ||
</div> | ||
); | ||
|
||
export const InfoTextDefault = Template.bind({}); | ||
InfoTextDefault.args = { | ||
variant: "grey", | ||
children: "test", | ||
}; |
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,2 @@ | ||
export { InfoText } from "./InfoText"; | ||
export * from "./constants"; |
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 |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
color: $text; | ||
} | ||
|
||
pointer-events: none; | ||
background-color: $background; | ||
} | ||
} | ||
|
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