Skip to content

Commit 4f6f59a

Browse files
feat(ui): DOMA-11785 update buttons (#6301)
* feat(condo): DOMA-11785 update buttons * fix(ui): DOMA-11785 fix minimal style * fix(ui): DOMA-11785 fix !important * fix(ui): DOMA-11785 fix gap * fix(ui): DOMA-11785 fix hover * fix(ui): DOMA-11785 fix focus and add active * fix(ui): DOMA-11759 fix disabled and add width/height for compact .condo-btn-icon-only * fix(ui): DOMA-11785 mark @deprecated * fix(ui): DOMA-11785 add hover on minimal, fix disabled and stateless * fix(ui): DOMA-11785 fix hover * fix(ui): DOMA-11785 fix focus-visible * fix(ui): DOMA-11785 fix focus * fix(ui): DOMA-11785 fix compact danger hover * fix(ui): DOMA-11785 fix border * fix(ui): DOMA-11785 fix size * fix(ui): DOMA-11785 review fixes * fix(ui): DOMA-11785 fix border * fix(ui): DOMA-11785 fix transition with minimal * fix(ui): DOMA-11785 fix disable hover * fix(ui): DOMA-11785 fix hover * fix(ui): DOMA-11785 fix hover * fix(ui): DOMA-11785 fix border * fix(ui): DOMA-11785 fix border * fix(ui): DOMA-11785 fix disable * fix(ui): DOMA-11785 fix condo-btn-stateless * fix(ui): DOMA-11785 fix secondary color * fix(ui): fix disable * Update style.less * feat(ui): DOMA-11785 fix focus
1 parent 2d0f7c2 commit 4f6f59a

File tree

7 files changed

+564
-99
lines changed

7 files changed

+564
-99
lines changed

packages/ui/src/components/Button/button.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,28 @@ import { sendAnalyticsClickEvent, extractChildrenContent } from '../_utils/analy
1010
export const BUTTON_CLASS_PREFIX = 'condo-btn'
1111

1212
type CondoButtonProps = {
13-
type: 'primary' | 'secondary'
13+
type: 'primary' | 'secondary' | 'accent'
1414
children?: string
1515
stateless?: boolean
1616
focus?: boolean
17+
minimal?: boolean
18+
compact?: boolean
19+
size?: 'medium' | 'large'
1720
}
1821

1922
export type ButtonProps = Omit<DefaultButtonProps, 'shape' | 'size' | 'style' | 'ghost' | 'type' | 'prefix' | 'prefixCls'>
2023
& CondoButtonProps
2124

2225
const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>> = React.forwardRef((props, ref) => {
23-
const { type, className, icon, children, onClick, stateless, id, focus, ...rest } = props
26+
const { type, className, icon, children, onClick, stateless, id, focus, minimal, compact, size = 'large', ...rest } = props
2427
const classes = classNames(
2528
{
2629
[`${BUTTON_CLASS_PREFIX}-${type}`]: type,
30+
[`${BUTTON_CLASS_PREFIX}-${size}`]: size,
2731
[`${BUTTON_CLASS_PREFIX}-stateless`]: stateless,
2832
[`${BUTTON_CLASS_PREFIX}-focus`]: focus,
33+
[`${BUTTON_CLASS_PREFIX}-minimal`]: minimal,
34+
[`${BUTTON_CLASS_PREFIX}-compact`]: compact,
2935
},
3036
className,
3137
)
@@ -71,4 +77,3 @@ Button.displayName = 'Button'
7177
export {
7278
Button,
7379
}
74-

packages/ui/src/components/Button/icon/iconButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ type CondoIconButtonProps = {
1616

1717
export type IconButtonProps = Omit<DefaultButtonProps, 'shape' | 'size' | 'style' | 'ghost' | 'type' | 'prefix' | 'prefixCls' | 'icon' | 'danger' | 'block'>
1818
& CondoIconButtonProps
19-
19+
/**
20+
* @deprecated
21+
*/
2022
const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>> = React.forwardRef((props, ref) => {
2123
const { className, children, onClick, id, size, ...rest } = props
2224
const mergedSize = size || 'medium'

packages/ui/src/components/Button/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export type { ButtonProps } from './button'
88
export type { IconButtonProps } from './icon/iconButton'
99

1010
type CombinedButtonType = typeof InternalButton & {
11+
/**
12+
* @deprecated
13+
*/
1114
Icon: typeof IconButton
1215
}
1316

0 commit comments

Comments
 (0)