Skip to content

Commit

Permalink
fix(navigationtab)!: change slot names activeIcon and inactiveIcon to…
Browse files Browse the repository at this point in the history
… active-icon and inactive-icon

PiperOrigin-RevId: 563583060
  • Loading branch information
AndrewJakubowicz authored and copybara-github committed Sep 7, 2023
1 parent 8e79da6 commit f019ac3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions labs/navigationbar/demo/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,32 @@ const standard: MaterialStoryInit<StoryKnobs> = {
.label=${label}
.showBadge=${showBadge}
.badgeValue=${badgeValue}>
<md-icon slot="activeIcon">${knobs['active icon']}</md-icon>
<md-icon slot="inactiveIcon">${knobs['inactive icon']}</md-icon>
<md-icon slot="active-icon">${knobs['active icon']}</md-icon>
<md-icon slot="inactive-icon">${knobs['inactive icon']}</md-icon>
</md-navigation-tab>
<md-navigation-tab
.label=${label}
.showBadge=${showBadge}
.badgeValue=${badgeValue}>
<md-icon slot="activeIcon">${knobs['active icon']}</md-icon>
<md-icon slot="inactiveIcon">${knobs['inactive icon']}</md-icon>
<md-icon slot="active-icon">${knobs['active icon']}</md-icon>
<md-icon slot="inactive-icon">${knobs['inactive icon']}</md-icon>
</md-navigation-tab>
<md-navigation-tab
.label=${label}
.showBadge=${showBadge}
.badgeValue=${badgeValue}>
<md-icon slot="activeIcon">${knobs['active icon']}</md-icon>
<md-icon slot="inactiveIcon">${knobs['inactive icon']}</md-icon>
<md-icon slot="active-icon">${knobs['active icon']}</md-icon>
<md-icon slot="inactive-icon">${knobs['inactive icon']}</md-icon>
</md-navigation-tab>
<md-navigation-tab
.label=${label}
.showBadge=${showBadge}
.badgeValue=${badgeValue}>
<md-icon slot="activeIcon">${knobs['active icon']}</md-icon>
<md-icon slot="inactiveIcon">${knobs['inactive icon']}</md-icon>
<md-icon slot="active-icon">${knobs['active icon']}</md-icon>
<md-icon slot="inactive-icon">${knobs['inactive icon']}</md-icon>
</md-navigation-tab>
</md-navigation-bar>
</div>`;
Expand Down
4 changes: 2 additions & 2 deletions labs/navigationtab/internal/navigation-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export class NavigationTab extends LitElement implements NavigationTabState {
<span aria-hidden="true" class="md3-navigation-tab__icon-content"
><span class="md3-navigation-tab__active-indicator"
></span><span class="md3-navigation-tab__icon"
><slot name="inactiveIcon"></slot
><slot name="inactive-icon"></slot
></span>
<span class="md3-navigation-tab__icon md3-navigation-tab__icon--active"
><slot name="activeIcon"></slot
><slot name="active-icon"></slot
></span>${this.renderBadge()}</span
>${this.renderLabel()}
</button>`;
Expand Down
18 changes: 9 additions & 9 deletions labs/navigationtab/md-navigation-tab_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,31 +191,31 @@ describe('mwc-navigation-tab', () => {
});

describe('icons', () => {
it('nodes with `slot=activeIcon` will serve as the active icon',
it('nodes with `slot=active-icon` will serve as the active icon',
async () => {
const {harness} = await setupTest();
const icons = html`
<i slot="activeIcon" class="material-icons">star</i>
<i slot="inactiveIcon" class="material-icons">star_border</i>
<i slot="active-icon" class="material-icons">star</i>
<i slot="inactive-icon" class="material-icons">star_border</i>
`;
render(icons, harness.element);

const icon =
harness.element.querySelector<HTMLElement>('[slot="activeIcon"]')!;
const icon = harness.element.querySelector<HTMLElement>(
'[slot="active-icon"]')!;
expect(icon.textContent!.trim()).toEqual('star');
});

it('nodes with `slot=inactiveIcon` will serve as the inactive icon',
it('nodes with `slot=inactive-icon` will serve as the inactive icon',
async () => {
const {harness} = await setupTest();
const icons = html`
<i slot="activeIcon" class="material-icons">star</i>
<i slot="inactiveIcon" class="material-icons">star_border</i>
<i slot="active-icon" class="material-icons">star</i>
<i slot="inactive-icon" class="material-icons">star_border</i>
`;
render(icons, harness.element);

const icon = harness.element.querySelector<HTMLElement>(
'[slot="inactiveIcon"]')!;
'[slot="inactive-icon"]')!;
expect(icon.textContent!.trim()).toEqual('star_border');
});
});
Expand Down

0 comments on commit f019ac3

Please sign in to comment.