Skip to content

Commit 60da03e

Browse files
committed
Move Size enum to constants (#676)
1 parent 8eb0a6c commit 60da03e

File tree

7 files changed

+13
-15
lines changed

7 files changed

+13
-15
lines changed

src/__tests__/components/ClearButton.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
userEvent,
1111
} from '../helpers';
1212

13-
import { Size } from '../../types';
13+
import { Size } from '../../constants';
1414

1515
describe('<ClearButton>', () => {
1616
it('renders a snapshot', () => {

src/behaviors/classNames.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import cx from 'classnames';
44
import React, { ComponentType } from 'react';
55

66
import { getDisplayName, isSizeLarge, isSizeSmall } from '../utils';
7-
import type { Size } from '../types';
7+
import { Size } from '../constants';
88

99
type Props = any & {
1010
className?: string;

src/components/ClearButton.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import React, {
88
MouseEventHandler,
99
} from 'react';
1010

11+
import { Size } from '../constants';
1112
import { isSizeLarge, noop } from '../utils';
12-
1313
import { sizeType } from '../propTypes';
14-
import { Size } from '../types';
1514

1615
const propTypes = {
1716
label: PropTypes.string,

src/components/Typeahead.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ import {
3030
preventInputBlur,
3131
} from '../utils';
3232
import { checkPropType, inputPropsType, sizeType } from '../propTypes';
33+
import { Size } from '../constants';
3334

3435
import {
3536
InputProps,
3637
Option,
3738
RefElement,
3839
RenderToken,
3940
RenderTokenProps,
40-
Size,
4141
TypeaheadProps,
4242
TypeaheadManagerChildProps,
4343
} from '../types';

src/constants.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
/* eslint-disable import/prefer-default-export */
2-
31
export const DEFAULT_LABELKEY = 'label';
2+
3+
export enum Size {
4+
LARGE = 'large',
5+
LG = 'lg',
6+
SM = 'sm',
7+
SMALL = 'small',
8+
}

src/propTypes.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import PropTypes from 'prop-types';
22
import { HTMLProps, Requireable } from 'react';
33

4+
import { Size } from './constants';
45
import { isFunction, warn } from './utils';
5-
import { Size, TypeaheadProps } from './types';
6+
import type { TypeaheadProps } from './types';
67

78
interface InputPropItem {
89
alt: string;

src/types.ts

-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ import {
1111
SyntheticEvent,
1212
} from 'react';
1313

14-
export enum Size {
15-
LARGE = 'large',
16-
LG = 'lg',
17-
SM = 'sm',
18-
SMALL = 'small',
19-
}
20-
2114
export type AllowNew =
2215
| boolean
2316
| ((options: Option[], state: TypeaheadPropsAndState) => boolean);

0 commit comments

Comments
 (0)