Skip to content

Commit

Permalink
[EC-457] feat: simplify sizes - update default
Browse files Browse the repository at this point in the history
  • Loading branch information
coroiu committed Sep 12, 2022
1 parent cfede15 commit 113f23f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions libs/components/src/banner/banner.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div
class="tw-flex tw-items-center tw-gap-2 tw-py-2.5 tw-px-4 tw-text-contrast"
class="tw-flex tw-items-center tw-gap-2 tw-py-2.5 tw-px-4 tw-pr-2.5 tw-text-contrast"
[ngClass]="bannerClass"
[attr.role]="useAlertRole ? 'status' : null"
[attr.aria-live]="useAlertRole ? 'polite' : null"
Expand All @@ -11,7 +11,7 @@
<button
bitIconButton="bwi-close"
buttonType="contrast"
size="base"
size="default"
(click)="onClose.emit()"
[attr.title]="'close' | i18n"
[attr.aria-label]="'close' | i18n"
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/dialog/dialog/dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2 class="tw-mb-0 tw-grow tw-text-lg tw-uppercase">
<button
bitIconButton="bwi-close"
buttonType="main"
size="base"
size="default"
bitDialogClose
[attr.title]="'close' | i18n"
[attr.aria-label]="'close' | i18n"
Expand Down
15 changes: 4 additions & 11 deletions libs/components/src/icon-button/icon-button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,11 @@ const styles: Record<IconButtonStyle, string[]> = {
],
};

export type IconButtonSize = "button" | "base" | "xl" | "2xl";
export type IconButtonSize = "default" | "small";

const sizes: Record<IconButtonSize, string[]> = {
/**
* `button` has similar sizing/padding to a bitButton, but should be used
* where the button only contains an icon.
* Use this instead of placing an icon inside of a bitButton.
*/
button: ["tw-px-2.5", "tw-py-1.5"],
base: ["tw-leading-none", "tw-text-base", "tw-p-1"],
xl: ["tw-leading-none", "tw-text-xl", "tw-p-1"],
"2xl": ["tw-leading-none", "tw-text-2xl", "tw-p-1"],
default: ["tw-px-2.5", "tw-py-1.5"],
small: ["tw-leading-none", "tw-text-base", "tw-p-1"],
};

@Component({
Expand All @@ -86,7 +79,7 @@ export class BitIconButtonComponent {

@Input() buttonType: IconButtonStyle = "main";

@Input() size: IconButtonSize = "button";
@Input() size: IconButtonSize = "default";

@HostBinding("class") get classList() {
return [
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/icon-button/icon-button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
args: {
bitIconButton: "bwi-plus",
buttonType: "primary",
size: "button",
size: "default",
disabled: false,
},
} as Meta;
Expand Down

0 comments on commit 113f23f

Please sign in to comment.