Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Button): add xs Button size #663

Merged
merged 6 commits into from
May 15, 2023
Merged

feat(Button): add xs Button size #663

merged 6 commits into from
May 15, 2023

Conversation

Marginy605
Copy link
Contributor

No description provided.

@Marginy605 Marginy605 requested a review from amje as a code owner May 15, 2023 11:26
@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -122,7 +122,7 @@ export function withTableActions<I extends TableDataItem, E extends {} = {}>(
disabled={disabled}
className={BUTTON_CLASSNAME}
onClick={this.handleActionsButtonClick.bind(this, {item, index})}
size={rowActionsSize}
size={rowActionsSize as ButtonSize}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for Button component

@@ -54,7 +54,7 @@ export type TableActionConfig<I> = TableAction<I> | TableActionGroup<I>;

export interface WithTableActionsProps<I> {
getRowActions: (item: I, index: number) => TableActionConfig<I>[];
rowActionsSize?: ButtonSize;
rowActionsSize?: Exclude<ButtonSize, 'xs'>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prop is used for Button and Menu components at the same time. But Menu doesn't support xs size.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add new type here?

Comment on lines 110 to 113
&_side_right {
margin-right: 6px;
width: var(--yc-button-icon-size);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to set these styles, width: var(--yc-button-height); does all the work. Same relates to &_side_left

/**
* common sizes for Menu and Button
*/
export type RowActionsSize = 's' | 'm' | 'l' | 'xl';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TableRowActionsSize would be better and can be exported safely

@Marginy605 Marginy605 requested a review from amje May 15, 2023 14:46
@Marginy605 Marginy605 merged commit efbe9fc into main May 15, 2023
@Marginy605 Marginy605 deleted the button-xs-size branch May 15, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants