Skip to content

Commit ea011df

Browse files
refactor(clerk-js): Tackle design feedback adjustments (#6934)
1 parent 6f7da3e commit ea011df

File tree

7 files changed

+22
-9
lines changed

7 files changed

+22
-9
lines changed

.changeset/huge-feet-enter.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
- Update checkbox checked background color and icon
6+
- Increase role select options contrast
7+
- Updates user preview subtitle text variant

packages/clerk-js/src/ui/baseTheme.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ const clerkTheme: Appearance = {
191191
appearance: 'none',
192192
borderRadius: theme.radii.$sm,
193193
border: 'none',
194+
backgroundSize: `${theme.sizes.$2} ${theme.sizes.$2}`,
195+
backgroundPosition: 'center',
196+
backgroundRepeat: 'no-repeat',
194197
'&:checked': {
195-
backgroundImage: `url("data:image/svg+xml,%3Csvg width='16' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.25 8L6.5 9.75L9.75 4.25' stroke='${theme.colors.$whiteAlpha900}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3C/path%3E%3C/svg%3E")`,
198+
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 8 8'%3E%3Cpath fill='${theme.colors.$white}' fill-rule='evenodd' d='M7.712.233a.889.889 0 0 1 .055 1.256C6.742 2.61 6.249 3.291 5.508 4.615c-.279.5-.589 1.194-.835 1.784a36.761 36.761 0 0 0-.382.95l-.021.057-.006.014-.001.003a.89.89 0 0 1-1.504.27L.218 4.765A.889.889 0 1 1 1.56 3.6l1.591 1.834c.235-.548.524-1.181.806-1.685.807-1.445 1.38-2.239 2.499-3.46A.889.889 0 0 1 7.712.234Z' clip-rule='evenodd'/%3E%3C/svg%3E")`,
196199
borderColor: theme.colors.$transparent,
197-
backgroundColor: theme.colors.$primary900,
198-
backgroundSize: '100% 100%',
199-
backgroundPosition: 'center',
200-
backgroundRepeat: 'no-repeat',
200+
backgroundColor: theme.colors.$primary500,
201201
},
202202
},
203203
tagInputContainer: {

packages/clerk-js/src/ui/components/OrganizationProfile/ActiveMembersList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const MemberRow = (props: {
8989
sx={{ maxWidth: '30ch' }}
9090
user={membership.publicUserData}
9191
subtitle={membership.publicUserData?.identifier}
92+
subtitleProps={{ variant: 'caption' }}
9293
badge={isCurrentUser && <Badge localizationKey={localizationKeys('badge__you')} />}
9394
/>
9495
</Td>

packages/clerk-js/src/ui/components/OrganizationProfile/InvitedMembersList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const InvitationRow = (props: {
8080
<UserPreview
8181
sx={{ maxWidth: '30ch' }}
8282
user={{ primaryEmailAddress: { emailAddress: invitation.emailAddress } } as any}
83+
subtitleProps={{ variant: 'caption' }}
8384
/>
8485
</Td>
8586
<Td>

packages/clerk-js/src/ui/components/OrganizationProfile/MemberListTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
useLocalizations,
2121
} from '../../customizables';
2222
import { useLocalizeCustomRoles } from '../../hooks/useFetchRoles';
23-
import type { PropsOfComponent, ThemableCssProp } from '../../styledSystem';
23+
import { common, type PropsOfComponent, type ThemableCssProp } from '../../styledSystem';
2424

2525
type MembersListTableProps = {
2626
headers: LocalizationKey[];
@@ -174,10 +174,10 @@ export const RoleSelect = (props: {
174174
option={option}
175175
sx={theme => ({
176176
'&:hover': {
177-
backgroundColor: theme.colors.$neutralAlpha100,
177+
background: common.mutedBackground(theme),
178178
},
179179
'&[data-focused="true"]': {
180-
backgroundColor: theme.colors.$neutralAlpha150,
180+
background: common.mutedBackground(theme),
181181
},
182182
})}
183183
/>
@@ -255,7 +255,7 @@ const RolesListItem = memo((props: RolesListItemProps) => {
255255
]}
256256
{...rest}
257257
>
258-
<Text colorScheme='secondary'>{option?.label}</Text>
258+
<Text variant='subtitle'>{option?.label}</Text>
259259
</Flex>
260260
);
261261
});

packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const RequestRow = withCardStateProvider(
8484
sx={{ maxWidth: '30ch' }}
8585
showAvatar={false}
8686
user={{ primaryEmailAddress: { emailAddress: request.publicUserData.identifier } } as any}
87+
subtitleProps={{ variant: 'caption' }}
8788
/>
8889
</Td>
8990
<Td>

packages/clerk-js/src/ui/elements/UserPreview.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type UserPreviewProps = Omit<PropsOfComponent<typeof Flex>, 'title' | 'el
2525
mainIdentifierVariant?: PropsOfComponent<typeof Text>['variant'];
2626
title?: LocalizationKey | string;
2727
subtitle?: LocalizationKey | string;
28+
subtitleProps?: PropsOfComponent<typeof Text>;
2829
showAvatar?: boolean;
2930
} & (
3031
| {
@@ -63,6 +64,7 @@ export const UserPreview = (props: UserPreviewProps) => {
6364
avatarSx,
6465
mainIdentifierSx,
6566
mainIdentifierVariant,
67+
subtitleProps,
6668
...rest
6769
} = props;
6870
const { t } = useLocalizations();
@@ -171,6 +173,7 @@ export const UserPreview = (props: UserPreviewProps) => {
171173
as='span'
172174
localizationKey={subtitle || identifier}
173175
colorScheme='secondary'
176+
{...subtitleProps}
174177
/>
175178
)}
176179
</Flex>

0 commit comments

Comments
 (0)