Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adds part to accordion component #264

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/core/src/components/pds-accordion/pds-accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { downSmall } from '@pine-ds/icons/icons';

/**
* @part accordion-body - Accordion body styles.
* @part accordion-button - Accordion button/trigger styles.
* @slot (default) - Accordion body content.
* @slot label - Accordion trigger button content.
*/
Expand Down Expand Up @@ -54,7 +55,7 @@ export class PdsAccordion {
return (
<Host class="pds-accordion" id={this.componentId}>
<details {...this.getOpenAttribute()} ref={(el) => (this.detailsEl = el as HTMLDetailsElement)}>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon={downSmall} />
</summary>
Expand Down
7 changes: 4 additions & 3 deletions libs/core/src/components/pds-accordion/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@

## Shadow Parts

| Part | Description |
| ------------------ | ---------------------- |
| `"accordion-body"` | Accordion body styles. |
| Part | Description |
| -------------------- | -------------------------------- |
| `"accordion-body"` | Accordion body styles. |
| `"accordion-button"` | Accordion button/trigger styles. |


## Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('pds-accordion', () => {
<pds-accordion class="pds-accordion">
<mock:shadow-root>
<details>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
Expand All @@ -34,7 +34,7 @@ describe('pds-accordion', () => {
<pds-accordion class="pds-accordion" open>
<mock:shadow-root>
<details open>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
Expand All @@ -57,7 +57,7 @@ describe('pds-accordion', () => {
<pds-accordion component-id="test" id="test" class="pds-accordion">
<mock:shadow-root>
<details>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
Expand All @@ -80,7 +80,7 @@ describe('pds-accordion', () => {
<pds-accordion class="pds-accordion">
<mock:shadow-root>
<details>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
Expand All @@ -104,7 +104,7 @@ describe('pds-accordion', () => {
<pds-accordion class="pds-accordion">
<mock:shadow-root>
<details>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
Expand All @@ -128,7 +128,7 @@ describe('pds-accordion', () => {
<pds-accordion class="pds-accordion" open>
<mock:shadow-root>
<details open>
<summary>
<summary part="accordion-button">
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
Expand Down
Loading