Skip to content

Commit 49f87a2

Browse files
fix(Button): deprecate incorrect spelling of collapsible
Also general cleanup
1 parent c275dcc commit 49f87a2

File tree

5 files changed

+184
-127
lines changed

5 files changed

+184
-127
lines changed

demo/app/components/button/button.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,28 @@ <h3 tsCardTitle tsVerticalSpacing>
132132
<ts-button
133133
theme="primary"
134134
iconName="add"
135-
[format]="formatCollapsable"
135+
[format]="formatCollapsible"
136136
tsVerticalSpacing
137137
>New Campaign / New Tactic</ts-button>
138138

139139
<ts-button
140140
theme="accent"
141141
iconName="add"
142-
[format]="formatCollapsable"
142+
[format]="formatCollapsible"
143143
tsVerticalSpacing
144144
>New Campaign / New Tactic</ts-button>
145145

146146
<ts-button
147147
theme="warn"
148148
iconName="add"
149-
[format]="formatCollapsable"
149+
[format]="formatCollapsible"
150150
tsVerticalSpacing
151151
>New Campaign / New Tactic</ts-button>
152152

153153
<ts-button
154154
theme="primary"
155155
iconName="add"
156-
[format]="formatCollapsable"
156+
[format]="formatCollapsible"
157157
[isDisabled]="true"
158158
tsVerticalSpacing
159159
>Rounded - Disabled</ts-button>

demo/app/components/button/button.component.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,22 @@ import { TsStyleThemeTypes } from '@terminus/ui/utilities';
99
styleUrls: ['./button.component.scss'],
1010
})
1111
export class ButtonComponent {
12-
style = 'primary';
13-
style2 = 'accent';
14-
disabled = false;
15-
progress1 = false;
16-
progress2 = false;
17-
icon = 'home';
18-
formatCollapsable = 'collapsable';
19-
formats: TsButtonFormatTypes[] = ['filled', 'hollow', 'collapsable'];
20-
myFormat = 'filled';
21-
myTheme: TsStyleThemeTypes = 'primary';
22-
themes: TsStyleThemeTypes[] = ['primary', 'accent', 'warn'];
23-
layoutIsRightAligned = false;
24-
get layout(): string {
12+
public style = 'primary';
13+
public disabled = false;
14+
public progress1 = false;
15+
public progress2 = false;
16+
public icon = 'home';
17+
public formatCollapsible = 'collapsible';
18+
public formats: TsButtonFormatTypes[] = ['filled', 'hollow', 'collapsible'];
19+
public myFormat = 'filled';
20+
public myTheme: TsStyleThemeTypes = 'primary';
21+
public themes: TsStyleThemeTypes[] = ['primary', 'accent', 'warn'];
22+
public layoutIsRightAligned = false;
23+
public get layout(): string {
2524
return this.layoutIsRightAligned ? 'right' : 'left';
2625
}
2726

28-
run(progress: string): void {
27+
public run(progress: string): void {
2928
console.log('Demo: In run!');
3029

3130
if (progress === 'progress1') {

terminus-ui/button/src/button.component.scss

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $shadow-transition: box-shadow $icon-transition-duration-expand $g-material-shad
8888
.c-button {
8989
// Define theme styles
9090
$themes: primary accent warn;
91-
$collapsable-radius: 2em;
91+
$collapsible-radius: 2em;
9292

9393
&[disabled] {
9494
@include cursor(not-allowed);
@@ -155,8 +155,9 @@ $shadow-transition: box-shadow $icon-transition-duration-expand $g-material-shad
155155
}
156156
}
157157

158-
// When collapsable AND disabled
159-
&.c-button--collapsable {
158+
// When collapsible AND disabled
159+
&.c-button--collapsable,
160+
&.c-button--collapsible {
160161
&[disabled] {
161162
&:not(:hover) {
162163
&:not(:focus) {
@@ -168,7 +169,6 @@ $shadow-transition: box-shadow $icon-transition-duration-expand $g-material-shad
168169

169170
// Loop through using each theme name to create styles
170171
@each $theme in $themes {
171-
172172
// Theme class sets the colors for standard buttons
173173
&.c-button--#{$theme} {
174174
background-color: color(#{$theme});
@@ -178,9 +178,10 @@ $shadow-transition: box-shadow $icon-transition-duration-expand $g-material-shad
178178
color: color(utility);
179179
}
180180

181-
// Collapsable button
182-
&.c-button--collapsable {
183-
border-radius: $collapsable-radius;
181+
// Collapsible button
182+
&.c-button--collapsable,
183+
&.c-button--collapsible {
184+
border-radius: $collapsible-radius;
184185

185186
// Fix left alignment when the icon is the first item
186187
.c-icon {
@@ -205,7 +206,7 @@ $shadow-transition: box-shadow $icon-transition-duration-expand $g-material-shad
205206
}
206207

207208
.mat-ripple {
208-
border-radius: $collapsable-radius;
209+
border-radius: $collapsible-radius;
209210
}
210211
}
211212

0 commit comments

Comments
 (0)