Skip to content

Commit

Permalink
fix(clerk-js): Use shadows for card borders and fix PhoneInput zIndices
Browse files Browse the repository at this point in the history
  • Loading branch information
desiprisg committed Nov 28, 2023
1 parent 9a1fe37 commit d880685
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changeset/pink-days-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
7 changes: 5 additions & 2 deletions packages/clerk-js/src/ui.retheme/elements/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>((props, ref) =>
position: 'relative',
backgroundColor: t.colors.$colorBackground,
padding: t.space.$8,
boxShadow: t.shadows.$sm,
boxShadow:
'0px 0px 2px 0px rgba(0, 0, 0, 0.08), 0px 1px 2px 0px rgba(25, 28, 33, 0.06), 0px 0px 0px 1px rgba(25, 28, 33, 0.04)',
width: t.sizes.$100,
borderRadius: `${t.radii.$xl} ${t.radii.$xl} ${t.radii.$lg} ${t.radii.$lg}`,
}),
Expand Down Expand Up @@ -115,7 +116,9 @@ export const BaseCard = React.forwardRef<HTMLDivElement, BaseCardProps>((props,
transitionProperty: t.transitionProperty.$common,
transitionDuration: '200ms',
borderRadius: t.radii.$xl,
boxShadow: t.shadows.$cardDropShadow,
boxShadow:
'0px 5px 15px 0px rgba(0, 0, 0, 0.08), 0px 15px 35px -5px rgba(25, 28, 33, 0.20), 0px 0px 0px 1px rgba(25, 28, 33, 0.06)',
backdropFilter: 'blur(10px)',
}),
sx,
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ const PhoneInputBase = forwardRef<HTMLInputElement, PhoneInputProps>((props, ref
/>
</Select>

<Flex sx={{ position: 'relative', width: '100%', marginLeft: 3 /* same as focus ring width */ }}>
<Flex sx={{ position: 'relative', width: '100%' }}>
<Text
variant='smallRegular'
sx={{ position: 'absolute', left: '1ch', top: '50%', transform: 'translateY(-50%)' }}
sx={{ position: 'absolute', left: '1ch', top: '50%', transform: 'translateY(-50%)', zIndex: 4 }}
>
+{selectedCountryOption.country.code}
</Text>
Expand All @@ -143,6 +143,10 @@ const PhoneInputBase = forwardRef<HTMLInputElement, PhoneInputProps>((props, ref
borderTopLeftRadius: '0',
borderBottomLeftRadius: '0',
paddingLeft: `${`+${selectedCountryOption.country.code}`.length + 1.5}ch`,
position: 'relative',
'&:focus': {
zIndex: 3,
},
},
sx,
]}
Expand Down

0 comments on commit d880685

Please sign in to comment.