Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit bd5eabc

Browse files
committed
update base class to not include namespace, update class usage
1 parent 035eab7 commit bd5eabc

File tree

34 files changed

+134
-108
lines changed

34 files changed

+134
-108
lines changed

src/badge/fixtures/createBadge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {VSCodeBadge} from '../index';
4+
import {Badge} from '../index';
55

66
export type BadgeArgs = {
77
label: string;
88
};
99

1010
export function createBadge({label}: BadgeArgs) {
11-
const badge = new VSCodeBadge();
11+
const badge = new Badge();
1212

1313
if (label) {
1414
badge.textContent = label;

src/badge/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {Badge, badgeTemplate as template} from '@microsoft/fast-foundation';
4+
import {
5+
Badge as FoundationBadge,
6+
badgeTemplate as template,
7+
} from '@microsoft/fast-foundation';
58
import {BadgeStyles as styles} from './badge.styles';
69

710
/**
811
* The Visual Studio Code badge class.
912
*
1013
* @public
1114
*/
12-
export class VSCodeBadge extends Badge {
15+
export class Badge extends FoundationBadge {
1316
/**
1417
* Component lifecycle method that runs when the component is inserted
1518
* into the DOM.
@@ -21,7 +24,7 @@ export class VSCodeBadge extends Badge {
2124

2225
// This will override any usage of the circular attribute
2326
// inherited by the FAST Foundation Badge component so
24-
// that VSCodeBadges are always circular
27+
// that VSCode Badges are always circular
2528
if (!this.circular) {
2629
this.circular = true;
2730
}
@@ -36,7 +39,7 @@ export class VSCodeBadge extends Badge {
3639
*
3740
* @public
3841
*/
39-
export const vsCodeBadge = VSCodeBadge.compose({
42+
export const vsCodeBadge = Badge.compose({
4043
baseName: 'badge',
4144
template,
4245
styles,

src/button/fixtures/createButton.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {ButtonAppearance, VSCodeButton} from '../index';
4+
import {Button, ButtonAppearance} from '../index';
55
import {
66
createCodiconIcon,
77
focusObserver,
@@ -28,7 +28,7 @@ export function createButton({
2828
ariaLabel,
2929
onClick,
3030
}: ButtonArgs) {
31-
const button = new VSCodeButton();
31+
const button = new Button();
3232

3333
if (label && !iconOnly) {
3434
button.textContent = label;

src/button/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import {attr} from '@microsoft/fast-element';
55
import {
6-
Button,
76
ButtonOptions,
7+
Button as FoundationButton,
88
buttonTemplate as template,
99
} from '@microsoft/fast-foundation';
1010
import {ButtonStyles as styles} from './button.styles';
@@ -20,7 +20,7 @@ export type ButtonAppearance = 'primary' | 'secondary' | 'icon';
2020
*
2121
* @public
2222
*/
23-
export class VSCodeButton extends Button {
23+
export class Button extends FoundationButton {
2424
/**
2525
* The appearance the button should have.
2626
*
@@ -93,7 +93,7 @@ export class VSCodeButton extends Button {
9393
*
9494
* @public
9595
*/
96-
export const vsCodeButton = VSCodeButton.compose<ButtonOptions>({
96+
export const vsCodeButton = Button.compose<ButtonOptions>({
9797
baseName: 'button',
9898
template,
9999
styles,

src/checkbox/fixtures/createCheckbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {VSCodeCheckbox} from '../index';
4+
import {Checkbox} from '../index';
55
import {focusObserver} from '../../utilities/storybook/index';
66

77
export type CheckboxArgs = {
@@ -25,7 +25,7 @@ export function createCheckbox({
2525
hasValue,
2626
onChange,
2727
}: CheckboxArgs) {
28-
const checkbox = new VSCodeCheckbox();
28+
const checkbox = new Checkbox();
2929

3030
if (label) {
3131
checkbox.textContent = label;

src/checkbox/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Licensed under the MIT License.
33

44
import {
5-
Checkbox,
65
CheckboxOptions,
6+
Checkbox as FoundationCheckbox,
77
checkboxTemplate as template,
88
} from '@microsoft/fast-foundation';
99
import {CheckboxStyles as styles} from './checkbox.styles';
@@ -13,7 +13,7 @@ import {CheckboxStyles as styles} from './checkbox.styles';
1313
*
1414
* @public
1515
*/
16-
export class VSCodeCheckbox extends Checkbox {
16+
export class Checkbox extends FoundationCheckbox {
1717
/**
1818
* Component lifecycle method that runs when the component is inserted
1919
* into the DOM.
@@ -39,7 +39,7 @@ export class VSCodeCheckbox extends Checkbox {
3939
*
4040
* @public
4141
*/
42-
export const vsCodeCheckbox = VSCodeCheckbox.compose<CheckboxOptions>({
42+
export const vsCodeCheckbox = Checkbox.compose<CheckboxOptions>({
4343
baseName: 'checkbox',
4444
template,
4545
styles,

src/data-grid/fixtures/createDataGrid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {VSCodeDataGrid} from '../index';
4+
import {DataGrid} from '../index';
55

66
export type DataGridArgs = {
77
gridData: any;
@@ -18,7 +18,7 @@ export function createDataGrid({
1818
hasCustomTitles,
1919
ariaLabel,
2020
}: DataGridArgs) {
21-
const dataGrid = new VSCodeDataGrid();
21+
const dataGrid = new DataGrid();
2222

2323
if (gridData) {
2424
dataGrid.rowsData = gridData;

src/data-grid/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import {
55
dataGridCellTemplate as cellTemplate,
6-
DataGrid,
7-
DataGridCell,
8-
DataGridRow,
6+
DataGrid as FoundationDataGrid,
7+
DataGridCell as FoundationDataGridCell,
8+
DataGridRow as FoundationDataGridRow,
99
dataGridTemplate as gridTemplate,
1010
dataGridRowTemplate as rowTemplate,
1111
} from '@microsoft/fast-foundation';
@@ -18,7 +18,7 @@ import {DataGridCellStyles as cellStyles} from './data-grid-cell.styles';
1818
*
1919
* @public
2020
*/
21-
export class VSCodeDataGrid extends DataGrid {
21+
export class DataGrid extends FoundationDataGrid {
2222
/**
2323
* Component lifecycle method that runs when the component is inserted
2424
* into the DOM.
@@ -45,7 +45,7 @@ export class VSCodeDataGrid extends DataGrid {
4545
*
4646
* @public
4747
*/
48-
export const vsCodeDataGrid = VSCodeDataGrid.compose({
48+
export const vsCodeDataGrid = DataGrid.compose({
4949
baseName: 'data-grid',
5050
template: gridTemplate,
5151
styles: gridStyles,
@@ -56,7 +56,7 @@ export const vsCodeDataGrid = VSCodeDataGrid.compose({
5656
*
5757
* @public
5858
*/
59-
export class VSCodeDataGridRow extends DataGridRow {}
59+
export class DataGridRow extends FoundationDataGridRow {}
6060

6161
/**
6262
* The Visual Studio Code data grid row component registration.
@@ -66,7 +66,7 @@ export class VSCodeDataGridRow extends DataGridRow {}
6666
*
6767
* @public
6868
*/
69-
export const vsCodeDataGridRow = VSCodeDataGridRow.compose({
69+
export const vsCodeDataGridRow = DataGridRow.compose({
7070
baseName: 'data-grid-row',
7171
template: rowTemplate,
7272
styles: rowStyles,
@@ -77,7 +77,7 @@ export const vsCodeDataGridRow = VSCodeDataGridRow.compose({
7777
*
7878
* @public
7979
*/
80-
export class VSCodeDataGridCell extends DataGridCell {}
80+
export class DataGridCell extends FoundationDataGridCell {}
8181

8282
/**
8383
* The Visual Studio Code data grid cell component registration.
@@ -87,7 +87,7 @@ export class VSCodeDataGridCell extends DataGridCell {}
8787
*
8888
* @public
8989
*/
90-
export const vsCodeDataGridCell = VSCodeDataGridCell.compose({
90+
export const vsCodeDataGridCell = DataGridCell.compose({
9191
baseName: 'data-grid-cell',
9292
template: cellTemplate,
9393
styles: cellStyles,

src/divider/fixtures/createDivider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {VSCodeDivider} from '../index';
4+
import {Divider} from '../index';
55

66
export type DividerArgs = {
77
role: string;
88
};
99

1010
export function createDivider({role}: DividerArgs) {
11-
const divider = new VSCodeDivider();
11+
const divider = new Divider();
1212

1313
if (role && role.toLocaleLowerCase() === 'presentation') {
1414
divider.setAttribute('role', role.toLocaleLowerCase());

src/divider/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {Divider, dividerTemplate as template} from '@microsoft/fast-foundation';
4+
import {
5+
Divider as FoundationDivider,
6+
dividerTemplate as template,
7+
} from '@microsoft/fast-foundation';
58
import {DividerStyles as styles} from './divider.styles';
69

710
/**
811
* The Visual Studio Code divider class.
912
*
1013
* @public
1114
*/
12-
export class VSCodeDivider extends Divider {}
15+
export class Divider extends FoundationDivider {}
1316

1417
/**
1518
* The Visual Studio Code divider component registration.
@@ -19,7 +22,7 @@ export class VSCodeDivider extends Divider {}
1922
*
2023
* @public
2124
*/
22-
export const vsCodeDivider = VSCodeDivider.compose({
25+
export const vsCodeDivider = Divider.compose({
2326
baseName: 'divider',
2427
template,
2528
styles,

0 commit comments

Comments
 (0)