Skip to content

Commit aa42648

Browse files
desiprisganagstefoctoper
authored
fix(clerk-js): Avoid using border-(dir) styles (clerk#2848)
* fix(clerk-js): Avoid using border-(dir) styles * Fix dashed border * fix(clerk-js): Fix Session actions borders * Fix borderTop on SessionActions --------- Co-authored-by: Stefanos Anagnostou <anagstef@users.noreply.github.com> Co-authored-by: Vaggelis Yfantis <me@octoper.me>
1 parent 17846f3 commit aa42648

35 files changed

Lines changed: 139 additions & 78 deletions

‎.changeset/spotty-hotels-cheat.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

‎packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganizationForm.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ export const CreateOrganizationForm = withCardStateProvider((props: CreateOrgani
157157
width: t.sizes.$16,
158158
height: t.sizes.$16,
159159
borderRadius: t.radii.$md,
160-
border: `${t.borders.$dashed} ${t.colors.$neutralAlpha200}`,
160+
borderWidth: t.borderWidths.$normal,
161+
borderStyle: t.borderStyles.$dashed,
162+
borderColor: t.colors.$neutralAlpha200,
161163
backgroundColor: t.colors.$neutralAlpha50,
162164
':hover': {
163165
backgroundColor: t.colors.$neutralAlpha50,

‎packages/clerk-js/src/ui/components/OrganizationList/OrganizationListPage.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ const OrganizationListPageList = (props: { onCreateOrganizationClick: () => void
189189
label={localizationKeys('organizationList.action__createOrganization')}
190190
onClick={handleCreateOrganizationClicked}
191191
sx={t => ({
192-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
192+
borderTopWidth: t.borderWidths.$normal,
193+
borderTopStyle: t.borderStyles.$solid,
194+
borderTopColor: t.colors.$neutralAlpha100,
193195
padding: `${t.space.$5} ${t.space.$5}`,
194196
})}
195197
iconSx={t => ({

‎packages/clerk-js/src/ui/components/OrganizationList/shared.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export const PreviewListItems = (props: PropsWithChildren) => {
1515
sx={t => ({
1616
maxHeight: `calc(8 * ${t.sizes.$12})`,
1717
overflowY: 'auto',
18-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
18+
borderTopWidth: t.borderWidths.$normal,
19+
borderTopStyle: t.borderStyles.$solid,
20+
borderTopColor: t.colors.$neutralAlpha100,
1921
...common.unstyledScrollbar(t),
2022
})}
2123
>
@@ -48,7 +50,9 @@ export const PreviewListItem = (
4850
t => ({
4951
minHeight: 'unset',
5052
justifyContent: 'space-between',
51-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
53+
borderTopWidth: t.borderWidths.$normal,
54+
borderTopStyle: t.borderStyles.$solid,
55+
borderTopColor: t.colors.$neutralAlpha100,
5256
}),
5357
sharedStyles,
5458
]}

‎packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationMembersTabInvitations.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export const OrganizationMembersTabInvitations = withCardStateProvider(() => {
3333
paddingBottom: t.space.$4,
3434
paddingLeft: t.space.$1,
3535
paddingRight: t.space.$1,
36-
borderBottom: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
36+
borderBottomWidth: t.borderWidths.$normal,
37+
borderBottomStyle: t.borderStyles.$solid,
38+
borderBottomColor: t.colors.$neutralAlpha100,
3739
[mqu.md]: {
3840
flexDirection: 'column',
3941
gap: t.space.$2,

‎packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationMembersTabRequests.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export const OrganizationMembersTabRequests = () => {
3333
paddingBottom: t.space.$4,
3434
paddingLeft: t.space.$1,
3535
paddingRight: t.space.$1,
36-
borderBottom: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
36+
borderBottomWidth: t.borderWidths.$normal,
37+
borderBottomStyle: t.borderStyles.$solid,
38+
borderBottomColor: t.colors.$neutralAlpha100,
3739
[mqu.md]: {
3840
flexDirection: 'column',
3941
gap: t.space.$2,

‎packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ export const OrganizationSwitcherPopover = React.forwardRef<HTMLDivElement, Orga
155155
/>
156156
<Actions
157157
role='menu'
158-
sx={t => ({ borderBottom: `${t.borders.$normal} ${t.colors.$neutralAlpha100}` })}
158+
sx={t => ({
159+
borderBottomWidth: t.borderWidths.$normal,
160+
borderBottomStyle: t.borderStyles.$solid,
161+
borderBottomColor: t.colors.$neutralAlpha100,
162+
})}
159163
>
160164
<Flex
161165
justify='between'

‎packages/clerk-js/src/ui/components/SignIn/SignInAccountSwitcher.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const _SignInAccountSwitcher = () => {
3434
elementDescriptor={descriptors.main}
3535
gap={8}
3636
sx={t => ({
37-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
37+
borderTopWidth: t.borderWidths.$normal,
38+
borderTopStyle: t.borderStyles.$solid,
39+
borderTopColor: t.colors.$neutralAlpha100,
3840
})}
3941
>
4042
<Actions role='menu'>
@@ -95,7 +97,7 @@ const _SignInAccountSwitcher = () => {
9597
width: '100%',
9698
'>:first-of-type': {
9799
width: '100%',
98-
borderBottom: 'none',
100+
borderBottomWidth: 0,
99101
},
100102
}}
101103
>

‎packages/clerk-js/src/ui/components/UserButton/SessionActions.tsx‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export const SingleSessionActions = (props: SingleSessionActionsProps) => {
2121
elementDescriptor={descriptors.userButtonPopoverActions}
2222
elementId={descriptors.userButtonPopoverActions.setId('singleSession')}
2323
sx={t => ({
24-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
24+
borderTopWidth: t.borderWidths.$normal,
25+
borderTopStyle: t.borderStyles.$solid,
26+
borderTopColor: t.colors.$neutralAlpha100,
2527
})}
2628
>
2729
<Action
@@ -35,7 +37,9 @@ export const SingleSessionActions = (props: SingleSessionActionsProps) => {
3537
label={localizationKeys('userButton.action__manageAccount')}
3638
onClick={handleManageAccountClicked}
3739
sx={t => ({
38-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
40+
borderTopWidth: t.borderWidths.$normal,
41+
borderTopStyle: t.borderStyles.$solid,
42+
borderTopColor: t.colors.$neutralAlpha100,
3943
padding: `${t.space.$4} ${t.space.$5}`,
4044
})}
4145
/>
@@ -118,7 +122,9 @@ export const MultiSessionActions = (props: MultiSessionActionsProps) => {
118122
<Actions
119123
role='menu'
120124
sx={t => ({
121-
borderTop: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
125+
borderTopStyle: t.borderStyles.$solid,
126+
borderTopWidth: t.borderWidths.$normal,
127+
borderTopColor: t.colors.$neutralAlpha100,
122128
})}
123129
>
124130
{otherSessions.map(session => (
@@ -184,7 +190,6 @@ export const SignOutAllActions = (props: SignOutAllActionsProps) => {
184190
role='menu'
185191
sx={t => ({
186192
padding: t.space.$2,
187-
borderBottom: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
188193
})}
189194
>
190195
<Action
@@ -202,7 +207,7 @@ export const SignOutAllActions = (props: SignOutAllActionsProps) => {
202207
sx={t => ({
203208
backgroundColor: t.colors.$transparent,
204209
padding: `${t.space.$2} ${t.space.$3}`,
205-
borderBottom: 'none',
210+
borderBottomWidth: 0,
206211
borderRadius: t.radii.$lg,
207212
})}
208213
spinnerSize='md'

‎packages/clerk-js/src/ui/components/UserProfile/MfaBackupCodeList.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export const MfaBackupCodeList = (props: MfaBackupCodeListProps) => {
5757
</Col>
5858
<Box
5959
sx={t => ({
60-
border: `${t.borders.$normal} ${t.colors.$neutralAlpha100}`,
60+
borderWidth: t.borderWidths.$normal,
61+
borderStyle: t.borderStyles.$solid,
62+
borderColor: t.colors.$neutralAlpha100,
6163
borderRadius: t.radii.$lg,
6264
})}
6365
>
@@ -78,7 +80,9 @@ export const MfaBackupCodeList = (props: MfaBackupCodeListProps) => {
7880

7981
<Grid
8082
sx={t => ({
81-
borderTop: `1px solid ${t.colors.$neutralAlpha100}`,
83+
borderTopWidth: t.borderWidths.$normal,
84+
borderTopStyle: t.borderStyles.$solid,
85+
borderTopColor: t.colors.$neutralAlpha100,
8286
gridTemplateColumns: `repeat(3, minmax(0, 1fr))`,
8387
'>:not([hidden])~:not([hidden])': {
8488
borderRightWidth: '0px',

0 commit comments

Comments
 (0)