Skip to content

Commit d87b8d0

Browse files
authored
ref: move inputGroup to components/core/input (#86031)
note: there are no usages in `getsentry` so we can just move it without having to keep the old file around for backwards compatibility
1 parent 75d3190 commit d87b8d0

File tree

18 files changed

+22
-23
lines changed

18 files changed

+22
-23
lines changed

static/app/components/inputGroup.spec.tsx renamed to static/app/components/core/input/inputGroup.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
22

33
import {Button} from 'sentry/components/button';
4-
import {InputGroup} from 'sentry/components/inputGroup';
4+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
55

66
describe('InputGroup', function () {
77
it('renders input', function () {

static/app/components/inputGroup.tsx renamed to static/app/components/core/input/inputGroup.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const InputGroupContext = createContext<InputContext>({inputProps: {}});
4747
* <InputGroup.TrailingItems> … </InputGroup.TrailingItems>
4848
* </InputGroup>
4949
*/
50-
function InputGroup({children, ...props}: React.HTMLAttributes<HTMLDivElement>) {
50+
export function InputGroup({children, ...props}: React.HTMLAttributes<HTMLDivElement>) {
5151
const [leadingWidth, setLeadingWidth] = useState<number>();
5252
const [trailingWidth, setTrailingWidth] = useState<number>();
5353
const [inputProps, setInputProps] = useState<Partial<InputProps>>({});
@@ -200,7 +200,6 @@ InputGroup.TextArea = TextArea;
200200
InputGroup.LeadingItems = LeadingItems;
201201
InputGroup.TrailingItems = TrailingItems;
202202

203-
export {InputGroup};
204203
export type {InputProps, TextAreaProps};
205204

206205
export const InputGroupWrap = styled('div')<{disabled?: boolean}>`

static/app/components/events/breadcrumbs/breadcrumbsDrawer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ProjectAvatar from 'sentry/components/avatar/projectAvatar';
66
import {Button} from 'sentry/components/button';
77
import ButtonBar from 'sentry/components/buttonBar';
88
import {CompactSelect} from 'sentry/components/compactSelect';
9+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
910
import BreadcrumbsTimeline from 'sentry/components/events/breadcrumbs/breadcrumbsTimeline';
1011
import {
1112
BREADCRUMB_TIME_DISPLAY_LOCALSTORAGE_KEY,
@@ -32,7 +33,6 @@ import {
3233
BreadcrumbSort,
3334
} from 'sentry/components/events/interfaces/breadcrumbs';
3435
import useFocusControl from 'sentry/components/events/useFocusControl';
35-
import {InputGroup} from 'sentry/components/inputGroup';
3636
import {IconClock, IconFilter, IconSearch, IconSort, IconTimer} from 'sentry/icons';
3737
import {t} from 'sentry/locale';
3838
import {space} from 'sentry/styles/space';

static/app/components/events/eventDrawer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import styled from '@emotion/styled';
22

33
import {Breadcrumbs as NavigationBreadcrumbs} from 'sentry/components/breadcrumbs';
4+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
45
import {DrawerBody, DrawerHeader} from 'sentry/components/globalDrawer/components';
5-
import {InputGroup} from 'sentry/components/inputGroup';
66
import {space} from 'sentry/styles/space';
77
import {MIN_NAV_HEIGHT} from 'sentry/views/issueDetails/streamline/eventTitle';
88

static/app/components/events/featureFlags/featureFlagDrawer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
33

44
import ProjectAvatar from 'sentry/components/avatar/projectAvatar';
55
import ButtonBar from 'sentry/components/buttonBar';
6+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
67
import {
78
CrumbContainer,
89
EventDrawerBody,
@@ -22,7 +23,6 @@ import {
2223
sortedFlags,
2324
} from 'sentry/components/events/featureFlags/utils';
2425
import useFocusControl from 'sentry/components/events/useFocusControl';
25-
import {InputGroup} from 'sentry/components/inputGroup';
2626
import KeyValueData, {
2727
type KeyValueDataContentProps,
2828
} from 'sentry/components/keyValueData';

static/app/components/events/highlights/editHighlightsModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {ModalRenderProps} from 'sentry/actionCreators/modal';
66
import {Button} from 'sentry/components/button';
77
import ButtonBar from 'sentry/components/buttonBar';
88
import type {InputProps} from 'sentry/components/core/input';
9+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
910
import {getOrderedContextItems} from 'sentry/components/events/contexts';
1011
import {ContextCardContent} from 'sentry/components/events/contexts/contextCard';
1112
import {getContextMeta} from 'sentry/components/events/contexts/utils';
@@ -18,7 +19,6 @@ import {
1819
getHighlightContextData,
1920
getHighlightTagData,
2021
} from 'sentry/components/events/highlights/util';
21-
import {InputGroup} from 'sentry/components/inputGroup';
2222
import {IconAdd, IconInfo, IconSearch, IconSubtract} from 'sentry/icons';
2323
import {t} from 'sentry/locale';
2424
import {space} from 'sentry/styles/space';

static/app/components/forms/fields/fileField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import {useState} from 'react';
22
import styled from '@emotion/styled';
33
import omit from 'lodash/omit';
44

5+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
56
import FormField from 'sentry/components/forms/formField';
67
import FormFieldControlState from 'sentry/components/forms/formField/controlState';
78
import type FormModel from 'sentry/components/forms/model';
8-
import {InputGroup} from 'sentry/components/inputGroup';
99
import {t} from 'sentry/locale';
1010

1111
// XXX(epurkhiser): This is wrong, it should not be inheriting these props

static/app/components/forms/fields/inputField.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import type {InputProps} from 'sentry/components/core/input/inputGroup';
2+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
13
import type {FormFieldProps} from 'sentry/components/forms/formField';
24
import FormField from 'sentry/components/forms/formField';
35
import FormFieldControlState from 'sentry/components/forms/formField/controlState';
46
import type FormModel from 'sentry/components/forms/model';
5-
import type {InputProps} from 'sentry/components/inputGroup';
6-
import {InputGroup} from 'sentry/components/inputGroup';
77

88
export interface InputFieldProps
99
extends Omit<FormFieldProps, 'children'>,

static/app/components/forms/fields/numberField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {css} from '@emotion/react';
33
import styled from '@emotion/styled';
44

55
import {Input} from 'sentry/components/core/input';
6+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
67
import FormFieldControlState from 'sentry/components/forms/formField/controlState';
78
import type FormModel from 'sentry/components/forms/model';
8-
import {InputGroup} from 'sentry/components/inputGroup';
99
import {space} from 'sentry/styles/space';
1010

1111
import type {InputFieldProps, OnEvent} from './inputField';

static/app/components/forms/fields/textareaField.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import omit from 'lodash/omit';
22

3+
import type {TextAreaProps} from 'sentry/components/core/input/inputGroup';
4+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
35
import FormField from 'sentry/components/forms/formField';
46
import FormFieldControlState from 'sentry/components/forms/formField/controlState';
57
import type FormModel from 'sentry/components/forms/model';
6-
import type {TextAreaProps} from 'sentry/components/inputGroup';
7-
import {InputGroup} from 'sentry/components/inputGroup';
88

99
// XXX(epurkhiser): This is wrong, it should not be inheriting these props
1010
import type {InputFieldProps} from './inputField';

static/app/components/numberInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {useNumberFieldState} from '@react-stately/numberfield';
88

99
import {Button} from 'sentry/components/button';
1010
import type {InputStylesProps} from 'sentry/components/core/input';
11-
import {InputGroup} from 'sentry/components/inputGroup';
11+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
1212
import {IconChevron} from 'sentry/icons/iconChevron';
1313
import {space} from 'sentry/styles/space';
1414
import mergeRefs from 'sentry/utils/mergeRefs';

static/app/components/searchBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {useCallback, useEffect, useRef, useState} from 'react';
22
import styled from '@emotion/styled';
33

44
import {Button} from 'sentry/components/button';
5-
import type {InputProps} from 'sentry/components/inputGroup';
6-
import {InputGroup} from 'sentry/components/inputGroup';
5+
import type {InputProps} from 'sentry/components/core/input/inputGroup';
6+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
77
import {IconSearch} from 'sentry/icons';
88
import {IconClose} from 'sentry/icons/iconClose';
99
import {t} from 'sentry/locale';

static/app/components/textCopyInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {useCallback, useId} from 'react';
22
import styled from '@emotion/styled';
33

44
import {CopyToClipboardButton} from 'sentry/components/copyToClipboardButton';
5-
import type {InputProps} from 'sentry/components/inputGroup';
6-
import {InputGroup} from 'sentry/components/inputGroup';
5+
import type {InputProps} from 'sentry/components/core/input/inputGroup';
6+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
77
import {space} from 'sentry/styles/space';
88
import {selectText} from 'sentry/utils/selectText';
99

static/app/views/issueDetails/groupTags/groupTagsDrawer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styled from '@emotion/styled';
44
import ProjectAvatar from 'sentry/components/avatar/projectAvatar';
55
import {Button} from 'sentry/components/button';
66
import ButtonBar from 'sentry/components/buttonBar';
7+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
78
import {ExportQueryType, useDataExport} from 'sentry/components/dataExport';
89
import {DropdownMenu} from 'sentry/components/dropdownMenu';
910
import {
@@ -16,7 +17,6 @@ import {
1617
SearchInput,
1718
ShortId,
1819
} from 'sentry/components/events/eventDrawer';
19-
import {InputGroup} from 'sentry/components/inputGroup';
2020
import LoadingError from 'sentry/components/loadingError';
2121
import LoadingIndicator from 'sentry/components/loadingIndicator';
2222
import {IconDownload, IconSearch} from 'sentry/icons';

static/app/views/performance/newTraceDetails/traceSearch/traceSearchInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type React from 'react';
22
import {Fragment, useCallback, useLayoutEffect, useRef, useState} from 'react';
33
import styled from '@emotion/styled';
44

5-
import {InputGroup} from 'sentry/components/inputGroup';
5+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
66
import LoadingIndicator from 'sentry/components/loadingIndicator';
77
import {SearchBarTrailingButton} from 'sentry/components/searchBar';
88
import {IconChevron, IconClose, IconSearch} from 'sentry/icons';

static/app/views/settings/dynamicSampling/percentInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {forwardRef} from 'react';
33
import {css} from '@emotion/react';
44
import styled from '@emotion/styled';
55

6-
import {InputGroup} from 'sentry/components/inputGroup';
6+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
77
import {space} from 'sentry/styles/space';
88

99
interface Props extends React.ComponentProps<typeof InputGroup.Input> {}

static/app/views/stories/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styled from '@emotion/styled';
44
import {Button} from 'sentry/components/button';
55
import {CompactSelect} from 'sentry/components/compactSelect';
66
import {Alert} from 'sentry/components/core/alert';
7-
import {InputGroup} from 'sentry/components/inputGroup';
7+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
88
import LoadingIndicator from 'sentry/components/loadingIndicator';
99
import {IconSettings} from 'sentry/icons';
1010
import {IconSearch} from 'sentry/icons/iconSearch';

static/app/views/stories/storyTypes.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {PropItem, Props} from 'react-docgen-typescript';
33
import styled from '@emotion/styled';
44

55
import {Button} from 'sentry/components/button';
6-
import {InputGroup} from 'sentry/components/inputGroup';
6+
import {InputGroup} from 'sentry/components/core/input/inputGroup';
77
import {Tooltip} from 'sentry/components/tooltip';
88
import {IconChevron} from 'sentry/icons';
99
import {IconSearch} from 'sentry/icons/iconSearch';

0 commit comments

Comments
 (0)