Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: [M3-6804] - MUI v5 Migration - Components > Chip #9339

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

MUI v5 Migration - Components > Chip ([#9339](https://github.com/linode/manager/pull/9339))
2 changes: 1 addition & 1 deletion packages/manager/src/components/BetaChip/BetaChip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Theme } from '@mui/material/styles';
import * as React from 'react';
import { Chip, ChipProps } from 'src/components/core/Chip';
import { Chip, ChipProps } from 'src/components/Chip';
import { makeStyles } from 'tss-react/mui';

interface BetaChipProps
Expand Down
6 changes: 3 additions & 3 deletions packages/manager/src/components/Chip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Chip } from 'src/components/core/Chip';
import type { ChipProps } from './core/Chip';
import { Chip } from './Chip';
import type { ChipProps } from './Chip';
import type { Meta, StoryObj } from '@storybook/react';

export const Default: StoryObj<ChipProps> = {
Expand Down Expand Up @@ -62,7 +62,7 @@ export const WithDeleteButton: StoryObj<ChipProps> = {
};

const meta: Meta<ChipProps> = {
title: 'Components/Core/Chip',
title: 'Components/Chip',
component: Chip,
args: { label: 'Chip', onDelete: undefined },
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { default as _Chip, ChipProps as _ChipProps } from '@mui/material/Chip';
import { styled } from '@mui/material/styles';
import { isPropValid } from 'src/utilities/isPropValid';

export interface ChipProps extends _ChipProps {
/**
Expand Down Expand Up @@ -37,6 +38,7 @@ export const Chip = ({

const StyledChip = styled(_Chip, {
label: 'StyledChip',
shouldForwardProp: (prop) => isPropValid(['inTable', 'outlineColor'], prop),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes some console errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes thank you... i had the fix in another PR, will nix it

})<ChipProps>(({ theme, ...props }) => ({
...(props.inTable && {
marginTop: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PaymentMethod } from '@linode/api-v4/lib/account/types';
import { useTheme } from '@mui/material/styles';
import Paper from 'src/components/core/Paper';
import Box from '@mui/material/Box';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import CreditCard from 'src/features/Billing/BillingPanels/BillingSummary/PaymentDrawer/CreditCard';
import ThirdPartyPayment from './ThirdPartyPayment';
import ActionMenu, { Action } from 'src/components/ActionMenu';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Alarm from '@mui/icons-material/Alarm';
import InsertPhoto from '@mui/icons-material/InsertPhoto';
import DE from 'flag-icons/flags/4x3/de.svg';
import US from 'flag-icons/flags/4x3/us.svg';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { SelectionCard } from './SelectionCard';
import type { Meta, StoryObj } from '@storybook/react';
import type { SelectionCardProps } from './SelectionCard';
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/components/ShowMore/ShowMore.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Chip, ChipProps } from 'src/components/core/Chip';
import { Chip, ChipProps } from 'src/components/Chip';
import Popover from '@mui/material/Popover';
import { styled, useTheme } from '@mui/material/styles';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { Link, useHistory } from 'react-router-dom';
import { Button } from 'src/components/Button/Button';
import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import Divider from 'src/components/core/Divider';
import { Typography } from 'src/components/Typography';
import { DateTimeDisplay } from 'src/components/DateTimeDisplay';
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/components/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Close from '@mui/icons-material/Close';
import { styled } from '@mui/material/styles';
import * as React from 'react';
import { useHistory } from 'react-router-dom';
import { Chip, ChipProps } from 'src/components/core/Chip';
import { Chip, ChipProps } from 'src/components/Chip';
import { truncateEnd } from 'src/utilities/truncate';

type Variants = 'blue' | 'lightBlue';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PaymentMethod, PaymentType } from '@linode/api-v4';
import * as React from 'react';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import Grid from '@mui/material/Unstable_Grid2';
import {
getIcon as getTPPIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@linode/api-v4/lib/databases/types';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { Hidden } from 'src/components/Hidden';
import { StatusIcon } from 'src/components/StatusIcon/StatusIcon';
import { Status } from 'src/components/StatusIcon/StatusIcon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { Hidden } from 'src/components/Hidden';
import Grid from '@mui/material/Unstable_Grid2';
import { DateTimeDisplay } from 'src/components/DateTimeDisplay';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import ActionsPanel from 'src/components/ActionsPanel';
import { Button } from 'src/components/Button/Button';
import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import Paper from 'src/components/core/Paper';
import Grid from '@mui/material/Unstable_Grid2';
import { TagsPanel } from 'src/components/TagsPanel/TagsPanel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { TableBody } from 'src/components/TableBody';
import { TableRow } from 'src/components/TableRow';
import { TagCell } from 'src/components/TagCell/TagCell';
import { Box } from 'src/components/Box';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { Typography, TypographyProps } from 'src/components/Typography';
import { Hidden } from 'src/components/Hidden';
import { lishLaunch } from 'src/features/Lish/lishUtils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { styled } from '@mui/material/styles';
import { Typography } from 'src/components/Typography';
import Grid from '@mui/material/Unstable_Grid2';
import SelectionCardWrapper from 'src/features/Linodes/LinodesCreate/SelectionCardWrapper';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';

const AppPanelGrid = styled(Grid)(({ theme }) => ({
marginTop: theme.spacing(2),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { styled } from '@mui/material/styles';
import { TableCell } from 'src/components/TableCell';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { APIError } from '@linode/api-v4/lib/types';
import classNames from 'classnames';
import * as React from 'react';
import { Button } from 'src/components/Button/Button';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import CircularProgress from 'src/components/core/CircularProgress';
import Paper from 'src/components/core/Paper';
import { makeStyles } from '@mui/styles';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Grid from '@mui/material/Unstable_Grid2';
import MenuItem from 'src/components/core/MenuItem';
import { TextField } from 'src/components/TextField';
import { Typography } from 'src/components/Typography';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { ConfigNodeIPSelect } from './ConfigNodeIPSelect';
import { getErrorMap } from 'src/utilities/errorUtils';
import { NodeBalancerConfigNodeFields } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isEmpty } from 'ramda';
import * as React from 'react';
import { Link, useHistory, useLocation, useParams } from 'react-router-dom';
import { CircleProgress } from 'src/components/CircleProgress';
import { Chip } from 'src/components/core/Chip';
import { Chip } from 'src/components/Chip';
import { makeStyles } from 'tss-react/mui';
import { Theme } from '@mui/material/styles';
import { Typography } from 'src/components/Typography';
Expand Down