Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

GDGT-2585 Replace deprecated Input component (#77559)

Egor Grushin7b3ed42a61d9
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png
index 9fc7ccbbf2f..3bc8a446152 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_Single_With_Value.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_Single_With_Value.png
index ad97ff14996..06c9e235fce 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_Single_With_Value.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_Single_With_Value.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_With_Value.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_With_Value.png
index 1ee014ca73e..daf275dfb52 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_With_Value.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_List_With_Value.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search.png
index 9fc7ccbbf2f..3bc8a446152 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search_With_Value.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search_With_Value.png
index d5ff841ff66..10e9b7e38a8 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search_With_Value.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Dark_Theme_Parameter_Search_With_Value.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png
index 992581f04c4..f119de22a96 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_Single_With_Value.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_Single_With_Value.png
index b25fda68419..446e7c4364e 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_Single_With_Value.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_Single_With_Value.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png
index 66afd06f8ee..92a2d13fed4 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_List_With_Value.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search.png
index 64c3b7cb399..56a11289cba 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search.png differ
diff --git a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search_With_Value.png b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search_With_Value.png
index 197d368801a..e17238260fa 100644
Binary files a/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search_With_Value.png and b/.loki/reference/chrome_laptop_App_Embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Parameter_Search_With_Value.png differ
diff --git a/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx b/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx
index 5195ea9fce7..cda345badf9 100644
--- a/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx
+++ b/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx
@@ -2,11 +2,10 @@ import { Fragment, useMemo, useState } from "react";
import { t } from "ttag";
import { EmptyState } from "metabase/common/components/EmptyState";
-import type { InputProps } from "metabase/common/components/Input";
-import { Input } from "metabase/common/components/Input";
import { Tree } from "metabase/common/components/tree";
import type { ITreeNodeItem } from "metabase/common/components/tree/types";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
+import { Icon, Input, TextInput, type TextInputProps } from "metabase/ui";
import { SEARCH_DEBOUNCE_DURATION } from "metabase/utils/constants";
import type { IconName } from "metabase-types/api";
@@ -51,20 +50,26 @@ export const FilterableTree = ({
return searchItems(itemGroups.flat(), trimmedFilter);
}, [itemGroups, debouncedFilter]);
- const handleFilterChange: InputProps["onChange"] = (e) =>
+ const handleFilterChange: TextInputProps["onChange"] = (e) =>
setFilter(e.target.value);
return (
<FilterableTreeRoot>
<FilterInputContainer>
- <Input
- fullWidth
+ <TextInput
placeholder={placeholder}
value={filter}
- leftIcon="search"
- colorScheme="core-filter"
+ leftSection={<Icon name="search" />}
+ rightSectionPointerEvents="all"
+ rightSection={
+ filter.length > 0 ? (
+ <Input.ClearButton
+ c="text-secondary"
+ onClick={() => setFilter("")}
+ />
+ ) : null
+ }
onChange={handleFilterChange}
- onResetClick={() => setFilter("")}
/>
</FilterInputContainer>
<FilterableTreeContainer>
diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorContent.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorContent.tsx
index 41ea189b4c7..7cafc460749 100644
--- a/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorContent.tsx
+++ b/frontend/src/metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorContent.tsx
@@ -2,10 +2,9 @@ import { useMemo, useState } from "react";
import { t } from "ttag";
import { EmptyState } from "metabase/common/components/EmptyState";
-import { Input } from "metabase/common/components/Input";
import { Subhead } from "metabase/common/components/type/Subhead";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
-import { Text } from "metabase/ui";
+import { Icon, Input, Text, TextInput } from "metabase/ui";
import { SEARCH_DEBOUNCE_DURATION } from "metabase/utils/constants";
import type {
@@ -87,13 +86,20 @@ export function PermissionsEditorContent({
<PostHeaderContent />
<EditorFilterContainer>
- <Input
- colorScheme="core-filter"
+ <TextInput
placeholder={filterPlaceholder}
onChange={handleFilterChange}
- onResetClick={() => setFilter("")}
value={filter}
- leftIcon="search"
+ leftSection={<Icon name="search" />}
+ rightSectionPointerEvents="all"
+ rightSection={
+ filter.length > 0 ? (
+ <Input.ClearButton
+ c="text-secondary"
+ onClick={() => setFilter("")}
+ />
+ ) : null
+ }
/>
</EditorFilterContainer>
diff --git a/frontend/src/metabase/admin/settings/components/LicenseInput/LicenseInput.tsx b/frontend/src/metabase/admin/settings/components/LicenseInput/LicenseInput.tsx
index 7265d3ba093..e662c31ee48 100644
--- a/frontend/src/metabase/admin/settings/components/LicenseInput/LicenseInput.tsx
+++ b/frontend/src/metabase/admin/settings/components/LicenseInput/LicenseInput.tsx
@@ -1,7 +1,6 @@
-import { useState } from "react";
+import { type ChangeEventHandler, useState } from "react";
import { t } from "ttag";
-import type { InputProps } from "metabase/common/components/Input";
import { Button, Flex, TextInput } from "metabase/ui";
export interface LicenseInputProps {
@@ -23,7 +22,8 @@ export const LicenseInput = ({
}: LicenseInputProps) => {
const [value, setValue] = useState(token ?? "");
- const handleChange: InputProps["onChange"] = (e) => setValue(e.target.value);
+ const handleChange: ChangeEventHandler<HTMLInputElement> = (e) =>
+ setValue(e.target.value);
const handleActivate = () => {
onUpdate(value);
diff --git a/frontend/src/metabase/common/components/AutocompleteInput/AutocompleteInput.tsx b/frontend/src/metabase/common/components/AutocompleteInput/AutocompleteInput.tsx
index f33945204ec..9105b5c78b7 100644
--- a/frontend/src/metabase/common/components/AutocompleteInput/AutocompleteInput.tsx
+++ b/frontend/src/metabase/common/components/AutocompleteInput/AutocompleteInput.tsx
@@ -1,17 +1,18 @@
import { useDisclosure } from "@mantine/hooks";
+import type { ChangeEventHandler } from "react";
import { useMemo, useRef } from "react";
import { SelectList } from "metabase/common/components/SelectList";
import { useListKeyboardNavigation } from "metabase/common/hooks/use-list-keyboard-navigation";
-import { Popover } from "metabase/ui";
+import { Popover, TextInput, type TextInputProps } from "metabase/ui";
import type { VisualizationSettings } from "metabase-types/api";
-import type { InputProps } from "../Input";
-import { Input } from "../Input";
-
import { OptionsList } from "./AutocompleteInput.styled";
-export interface AutocompleteInputProps extends Omit<InputProps, "onChange"> {
+export interface AutocompleteInputProps extends Omit<
+ TextInputProps,
+ "onChange"
+> {
options?: string[];
filterOptions?: (value: string | undefined, options: string[]) => string[];
onOptionSelect?: (value: string) => void;
@@ -46,13 +47,13 @@ export const AutocompleteInput = ({
...rest
}: AutocompleteInputProps) => {
const optionsListRef = useRef<HTMLUListElement>(null);
- const inputRef = useRef<HTMLDivElement | null>(null);
+ const inputRef = useRef<HTMLInputElement | null>(null);
const [isOpened, { open, close }] = useDisclosure(false);
const filteredOptions = useMemo(() => {
return filterOptions(String(value), options);
}, [value, options, filterOptions]);
- const { cursorIndex } = useListKeyboardNavigation<string, HTMLDivElement>({
+ const { cursorIndex } = useListKeyboardNavigation<string, HTMLInputElement>({
list: filteredOptions,
onEnter: (item: string) => handleOptionSelect(item),
resetOnListChange: true,
@@ -78,7 +79,7 @@ export const AutocompleteInput = ({
}
};
- const handleChange: InputProps["onChange"] = (e) => {
+ const handleChange: ChangeEventHandler<HTMLInputElement> = (e) => {
onChange(e.target.value);
};
@@ -94,7 +95,7 @@ export const AutocompleteInput = ({
withRoles={false}
>
<Popover.Target>
- <Input
+ <TextInput
ref={inputRef}
role="combobox"
aria-autocomplete="list"
diff --git a/frontend/src/metabase/common/components/Input/Input.stories.tsx b/frontend/src/metabase/common/components/Input/Input.stories.tsx
deleted file mode 100644
index 7fd48d19a82..00000000000
--- a/frontend/src/metabase/common/components/Input/Input.stories.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import type { StoryFn } from "@storybook/react";
-import { useState } from "react";
-
-import { Input, type InputProps } from "./Input";
-
-export default {
- title: "Deprecated/Components/Input",
- component: Input,
-};
-
-const UncontrolledTemplate: StoryFn<InputProps> = (args) => {
- return <Input {...args} />;
-};
-
-const ControlledTemplate: StoryFn<typeof Input> = (args) => {
- const [value, setValue] = useState("");
- return (
- <Input
- {...args}
- value={value}
- onChange={(e) => setValue(e.target.value)}
- onResetClick={() => setValue("")}
- />
- );
-};
-
-export const Default = {
- render: UncontrolledTemplate,
-};
-
-export const WithError = {
- render: UncontrolledTemplate,
-
- args: {
- error: true,
- },
-};
-
-export const WithRightIcon = {
- render: UncontrolledTemplate,
-
- args: {
- rightIcon: "info",
- rightIconTooltip: "Useful tips",
- },
-};
-
-export const Controlled = {
- render: ControlledTemplate,
-};
diff --git a/frontend/src/metabase/common/components/Input/Input.styled.tsx b/frontend/src/metabase/common/components/Input/Input.styled.tsx
deleted file mode 100644
index 1e22f06b61d..00000000000
--- a/frontend/src/metabase/common/components/Input/Input.styled.tsx
+++ /dev/null
@@ -1,168 +0,0 @@
-import isPropValid from "@emotion/is-prop-valid";
-// eslint-disable-next-line no-restricted-imports
-import { css } from "@emotion/react";
-// eslint-disable-next-line no-restricted-imports
-import styled from "@emotion/styled";
-
-import { IconButtonWrapper } from "metabase/common/components/IconButtonWrapper";
-import {
- focusOutlineStyle,
- inputPadding,
- inputTypography,
-} from "metabase/common/style/input";
-import { monospaceFontFamily } from "metabase/styled-components/theme";
-import type { ColorName } from "metabase/ui/colors/types";
-import { color } from "metabase/ui/utils/colors";
-
-import type { InputSize } from "../../style/types";
-
-interface InputProps {
- fieldSize?: InputSize;
- hasError?: boolean;
- fullWidth?: boolean;
- hasSubtitle?: boolean;
- hasLeftIcon?: boolean;
- hasRightIcon?: boolean;
- hasClearButton?: boolean;
- colorScheme: ColorName;
-}
-
-interface InputRootProps {
- fullWidth?: boolean;
-}
-
-const getHorizontalPadding = (
- inputSize?: InputSize,
- hasIcon?: boolean,
- hasClearButton?: boolean,
-) => {
- let padding = inputSize === "small" ? 0.625 : 0.75;
-
- if (hasIcon) {
- padding += 1.5;
- }
-
- if (hasClearButton) {
- padding += 1;
- }
-
- return `${padding}rem`;
-};
-
-export const InputRoot = styled.div<InputRootProps>`
- display: inline-flex;
- align-items: center;
- position: relative;
- width: ${(props) => (props.fullWidth ? "100%" : "")};
-`;
-
-export const InputField = styled.input<InputProps>`
- ${(props) => inputPadding(props.fieldSize)}
- ${(props) => inputTypography(props.fieldSize)}
- font-family: inherit;
- color: var(--mb-color-text-primary);
- border: 1px solid var(--mb-color-border-neutral);
- border-radius: var(--mantine-spacing-sm);
- background-color: ${(props) =>
- props.readOnly
- ? "var(--mb-color-background_surface-disabled)"
- : "var(--mb-color-background_page-primary)"};
- outline: none;
- text-align: inherit;
-
- &:focus,
- &:hover {
- border-color: ${(props) => color(props.colorScheme)};
- transition: border 300ms ease-in-out;
- }
-
- &:disabled {
- cursor: default;
- background-color: var(--mb-color-background_page-secondary);
- }
-
- ${(props) => focusOutlineStyle(props.colorScheme)};
-
- ${(props) =>
- props.hasError &&
- css`
- border-color: var(--mb-color-feedback-negative);
- `};
-
- ${(props) =>
- props.fullWidth &&
- css`
- width: 100%;
- `}
-
- ${(props) =>
- props.fieldSize === "small" &&
- css`
- font-size: 0.875rem;
- line-height: 1rem;
- `};
-
- padding-left: ${(props) =>
- getHorizontalPadding(props.fieldSize, props.hasLeftIcon)};
- padding-right: ${(props) =>
- getHorizontalPadding(
- props.fieldSize,
- props.hasRightIcon,
- props.hasClearButton,
- )};
-
- ${(props) =>
- props.hasSubtitle &&
- css`
- padding-top: 1.75rem;
- `};
-`;
-
-type InputButtonProps = {
- size: InputSize;
-};
-
-const InputButton = styled(IconButtonWrapper)<InputButtonProps>`
- position: absolute;
- color: ${(props) =>
- color(props.onClick != null ? "text-primary" : "text-disabled")};
- padding: ${(props) => (props.size === "small" ? "0.5rem" : "0.75rem")};
- border-radius: 50%;
- bottom: ${(props) => (props.size === "large" ? "0.125rem" : 0)};
-
- &:disabled {
- cursor: default;
- }
-`;
-
-export const InputLeftButton = styled(InputButton)<InputButtonProps>`
- left: 0;
-`;
-
-export const InputRightButton = styled(InputButton)<InputButtonProps>`
- right: 0;
-`;
-
-type InputResetButtonProps = {
- hasRightIcon: boolean;
-};
-
-// shouldForwardProp: isPropValid is used to prevent passing the `hasRightIcon` prop to the DOM element
-export const InputResetButton = styled(InputButton, {
- shouldForwardProp: isPropValid,
-})<InputResetButtonProps>`
- right: ${(props) => (props.hasRightIcon ? "1.25rem" : 0)};
-`;
-
-export const InputSubtitle = styled.div`
- color: var(--mb-color-text-disabled);
- position: absolute;
- top: 1.25em;
- left: 1.25em;
- font-family: ${monospaceFontFamily};
- font-size: 0.75em;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- max-width: 90%;
-`;
diff --git a/frontend/src/metabase/common/components/Input/Input.tsx b/frontend/src/metabase/common/components/Input/Input.tsx
deleted file mode 100644
index b745b73e7f9..00000000000
--- a/frontend/src/metabase/common/components/Input/Input.tsx
+++ /dev/null
@@ -1,147 +0,0 @@
-import type { InputHTMLAttributes, MouseEvent, ReactNode, Ref } from "react";
-import { forwardRef } from "react";
-import { t } from "ttag";
-
-import { Icon, Tooltip } from "metabase/ui";
-import type { IconName } from "metabase-types/api";
-
-import type { InputSize } from "../../style/types";
-
-import {
- InputField,
- InputLeftButton,
- InputResetButton,
- InputRightButton,
- InputRoot,
- InputSubtitle,
-} from "./Input.styled";
-
-export type InputColorScheme = "core-brand" | "core-filter";
-
-export type InputAttributes = Omit<
- InputHTMLAttributes<HTMLInputElement>,
- "size"
->;
-
-export interface InputProps extends InputAttributes {
- inputRef?: Ref<HTMLInputElement>;
- size?: InputSize;
- error?: boolean;
- fullWidth?: boolean;
- leftIcon?: IconName;
- leftIconTooltip?: ReactNode;
- rightIcon?: IconName;
- rightIconTooltip?: string;
- subtitle?: string;
- colorScheme?: InputColorScheme;
- onLeftIconClick?: (event: MouseEvent<HTMLButtonElement>) => void;
- onRightIconClick?: (event: MouseEvent<HTMLButtonElement>) => void;
- onResetClick?: () => void;
-}
-
-const BaseInput = forwardRef(function Input(
- {
- className,
- style,
- inputRef,
- size = "medium",
- error,
- fullWidth,
- leftIcon,
- leftIconTooltip,
- rightIcon,
- rightIconTooltip,
- subtitle,
- colorScheme = "core-brand",
- value,
- onLeftIconClick,
- onRightIconClick,
- onResetClick,
- onChange,
- ...props
- }: InputProps,
- ref: Ref<HTMLDivElement>,
-) {
- const showResetButton =
- onResetClick && value != null && String(value).length > 0;
-
- return (
- <InputRoot
- ref={ref}
- className={className}
- style={style}
- fullWidth={fullWidth}
- >
- {subtitle && <InputSubtitle>{subtitle}</InputSubtitle>}
-
- <InputField
- {...props}
- ref={inputRef}
- fieldSize={size}
- hasError={error}
- fullWidth={fullWidth}
- hasSubtitle={Boolean(subtitle)}
- hasLeftIcon={Boolean(leftIcon)}
- hasRightIcon={Boolean(rightIcon)}
- hasClearButton={showResetButton}
- colorScheme={colorScheme}
- value={value}
- onChange={onChange}
- />
- {leftIcon && (
- <Tooltip
- disabled={!leftIconTooltip}
- label={leftIconTooltip}
- position="left"
- >
- <InputLeftButton
- data-testid="input-left-icon-button"
- size={size}
- onClick={onLeftIconClick}
- disabled={!leftIconTooltip && !onLeftIconClick}
- >
- <Icon name={leftIcon} />
- </InputLeftButton>
- </Tooltip>
- )}
- {rightIcon && (
- <Tooltip
- disabled={!rightIconTooltip}
- label={rightIconTooltip}
- position="right"
- >
- <InputRightButton
- data-testid="input-right-icon-button"
- size={size}
- onClick={onRightIconClick}
- disabled={!rightIconTooltip && !onRightIconClick}
- >
- <Icon name={rightIcon} />
- </InputRightButton>
- </Tooltip>
- )}
-
- {showResetButton && (
- <Tooltip label={t`Clear`} position="right">
- <InputResetButton
- data-testid="input-reset-button"
- size={size}
- hasRightIcon={!!rightIcon}
- onClick={onResetClick}
- >
- <Icon name="close" />
- </InputResetButton>
- </Tooltip>
- )}
- </InputRoot>
- );
-});
-
-/**
- * @deprecated: use TextInput from "metabase/ui"
- */
-export const Input = Object.assign(BaseInput, {
- Root: InputRoot,
- Field: InputField,
- Subtitle: InputSubtitle,
-});
diff --git a/frontend/src/metabase/common/components/Input/Input.unit.spec.tsx b/frontend/src/metabase/common/components/Input/Input.unit.spec.tsx
deleted file mode 100644
index 3d48e235376..00000000000
--- a/frontend/src/metabase/common/components/Input/Input.unit.spec.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import userEvent from "@testing-library/user-event";
-
-import { render, screen } from "__support__/ui";
-
-import { Input, type InputProps } from "./Input";
-
-const setup = (props: InputProps = {}) => {
- render(<Input {...props} />);
-};
-
-describe("Input", () => {
- describe("when rendering basic elements", () => {
- it("renders input field", () => {
- setup({ placeholder: "Enter text" });
- expect(screen.getByPlaceholderText("Enter text")).toBeInTheDocument();
- });
-
- it("renders subtitle when provided", () => {
- setup({ subtitle: "Test subtitle" });
- expect(screen.getByText("Test subtitle")).toBeInTheDocument();
- });
- });
-
- describe("when rendering icons", () => {
- it("renders left icon when provided", () => {
- setup({ leftIcon: "search" });
- expect(screen.getByTestId("input-left-icon-button")).toBeInTheDocument();
- });
-
- it("renders right icon when provided", () => {
- setup({ rightIcon: "close" });
- expect(screen.getByTestId("input-right-icon-button")).toBeInTheDocument();
- });
-
- it("renders reset button when value is present and onResetClick is provided", () => {
- setup({ value: "Test", onChange: jest.fn(), onResetClick: jest.fn() });
- expect(screen.getByTestId("input-reset-button")).toBeInTheDocument();
- });
- });
-
- describe("when handling user interactions", () => {
- it("calls onLeftIconClick when left icon is clicked", async () => {
- const onLeftIconClick = jest.fn();
- setup({ leftIcon: "search", onLeftIconClick });
-
- await userEvent.click(screen.getByTestId("input-left-icon-button"));
- expect(onLeftIconClick).toHaveBeenCalledTimes(1);
- });
-
- it("calls onRightIconClick when right icon is clicked", async () => {
- const onRightIconClick = jest.fn();
- setup({ rightIcon: "close", onRightIconClick });
-
- await userEvent.click(screen.getByTestId("input-right-icon-button"));
- expect(onRightIconClick).toHaveBeenCalledTimes(1);
- });
-
- it("calls onResetClick when reset button is clicked", async () => {
- const onResetClick = jest.fn();
- setup({ value: "Test", onChange: jest.fn(), onResetClick });
-
- await userEvent.click(screen.getByTestId("input-reset-button"));
- expect(onResetClick).toHaveBeenCalledTimes(1);
- });
-
- it("calls onChange when input value changes", async () => {
- const onChange = jest.fn();
- setup({ onChange });
-
- await userEvent.type(screen.getByRole("textbox"), "Test input");
- expect(onChange).toHaveBeenCalledTimes(10);
- });
- });
-
- describe("when handling tooltips", () => {
- describe("for left icon", () => {
- it("shows tooltip on hover when leftIconTooltip is provided", async () => {
- setup({ leftIcon: "search", leftIconTooltip: "Search" });
- const leftIcon = screen.getByTestId("input-left-icon-button");
-
- expect(screen.queryByText("Search")).not.toBeInTheDocument();
- await userEvent.hover(leftIcon);
- expect(await screen.findByText("Search")).toBeInTheDocument();
- });
-
- it("does not show tooltip when leftIconTooltip is not provided", async () => {
- setup({ leftIcon: "search" });
- const leftIcon = screen.getByTestId("input-left-icon-button");
-
- await userEvent.hover(leftIcon);
- expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
- });
- });
-
- describe("for right icon", () => {
- it("shows tooltip on hover when rightIconTooltip is provided", async () => {
- setup({ rightIcon: "close", rightIconTooltip: "Close" });
- const rightIcon = screen.getByTestId("input-right-icon-button");
-
- expect(screen.queryByText("Close")).not.toBeInTheDocument();
- await userEvent.hover(rightIcon);
- expect(await screen.findByText("Close")).toBeInTheDocument();
- });
-
- it("does not show tooltip when rightIconTooltip is not provided", async () => {
- setup({ rightIcon: "close" });
- const rightIcon = screen.getByTestId("input-right-icon-button");
-
- await userEvent.hover(rightIcon);
- expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
- });
- });
-
- describe("for reset button", () => {
- it("shows tooltip on hover", async () => {
- setup({ value: "Test", onChange: jest.fn(), onResetClick: jest.fn() });
- const resetButton = screen.getByTestId("input-reset-button");
-
- expect(screen.queryByText("Clear")).not.toBeInTheDocument();
- await userEvent.hover(resetButton);
- expect(await screen.findByText("Clear")).toBeInTheDocument();
- });
- });
- });
-});
diff --git a/frontend/src/metabase/common/components/Input/index.ts b/frontend/src/metabase/common/components/Input/index.ts
deleted file mode 100644
index 96a83943e74..00000000000
--- a/frontend/src/metabase/common/components/Input/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { Input } from "./Input";
-export type { InputProps } from "./Input";
diff --git a/frontend/src/metabase/common/components/SelectButton/SelectButton.styled.tsx b/frontend/src/metabase/common/components/SelectButton/SelectButton.styled.tsx
index 434ba14faca..df14f9c5f28 100644
--- a/frontend/src/metabase/common/components/SelectButton/SelectButton.styled.tsx
+++ b/frontend/src/metabase/common/components/SelectButton/SelectButton.styled.tsx
@@ -2,7 +2,6 @@
import styled from "@emotion/styled";
import type { ComponentPropsWithRef } from "react";
-import { inputPadding } from "metabase/common/style/input";
import { Icon } from "metabase/ui";
import { color } from "metabase/ui/utils/colors";
interface SelectButtonRootProps {
@@ -20,7 +19,7 @@ const getColor = ({ hasValue, highlighted }: SelectButtonRootProps) => {
};
export const SelectButtonRoot = styled.button<SelectButtonRootProps>`
- ${inputPadding()}
+ padding: 0.625rem 0.75rem;
cursor: pointer;
display: flex;
width: ${(props) => (props.fullWidth ? "100%" : "unset")};
diff --git a/frontend/src/metabase/common/components/Tab/Tab.styled.tsx b/frontend/src/metabase/common/components/Tab/Tab.styled.tsx
index a83b3ad7276..f6c048aaa39 100644
--- a/frontend/src/metabase/common/components/Tab/Tab.styled.tsx
+++ b/frontend/src/metabase/common/components/Tab/Tab.styled.tsx
@@ -1,7 +1,7 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { focusOutlineStyle } from "metabase/common/style/input";
+import { focusOutlineStyle } from "metabase/common/style/focus-outline";
import { Icon } from "metabase/ui";
import { alpha } from "metabase/ui/colors";
import { color } from "metabase/ui/utils/colors";
diff --git a/frontend/src/metabase/common/components/TextArea/TextArea.styled.tsx b/frontend/src/metabase/common/components/TextArea/TextArea.styled.tsx
index dd96aff1230..d35dbabb3ad 100644
--- a/frontend/src/metabase/common/components/TextArea/TextArea.styled.tsx
+++ b/frontend/src/metabase/common/components/TextArea/TextArea.styled.tsx
@@ -3,7 +3,7 @@ import { css } from "@emotion/react";
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { focusOutlineStyle } from "metabase/common/style/input";
+import { focusOutlineStyle } from "metabase/common/style/focus-outline";
interface TextAreaRootProps {
readOnly?: boolean;
diff --git a/frontend/src/metabase/common/style/focus-outline.ts b/frontend/src/metabase/common/style/focus-outline.ts
new file mode 100644
index 00000000000..c4449a03474
--- /dev/null
+++ b/frontend/src/metabase/common/style/focus-outline.ts
@@ -0,0 +1,17 @@
+// eslint-disable-next-line no-restricted-imports
+import { css } from "@emotion/react";
+
+import { getFocusColor } from "metabase/ui/colors";
+
+/**
+ * @deprecated styled components are deprecated
+ */
+export const focusOutlineStyle = (color: string) => css`
+ &:focus {
+ outline: 2px solid ${getFocusColor(color)};
+ }
+
+ &:focus:not(:focus-visible) {
+ outline: none;
+ }
+`;
diff --git a/frontend/src/metabase/common/style/input.ts b/frontend/src/metabase/common/style/input.ts
deleted file mode 100644
index 147931e7085..00000000000
--- a/frontend/src/metabase/common/style/input.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-// eslint-disable-next-line no-restricted-imports
-import { css } from "@emotion/react";
-
-import { getFocusColor } from "metabase/ui/colors";
-
-import type { InputSize } from "./types";
-
-const inputPaddingBySize = {
- small: css`
- padding: 0.5rem 0.625rem;
- `,
- medium: css`
- padding: 0.625rem 0.75rem;
- `,
- large: css`
- padding: 0.75rem;
- `,
-} as const;
-
-export const inputPadding = (size: InputSize = "medium") =>
- inputPaddingBySize[size];
-
-const inputTypographyBySize = {
- small: css`
- font-size: 0.875rem;
- font-weight: 700;
- `,
- medium: css`
- font-size: 0.875rem;
- font-weight: 700;
- `,
- large: css`
- font-size: 1rem;
- font-weight: 700;
- `,
-} as const;
-
-export const inputTypography = (size: InputSize = "medium") =>
- inputTypographyBySize[size];
-
-export const focusOutlineStyle = (color: string) => css`
- &:focus {
- outline: 2px solid ${getFocusColor(color)};
- }
-
- &:focus:not(:focus-visible) {
- outline: none;
- }
-`;
diff --git a/frontend/src/metabase/common/style/types.ts b/frontend/src/metabase/common/style/types.ts
deleted file mode 100644
index 195fb40750c..00000000000
--- a/frontend/src/metabase/common/style/types.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type InputSize = "small" | "medium" | "large";
diff --git a/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx b/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx
index 02c6b9cd5de..2793ee63499 100644
--- a/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx
+++ b/frontend/src/metabase/dashboard/components/QuestionPicker/QuestionPicker.tsx
@@ -6,7 +6,6 @@ import { ROOT_COLLECTION } from "metabase/common/collections/constants";
import getExpandedCollectionsById from "metabase/common/collections/getExpandedCollectionsById";
import { isPublicCollection } from "metabase/common/collections/utils";
import { Breadcrumbs } from "metabase/common/components/Breadcrumbs";
-import { Input } from "metabase/common/components/Input";
import { SelectList } from "metabase/common/components/SelectList";
import type { BaseSelectListItemProps } from "metabase/common/components/SelectList/BaseSelectListItem";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
@@ -22,7 +21,7 @@ import {
canUserCreateQueries,
getUserPersonalCollectionId,
} from "metabase/selectors/user";
-import { Button, Flex, Icon } from "metabase/ui";
+import { Button, Flex, Icon, Input, TextInput } from "metabase/ui";
import { SEARCH_DEBOUNCE_DURATION } from "metabase/utils/constants";
import type { Collection, CollectionId } from "metabase-types/api";
@@ -93,14 +92,21 @@ export function QuestionPicker({ onSelect }: QuestionPickerProps) {
const onNewNativeQuestion = () => dispatch(addDashboardQuestion("native"));
return (
<div className={S.questionPickerRoot}>
- <Input
+ <TextInput
className={S.searchInput}
- fullWidth
autoFocus
data-autofocus
placeholder={t`Search…`}
value={searchText}
- onResetClick={() => setSearchText("")}
+ rightSectionPointerEvents="all"
+ rightSection={
+ searchText.length > 0 ? (
+ <Input.ClearButton
+ c="text-secondary"
+ onClick={() => setSearchText("")}
+ />
+ ) : null
+ }
onChange={handleSearchTextChange}
/>
diff --git a/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.styled.tsx b/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.styled.tsx
index 6f3a7961d20..afe0d46d4ab 100644
--- a/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.styled.tsx
+++ b/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.styled.tsx
@@ -2,7 +2,6 @@
import styled from "@emotion/styled";
import { ExternalLink as BaseExternalLink } from "metabase/common/components/ExternalLink";
-import { Input } from "metabase/common/components/Input";
import { Link } from "metabase/common/components/Link";
import { RecentsList } from "metabase/nav/components/search/RecentsList";
@@ -77,15 +76,3 @@ export const SearchResultsContainer = styled.div`
export const StyledRecentsList = styled(RecentsList)`
${searchResultsStyles}
`;
-
-export const StyledInput = styled(Input)`
- pointer-events: all;
-
- input {
- max-height: 38px; /* prevents natural height of input from growing beyond the (bordered) card container */
- }
-
- * {
- pointer-events: all;
- }
-`;
diff --git a/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.tsx b/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.tsx
index 35155b09655..7dc29f755b3 100644
--- a/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.tsx
+++ b/frontend/src/metabase/dashboard/visualizations/LinkViz/LinkViz.tsx
@@ -7,7 +7,7 @@ import { getParameterValues } from "metabase/dashboard/selectors";
import { fillParametersInText } from "metabase/dashboard/visualizations/parameter-substitution";
import { SearchResults } from "metabase/nav/components/search/SearchResults";
import { useSelector } from "metabase/redux";
-import { Popover } from "metabase/ui";
+import { Popover, TextInput } from "metabase/ui";
import { modelToUrl } from "metabase/urls";
import { getUrlTarget } from "metabase/visualizations/lib/open-url";
import type {
@@ -30,7 +30,6 @@ import {
EditLinkCardWrapper,
ExternalLink,
SearchResultsContainer,
- StyledInput,
StyledRecentsList,
} from "./LinkViz.styled";
import { settings } from "./LinkVizSettings";
@@ -157,8 +156,7 @@ function LinkVizInner({
<EditLinkCardWrapper data-testid="custom-edit-text-link">
<Popover opened={inputIsFocused && !isUrlString(url)} position="bottom">
<Popover.Target>
- <StyledInput
- fullWidth
+ <TextInput
value={url ?? ""}
autoFocus={autoFocus}
placeholder={"https://example.com"}
@@ -168,6 +166,14 @@ function LinkVizInner({
onBlur={_.debounce(onBlurInput, 100)}
// the dashcard really wants to turn all mouse events into drag events
onMouseDown={(e) => e.stopPropagation()}
+ size="sm"
+ // DashEditing disables pointer-events on card content; the Input
+ // wrapper's `none` breaks inheritance, so re-enable on both root
+ // and input or the field can't be clicked/typed into.
+ styles={{
+ root: { pointerEvents: "all" },
+ input: { pointerEvents: "all" },
+ }}
/>
</Popover.Target>
<Popover.Dropdown>
diff --git a/frontend/src/metabase/nav/components/search/SearchBar/SearchBar.styled.tsx b/frontend/src/metabase/nav/components/search/SearchBar/SearchBar.styled.tsx
index 1433c072446..686182239a6 100644
--- a/frontend/src/metabase/nav/components/search/SearchBar/SearchBar.styled.tsx
+++ b/frontend/src/metabase/nav/components/search/SearchBar/SearchBar.styled.tsx
@@ -40,6 +40,7 @@ export const SearchInputContainer = styled.div<{
}
return css`
background-color: var(--mb-color-background_page-primary);
+
&:hover {
background-color: var(--mb-color-background_page-secondary);
}
diff --git a/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/ListField/ListField.tsx b/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/ListField/ListField.tsx
index 74ceddac5e2..ede3dda1057 100644
--- a/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/ListField/ListField.tsx
+++ b/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/ListField/ListField.tsx
@@ -1,16 +1,15 @@
+import type { ChangeEventHandler } from "react";
import { useCallback, useMemo, useRef, useState } from "react";
import { t } from "ttag";
import _ from "underscore";
import { EmptyState } from "metabase/common/components/EmptyState";
-import type { InputProps } from "metabase/common/components/Input";
-import { Input } from "metabase/common/components/Input";
import { LoadingSpinner } from "metabase/common/components/LoadingSpinner";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
import { useTranslateContent } from "metabase/content-translation/hooks";
import { optionItemEqualsFilter } from "metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/SingleSelectListField/utils";
import { PLUGIN_CONTENT_TRANSLATION } from "metabase/plugins";
-import { Checkbox, Flex, Text } from "metabase/ui";
+import { Checkbox, Flex, Input, Text, TextInput } from "metabase/ui";
import { delay } from "metabase/utils/delay";
import type { RowValue } from "metabase-types/api";
@@ -152,7 +151,7 @@ export const ListField = ({
}
};
- const handleFilterChange: InputProps["onChange"] = (e) =>
+ const handleFilterChange: ChangeEventHandler<HTMLInputElement> = (e) =>
setFilter(e.target.value);
const handleToggleAll = () => {
@@ -171,14 +170,21 @@ export const ListField = ({
return (
<>
<FilterInputContainer isDashboardFilter={isDashboardFilter}>
- <Input
- fullWidth
+ <TextInput
autoFocus
placeholder={placeholder}
value={filter}
onChange={handleFilterChange}
onKeyDown={handleKeyDown}
- onResetClick={() => setFilter("")}
+ rightSectionPointerEvents="all"
+ rightSection={
+ filter.length > 0 ? (
+ <Input.ClearButton
+ c="text-secondary"
+ onClick={() => setFilter("")}
+ />
+ ) : null
+ }
data-testid="list-field"
/>
</FilterInputContainer>
diff --git a/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/SingleSelectListField/SingleSelectListField.tsx b/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/SingleSelectListField/SingleSelectListField.tsx
index aaf7e36adab..976af877b33 100644
--- a/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/SingleSelectListField/SingleSelectListField.tsx
+++ b/frontend/src/metabase/parameters/components/widgets/ParameterFieldWidget/FieldValuesWidget/SingleSelectListField/SingleSelectListField.tsx
@@ -1,15 +1,14 @@
+import type { ChangeEventHandler } from "react";
import { useMemo, useState } from "react";
import { t } from "ttag";
import _ from "underscore";
import { EmptyState } from "metabase/common/components/EmptyState";
-import type { InputProps } from "metabase/common/components/Input";
-import { Input } from "metabase/common/components/Input";
import { LoadingSpinner } from "metabase/common/components/LoadingSpinner";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
import { useTranslateContent } from "metabase/content-translation/hooks";
import { PLUGIN_CONTENT_TRANSLATION } from "metabase/plugins";
-import { Flex } from "metabase/ui";
+import { Flex, Input, TextInput } from "metabase/ui";
import { delay } from "metabase/utils/delay";
import type { RowValue } from "metabase-types/api";
@@ -147,7 +146,7 @@ const SingleSelectListField = ({
}
};
- const handleFilterChange: InputProps["onChange"] = (evt) => {
+ const handleFilterChange: ChangeEventHandler<HTMLInputElement> = (evt) => {
const value = evt.target.value;
setFilter(value);
onChange([]);
@@ -165,14 +164,21 @@ const SingleSelectListField = ({
return (
<>
<FilterInputContainer isDashboardFilter={isDashboardFilter}>
- <Input
- fullWidth
+ <TextInput
autoFocus
placeholder={placeholder}
value={filter}
onChange={handleFilterChange}
onKeyDown={handleKeyDown}
- onResetClick={handleResetClick}
+ rightSectionPointerEvents="all"
+ rightSection={
+ filter.length > 0 ? (
+ <Input.ClearButton
+ c="text-secondary"
+ onClick={handleResetClick}
+ />
+ ) : null
+ }
data-testid="single-select-list-field"
/>
</FilterInputContainer>
diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/SummarizeSidebar/BreakoutColumnList/BreakoutColumnList.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/SummarizeSidebar/BreakoutColumnList/BreakoutColumnList.tsx
index 72edd0ff3a2..448157c1556 100644
--- a/frontend/src/metabase/query_builder/components/view/sidebars/SummarizeSidebar/BreakoutColumnList/BreakoutColumnList.tsx
+++ b/frontend/src/metabase/query_builder/components/view/sidebars/SummarizeSidebar/BreakoutColumnList/BreakoutColumnList.tsx
@@ -1,14 +1,13 @@
import { type ChangeEvent, useCallback, useMemo, useState } from "react";
import { t } from "ttag";
-import { Input } from "metabase/common/components/Input";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
import { useTranslateContent } from "metabase/content-translation/hooks";
import {
type UpdateQueryHookProps,
useBreakoutQueryHandlers,
} from "metabase/query_builder/hooks";
-import { Box, DelayGroup } from "metabase/ui";
+import { Box, DelayGroup, Icon, Input, TextInput } from "metabase/ui";
import { SEARCH_DEBOUNCE_DURATION } from "metabase/utils/constants";
import { isNotNull } from "metabase/utils/types";
import * as Lib from "metabase-lib";
@@ -110,12 +109,19 @@ export function BreakoutColumnList({
return (
<>
<Box mb="md">
- <Input
- fullWidth
+ <TextInput
placeholder={t`Find...`}
value={searchQuery}
- leftIcon="search"
- onResetClick={handleResetSearch}
+ leftSection={<Icon name="search" />}
+ rightSectionPointerEvents="all"
+ rightSection={
+ searchQuery.length > 0 ? (
+ <Input.ClearButton
+ c="text-secondary"
+ onClick={handleResetSearch}
+ />
+ ) : null
+ }
onChange={handleChangeSearchQuery}
/>
</Box>
diff --git a/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.styled.tsx b/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.styled.tsx
index a335fc4b22d..4775c0346c6 100644
--- a/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.styled.tsx
+++ b/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.styled.tsx
@@ -1,7 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Input } from "metabase/common/components/Input";
import { Link } from "metabase/common/components/Link";
export const ModalRoot = styled.div`
@@ -16,10 +15,6 @@ export const ModalToolbar = styled.div`
padding: 1rem 2rem 0;
`;
-export const ModalToolbarInput = styled(Input)`
- flex: 1 1 auto;
-`;
-
export const ModalToolbarLink = styled(Link)`
display: flex;
flex: 0 0 auto;
diff --git a/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.tsx b/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.tsx
index c4e6057d145..9e4303117ec 100644
--- a/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.tsx
+++ b/frontend/src/metabase/timelines/collections/components/TimelineDetailsModal/TimelineDetailsModal.tsx
@@ -1,14 +1,13 @@
-import { useCallback, useMemo, useState } from "react";
+import { type ChangeEventHandler, useCallback, useMemo, useState } from "react";
import { t } from "ttag";
import _ from "underscore";
-import type { InputProps } from "metabase/common/components/Input";
import { ForwardRefLink } from "metabase/common/components/Link";
import { useDebouncedValue } from "metabase/common/hooks/use-debounced-value";
import { getTimelineName } from "metabase/common/utils/timelines";
import ButtonsS from "metabase/css/components/buttons.module.css";
import ModalHeader from "metabase/timelines/common/components/ModalHeader";
-import { ActionIcon, Icon, Menu } from "metabase/ui";
+import { ActionIcon, Icon, Menu, TextInput } from "metabase/ui";
import * as Urls from "metabase/urls";
import { SEARCH_DEBOUNCE_DURATION } from "metabase/utils/constants";
import { parseTimestamp } from "metabase/utils/time-dayjs";
@@ -22,7 +21,6 @@ import {
ModalBody,
ModalRoot,
ModalToolbar,
- ModalToolbarInput,
ModalToolbarLink,
} from "./TimelineDetailsModal.styled";
@@ -70,7 +68,7 @@ const TimelineDetailsModal = ({
const canWrite = timeline.collection?.can_write;
const canGoBack = isArchive || !isOnlyTimeline;
- const handleSearchChange: InputProps["onChange"] = (e) =>
+ const handleSearchChange: ChangeEventHandler<HTMLInputElement> = (e) =>
setInputText(e.target.value);
return (
@@ -93,11 +91,11 @@ const TimelineDetailsModal = ({
</ModalHeader>
{(isNotEmpty || isSearching) && (
<ModalToolbar>
- <ModalToolbarInput
- fullWidth
+ <TextInput
+ flex="1 1 auto"
value={inputText}
placeholder={t`Search for an event`}
- leftIcon="search"
+ leftSection={<Icon name="search" />}
onChange={handleSearchChange}
/>
{canWrite && !isArchive && (
diff --git a/frontend/src/metabase/visualizations/components/settings/ChartNestedSettingSeries.styled.tsx b/frontend/src/metabase/visualizations/components/settings/ChartNestedSettingSeries.styled.tsx
index df84ec8395a..09ab2babfd1 100644
--- a/frontend/src/metabase/visualizations/components/settings/ChartNestedSettingSeries.styled.tsx
+++ b/frontend/src/metabase/visualizations/components/settings/ChartNestedSettingSeries.styled.tsx
@@ -1,7 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import styled from "@emotion/styled";
-import { Input } from "metabase/common/components/Input";
import { Icon, TextInputBlurChange } from "metabase/ui";
export const OptionsIcon = styled(Icon)`
@@ -15,18 +14,4 @@ export const OptionsIcon = styled(Icon)`
export const SeriesNameInput = styled(TextInputBlurChange)`
width: auto;
-
- ${({ description }) =>
- description &&
- `
- ${Input.Field} {
- padding-top: 1rem;
- padding-bottom: 0.375rem;
- }
-
- ${Input.Subtitle} {
- top: 0.375rem;
- left: 0.8rem;
- }
- `}
`;
diff --git a/frontend/src/metabase/visualizations/components/settings/ChartSettingLinkUrlInput.tsx b/frontend/src/metabase/visualizations/components/settings/ChartSettingLinkUrlInput.tsx
index ed1cb1350e6..6639ddd956b 100644
--- a/frontend/src/metabase/visualizations/components/settings/ChartSettingLinkUrlInput.tsx
+++ b/frontend/src/metabase/visualizations/components/settings/ChartSettingLinkUrlInput.tsx
@@ -30,7 +30,8 @@ const ChartSettingLinkUrlInput = ({
value,
onChange,
options,
- ...props
+ id,
+ onChangeSettings,
}: ChartSettingLinkUrlInputProps) => {
const valueOrDefault = value ?? "";
const [isFocused, setIsFocused] = useState(false);
@@ -61,8 +62,9 @@ const ChartSettingLinkUrlInput = ({
return (
<AutocompleteInput
- {...props}
- data-testid={props.id}
+ id={id}
+ data-testid={id}
+ onChangeSettings={onChangeSettings}
options={options}
onChange={setFocusedValue}
value={isFocused ? focusedValue : valueOrDefault}