Skip to content

Commit

Permalink
Accordion: Removes Animation (#215)
Browse files Browse the repository at this point in the history
* fix(accordion): removes accordion animation

* style(accordion): removes unneeded styles

* Publish

 - @pine-ds/[email protected]
 - @pine-ds/[email protected]
 - @pine-ds/[email protected]

* chore: fixes prop formatting

* chore: fixes linting issue

---------

Co-authored-by: DSS Automation Bot <[email protected]>
  • Loading branch information
anechol and kajabi-bot authored Jun 28, 2024
1 parent c5bec03 commit e1bb7d6
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 35 deletions.
13 changes: 13 additions & 0 deletions libs/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.1.0-rc.0](https://github.com/Kajabi/pine/compare/@pine-ds/[email protected]...@pine-ds/[email protected]) (2024-06-28)


### Bug Fixes

* **accordion:** removes accordion animation ([9c25da0](https://github.com/Kajabi/pine/commit/9c25da00c08b45edb9e4f1decac0b630f4f9dcca))
* **tooltip:** resolve trigger alignment when present in a group ([#208](https://github.com/Kajabi/pine/issues/208)) ([c5bec03](https://github.com/Kajabi/pine/commit/c5bec031f5eda1de0d55561b51aa3cbc05e43379))
* update old token values in components ([#210](https://github.com/Kajabi/pine/issues/210)) ([ddc2e50](https://github.com/Kajabi/pine/commit/ddc2e50ac69a173324a5f5c772216d1c7c82ccae))





## [1.0.5](https://github.com/Kajabi/pine/compare/core-v1.0.2...core-v1.0.5) (2024-06-06)


Expand Down
2 changes: 1 addition & 1 deletion libs/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pine-ds/core",
"version": "1.0.5",
"version": "1.1.0-rc.0",
"license": "MIT",
"description": "Base components for Pine Design System",
"author": "Kajabi Design System Services",
Expand Down
11 changes: 0 additions & 11 deletions libs/core/src/components/pds-accordion/pds-accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ details {
/* stylelint-disable-next-line */
details[open] {
background-color: var(--color-content-background);
transition: transform var(--number-animation-transform-timing);

summary {
color: var(--color-text-active);
Expand All @@ -45,16 +44,6 @@ details[open] {
transition: transform var(--number-animation-transform-timing);
}
}

/* stylelint-disable-next-line selector-no-qualifying-type */
.pds-accordion__body {
display: none;

/* stylelint-disable-next-line selector-no-qualifying-type */
&.open {
display: block;
}
}
}

summary {
Expand Down
19 changes: 6 additions & 13 deletions libs/core/src/components/pds-accordion/pds-accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { downSmall } from '@pine-ds/icons/icons';
})
export class PdsAccordion {
private detailsEl: HTMLDetailsElement;
private containerEl: HTMLDivElement;

/**
* A unique identifier used for the underlying component `id` attribute.
Expand All @@ -27,30 +26,24 @@ export class PdsAccordion {
@Prop({
attribute: 'open',
mutable: true,
reflect: true
reflect: true,
}) isOpen: boolean = false;

@Watch('isOpen')
handleOpenState(newValue: boolean) {
this.isOpen = newValue;

if ( newValue === true ) {
this.containerEl.classList.add('open');
} else {
this.containerEl.classList.remove('open');
}
}

private handleToggle = () => {
this.isOpen = this.detailsEl.open;
}
};

private getOpenAttribute = () => {
if (this.isOpen !== false) {
return { open: true };
}
return '';
}
};

componentDidLoad() {
this.detailsEl.addEventListener('toggle', this.handleToggle);
Expand All @@ -59,12 +52,12 @@ export class PdsAccordion {
render() {
return (
<Host class="pds-accordion" id={this.componentId}>
<details {...this.getOpenAttribute()} ref={(el) => this.detailsEl = el as HTMLDetailsElement}>
<details {...this.getOpenAttribute()} ref={(el) => (this.detailsEl = el as HTMLDetailsElement)}>
<summary>
<slot name="label">Details</slot>
<pds-icon icon={ downSmall } />
<pds-icon icon={downSmall} />
</summary>
<div class={`pds-accordion__body ${this.isOpen ? 'open' : ''}`} ref={(el) => this.containerEl = el as HTMLDivElement}>
<div class="pds-accordion__body">
<slot />
</div>
</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('pds-accordion', () => {
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
<div class="open pds-accordion__body">
<div class="pds-accordion__body">
<slot />
</div>
</details>
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('pds-accordion', () => {
</details>
</mock:shadow-root>
</pds-accordion>
`)
`);
});

it('renders summary slot content when set', async () => {
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('pds-accordion', () => {
<slot name="label">Details</slot>
<pds-icon icon="${downSmall}"></pds-icon>
</summary>
<div class="open pds-accordion__body">
<div class="pds-accordion__body">
<slot />
</div>
</details>
Expand Down
8 changes: 8 additions & 0 deletions libs/doc-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.1.0-rc.0](https://github.com/Kajabi/pine/compare/@pine-ds/[email protected]...@pine-ds/[email protected]) (2024-06-28)

**Note:** Version bump only for package @pine-ds/doc-components





## [1.0.1](https://github.com/Kajabi/pine/compare/@pine-ds/[email protected]...@pine-ds/[email protected]) (2024-06-04)


Expand Down
2 changes: 1 addition & 1 deletion libs/doc-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@pine-ds/doc-components",
"description": "Pine documentation components",
"author": "Kajabi Design System Services",
"version": "1.0.1",
"version": "1.1.0-rc.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down
8 changes: 8 additions & 0 deletions libs/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.1.0-rc.0](https://github.com/Kajabi/pine/compare/@pine-ds/[email protected]...@pine-ds/[email protected]) (2024-06-28)

**Note:** Version bump only for package @pine-ds/react





## [1.0.2](https://github.com/Kajabi/pine/compare/@pine-ds/[email protected]...@pine-ds/[email protected]) (2024-06-04)

**Note:** Version bump only for package @pine-ds/react
Expand Down
4 changes: 2 additions & 2 deletions libs/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pine-ds/react",
"version": "1.0.5",
"version": "1.1.0-rc.0",
"license": "MIT",
"description": "Pine Web Components React Wrapper",
"author": "Kajabi Design System Services",
Expand Down Expand Up @@ -37,7 +37,7 @@
"tsc": "tsc -p ."
},
"dependencies": {
"@pine-ds/core": "*",
"@pine-ds/core": "^1.1.0-rc.0",
"@pine-ds/icons": "*",
"tslib": "*"
},
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1bb7d6

Please sign in to comment.