Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/password-toggle-hit-area.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/ui': patch
---

Enlarge the show/hide password toggle button's hit area with added padding and rounded corners, making it easier to tap and giving it a clearer hover/focus target.
8 changes: 8 additions & 0 deletions packages/ui/src/baseTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ const clerkTheme: Appearance = {
borderWidth: 0,
boxShadow: `0px 0px 2px 0px rgba(0, 0, 0, 0.08), 0px 1px 2px 0px rgba(25, 28, 33, 0.12), 0px 0px 0px 1px ${theme.colors.$borderAlpha100}`,
},
formFieldInputShowPasswordButton: {
insetInlineEnd: theme.space.$0x75,
insetBlock: theme.space.$0x75,
borderRadius: `calc(${theme.radii.$md} - ${theme.space.$0x75})`,
'&::before': {
inset: `calc(${theme.space.$0x75} * -1)`,
},
},
};
},
} satisfies Appearance;
Expand Down
13 changes: 11 additions & 2 deletions packages/ui/src/elements/PasswordInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,18 @@ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>((p
onClick={() => setHidden(s => !s)}
sx={theme => ({
position: 'absolute',
insetInlineEnd: 0,
marginInlineEnd: theme.space.$1,
insetInlineEnd: theme.space.$1,
insetBlock: theme.space.$1,
borderRadius: `calc(${theme.radii.$md} - ${theme.space.$1})`,
color: theme.colors.$neutralAlpha400,
paddingInline: theme.space.$2,
'&::before': {
content: '""',
position: 'absolute',
inset: `calc(${theme.space.$1} * -1)`,
display: 'block',
borderRadius: theme.radii.$md,
},
})}
icon={hidden ? Eye : EyeSlash}
/>
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/foundations/sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const baseSpaceUnits = Object.freeze({
const spacingScale = Object.freeze({
'0x25': { rem: '0.0625rem', multiplier: 0.25 },
'0x5': { rem: '0.125rem', multiplier: 0.5 },
'0x75': { rem: '0.1875rem', multiplier: 0.75 },
Comment thread
coderabbitai[bot] marked this conversation as resolved.
'1': { rem: '0.25rem', multiplier: 1 },
'1x5': { rem: '0.375rem', multiplier: 1.5 },
'2': { rem: '0.5rem', multiplier: 2 },
Expand Down Expand Up @@ -94,6 +95,7 @@ type ExtractRemValues<T> = {
const spaceUnits = Object.freeze({
'0x25': spacingScale['0x25'].rem,
'0x5': spacingScale['0x5'].rem,
'0x75': spacingScale['0x75'].rem,
'1': spacingScale['1'].rem,
'1x5': spacingScale['1x5'].rem,
'2': spacingScale['2'].rem,
Expand Down Expand Up @@ -197,4 +199,4 @@ const radii = Object.freeze({
*/
const spaceScaleKeys = Object.keys(spacingScale) as SpacingScaleKey[];

export { sizes, space, radii, spaceScaleKeys };
export { radii, sizes, space, spaceScaleKeys };
Loading