Skip to content

Commit

Permalink
feat(toggle-button-group): added min columns option (#2228)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtBlue authored Aug 7, 2024
1 parent 5659ebe commit b1f4dc1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tame-beans-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/ebayui-core": minor
---

feat(toggle-button-group): added min columns option
1 change: 1 addition & 0 deletions src/components/ebay-toggle-button-group/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface ToggleButtonGroupInput
variant?: "checkbox" | "radio" | "radio-toggle";
"a11y-text"?: string;
"a11y-label-id"?: string;
columnsMin?: number;
columnsXS?: number;
columnsSM?: number;
columnsMD?: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ebay-toggle-button-group columnsSM=3 columnsXS=2 columnsMD=6 columnsXL=8 ...input>
<ebay-toggle-button-group columnsMin=1 columnsSM=3 columnsXS=2 columnsMD=6 columnsXL=8 ...input>
<@button>
First Item
<@subtitle>Empty on load</@subtitle>
Expand Down
2 changes: 2 additions & 0 deletions src/components/ebay-toggle-button-group/index.marko
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { processHtmlAttributes } from "../../common/html-attributes";
$ const {
class: inputClass,
layoutType: baseLayoutType,
columnsMin,
columnsXS,
columnsSM,
columnsMD,
Expand All @@ -15,6 +16,7 @@ $ const {

<div
class=["toggle-button-group", inputClass]
data-columns-min=columnsMin
data-columns-xs=columnsXS
data-columns-sm=columnsSM
data-columns-md=columnsMD
Expand Down
1 change: 1 addition & 0 deletions src/components/ebay-toggle-button-group/marko-tag.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"@html-attributes": "expression",
"@radio": "boolean",
"@columnsMin": "number",
"@columnsMD": "number",
"@columnsSM": "number",
"@columnsXS": "number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div
class="toggle-button-group"
data-columns-md="6"
data-columns-min="1"
data-columns-sm="3"
data-columns-xl="8"
data-columns-xs="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export default {
description:
'Selection type for the buttons in the group. May be `"checkbox"` (default), `"radio"`, or `"radio-toggle"` (same as radio but with the option to deselect)',
},
columnsMin: {
type: "number",
control: { type: "number" },
description:
"Preferred minimum number of columns for smallest container/screen (1-3). If this is not set will do an automatic layout. It is recommended to not set this unless needed.",
},
columnsXS: {
type: "number",
control: { type: "number" },
Expand Down Expand Up @@ -145,6 +151,7 @@ export const PerferedColumns = buildExtensionTemplate(
columnsTemplate,
columnsCode,
{
columnsMin: 1,
columnsSM: 3,
columnsXS: 2,
columnsMD: 6,
Expand Down

0 comments on commit b1f4dc1

Please sign in to comment.