Skip to content

Commit 7730838

Browse files
committed
feat(html): add rounded prop to button-group
1 parent 586e93e commit 7730838

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

packages/html/src/button-group/button-group.spec.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { classNames, optionClassNames, stateClassNames, States, FillMode } from '../misc';
1+
import { classNames, optionClassNames, stateClassNames, States, Roundness, FillMode } from '../misc';
22

33
export const BUTTONGROUP_CLASSNAME = `k-button-group`;
44

@@ -8,10 +8,12 @@ const states = [
88

99
const options = {
1010
fillMode: [ FillMode.solid, FillMode.flat, FillMode.outline, FillMode.clear, FillMode.link ],
11+
rounded: [ Roundness.small, Roundness.medium, Roundness.large, Roundness.full ]
1112
};
1213

1314
export type KendoButtonGroupOptions = {
1415
fillMode?: (typeof options.fillMode)[number] | null;
16+
rounded?: (typeof options.rounded)[number] | null;
1517
};
1618

1719
export type KendoButtonGroupProps = KendoButtonGroupOptions & {
@@ -21,7 +23,8 @@ export type KendoButtonGroupProps = KendoButtonGroupOptions & {
2123
export type KendoButtonGroupState = { [K in (typeof states)[number]]?: boolean };
2224

2325
const defaultProps = {
24-
fillMode: FillMode.solid
26+
fillMode: FillMode.solid,
27+
rounded: Roundness.medium
2528
};
2629

2730
export const ButtonGroup = (
@@ -31,6 +34,7 @@ export const ButtonGroup = (
3134
) => {
3235
const {
3336
fillMode = defaultProps.fillMode,
37+
rounded = defaultProps.rounded,
3438
disabled,
3539
stretched,
3640
...other
@@ -43,7 +47,8 @@ export const ButtonGroup = (
4347
props.className,
4448
BUTTONGROUP_CLASSNAME,
4549
optionClassNames(BUTTONGROUP_CLASSNAME, {
46-
fillMode
50+
fillMode,
51+
rounded
4752
}),
4853
stateClassNames(BUTTONGROUP_CLASSNAME, {
4954
disabled

packages/html/src/button-group/templates/icon-button-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ButtonGroup } from "../button-group.spec";
22
import { Button } from "../../button";
33

44
export const IconButtonGroup = (props) => (
5-
<ButtonGroup children={
5+
<ButtonGroup {...props} children={
66
<>
77
<Button className="k-group-start" {...props} icon="bold" />
88
<Button {...props} icon="italic" />

packages/html/src/button-group/templates/icon-text-button-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ButtonGroup } from "../button-group.spec";
22
import { Button } from "../../button";
33

44
export const IconTextButtonGroup = (props) => (
5-
<ButtonGroup children={
5+
<ButtonGroup {...props} children={
66
<>
77
<Button className="k-group-start" {...props} icon="star">First</Button>
88
<Button {...props} icon="star">Middle</Button>

packages/html/src/button-group/templates/mixed-button-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ButtonGroup } from "../button-group.spec";
22
import { Button } from "../../button";
33

44
export const MixedButtonGroup = (props) => (
5-
<ButtonGroup children={
5+
<ButtonGroup {...props} children={
66
<>
77
<Button className="k-group-start" {...props}>First</Button>
88
<Button {...props} icon="star">Middle</Button>

packages/html/src/button-group/templates/text-button-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ButtonGroup } from "../button-group.spec";
22
import { Button } from "../../button";
33

44
export const TextButtonGroup = (props) => (
5-
<ButtonGroup children={
5+
<ButtonGroup {...props} children={
66
<>
77
<Button className="k-group-start" {...props}>First</Button>
88
<Button {...props}>Middle</Button>

packages/html/src/button-group/tests/button-group-rounded.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default () => (
1717
<span>medium</span>
1818
<span>large</span>
1919

20-
{[ "null", ...Button.options.rounded ].map((rounded: any) => (
20+
{[ "null", ...Button.options.rounded ].map((rounded) => (
2121
<>
2222
<span>{rounded}</span>
2323
{Button.options.size.map((size) => (

0 commit comments

Comments
 (0)