-
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.
* genericize alert component * add className prop to alert * rename infobox "callout", swap in place for scss module * fix imports * use callout in place of alert * add blue variant, remove icon prop * remove font-size (this is already the default) * remove single use prop, use a classname instead * use semantic names, remove empty line * cleanup from rebase
- Loading branch information
1 parent
fd9fe9a
commit fbb317d
Showing
17 changed files
with
117 additions
and
91 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
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
22 changes: 22 additions & 0 deletions
22
airbyte-webapp/src/components/ui/Callout/Callout.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,22 @@ | ||
@use "scss/colors"; | ||
@use "scss/variables"; | ||
|
||
.container { | ||
border-radius: variables.$border-radius-md; | ||
padding: variables.$spacing-lg variables.$spacing-xl; | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
} | ||
|
||
.default { | ||
background-color: colors.$yellow-100; | ||
} | ||
|
||
.error { | ||
background-color: colors.$red-50; | ||
} | ||
|
||
.info { | ||
background-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,22 @@ | ||
import classNames from "classnames"; | ||
|
||
import styles from "./Callout.module.scss"; | ||
|
||
interface CalloutProps { | ||
className?: string; | ||
variant?: "default" | "error" | "info"; | ||
} | ||
|
||
export const Callout: React.FC<React.PropsWithChildren<CalloutProps>> = ({ | ||
children, | ||
className, | ||
variant = "default", | ||
}) => { | ||
const containerStyles = classNames(styles.container, className, { | ||
[styles.default]: variant === "default", | ||
[styles.error]: variant === "error", | ||
[styles.info]: variant === "info", | ||
}); | ||
|
||
return <div className={containerStyles}>{children}</div>; | ||
}; |
25 changes: 25 additions & 0 deletions
25
airbyte-webapp/src/components/ui/Callout/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,25 @@ | ||
import { faEnvelope } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
|
||
import { Text } from "../Text"; | ||
import { Callout } from "./Callout"; | ||
|
||
export default { | ||
title: "UI/Callout", | ||
component: Callout, | ||
argTypes: { | ||
children: { type: "string", required: true }, | ||
}, | ||
} as ComponentMeta<typeof Callout>; | ||
|
||
const Template: ComponentStory<typeof Callout> = (args) => <Callout {...args} />; | ||
export const Primary = Template.bind({}); | ||
Primary.args = { | ||
children: ( | ||
<> | ||
<FontAwesomeIcon icon={faEnvelope} size="lg" /> | ||
<Text>"Here is some info."</Text> | ||
</> | ||
), | ||
}; |
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 @@ | ||
export { Callout } from "./Callout"; |
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
airbyte-webapp/src/components/ui/InfoBox/index.stories.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
24 changes: 10 additions & 14 deletions
24
airbyte-webapp/src/views/Connector/ConnectorForm/components/WarningMessage.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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
@use "../../../../scss/colors"; | ||
@use "../../../../scss/variables" as vars; | ||
@use "scss/colors"; | ||
@use "scss/variables"; | ||
|
||
.container { | ||
padding: vars.$spacing-md vars.$spacing-lg; | ||
background: colors.$yellow-100; | ||
border-radius: vars.$border-radius-lg; | ||
white-space: break-spaces; | ||
margin-top: vars.$spacing-lg; | ||
} | ||
.calloutContainer { | ||
margin-top: variables.$spacing-lg; | ||
|
||
.link { | ||
color: colors.$dark-blue; | ||
.link { | ||
color: colors.$dark-blue; | ||
|
||
&:hover, | ||
&:focus { | ||
color: colors.$blue-400; | ||
&:hover, | ||
&:focus { | ||
color: colors.$blue-400; | ||
} | ||
} | ||
} |
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