Skip to content

Commit

Permalink
refactor(leadspace): reorganize slots (carbon-design-system#4898)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Refs carbon-design-system#4627.

### Description

Changes `<slot name="buttons">` to `<slot name="action">` to align the naming strategy to `<dds-cta-section>`.

### Changelog

**Changed**

- Changes `<slot name="buttons">` to `<slot name="action">`.
  • Loading branch information
asudoh authored and IgnacioBecerra committed Feb 22, 2021
1 parent ec4b534 commit 94c7628
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import '@carbon/ibmdotcom-web-components/es/components/button-group/button-group
<dds-leadspace alt="alt text" default-src="www.example.com">
<dds-leadspace-heading>LeadSpace title</dds-leadspace-heading>
LeadSpace copy
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map( elem => html`
<dds-button-group-item href="www.example.com">${elem.copy}${ArrowRight20}</dds-button-group-item>
` )}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const DefaultWithNoImage = ({ parameters }) => {
<dds-leadspace alt="${ifNonNull(alt)}" default-src="${ifNonNull(defaultSrc)}">
<dds-leadspace-heading>${ifNonNull(title)}</dds-leadspace-heading>
${ifNonNull(copy)}
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map(
elem => html`
<dds-button-group-item href="${elem.href}">${elem.copy}${elem.renderIcon}</dds-button-group-item>
Expand All @@ -60,7 +60,7 @@ export const DefaultWithImage = ({ parameters }) => {
>
<dds-leadspace-heading>${ifNonNull(title)}</dds-leadspace-heading>
${ifNonNull(copy)}
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map(
elem => html`
<dds-button-group-item href="${elem.href}">${elem.copy}${elem.renderIcon}</dds-button-group-item>
Expand All @@ -81,7 +81,7 @@ export const Centered = ({ parameters }) => {
<dds-leadspace type="centered">
<dds-leadspace-heading>${ifNonNull(title)}</dds-leadspace-heading>
${ifNonNull(copy)}
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map(
elem => html`
<dds-button-group-item href="${elem.href}">${elem.copy}${elem.renderIcon}</dds-button-group-item>
Expand All @@ -103,7 +103,7 @@ export const CenteredWithImage = ({ parameters }) => {
>
<dds-leadspace-heading>${ifNonNull(title)}</dds-leadspace-heading>
${ifNonNull(copy)}
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map(
elem => html`
<dds-button-group-item href="${elem.href}">${elem.copy}${elem.renderIcon}</dds-button-group-item>
Expand All @@ -124,7 +124,7 @@ export const Small = ({ parameters }) => {
<dds-leadspace alt="${ifNonNull(alt)}" default-src="${ifNonNull(defaultSrc)}" type="small">
<dds-leadspace-heading>${ifNonNull(title)}</dds-leadspace-heading>
${ifNonNull(copy)}
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map(
elem => html`
<dds-button-group-item href="${elem.href}">${elem.copy}${elem.renderIcon}</dds-button-group-item>
Expand All @@ -141,7 +141,7 @@ export const SmallWithImage = ({ parameters }) => {
<dds-leadspace ?gradient="${ifNonNull(gradient)}" alt="${ifNonNull(alt)}" default-src="${ifNonNull(defaultSrc)}" type="small">
<dds-leadspace-heading>${ifNonNull(title)}</dds-leadspace-heading>
${ifNonNull(copy)}
<dds-button-group slot="buttons">
<dds-button-group slot="action">
${buttons.map(
elem => html`
<dds-button-group-item href="${elem.href}">${elem.copy}${elem.renderIcon}</dds-button-group-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const { stablePrefix: ddsPrefix } = ddsSettings;
* The LeadSpace component.
*
* @element dds-leadspace
* @slot action The action (CTA) content.
* @slot image The image content.
* @csspart section The first DOM node inside the shadow-root
*/
@customElement(`${ddsPrefix}-leadspace`)
Expand Down Expand Up @@ -176,7 +178,7 @@ class DDSLeadSpace extends StableSelectorMixin(LitElement) {
</div>
<div class="${prefix}--leadspace__content">
${this._renderCopy()}
<slot name="buttons"></slot>
<slot name="action"></slot>
</div>
</div>
</div>
Expand Down
24 changes: 12 additions & 12 deletions packages/web-components/tests/snapshots/dds-leadspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -64,7 +64,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -103,7 +103,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -140,7 +140,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -179,7 +179,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -223,7 +223,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -269,7 +269,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -313,7 +313,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -359,7 +359,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -396,7 +396,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -435,7 +435,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down Expand Up @@ -472,7 +472,7 @@
</slot>
</p>
</div>
<slot name="buttons">
<slot name="action">
</slot>
</div>
</div>
Expand Down

0 comments on commit 94c7628

Please sign in to comment.