Skip to content

Commit 4dc2906

Browse files
fix(ui): Actions border radius consistency (#9146)
1 parent 9c027fa commit 4dc2906

2 files changed

Lines changed: 7 additions & 80 deletions

File tree

.changeset/kind-cooks-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/ui': patch
3+
---
4+
5+
Fix small actions button border radius to ensure consistency.

packages/ui/src/elements/Actions.tsx

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
import type { LocalizationKey } from '../customizables';
4-
import { Button, Col, descriptors, Flex, Icon, SimpleButton, Spinner, useLocalizations } from '../customizables';
4+
import { Button, Col, descriptors, Flex, Icon, Spinner, useLocalizations } from '../customizables';
55
import type { ElementDescriptor, ElementId } from '../customizables/elementDescriptors';
66
import { useCardState } from '../elements/contexts';
77
import { useLoadingStatus } from '../hooks';
@@ -43,84 +43,6 @@ type ActionProps = Omit<PropsOfComponent<typeof Button>, 'label'> & {
4343
spinnerSize?: PropsOfComponent<typeof Spinner>['size'];
4444
};
4545

46-
export const ExtraSmallAction = (props: Omit<ActionProps, 'label'>) => {
47-
const card = useCardState();
48-
const status = useLoadingStatus();
49-
const {
50-
icon,
51-
onClick: onClickProp,
52-
iconElementDescriptor,
53-
sx,
54-
iconElementId,
55-
iconSx,
56-
iconBoxElementDescriptor,
57-
iconBoxElementId,
58-
iconBoxSx,
59-
trailing,
60-
spinnerSize,
61-
...rest
62-
} = props;
63-
64-
const onClick: React.MouseEventHandler<HTMLButtonElement> = async e => {
65-
card.setLoading();
66-
status.setLoading();
67-
try {
68-
await onClickProp?.(e);
69-
} finally {
70-
card.setIdle();
71-
status.setIdle();
72-
}
73-
};
74-
75-
return (
76-
<SimpleButton
77-
size='xs'
78-
variant='outline'
79-
hoverAsFocus
80-
sx={[
81-
t => ({
82-
borderRadius: t.radii.$lg,
83-
gap: 0,
84-
justifyContent: 'center',
85-
padding: t.space.$1,
86-
}),
87-
sx,
88-
]}
89-
isDisabled={card.isLoading}
90-
onClick={onClick}
91-
{...rest}
92-
>
93-
<Flex
94-
elementDescriptor={iconBoxElementDescriptor}
95-
elementId={iconBoxElementId}
96-
justify='center'
97-
as='span'
98-
>
99-
{status.isLoading ? (
100-
<Spinner
101-
size={spinnerSize || 'xs'}
102-
elementDescriptor={descriptors.spinner}
103-
/>
104-
) : (
105-
<Icon
106-
elementDescriptor={iconElementDescriptor}
107-
elementId={iconElementId}
108-
icon={icon}
109-
sx={[
110-
theme => ({
111-
width: theme.sizes.$4,
112-
height: theme.sizes.$4,
113-
}),
114-
iconSx,
115-
]}
116-
/>
117-
)}
118-
</Flex>
119-
{trailing}
120-
</SimpleButton>
121-
);
122-
};
123-
12446
export const SmallAction = (props: ActionProps) => {
12547
const { sx, iconBoxSx, iconSx, ...rest } = props;
12648
return (
@@ -130,7 +52,7 @@ export const SmallAction = (props: ActionProps) => {
13052
textVariant='buttonSmall'
13153
sx={[
13254
t => ({
133-
borderRadius: t.radii.$lg,
55+
borderRadius: t.radii.$md,
13456
gap: t.space.$0x5,
13557
justifyContent: 'center',
13658
flex: '1 1 0',

0 commit comments

Comments
 (0)