Skip to content

Commit

Permalink
fix(clerk-js): Fix phone input select button styles (#2468)
Browse files Browse the repository at this point in the history
  • Loading branch information
desiprisg authored Jan 3, 2024
1 parent 9bd8be3 commit a1214bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .changeset/weak-feet-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
14 changes: 9 additions & 5 deletions packages/clerk-js/src/ui/elements/PhoneInput/PhoneInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { forwardRef, memo, useEffect, useMemo, useRef } from 'react';
import { descriptors, Flex, Icon, Input, Text } from '../../customizables';
import { Select, SelectButton, SelectOptionList } from '../../elements';
import { Check } from '../../icons';
import type { PropsOfComponent } from '../../styledSystem';
import { common, type PropsOfComponent } from '../../styledSystem';
import { mergeRefs } from '../../utils';
import type { CountryEntry, CountryIso } from './countryCodeData';
import { IsoToCountryMap } from './countryCodeData';
Expand Down Expand Up @@ -69,6 +69,7 @@ const PhoneInputBase = forwardRef<HTMLInputElement, PhoneInputProps>((props, ref
direction='row'
hasError={rest.hasError}
sx={theme => ({
...common.borderVariants(theme).normal,
position: 'relative',
borderRadius: theme.radii.$md,
zIndex: 1,
Expand Down Expand Up @@ -99,14 +100,14 @@ const PhoneInputBase = forwardRef<HTMLInputElement, PhoneInputProps>((props, ref
>
<SelectButton
sx={t => ({
border: 'none',
borderRadius: t.radii.$md, // needs to be specified as we can't use overflow: hidden on the parent, hides the popover
borderBottomRightRadius: '0',
borderTopRightRadius: '0',
':hover': {
boxShadow: 'none',
':focus': {
zIndex: 2,
},
':focus': {
':active': {
zIndex: 2,
},
})}
Expand Down Expand Up @@ -145,7 +146,10 @@ const PhoneInputBase = forwardRef<HTMLInputElement, PhoneInputProps>((props, ref
type='tel'
sx={[
{
border: 'none',
boxShadow: 'none',
':hover:not(:focus)': {
boxShadow: 'none',
},
height: '100%',
borderTopLeftRadius: '0',
borderBottomLeftRadius: '0',
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/elements/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export const SelectButton = (props: PropsOfComponent<typeof Button>) => {
elementDescriptor={descriptors.selectButton}
elementId={descriptors.selectButton.setId(elementId)}
ref={reference}
variant='ghost'
variant='unstyled'
textVariant='buttonLarge'
onClick={onTriggerClick}
sx={[
Expand Down
3 changes: 2 additions & 1 deletion packages/clerk-js/src/ui/primitives/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const { applyVariants, filterProps } = createVariants((theme, props: OwnProps) =
'&:hover': { textDecoration: 'underline' },
'&:focus': props.hoverAsFocus ? { textDecoration: 'underline' } : undefined,
},
unstyled: {},
roundWrapper: { padding: 0, margin: 0, height: 'unset', width: 'unset', minHeight: 'unset' },
},
block: {
Expand All @@ -192,7 +193,7 @@ const { applyVariants, filterProps } = createVariants((theme, props: OwnProps) =
textVariant: 'buttonLarge',
variant: 'primary',
size: 'sm',
focusRing: false,
focusRing: true,
},
};
});
Expand Down

0 comments on commit a1214bf

Please sign in to comment.