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-8900] - Move RadioGroup to @linode/ui package #11254

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
3 changes: 1 addition & 2 deletions packages/manager/src/components/FormLabel.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { FormControl } from '@linode/ui';
import { FormControl, RadioGroup } from '@linode/ui';
import React from 'react';

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

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

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

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

export interface Mode<modes> {
label: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/manager/src/components/Radio/Radio.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box } from '@linode/ui';
import { Box, RadioGroup } from '@linode/ui';
import React from 'react';

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

import type { RadioProps } from './Radio';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Notice, RadioGroup } from '@linode/ui';
import { Theme } from '@mui/material/styles';
import Grid from '@mui/material/Unstable_Grid2';
import * as React from 'react';
Expand All @@ -8,14 +9,12 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
import { Typography } from 'src/components/Typography';
import { ExtendedIP, ipFieldPlaceholder } from 'src/utilities/ipUtils';

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

import type { APIError } from '@linode/api-v4/lib/types';
import { Notice } from '@linode/ui';

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

import { FormControlLabel } from 'src/components/FormControlLabel';
import { Radio } from 'src/components/Radio/Radio';
import { RadioGroup } from 'src/components/RadioGroup';
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 } from '@linode/ui';
import { FormControl, Notice, RadioGroup } from '@linode/ui';
import { useFormik } from 'formik';
import { DateTime } from 'luxon';
import { useSnackbar } from 'notistack';
Expand All @@ -10,7 +10,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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,4 +1,4 @@
import { Notice } from '@linode/ui';
import { Notice, RadioGroup } from '@linode/ui';
import { useFormik } from 'formik';
import React from 'react';
import { useHistory } from 'react-router-dom';
Expand All @@ -7,7 +7,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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 } from '@linode/ui';
import { FormHelperText, Notice, Paper, 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 @@ -15,7 +15,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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,4 +1,4 @@
import { Notice } from '@linode/ui';
import { Notice, RadioGroup } from '@linode/ui';
import { useFormik } from 'formik';
import * as React from 'react';

Expand All @@ -7,7 +7,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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,4 +1,4 @@
import { Notice } from '@linode/ui';
import { Notice, RadioGroup } from '@linode/ui';
import { styled } from '@mui/material/styles';
import * as React from 'react';

Expand All @@ -7,7 +7,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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 } from '@linode/ui';
import { Box, Notice, RadioGroup } from '@linode/ui';
import { CreateFirewallSchema } from '@linode/validation/lib/firewalls.schema';
import { useFormik } from 'formik';
import { useSnackbar } from 'notistack';
Expand All @@ -12,7 +12,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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,12 +1,11 @@
import { Box, FormControl } from '@linode/ui';
import { Box, FormControl, 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 { RadioGroup } from 'src/components/RadioGroup';
import { Typography } from 'src/components/Typography';

export interface APLProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Box, FormControl, Notice } from '@linode/ui';
import { Box, FormControl, Notice, RadioGroup } from '@linode/ui';
import { FormLabel } from '@mui/material';
import * as React from 'react';

import { CircleProgress } from 'src/components/CircleProgress';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { Radio } from 'src/components/Radio/Radio';
import { RadioGroup } from 'src/components/RadioGroup';
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,4 +1,4 @@
import { Divider, FormControl, Stack } from '@linode/ui';
import { Divider, FormControl, RadioGroup, Stack } from '@linode/ui';
import React from 'react';
import { useController, useFormContext } from 'react-hook-form';

Expand All @@ -8,7 +8,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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,9 +1,8 @@
import { Divider, FormControl } from '@linode/ui';
import { Divider, FormControl, RadioGroup } from '@linode/ui';
import { styled } from '@mui/material/styles';

import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormGroup } from 'src/components/FormGroup';
import { RadioGroup } from 'src/components/RadioGroup';

const formGroupStyling = {
'&.MuiFormGroup-root[role="radiogroup"]': {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Divider, Notice, Stack, Tooltip } from '@linode/ui';
import { Box, Divider, Notice, RadioGroup, Stack, Tooltip } from '@linode/ui';
import { styled } from '@mui/material/styles';
import * as React from 'react';

Expand All @@ -7,7 +7,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
import { Typography } from 'src/components/Typography';
import {
useAllocateIPMutation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Box, Divider, FormControl } from '@linode/ui';
import { Box, Divider, FormControl, 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 { RadioGroup } from 'src/components/RadioGroup';
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
@@ -1,10 +1,9 @@
import { Box, Notice } from '@linode/ui';
import { Box, Notice, 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 { RadioGroup } from 'src/components/RadioGroup';
import { Typography } from 'src/components/Typography';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Paper, Stack } from '@linode/ui';
import { Paper, RadioGroup, Stack } from '@linode/ui';
import { createLazyRoute } from '@tanstack/react-router';
import * as React from 'react';
import { useHistory, useLocation } from 'react-router-dom';
Expand All @@ -7,7 +7,6 @@ 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 { RadioGroup } from 'src/components/RadioGroup';
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,8 +1,8 @@
import { RadioGroup } from '@linode/ui';
import * as React from 'react';

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

type Mode = 'attach' | 'create';

Expand Down
5 changes: 5 additions & 0 deletions packages/ui/.changeset/pr-11254-added-1731501211100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/ui": Added
---

Move `RadioGroup` from `manager` to `ui` package ([#11254](https://github.com/linode/manager/pull/11254))
1 change: 1 addition & 0 deletions packages/ui/src/components/RadioGroup/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './RadioGroup';
1 change: 1 addition & 0 deletions packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from './InputAdornment';
export * from './InputLabel';
export * from './Notice';
export * from './Paper';
export * from './RadioGroup';
export * from './Stack';
export * from './Tooltip';
export * from './VisibilityTooltip';