Skip to content

Commit

Permalink
Rename va-featured-content to va-summary-box (#1054)
Browse files Browse the repository at this point in the history
* Rename featured content to summary box

* undo unnecessary changes
  • Loading branch information
ataker authored Feb 13, 2024
1 parent 7bab5d6 commit 60632fc
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import React from 'react';
import { getWebComponentDocs, propStructure, StoryDocs } from './wc-helpers';

const featuredContentDocs = getWebComponentDocs('va-featured-content');
const summaryBoxDocs = getWebComponentDocs('va-summary-box');

export default {
title: 'USWDS/Featured content USWDS',
id: 'uswds/va-featured-content',
title: 'USWDS/Summary box USWDS',
id: 'uswds/va-summary-box',
parameters: {
componentSubtitle: `va-featured-content web component`,
componentSubtitle: `va-summary-box web component`,
docs: {
page: () => <StoryDocs data={featuredContentDocs} />,
page: () => <StoryDocs data={summaryBoxDocs} />,
},
},
};
Expand All @@ -19,7 +19,7 @@ const defaultArgs = { uswds: true };
const Template = args => {
const { uswds } = args
return (
<va-featured-content uswds={uswds}>
<va-summary-box uswds={uswds}>
<h3 slot="headline">
If I'm a Veteran, can I get VR&E benefits and services?
</h3>
Expand All @@ -42,11 +42,11 @@ const Template = args => {
<a href="#">Apply for VR&amp;E services</a>
</li>
</ul>
</va-featured-content>
</va-summary-box>
);
}

export const Default = Template.bind(null);
Default.args = defaultArgs;
Default.argTypes = propStructure(featuredContentDocs);
Default.argTypes = propStructure(summaryBoxDocs);

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import React from 'react';
import { getWebComponentDocs, propStructure, StoryDocs } from './wc-helpers';

const featuredContentDocs = getWebComponentDocs('va-featured-content');
const summaryBoxDocs = getWebComponentDocs('va-summary-box');

export default {
title: 'Components/Featured content',
id: 'components/va-featured-content',
title: 'Components/Summary box',
id: 'components/va-summary-box',
parameters: {
componentSubtitle: `va-featured-content web component`,
componentSubtitle: `va-summary-box web component`,
docs: {
page: () => <StoryDocs data={featuredContentDocs} />,
page: () => <StoryDocs data={summaryBoxDocs} />,
},
},
};
Expand All @@ -19,7 +19,7 @@ const defaultArgs = { uswds: false };
const Template = args => {
const { uswds } = args
return (
<va-featured-content uswds={uswds}>
<va-summary-box uswds={uswds}>
<h3 slot="headline">
If I'm a Veteran, can I get VR&E benefits and services?
</h3>
Expand All @@ -42,11 +42,11 @@ const Template = args => {
<a href="#">Apply for VR&amp;E services</a>
</li>
</ul>
</va-featured-content>
</va-summary-box>
);
}

export const Default = Template.bind(null);
Default.args = defaultArgs;
Default.argTypes = propStructure(featuredContentDocs);
Default.argTypes = propStructure(summaryBoxDocs);

2 changes: 1 addition & 1 deletion packages/web-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@department-of-veterans-affairs/web-components",
"version": "4.60.0",
"version": "5.0.0",
"description": "Stencil Component Starter",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
Expand Down
42 changes: 21 additions & 21 deletions packages/web-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,6 @@ export namespace Components {
*/
"value"?: string;
}
interface VaFeaturedContent {
/**
* Whether or not the component will use USWDS v3 styling.
*/
"uswds"?: boolean;
}
interface VaFileInput {
/**
* A comma-separated list of unique file type specifiers.
Expand Down Expand Up @@ -1173,6 +1167,12 @@ export namespace Components {
*/
"inputValue": string;
}
interface VaSummaryBox {
/**
* Whether or not the component will use USWDS v3 styling.
*/
"uswds"?: boolean;
}
interface VaTable {
/**
* Whether the initial sort state will be descending or not.
Expand Down Expand Up @@ -1617,12 +1617,6 @@ declare global {
prototype: HTMLVaDateElement;
new (): HTMLVaDateElement;
};
interface HTMLVaFeaturedContentElement extends Components.VaFeaturedContent, HTMLStencilElement {
}
var HTMLVaFeaturedContentElement: {
prototype: HTMLVaFeaturedContentElement;
new (): HTMLVaFeaturedContentElement;
};
interface HTMLVaFileInputElement extends Components.VaFileInput, HTMLStencilElement {
}
var HTMLVaFileInputElement: {
Expand Down Expand Up @@ -1785,6 +1779,12 @@ declare global {
prototype: HTMLVaStatementOfTruthElement;
new (): HTMLVaStatementOfTruthElement;
};
interface HTMLVaSummaryBoxElement extends Components.VaSummaryBox, HTMLStencilElement {
}
var HTMLVaSummaryBoxElement: {
prototype: HTMLVaSummaryBoxElement;
new (): HTMLVaSummaryBoxElement;
};
interface HTMLVaTableElement extends Components.VaTable, HTMLStencilElement {
}
var HTMLVaTableElement: {
Expand Down Expand Up @@ -1831,7 +1831,6 @@ declare global {
"va-checkbox-group": HTMLVaCheckboxGroupElement;
"va-crisis-line-modal": HTMLVaCrisisLineModalElement;
"va-date": HTMLVaDateElement;
"va-featured-content": HTMLVaFeaturedContentElement;
"va-file-input": HTMLVaFileInputElement;
"va-header-minimal": HTMLVaHeaderMinimalElement;
"va-icon": HTMLVaIconElement;
Expand Down Expand Up @@ -1859,6 +1858,7 @@ declare global {
"va-segmented-progress-bar": HTMLVaSegmentedProgressBarElement;
"va-select": HTMLVaSelectElement;
"va-statement-of-truth": HTMLVaStatementOfTruthElement;
"va-summary-box": HTMLVaSummaryBoxElement;
"va-table": HTMLVaTableElement;
"va-table-row": HTMLVaTableRowElement;
"va-telephone": HTMLVaTelephoneElement;
Expand Down Expand Up @@ -2344,12 +2344,6 @@ declare namespace LocalJSX {
*/
"value"?: string;
}
interface VaFeaturedContent {
/**
* Whether or not the component will use USWDS v3 styling.
*/
"uswds"?: boolean;
}
interface VaFileInput {
/**
* A comma-separated list of unique file type specifiers.
Expand Down Expand Up @@ -3258,6 +3252,12 @@ declare namespace LocalJSX {
*/
"onVaInputChange"?: (event: VaStatementOfTruthCustomEvent<any>) => void;
}
interface VaSummaryBox {
/**
* Whether or not the component will use USWDS v3 styling.
*/
"uswds"?: boolean;
}
interface VaTable {
/**
* Whether the initial sort state will be descending or not.
Expand Down Expand Up @@ -3498,7 +3498,6 @@ declare namespace LocalJSX {
"va-checkbox-group": VaCheckboxGroup;
"va-crisis-line-modal": VaCrisisLineModal;
"va-date": VaDate;
"va-featured-content": VaFeaturedContent;
"va-file-input": VaFileInput;
"va-header-minimal": VaHeaderMinimal;
"va-icon": VaIcon;
Expand Down Expand Up @@ -3526,6 +3525,7 @@ declare namespace LocalJSX {
"va-segmented-progress-bar": VaSegmentedProgressBar;
"va-select": VaSelect;
"va-statement-of-truth": VaStatementOfTruth;
"va-summary-box": VaSummaryBox;
"va-table": VaTable;
"va-table-row": VaTableRow;
"va-telephone": VaTelephone;
Expand All @@ -3552,7 +3552,6 @@ declare module "@stencil/core" {
"va-checkbox-group": LocalJSX.VaCheckboxGroup & JSXBase.HTMLAttributes<HTMLVaCheckboxGroupElement>;
"va-crisis-line-modal": LocalJSX.VaCrisisLineModal & JSXBase.HTMLAttributes<HTMLVaCrisisLineModalElement>;
"va-date": LocalJSX.VaDate & JSXBase.HTMLAttributes<HTMLVaDateElement>;
"va-featured-content": LocalJSX.VaFeaturedContent & JSXBase.HTMLAttributes<HTMLVaFeaturedContentElement>;
"va-file-input": LocalJSX.VaFileInput & JSXBase.HTMLAttributes<HTMLVaFileInputElement>;
"va-header-minimal": LocalJSX.VaHeaderMinimal & JSXBase.HTMLAttributes<HTMLVaHeaderMinimalElement>;
"va-icon": LocalJSX.VaIcon & JSXBase.HTMLAttributes<HTMLVaIconElement>;
Expand Down Expand Up @@ -3580,6 +3579,7 @@ declare module "@stencil/core" {
"va-segmented-progress-bar": LocalJSX.VaSegmentedProgressBar & JSXBase.HTMLAttributes<HTMLVaSegmentedProgressBarElement>;
"va-select": LocalJSX.VaSelect & JSXBase.HTMLAttributes<HTMLVaSelectElement>;
"va-statement-of-truth": LocalJSX.VaStatementOfTruth & JSXBase.HTMLAttributes<HTMLVaStatementOfTruthElement>;
"va-summary-box": LocalJSX.VaSummaryBox & JSXBase.HTMLAttributes<HTMLVaSummaryBoxElement>;
"va-table": LocalJSX.VaTable & JSXBase.HTMLAttributes<HTMLVaTableElement>;
"va-table-row": LocalJSX.VaTableRow & JSXBase.HTMLAttributes<HTMLVaTableRowElement>;
"va-telephone": LocalJSX.VaTelephone & JSXBase.HTMLAttributes<HTMLVaTelephoneElement>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { newE2EPage } from '@stencil/core/testing';
import { axeCheck } from '../../../testing/test-helpers';

describe('va-featured-content', () => {
describe('va-summary-box', () => {
it('renders v1', async () => {
const page = await newE2EPage();
await page.setContent(`
<va-featured-content>
<va-summary-box>
<h3 slot="headline">
If I'm a Veteran, can I get VR&E benefits and services?
</h3>
Expand All @@ -16,12 +16,12 @@ describe('va-featured-content', () => {
<li>Have a service-connected disability rating of at least 10% from VA, <strong>and</strong></li>
<li><a href="#">Apply for VR&amp;E services</a></li>
</ul>
</va-featured-content>
</va-summary-box>
`);
const element = await page.find('va-featured-content');
const element = await page.find('va-summary-box');

expect(element).toEqualHtml(`
<va-featured-content class="hydrated">
<va-summary-box class="hydrated">
<mock:shadow-root>
<div class="feature">
<slot name="headline"></slot>
Expand All @@ -36,17 +36,17 @@ describe('va-featured-content', () => {
<li>Have a service-connected disability rating of at least 10% from VA, <strong>and</strong></li>
<li><a href="#">Apply for VR&amp;E services</a></li>
</ul>
</va-featured-content>
</va-summary-box>
`);
});

it("renders the heading passed to the 'headline' slot", async () => {
const heading = "If I'm a Veteran, can I get VR&E benefits and services?";
const page = await newE2EPage();
await page.setContent(`
<va-featured-content>
<va-summary-box>
<h3 slot="headline">${heading}</h3>
</va-featured-content>
</va-summary-box>
`);
const element = await page.find('h3');
expect(element).not.toBeNull();
Expand All @@ -56,7 +56,7 @@ describe('va-featured-content', () => {
it('passes an axe check', async () => {
const page = await newE2EPage();
await page.setContent(`
<va-featured-content>
<va-summary-box>
<h3 slot="headline">
If I'm a Veteran, can I get VR&E benefits and services?
</h3>
Expand All @@ -67,7 +67,7 @@ describe('va-featured-content', () => {
<li>Have a service-connected disability rating of at least 10% from VA, <strong>and</strong></li>
<li><a href="#">Apply for VR&amp;E services</a></li>
</ul>
</va-featured-content>
</va-summary-box>
`);

await axeCheck(page);
Expand All @@ -76,7 +76,7 @@ describe('va-featured-content', () => {
it('renders v3', async () => {
const page = await newE2EPage();
await page.setContent(`
<va-featured-content uswds>
<va-summary-box uswds>
<h3 slot="headline">
If I'm a Veteran, can I get VR&E benefits and services?
</h3>
Expand All @@ -87,12 +87,12 @@ describe('va-featured-content', () => {
<li>Have a service-connected disability rating of at least 10% from VA, <strong>and</strong></li>
<li><a href="#">Apply for VR&amp;E services</a></li>
</ul>
</va-featured-content>
</va-summary-box>
`);
const element = await page.find('va-featured-content');
const element = await page.find('va-summary-box');

expect(element).toEqualHtml(`
<va-featured-content class="hydrated" uswds="">
<va-summary-box class="hydrated" uswds="">
<mock:shadow-root>
<div class="usa-summary-box" role="region" aria-label="If I'm a Veteran, can I get VR&amp;E benefits and services?">
<div class="usa-summary-box__body">
Expand All @@ -109,17 +109,17 @@ describe('va-featured-content', () => {
<li>Have a service-connected disability rating of at least 10% from VA, <strong>and</strong></li>
<li><a href="#">Apply for VR&amp;E services</a></li>
</ul>
</va-featured-content>
</va-summary-box>
`);
});

it("renders the heading passed to the 'headline' slot", async () => {
const heading = "If I'm a Veteran, can I get VR&E benefits and services?";
const page = await newE2EPage();
await page.setContent(`
<va-featured-content uswds>
<va-summary-box uswds>
<h3 slot="headline">${heading}</h3>
</va-featured-content>
</va-summary-box>
`);
const element = await page.find('h3');
expect(element).not.toBeNull();
Expand All @@ -129,7 +129,7 @@ describe('va-featured-content', () => {
it('passes an axe check', async () => {
const page = await newE2EPage();
await page.setContent(`
<va-featured-content uswds>
<va-summary-box uswds>
<h3 slot="headline">
If I'm a Veteran, can I get VR&E benefits and services?
</h3>
Expand All @@ -140,7 +140,7 @@ describe('va-featured-content', () => {
<li>Have a service-connected disability rating of at least 10% from VA, <strong>and</strong></li>
<li><a href="#">Apply for VR&amp;E services</a></li>
</ul>
</va-featured-content>
</va-summary-box>
`);

await axeCheck(page);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Component, Host, h, Prop, Element, State } from '@stencil/core';

/**
* @componentName Featured content
* @componentName Summary box
* @maturityCategory use
* @maturityLevel deployed
*/
@Component({
tag: 'va-featured-content',
styleUrl: 'va-featured-content.scss',
tag: 'va-summary-box',
styleUrl: 'va-summary-box.scss',
shadow: true,
})
export class VaFeaturedContent {
export class VaSummaryBox {
/**
* Whether or not the component will use USWDS v3 styling.
*/
Expand Down

0 comments on commit 60632fc

Please sign in to comment.