Skip to content

Commit a9f301b

Browse files
authored
refactor!: rename clear button to remove button (#2809)
1 parent 3ee2bcb commit a9f301b

8 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎packages/upload/src/vaadin-upload-file.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import './vaadin-upload-icons.js';
2828
* `commands` | Container for file command icons
2929
* `start-button` | Start file upload button
3030
* `retry-button` | Retry file upload button
31-
* `clear-button` | Clear file button
31+
* `remove-button` | Remove file button
3232
* `progress`| Progress bar
3333
*
3434
* The following state attributes are available for styling:
@@ -100,10 +100,10 @@ class UploadFile extends ThemableMixin(PolymerElement) {
100100
></button>
101101
<button
102102
type="button"
103-
part="clear-button"
103+
part="remove-button"
104104
file-event="file-abort"
105105
on-click="_fireFileEvent"
106-
aria-label$="[[i18n.file.clear]]"
106+
aria-label$="[[i18n.file.remove]]"
107107
aria-describedby="name"
108108
></button>
109109
</div>

‎packages/upload/src/vaadin-upload.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ declare class Upload extends ThemableMixin(ElementMixin(HTMLElement)) {
371371
* file: {
372372
* retry: 'Retry',
373373
* start: 'Start',
374-
* clear: 'Clear'
374+
* remove: 'Remove'
375375
* },
376376
* units: {
377377
* size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],

‎packages/upload/src/vaadin-upload.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
369369
* file: {
370370
* retry: 'Retry',
371371
* start: 'Start',
372-
* clear: 'Clear'
372+
* remove: 'Remove'
373373
* },
374374
* units: {
375375
* size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
@@ -424,7 +424,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
424424
file: {
425425
retry: 'Retry',
426426
start: 'Start',
427-
clear: 'Clear'
427+
remove: 'Remove'
428428
},
429429
units: {
430430
size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']

‎packages/upload/test/a11y.test.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('a11y', () => {
3434
file: {
3535
start: 'Start',
3636
retry: 'Retry',
37-
clear: 'clear'
37+
remove: 'Remove'
3838
}
3939
};
4040
uploadFileElement.i18n = i18n;
@@ -86,9 +86,9 @@ describe('a11y', () => {
8686
});
8787
});
8888

89-
describe('clear button', () => {
89+
describe('remove button', () => {
9090
beforeEach(() => {
91-
button = uploadFileElement.shadowRoot.querySelector('[part=clear-button]');
91+
button = uploadFileElement.shadowRoot.querySelector('[part=remove-button]');
9292
});
9393

9494
it('should be a <button> element', () => {
@@ -100,7 +100,7 @@ describe('a11y', () => {
100100
});
101101

102102
it('should have aria-label attribute', () => {
103-
expect(button.getAttribute('aria-label')).to.equal(i18n.file.clear);
103+
expect(button.getAttribute('aria-label')).to.equal(i18n.file.remove);
104104
});
105105
});
106106
});

‎packages/upload/test/file-list.test.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ describe('file list', () => {
3535
files.forEach((file) => upload._addFile(file));
3636
await nextFrame();
3737

38-
const clearButton1 = getFileListItems(upload)[0].shadowRoot.querySelector('[part="clear-button"]');
39-
clearButton1.click();
38+
const removeButton1 = getFileListItems(upload)[0].shadowRoot.querySelector('[part="remove-button"]');
39+
removeButton1.click();
4040
await nextFrame();
4141
expect(getFileListItems(upload).length).to.equal(1);
4242

43-
const clearButton2 = getFileListItems(upload)[0].shadowRoot.querySelector('[part="clear-button"]');
44-
clearButton2.click();
43+
const removeButton2 = getFileListItems(upload)[0].shadowRoot.querySelector('[part="remove-button"]');
44+
removeButton2.click();
4545
await nextFrame();
4646
expect(getFileListItems(upload).length).to.equal(0);
4747
});

‎packages/upload/test/keyboard-navigation.test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('keyboard navigation', () => {
8080
});
8181

8282
it('should focus on the clear button', async () => {
83-
const removeButton = fileElement.shadowRoot.querySelector('[part=clear-button]');
83+
const removeButton = fileElement.shadowRoot.querySelector('[part=remove-button]');
8484

8585
await repeatTab(5);
8686

‎packages/upload/theme/lumo/vaadin-upload-styles.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const uploadFile = css`
159159
content: var(--lumo-icons-reload);
160160
}
161161
162-
[part='clear-button']::before {
162+
[part='remove-button']::before {
163163
content: var(--lumo-icons-cross);
164164
}
165165

‎packages/upload/theme/material/vaadin-upload-styles.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ registerStyles(
168168
outline: none;
169169
}
170170
171-
[part='clear-button'] {
171+
[part='remove-button'] {
172172
margin-right: -8px;
173173
}
174174
@@ -194,7 +194,7 @@ registerStyles(
194194
content: var(--material-icons-reload);
195195
}
196196
197-
[part='clear-button']::before {
197+
[part='remove-button']::before {
198198
content: var(--material-icons-clear);
199199
}
200200

0 commit comments

Comments
 (0)