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-8909] - Migrate EditableText to ui package #11308

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": Removed
---

Migrate `EditableText` from `manager` to `ui` package ([#11308](https://github.com/linode/manager/pull/11308))
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { H1Header } from '@linode/ui';
import { EditableText, H1Header } from '@linode/ui';
import { styled } from '@mui/material';

import { EditableText } from 'src/components/EditableText/EditableText';

export const StyledDiv = styled('div', { label: 'StyledDiv' })({
display: 'flex',
flexDirection: 'column',
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/.changeset/pr-11308-added-1732280066633.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/ui": Added
---

Migrate `EditableText` from `manager` to `ui` package ([#11308](https://github.com/linode/manager/pull/11308))
7 changes: 6 additions & 1 deletion packages/ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"sonarjs",
"prettier",
"@linode/eslint-plugin-cloud-manager"
Expand Down Expand Up @@ -56,7 +57,7 @@
"no-trailing-spaces": "warn",
"no-mixed-requires": "warn",
"object-shorthand": "warn",
// Perfectionist
// perfectionist
"perfectionist/sort-array-includes": "warn",
"perfectionist/sort-classes": "warn",
"perfectionist/sort-enums": "warn",
Expand Down Expand Up @@ -100,6 +101,10 @@
"react/self-closing-comp": "warn",
"react/jsx-no-useless-fragment": "warn",
"react/no-unescaped-entities": "warn",
"react/jsx-no-script-url": "error",
"react/prop-types": "off",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
// sonar
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-duplicate-string": "warn",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fireEvent } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import * as React from 'react';
import { describe, expect, it, vi } from 'vitest';

import { renderWithTheme } from 'src/utilities/testHelpers';

import { renderWithTheme } from '../../utilities/testHelpers';
import { EditableText } from './EditableText';

const props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { Button, ClickAwayListener, H1Header, TextField } from '@linode/ui';
import Check from '@mui/icons-material/Check';
import Close from '@mui/icons-material/Close';
import Edit from '@mui/icons-material/Edit';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { makeStyles } from 'tss-react/mui';

import type { TextFieldProps } from '@linode/ui';
import { Button } from '../Button';
import { ClickAwayListener } from '../ClickAwayListener';
import { H1Header } from '../H1Header';
import { TextField } from '../TextField';

import type { TextFieldProps } from '../TextField';
import type { Theme } from '@mui/material/styles';

const useStyles = makeStyles<void, 'editIcon' | 'icon'>()(
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/EditableText/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './EditableText';
1 change: 1 addition & 0 deletions packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export * from './Checkbox';
export * from './CircleProgress';
export * from './ClickAwayListener';
export * from './Divider';
export * from './EditableText';
export * from './FormControl';
export * from './FormHelperText';
export * from './H1Header';
Expand Down