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

consistency property naming between code and documentation for divider (#874) #896

Merged
merged 1 commit into from
Feb 14, 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
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class BlrNumberInput extends LitElement {
<div class="stepper-combo horizontal ${this.size}">
${this.getButtonTemplate('blrMinus', this.stepperDown)}
${BlrDividerRenderFunction({
directionVariant: 'vertical',
direction: 'vertical',
theme: this.theme,
})}
${this.getButtonTemplate('blrPlus', this.stepperUp)}
Expand All @@ -148,7 +148,7 @@ export class BlrNumberInput extends LitElement {
<div class="stepper-combo vertical ${this.size}">
${this.getButtonTemplate('blrChevronUp', this.stepperUp)}
${BlrDividerRenderFunction({
directionVariant: 'horizontal',
direction: 'horizontal',
theme: this.theme,
})}
${this.getButtonTemplate('blrChevronDown', this.stepperDown)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class BlrTabBar extends LitElement {
<div class="wrapper-horizontal ${this.overflowVariantStandard} ${this.overflowVariantFullWidth}">
${this.showDivider
? BlrDividerRenderFunction({
directionVariant: 'horizontal',
direction: 'horizontal',
theme: this.theme,
})
: nothing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const sharedStyles = html`
export default {
title: 'Design System/Web Components/UI/Divider',
argTypes: {
directionVariant: {
direction: {
description: 'Choose direction of the component.',
options: DividerVariations,
control: { type: 'select' },
Expand Down Expand Up @@ -72,7 +72,7 @@ export const Divider = (params: BlrDividerType) => {
};
const defaultParams: BlrDividerType = {
theme: 'Light',
directionVariant: 'horizontal',
direction: 'horizontal',
};

Divider.args = defaultParams;
Expand All @@ -89,12 +89,12 @@ export const Direction = () => {
${sharedStyles}
${Divider({
...defaultParams,
directionVariant: 'horizontal',
direction: 'horizontal',
})}
<div class="wrapper">
${Divider({
...defaultParams,
directionVariant: 'vertical',
direction: 'vertical',
})}
</div>
`;
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/ui/divider/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { BlrDividerType } from '@boiler/ui-library/dist/';
import { fixture, expect } from '@open-wc/testing';
import { querySelectorDeep } from 'query-selector-shadow-dom';

const sampleParams: BlrDividerType = { theme: 'Light', directionVariant: 'vertical' };
const sampleParams: BlrDividerType = { theme: 'Light', direction: 'vertical' };

describe('blr-divider', () => {
it('renders a <div> element inside Shadow DOM', async () => {
Expand All @@ -32,7 +32,7 @@ describe('blr-divider', () => {
});

it('should render horizontal line', async () => {
const element = await fixture(BlrDividerRenderFunction({ ...sampleParams, directionVariant: 'horizontal' }));
const element = await fixture(BlrDividerRenderFunction({ ...sampleParams, direction: 'horizontal' }));
const dividerDiv = querySelectorDeep('.blr-divider', element.getRootNode() as HTMLElement);
const className = dividerDiv?.className;

Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/ui/divider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrDivider extends LitElement {
@property() directionVariant: DividerVariationTypes = 'vertical';
@property() direction: DividerVariationTypes = 'vertical';
@property() theme: ThemeType = 'Light';

protected render() {
const dynamicStyles = this.theme === 'Light' ? [dividerLight] : [dividerDark];

const dividerClasses = classMap({
'blr-divider': true,
[this.directionVariant]: true,
[this.direction]: true,
});

return html`
Expand Down
Loading