diff --git a/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap b/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap index 673366fc13d6..80ad427dd64c 100644 --- a/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap +++ b/airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap @@ -676,6 +676,7 @@ exports[`CreateConnectionForm should render 1`] = ` class="" > { +interface LabeledSwitchProps extends Omit, "size"> { message?: React.ReactNode; label?: React.ReactNode; checkbox?: boolean; diff --git a/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx b/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx index 4cbf1ad836d2..4bbbe17f7774 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/BulkHeader.tsx @@ -82,7 +82,7 @@ export const BulkHeader: React.FC = () => { - onChangeOption({ selected: !options.selected })} /> + onChangeOption({ selected: !options.selected })} /> diff --git a/airbyte-webapp/src/components/connection/CatalogTree/FieldRow.tsx b/airbyte-webapp/src/components/connection/CatalogTree/FieldRow.tsx index f2ec7d64fceb..544d08d7a0bd 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/FieldRow.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/FieldRow.tsx @@ -61,10 +61,10 @@ const FieldRowInner: React.FC = ({ {!isNestedField && ( - onToggleFieldSelected(field.path, !isSelected)} /> + onToggleFieldSelected(field.path, !isSelected)} /> )} {isNestedField && ( - }> + }> )} diff --git a/airbyte-webapp/src/components/connection/CatalogTree/StreamHeader.tsx b/airbyte-webapp/src/components/connection/CatalogTree/StreamHeader.tsx index 9a1690c118b2..ea1f29071cbe 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/StreamHeader.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/StreamHeader.tsx @@ -118,7 +118,7 @@ export const StreamHeader: React.FC = ({
{

- onChangeOption({ selected: !options.selected })} /> + onChangeOption({ selected: !options.selected })} + />
diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRow.tsx b/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRow.tsx index 995101b985ca..4a90a2809839 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRow.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRow.tsx @@ -65,7 +65,7 @@ export const CatalogTreeTableRow: React.FC = ({
)} - + {/* {fieldCount} */} diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/StreamDetailsPanel/StreamPanelHeader/StreamPanelHeader.tsx b/airbyte-webapp/src/components/connection/CatalogTree/next/StreamDetailsPanel/StreamPanelHeader/StreamPanelHeader.tsx index 15ac2571deb1..82f67856d27c 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/StreamDetailsPanel/StreamPanelHeader/StreamPanelHeader.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/StreamDetailsPanel/StreamPanelHeader/StreamPanelHeader.tsx @@ -51,7 +51,7 @@ export const StreamPanelHeader: React.FC = ({ return (
- +
should render 1`] = ` class="" > = (args) => ; export const SwitchControl = Template.bind({}); SwitchControl.args = { checked: false, - small: false, + size: "sm", loading: false, }; diff --git a/airbyte-webapp/src/components/ui/Switch/Switch.tsx b/airbyte-webapp/src/components/ui/Switch/Switch.tsx index 3c27f54c5db9..77bc118e1528 100644 --- a/airbyte-webapp/src/components/ui/Switch/Switch.tsx +++ b/airbyte-webapp/src/components/ui/Switch/Switch.tsx @@ -3,18 +3,40 @@ import React from "react"; import styles from "./Switch.module.scss"; -interface SwitchProps extends React.InputHTMLAttributes { - small?: boolean; +type SwitchSize = "lg" | "sm" | "xs"; + +type SwitchVariant = "default" | "strong-blue"; + +interface SwitchProps extends Omit, "size"> { + indeterminate?: boolean; loading?: boolean; + size?: SwitchSize; + variant?: SwitchVariant; } -export const Switch: React.FC = ({ loading, small, checked, value, ...props }) => { +export const Switch: React.FC = ({ + checked, + disabled, + indeterminate, + loading, + size = "lg", + value, + variant = "default", + ...props +}) => { const labelStyle = classnames(styles.switch, { - [styles.small]: small, + [styles.sizeLg]: size === "lg", + [styles.sizeSm]: size === "sm", + [styles.sizeXs]: size === "xs", [styles.loading]: loading, }); const spanStyle = classnames(styles.slider, { - [styles.small]: small, + [styles.sizeLg]: size === "lg", + [styles.sizeSm]: size === "sm", + [styles.sizeXs]: size === "xs", + [styles.variantDefault]: variant === "default", + [styles.variantStrongBlue]: variant === "strong-blue", + [styles.indeterminate]: indeterminate, [styles.loading]: loading, }); @@ -22,10 +44,11 @@ export const Switch: React.FC = ({ loading, small, checked, value,