Skip to content

Commit

Permalink
Moving RESIZE constant to textarea component folder (#19240)
Browse files Browse the repository at this point in the history
* Moving RESIZE constant

* fixinf linting errors
  • Loading branch information
dhruvv173 authored May 23, 2023
1 parent 15598f2 commit 49b8dcb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
8 changes: 8 additions & 0 deletions ui/components/ui/textarea/textarea.constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const RESIZE = {
NONE: 'none',
BOTH: 'both',
HORIZONTAL: 'horizontal',
VERTICAL: 'vertical',
INITIAL: 'initial',
INHERIT: 'inherit',
};
7 changes: 3 additions & 4 deletions ui/components/ui/textarea/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import PropTypes from 'prop-types';
import classnames from 'classnames';

import {
RESIZE,
BorderStyle,
BLOCK_SIZES,
BlockSize,
Size,
BorderColor,
BackgroundColor,
} from '../../../helpers/constants/design-system';

import Box from '../box';
import { RESIZE } from './textarea.constants';

const TextArea = ({
className,
Expand Down Expand Up @@ -40,7 +39,7 @@ const TextArea = ({
borderRadius={Size.SM}
borderStyle={BorderStyle.solid}
padding={4}
width={BLOCK_SIZES.FULL}
width={BlockSize.Full}
{...boxProps}
>
{(boxClassName) => (
Expand Down
7 changes: 3 additions & 4 deletions ui/components/ui/textarea/textarea.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import React from 'react';
import { useArgs } from '@storybook/client-api';

import {
RESIZE,
BorderStyle,
BLOCK_SIZES,
BlockSize,
BorderRadius,
BorderColor,
Size,
} from '../../../helpers/constants/design-system';

import { RESIZE } from './textarea.constants';
import README from './README.mdx';
import Textarea from '.';

Expand Down Expand Up @@ -115,6 +114,6 @@ Scrollable.args = {
borderRadius: BorderRadius.none,
borderStyle: BorderStyle.none,
padding: [2, 4],
width: BLOCK_SIZES.FULL,
width: BlockSize.Full,
},
};
2 changes: 1 addition & 1 deletion ui/components/ui/textarea/textarea.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { render, fireEvent } from '@testing-library/react';
import {
BorderColor,
BorderStyle,
RESIZE,
Size,
} from '../../../helpers/constants/design-system';
import { RESIZE } from './textarea.constants';
import TextArea from '.';

describe('TextArea', () => {
Expand Down
9 changes: 0 additions & 9 deletions ui/helpers/constants/design-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,4 @@ export const SEVERITIES = {
SUCCESS: 'success',
};

export const RESIZE = {
NONE: 'none',
BOTH: 'both',
HORIZONTAL: 'horizontal',
VERTICAL: 'vertical',
INITIAL: 'initial',
INHERIT: 'inherit',
};

export const BREAKPOINTS = ['base', 'sm', 'md', 'lg'];

0 comments on commit 49b8dcb

Please sign in to comment.