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-8649] - Move Radio to at linode/ui package #11244

Merged
5 changes: 1 addition & 4 deletions packages/manager/cypress/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import { URL } from 'url';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';

import type { UserConfig } from 'vite';

// ESM-friendly alternative to `__dirname`.
const DIRNAME = new URL('.', import.meta.url).pathname;

export default defineConfig({
// @todo Remove this `as` when we upgrade our package manager. Yarn v1's hoisting behavior is causing a type error
plugins: [react(), svgr({ exportAsDefault: true })] as UserConfig['plugins'],
plugins: [react(), svgr({ exportAsDefault: true })],
pmakode-akamai marked this conversation as resolved.
Show resolved Hide resolved
build: {
rollupOptions: {
// Suppress "SOURCEMAP_ERROR" warnings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Meta, StoryObj } from '@storybook/react';
import { Radio } from '@linode/ui';
import React from 'react';

import { Checkbox } from './Checkbox';
import { FormControlLabel } from './FormControlLabel';
import { Radio } from './Radio/Radio';
import { Toggle } from './Toggle/Toggle';

import type { Meta, StoryObj } from '@storybook/react';

const meta: Meta<typeof FormControlLabel> = {
component: FormControlLabel,
title: 'Components/Form/FormControlLabel',
Expand Down
3 changes: 1 addition & 2 deletions packages/manager/src/components/FormLabel.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { FormControl, RadioGroup } from '@linode/ui';
import { FormControl, Radio, RadioGroup } from '@linode/ui';
import React from 'react';

import { FormControlLabel } from './FormControlLabel';
import { FormLabel } from './FormLabel';
import { Radio } from './Radio/Radio';

import type { Meta, StoryObj } from '@storybook/react';

Expand Down
3 changes: 1 addition & 2 deletions packages/manager/src/components/ModeSelect/ModeSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { RadioGroup } from '@linode/ui';
import { Radio, RadioGroup } from '@linode/ui';
import * as React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { Radio } from 'src/components/Radio/Radio';

export interface Mode<modes> {
label: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { Notice, RadioGroup } from '@linode/ui';
import { Theme } from '@mui/material/styles';
import { Notice, Radio, RadioGroup } from '@linode/ui';
import Grid from '@mui/material/Unstable_Grid2';
import * as React from 'react';
import { ChangeEvent, useState } from 'react';
import { useState } from 'react';
import { makeStyles } from 'tss-react/mui';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { MultipleIPInput } from 'src/components/MultipleIPInput/MultipleIPInput';
import { Radio } from 'src/components/Radio/Radio';
import { Typography } from 'src/components/Typography';
import { ExtendedIP, ipFieldPlaceholder } from 'src/utilities/ipUtils';
import { ipFieldPlaceholder } from 'src/utilities/ipUtils';

import { useIsDatabasesEnabled } from '../utilities';

import type { APIError } from '@linode/api-v4/lib/types';
import type { Theme } from '@mui/material/styles';
import type { ChangeEvent } from 'react';
import type { ExtendedIP } from 'src/utilities/ipUtils';

const useStyles = makeStyles()((theme: Theme) => ({
container: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FormControl, Notice, RadioGroup } from '@linode/ui';
import { FormControl, Notice, Radio, RadioGroup } from '@linode/ui';
import React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { Radio } from 'src/components/Radio/Radio';
import { Typography } from 'src/components/Typography';
import { StyledChip } from 'src/features/components/PlansPanel/PlanSelection.styles';
import { determineInitialPlanCategoryTab } from 'src/features/components/PlansPanel/utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormControl, Notice, RadioGroup } from '@linode/ui';
import { FormControl, Notice, Radio, RadioGroup } from '@linode/ui';
import { useFormik } from 'formik';
import { DateTime } from 'luxon';
import { useSnackbar } from 'notistack';
Expand All @@ -9,7 +9,6 @@ import { makeStyles } from 'tss-react/mui';
import { Button } from 'src/components/Button/Button';
import Select from 'src/components/EnhancedSelect/Select';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Radio } from 'src/components/Radio/Radio';
import { TooltipIcon } from 'src/components/TooltipIcon';
import { Typography } from 'src/components/Typography';
import { useDatabaseMutation } from 'src/queries/databases/databases';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Notice, RadioGroup } from '@linode/ui';
import { Notice, Radio, RadioGroup } from '@linode/ui';
import { useFormik } from 'formik';
import React from 'react';
import { useHistory } from 'react-router-dom';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Drawer } from 'src/components/Drawer';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Radio } from 'src/components/Radio/Radio';
import { TextField } from 'src/components/TextField';
import { useCloneDomainMutation } from 'src/queries/domains';
import { useGrants, useProfile } from 'src/queries/profile/profile';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormHelperText, Notice, Paper, RadioGroup } from '@linode/ui';
import { FormHelperText, Notice, Paper, Radio, RadioGroup } from '@linode/ui';
import { createDomainSchema } from '@linode/validation/lib/domains.schema';
import { styled } from '@mui/material/styles';
import Grid from '@mui/material/Unstable_Grid2';
Expand All @@ -14,7 +14,6 @@ import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { LandingHeader } from 'src/components/LandingHeader';
import { MultipleIPInput } from 'src/components/MultipleIPInput/MultipleIPInput';
import { Radio } from 'src/components/Radio/Radio';
import { TextField } from 'src/components/TextField';
import { reportException } from 'src/exceptionReporting';
import { LinodeSelect } from 'src/features/Linodes/LinodeSelect/LinodeSelect';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Notice, RadioGroup } from '@linode/ui';
import { Notice, Radio, RadioGroup } from '@linode/ui';
import { useFormik } from 'formik';
import * as React from 'react';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Drawer } from 'src/components/Drawer';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { MultipleIPInput } from 'src/components/MultipleIPInput/MultipleIPInput';
import { Radio } from 'src/components/Radio/Radio';
import { TagsInput } from 'src/components/TagsInput/TagsInput';
import { TextField } from 'src/components/TextField';
import { useUpdateDomainMutation } from 'src/queries/domains';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Notice, RadioGroup } from '@linode/ui';
import { Notice, Radio, RadioGroup } from '@linode/ui';
import { styled } from '@mui/material/styles';
import * as React from 'react';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Autocomplete } from 'src/components/Autocomplete/Autocomplete';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { MultipleIPInput } from 'src/components/MultipleIPInput/MultipleIPInput';
import { Radio } from 'src/components/Radio/Radio';
import { TextField } from 'src/components/TextField';
import { Typography } from 'src/components/Typography';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
import { Box, Notice, RadioGroup } from '@linode/ui';
import { Box, Notice, Radio, RadioGroup } from '@linode/ui';
import { CreateFirewallSchema } from '@linode/validation/lib/firewalls.schema';
import { useFormik } from 'formik';
import { useSnackbar } from 'notistack';
Expand All @@ -11,7 +11,6 @@ import { Drawer } from 'src/components/Drawer';
import { ErrorMessage } from 'src/components/ErrorMessage';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { TextField } from 'src/components/TextField';
import { Typography } from 'src/components/Typography';
import { FIREWALL_LIMITS_CONSIDERATIONS_LINK } from 'src/constants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Box, FormControl, RadioGroup } from '@linode/ui';
import { Box, FormControl, Radio, RadioGroup } from '@linode/ui';
import * as React from 'react';

import { Chip } from 'src/components/Chip';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormLabel } from 'src/components/FormLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { Typography } from 'src/components/Typography';

export interface APLProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import {
CircleProgress,
FormControl,
Notice,
Radio,
RadioGroup,
} from '@linode/ui';
import { FormLabel } from '@mui/material';
import * as React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { TooltipIcon } from 'src/components/TooltipIcon';
import { Typography } from 'src/components/Typography';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
import { Stack } from '@linode/ui';
import { Radio, Stack } from '@linode/ui';
import React from 'react';

import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction';
import { Radio } from 'src/components/Radio/Radio';
import { TableCell } from 'src/components/TableCell';
import { TableRow } from 'src/components/TableRow';
import { Typography } from 'src/components/Typography';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Divider, FormControl, RadioGroup, Stack } from '@linode/ui';
import { Divider, FormControl, Radio, RadioGroup, Stack } from '@linode/ui';
import React from 'react';
import { useController, useFormContext } from 'react-hook-form';

Expand All @@ -7,7 +7,6 @@ import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormLabel } from 'src/components/FormLabel';
import { Link } from 'src/components/Link';
import PasswordInput from 'src/components/PasswordInput/PasswordInput';
import { Radio } from 'src/components/Radio/Radio';
import { TextField } from 'src/components/TextField';
import { Typography } from 'src/components/Typography';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Radio } from '@linode/ui';
import React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction';
import { Radio } from 'src/components/Radio/Radio';
import { StatusIcon } from 'src/components/StatusIcon/StatusIcon';
import { TableCell } from 'src/components/TableCell';
import { TableRow } from 'src/components/TableRow';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
FormControl,
FormHelperText,
Notice,
Radio,
} from '@linode/ui';
import { useTheme } from '@mui/material/styles';
import Grid from '@mui/material/Unstable_Grid2';
Expand All @@ -22,7 +23,6 @@ import { ErrorState } from 'src/components/ErrorState/ErrorState';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormLabel } from 'src/components/FormLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { TextField } from 'src/components/TextField';
import { Toggle } from 'src/components/Toggle/Toggle';
import { TooltipIcon } from 'src/components/TooltipIcon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Box, Divider, Notice, RadioGroup, Stack, Tooltip } from '@linode/ui';
import { Box, Divider, Notice, Radio, RadioGroup, Stack, Tooltip } from '@linode/ui';
import { styled } from '@mui/material/styles';
import * as React from 'react';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Drawer } from 'src/components/Drawer';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { Typography } from 'src/components/Typography';
import {
useAllocateIPMutation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Box, Divider, FormControl, RadioGroup } from '@linode/ui';
import { Box, Divider, FormControl, Radio, RadioGroup } from '@linode/ui';
import { useTheme } from '@mui/material/styles';
import * as React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { TooltipIcon } from 'src/components/TooltipIcon';
import { Typography } from 'src/components/Typography';
import { capitalize } from 'src/utilities/capitalize';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import {
getActiveLongviewPlan,
updateActiveLongviewPlan,
} from '@linode/api-v4/lib/longview';
import { CircleProgress, Notice, Paper } from '@linode/ui';
import { CircleProgress, Notice, Paper, Radio } from '@linode/ui';
import { useTheme } from '@mui/material/styles';
import * as React from 'react';

import { Button } from 'src/components/Button/Button';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { Radio } from 'src/components/Radio/Radio';
import { SupportLink } from 'src/components/SupportLink';
import { TableBody } from 'src/components/TableBody';
import { TableCell } from 'src/components/TableCell';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
import { Tooltip } from '@linode/ui';
import { Radio, Tooltip } from '@linode/ui';
import { styled } from '@mui/material/styles';
import * as React from 'react';

import Check from 'src/assets/icons/monitor-ok.svg';
import { Radio } from 'src/components/Radio/Radio';

interface RadioButton extends HTMLInputElement {
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Radio } from '@linode/ui';
import { update } from 'ramda';
import * as React from 'react';

import { Radio } from 'src/components/Radio/Radio';
import { TableBody } from 'src/components/TableBody';
import { TableCell } from 'src/components/TableCell';
import { TableHead } from 'src/components/TableHead';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {
ObjectStorageKeyBucketAccessPermissions,
ObjectStorageKeyBucketAccess,
} from '@linode/api-v4/lib/object-storage/types';
import { Radio } from '@linode/ui';
import { update } from 'ramda';
import * as React from 'react';

import { Radio } from 'src/components/Radio/Radio';
import { TableBody } from 'src/components/TableBody';
import { TableCell } from 'src/components/TableCell';
import { TableHead } from 'src/components/TableHead';
Expand All @@ -25,6 +21,10 @@ import {
} from './AccessTable.styles';

import type { MODE } from './types';
import type {
ObjectStorageKeyBucketAccess,
ObjectStorageKeyBucketAccessPermissions,
} from '@linode/api-v4/lib/object-storage/types';

export const getUpdatedScopes = (
oldScopes: ObjectStorageKeyBucketAccess[],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Box } from '@linode/ui';
import { Box, Radio } from '@linode/ui';
import React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormLabel } from 'src/components/FormLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { SupportLink } from 'src/components/SupportLink';
import { Table } from 'src/components/Table';
import { TableBody } from 'src/components/TableBody';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Box, Notice, RadioGroup } from '@linode/ui';
import { Box, Notice, Radio, RadioGroup } from '@linode/ui';
import * as React from 'react';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormLabel } from 'src/components/FormLabel';
import { Radio } from 'src/components/Radio/Radio';
import { Typography } from 'src/components/Typography';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { FormControl, FormHelperText, Notice } from '@linode/ui';
import { FormControl, FormHelperText, Notice, Radio } from '@linode/ui';
import { useFormik } from 'formik';
import { DateTime } from 'luxon';
import * as React from 'react';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Autocomplete } from 'src/components/Autocomplete/Autocomplete';
import { Drawer } from 'src/components/Drawer';
import { Radio } from 'src/components/Radio/Radio';
import { TableBody } from 'src/components/TableBody';
import { TableCell } from 'src/components/TableCell';
import { TableHead } from 'src/components/TableHead';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Paper, RadioGroup, Stack } from '@linode/ui';
import { Paper, Radio, RadioGroup, Stack } from '@linode/ui';
import { createLazyRoute } from '@tanstack/react-router';
import * as React from 'react';
import { useHistory, useLocation } from 'react-router-dom';

import { Code } from 'src/components/Code/Code';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Radio } from 'src/components/Radio/Radio';
import { Toggle } from 'src/components/Toggle/Toggle';
import { Typography } from 'src/components/Typography';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Radio } from '@linode/ui';
import * as React from 'react';

import { Radio } from 'src/components/Radio/Radio';
import { RenderGuard } from 'src/components/RenderGuard';
import { TableCell } from 'src/components/TableCell';
import { TableRow } from 'src/components/TableRow';
Expand Down
Loading