Skip to content

Commit

Permalink
fix(checkbox-group): use lowercase values for orientation attribute
Browse files Browse the repository at this point in the history
fix(radio-group): use lowercase values for orientation attribute
  • Loading branch information
daenub authored Jul 16, 2024
1 parent 78eb332 commit da68c5e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/components/checkbox/CheckboxGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export class LeuCheckboxGroup extends LeuElement {

constructor() {
super()
this.orientation = "HORIZONTAL"
/** @type {"horizontal" | "vertical"} */
this.orientation = "horizontal"
this.items = []
}

Expand All @@ -38,7 +39,7 @@ export class LeuCheckboxGroup extends LeuElement {
render() {
const fieldsetClasses = {
fieldset: "true",
"fieldset--vertical": this.orientation === "VERTICAL",
"fieldset--vertical": this.orientation === "vertical",
}

return html`
Expand Down
6 changes: 3 additions & 3 deletions src/components/checkbox/stories/checkbox-group.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
argTypes: {
legend: { control: "text" },
orientation: {
options: ["VERTICAL", "HORIZONTAL"],
options: ["vertical", "horizontal"],
control: { type: "checkbox" },
},
},
Expand Down Expand Up @@ -49,11 +49,11 @@ HorizontalLabel.args = {

export const Vertical = Template.bind({})
Vertical.args = {
orientation: "VERTICAL",
orientation: "vertical",
}

export const VerticalLabel = Template.bind({})
VerticalLabel.args = {
orientation: "VERTICAL",
orientation: "vertical",
label: "Anrede",
}
5 changes: 3 additions & 2 deletions src/components/radio/RadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export class LeuRadioGroup extends LeuElement {

constructor() {
super()
this.orientation = "HORIZONTAL"
/** @type {"horizontal" | "vertical"} */
this.orientation = "horizontal"
this._currentIndex = 0
this.items = []
}
Expand Down Expand Up @@ -154,7 +155,7 @@ export class LeuRadioGroup extends LeuElement {
render() {
const fieldsetClasses = {
fieldset: "true",
"fieldset--vertical": this.orientation === "VERTICAL",
"fieldset--vertical": this.orientation === "vertical",
}

return html`
Expand Down
6 changes: 3 additions & 3 deletions src/components/radio/stories/radio-group.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
argTypes: {
label: { control: "text" },
orientation: {
options: ["VERTICAL", "HORIZONTAL"],
options: ["vertical", "horizontal"],
control: { type: "radio" },
},
},
Expand Down Expand Up @@ -44,11 +44,11 @@ HorizontalLabel.args = {

export const Vertical = Template.bind({})
Vertical.args = {
orientation: "VERTICAL",
orientation: "vertical",
}

export const VerticalLabel = Template.bind({})
VerticalLabel.args = {
orientation: "VERTICAL",
orientation: "vertical",
label: "Anrede",
}

0 comments on commit da68c5e

Please sign in to comment.