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

panelprovider: remove panel border radius override #84932

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
55 changes: 26 additions & 29 deletions static/app/components/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import classNames from 'classnames';
import {IconCheckmark, IconChevron, IconInfo, IconNot, IconWarning} from 'sentry/icons';
import {space} from 'sentry/styles/space';
import {defined} from 'sentry/utils';
import PanelProvider from 'sentry/utils/panelProvider';

export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
type: 'muted' | 'info' | 'warning' | 'success' | 'error';
Expand Down Expand Up @@ -77,34 +76,32 @@ export function Alert({
{...hoverProps}
{...props}
>
<PanelProvider>
{showIcon && (
<IconWrapper onClick={handleClick}>
{icon ?? <AlertIcon type={type} />}
</IconWrapper>
)}
<Message>{children}</Message>
{!!trailingItems && (
<TrailingItems showIcon={!!showIcon} onClick={e => e.stopPropagation()}>
{trailingItems}
</TrailingItems>
)}
{showExpand && (
<ExpandIconWrap>
<IconChevron direction={isExpanded ? 'up' : 'down'} />
</ExpandIconWrap>
)}
{isExpanded && (
<ExpandContainer
ref={expandRef}
showIcon={!!showIcon}
showTrailingItems={!!trailingItems}
{...expandHoverProps}
>
{Array.isArray(expand) ? expand.map(item => item) : expand}
</ExpandContainer>
)}
</PanelProvider>
{showIcon && (
<IconWrapper onClick={handleClick}>
{icon ?? <AlertIcon type={type} />}
</IconWrapper>
)}
<Message>{children}</Message>
{!!trailingItems && (
<TrailingItems showIcon={!!showIcon} onClick={e => e.stopPropagation()}>
{trailingItems}
</TrailingItems>
)}
{showExpand && (
<ExpandIconWrap>
<IconChevron direction={isExpanded ? 'up' : 'down'} />
</ExpandIconWrap>
)}
{isExpanded && (
<ExpandContainer
ref={expandRef}
showIcon={!!showIcon}
showTrailingItems={!!trailingItems}
{...expandHoverProps}
>
{Array.isArray(expand) ? expand.map(item => item) : expand}
</ExpandContainer>
)}
</AlertContainer>
);
}
Expand Down
3 changes: 1 addition & 2 deletions static/app/components/dropdownBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {css} from '@emotion/react';
import styled from '@emotion/styled';

import {space} from 'sentry/styles/space';
import PanelProvider from 'sentry/utils/panelProvider';
import SettingsHeader from 'sentry/views/settings/components/settingsHeader';

interface DropdownBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
Expand Down Expand Up @@ -68,7 +67,7 @@ const DropdownBubble = styled(
forwardRef<HTMLDivElement, DropdownBubbleProps>(
({children, ...props}, forwardedRef) => (
<div ref={forwardedRef} {...props}>
<PanelProvider>{children}</PanelProvider>
{children}
</div>
)
),
Expand Down
7 changes: 1 addition & 6 deletions static/app/components/forms/controls/selectControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {Choices, SelectValue} from 'sentry/types/core';
import convertFromSelect2Choices from 'sentry/utils/convertFromSelect2Choices';
import PanelProvider from 'sentry/utils/panelProvider';
import type {FormSize} from 'sentry/utils/theme';

import Option from './selectOption';
Expand Down Expand Up @@ -110,11 +109,7 @@ const SingleValueLabel = styled('div')`

function Menu(props: React.ComponentProps<typeof selectComponents.Menu>) {
const {children, ...otherProps} = props;
return (
<selectComponents.Menu {...otherProps}>
<PanelProvider>{children}</PanelProvider>
</selectComponents.Menu>
);
return <selectComponents.Menu {...otherProps}>{children}</selectComponents.Menu>;
}

export interface ControlProps<OptionType extends OptionTypeBase = GeneralSelectValue>
Expand Down
3 changes: 1 addition & 2 deletions static/app/components/overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type {OverlayArrowProps} from 'sentry/components/overlayArrow';
import {OverlayArrow} from 'sentry/components/overlayArrow';
import {NODE_ENV} from 'sentry/constants';
import {defined} from 'sentry/utils';
import PanelProvider from 'sentry/utils/panelProvider';
import testableTransition from 'sentry/utils/testableTransition';

type OriginPoint = Partial<{x: number; y: number}>;
Expand Down Expand Up @@ -126,7 +125,7 @@ const Overlay = styled(
return (
<motion.div {...props} {...animationProps} data-overlay ref={ref}>
{defined(arrowProps) && <OverlayArrow {...arrowProps} />}
<PanelProvider>{children}</PanelProvider>
{children}
</motion.div>
);
}
Expand Down
3 changes: 1 addition & 2 deletions static/app/components/panels/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import isPropValid from '@emotion/is-prop-valid';
import styled from '@emotion/styled';

import {space} from 'sentry/styles/space';
import PanelProvider from 'sentry/utils/panelProvider';

interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {
dashedBorder?: boolean;
Expand All @@ -13,7 +12,7 @@ interface PanelProps extends React.HTMLAttributes<HTMLDivElement> {
const Panel = styled(
forwardRef<HTMLDivElement, PanelProps>(({children, ...props}, forwardedRef) => (
<div ref={forwardedRef} {...props}>
<PanelProvider>{children}</PanelProvider>
{children}
</div>
)),
{shouldForwardProp: prop => typeof prop === 'string' && isPropValid(prop)}
Expand Down
27 changes: 12 additions & 15 deletions static/app/components/searchQueryBuilder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {SavedSearchType, Tag, TagCollection} from 'sentry/types/group';
import {getFieldDefinition} from 'sentry/utils/fields';
import PanelProvider from 'sentry/utils/panelProvider';
import {useDimensions} from 'sentry/utils/useDimensions';
import {useEffectAfterFirstRender} from 'sentry/utils/useEffectAfterFirstRender';
import usePrevious from 'sentry/utils/usePrevious';
Expand Down Expand Up @@ -305,20 +304,18 @@ export function SearchQueryBuilder({
aria-disabled={disabled}
data-test-id="search-query-builder"
>
<PanelProvider>
<SearchIndicator
initialQuery={initialQuery}
showUnsubmittedIndicator={showUnsubmittedIndicator}
/>
{!parsedQuery || queryInterface === QueryInterfaceType.TEXT ? (
<PlainTextQueryInput label={label} />
) : (
<TokenizedQueryGrid label={label} actionBarWidth={actionBarWidth} />
)}
{size !== 'small' && (
<ActionButtons ref={actionBarRef} trailingItems={trailingItems} />
)}
</PanelProvider>
<SearchIndicator
initialQuery={initialQuery}
showUnsubmittedIndicator={showUnsubmittedIndicator}
/>
{!parsedQuery || queryInterface === QueryInterfaceType.TEXT ? (
<PlainTextQueryInput label={label} />
) : (
<TokenizedQueryGrid label={label} actionBarWidth={actionBarWidth} />
)}
{size !== 'small' && (
<ActionButtons ref={actionBarRef} trailingItems={trailingItems} />
)}
</Wrapper>
</SearchQueryBuilderContext.Provider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export function SearchQueryBuilderFilter({item, state, token}: SearchQueryTokenP
const FilterWrapper = styled('div')<{state: 'invalid' | 'warning' | 'valid'}>`
position: relative;
border: 1px solid ${p => p.theme.innerBorder};
border-radius: ${p => p.theme.borderRadius};
border-radius: 4px;
height: 24px;
/* Ensures that filters do not grow outside of the container */
min-width: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ const RecentFilterPill = styled('li')`
padding: 0 ${space(1.5)} 0 ${space(0.75)};
background: ${p => p.theme.background};
box-shadow: inset 0 0 0 1px ${p => p.theme.innerBorder};
border-radius: ${p => p.theme.borderRadius} 0 0 ${p => p.theme.borderRadius};
border-radius: 4px 0 0 4px;
cursor: pointer;

/* Fade out on right side to represent that this is a filter key only */
Expand Down Expand Up @@ -494,6 +494,7 @@ const SectionButton = styled(Button)`
padding: 0 ${space(1.5)};
color: ${p => p.theme.subText};
border: 0;
border-radius: 4px;

&[aria-selected='true'] {
background-color: ${p => p.theme.purple100};
Expand Down
26 changes: 0 additions & 26 deletions static/app/utils/panelProvider.tsx

This file was deleted.

Loading