Skip to content

Commit

Permalink
style(vwc-accordion): extract divider from expansion panel (#937)
Browse files Browse the repository at this point in the history
* style(vwc-accordion): extract divider from expansion panel

* removed unused wrapper

* group story

* snapshot changed tree structure
  • Loading branch information
yinonov authored Jul 6, 2021
1 parent 418a2db commit 911bf45
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
52 changes: 25 additions & 27 deletions __snapshots__/expansion panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@
#### `should have internal contents`

```html
<div class="expansion-panel">
<div class="expansion-panel-header">
<mwc-ripple>
</mwc-ripple>
<span class="leading-icon">
<slot name="icon">
</slot>
</span>
click me
<span class="trailing-icon">
<slot name="trailingIcon">
<vwc-icon
class="toggle-open"
type="chevron-down-solid"
>
</vwc-icon>
<vwc-icon
class="toggle-close"
type="chevron-up-solid"
>
</vwc-icon>
</slot>
</span>
</div>
<div class="expansion-panel-body">
<slot>
<div class="expansion-panel-header">
<mwc-ripple>
</mwc-ripple>
<span class="leading-icon">
<slot name="icon">
</slot>
</div>
</span>
click me
<span class="trailing-icon">
<slot name="trailingIcon">
<vwc-icon
class="toggle-open"
type="chevron-down-solid"
>
</vwc-icon>
<vwc-icon
class="toggle-close"
type="chevron-up-solid"
>
</vwc-icon>
</slot>
</span>
</div>
<div class="expansion-panel-body">
<slot>
</slot>
</div>

```
Expand Down
3 changes: 2 additions & 1 deletion components/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"tslib": "^2.3.0"
},
"devDependencies": {
"@vonage/vvd-design-tokens": "2.13.0",
"@vonage/vvd-umbrella": "2.13.0",
"typescript": "^4.3.2"
}
}
}
6 changes: 6 additions & 0 deletions components/accordion/src/vwc-accordion.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables' as scheme-variables;

:host {
display: flex;
flex-direction: column;
}

::slotted(vwc-expansion-panel:not(:only-of-type)) {
border-bottom: 1px solid var(#{scheme-variables.$vvd-color-neutral-30});
}
4 changes: 0 additions & 4 deletions components/expansion-panel/src/vwc-expansion-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
}
}

.expansion-panel {
border-bottom: 1px solid var(#{scheme-variables.$vvd-color-neutral-30});
}

.expansion-panel-header {
@include typography.typography-cat-shorthand('subtitle-2');
position: relative;
Expand Down
5 changes: 2 additions & 3 deletions components/expansion-panel/src/vwc-expansion-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class VWCExpansionPanel extends VWCExpansionPanelBase {
}

protected render(): TemplateResult {
return html`<div class="expansion-panel">
return html`
<div class="expansion-panel-header"
@mousedown="${this.handleRippleActivate}"
@mouseenter="${this.handleRippleMouseEnter}"
Expand All @@ -95,8 +95,7 @@ export class VWCExpansionPanel extends VWCExpansionPanelBase {
</div>
<div class="expansion-panel-body">
<slot></slot>
</div>
</div>`;
</div>`;
}

protected renderIconOrToggle(): TemplateResult | string {
Expand Down
4 changes: 2 additions & 2 deletions components/expansion-panel/stories/expansion-panel.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { spread } from '@open-wc/lit-helpers';
import { argTypes } from './arg-types.js';

export default {
title: 'Alpha/Components/Expansion Panel',
component: 'vwc-expansion-panel',
title: 'Alpha/Components/Accordion/Accordion Item',
component: 'vwc-accordion-item',
argTypes
};

Expand Down

0 comments on commit 911bf45

Please sign in to comment.