) => (
{
buttonRef.current = element;
if (childButtonCallbackRef) {
diff --git a/src/components/button-toggle/button-toggle.spec.tsx b/src/components/button-toggle/button-toggle.spec.tsx
index 061990a31f..13584e53e7 100644
--- a/src/components/button-toggle/button-toggle.spec.tsx
+++ b/src/components/button-toggle/button-toggle.spec.tsx
@@ -10,7 +10,6 @@ import {
StyledButtonToggleIcon,
ButtonToggleIconSizes,
StyledButtonToggle,
- StyledButtonToggleWrapper,
} from "./button-toggle.style";
import { InputGroupContext } from "../../__internal__/input-behaviour";
import { ThemeObject } from "../../style/themes/base";
@@ -396,16 +395,4 @@ describe("ButtonToggle", () => {
describe("coverage filler for else path", () => {
mount(toggle);
});
-
- it("renders with the expected border radius styling", () => {
- assertStyleMatch(
- {
- borderRadius: "var(--borderRadius400)",
- },
- mount(toggle).find(
- StyledButtonToggleWrapper
- ),
- { modifier: `&&&& ${StyledButtonToggle}` }
- );
- });
});
diff --git a/src/components/button-toggle/button-toggle.stories.mdx b/src/components/button-toggle/button-toggle.stories.mdx
index 2b63e210aa..b82fcf5a80 100644
--- a/src/components/button-toggle/button-toggle.stories.mdx
+++ b/src/components/button-toggle/button-toggle.stories.mdx
@@ -6,7 +6,7 @@ import { ButtonToggle } from ".";
import * as stories from "./button-toggle.stories";
import * as groupStories from "./button-toggle-group/button-toggle-group.stories";
-
Product Design System component
@@ -35,7 +35,10 @@ Press one of the buttons to make selection. This component should be used when u
## Quick Start
```javascript
-import { ButtonToggle, ButtonToggleGroup } from "carbon-react/lib/components/button-toggle";
+import {
+ ButtonToggle,
+ ButtonToggleGroup,
+} from "carbon-react/lib/components/button-toggle";
```
- You should use the ButtonToggleGroup component if you need to wrap multiple `ButtonToggle` components together.
diff --git a/src/components/button-toggle/button-toggle.stories.tsx b/src/components/button-toggle/button-toggle.stories.tsx
index 29d57c7c82..3dc418350b 100644
--- a/src/components/button-toggle/button-toggle.stories.tsx
+++ b/src/components/button-toggle/button-toggle.stories.tsx
@@ -2,7 +2,6 @@ import React from "react";
import { ComponentStory } from "@storybook/react";
import { ButtonToggle, ButtonToggleGroup } from ".";
-import Box from "../box";
export const Default: ComponentStory = () => (
@@ -13,16 +12,14 @@ export const Default: ComponentStory = () => (
);
export const DefaultWrappedText: ComponentStory = () => (
-
-
-
- Some text that wraps
-
-
- FooBar
-
-
-
+
+
+ Some text that wraps
+
+
+ FooBar
+
+
);
export const DefaultSmallIcon: ComponentStory = () => (
diff --git a/src/components/button-toggle/button-toggle.style.ts b/src/components/button-toggle/button-toggle.style.ts
index 18e4f008dc..12b3ffee14 100644
--- a/src/components/button-toggle/button-toggle.style.ts
+++ b/src/components/button-toggle/button-toggle.style.ts
@@ -136,7 +136,114 @@ const StyledButtonToggle = styled.button`
}
}
cursor: not-allowed;
- `};
+ `}
+
+<<<<<<< HEAD
+
+=======
+<<<<<<< HEAD
+<<<<<<< HEAD
+
+ & ${StyledIcon} {
+ color: var(--colorsActionMinor500);
+ :not([aria-pressed="true"]):not(:disabled):hover {
+ color: var(--colorsActionMinorYang100);
+ }
+ }
+
+ color: var(--colorsActionMinor500);
+ border: 1px solid var(--colorsActionMinor500);
+
+ :not([aria-pressed="true"]):not(:disabled):hover {
+ color: var(--colorsActionMinorYang100);
+ background-color: var(--colorsActionMinor600);
+ ${StyledIcon} {
+ color: var(--colorsActionMinorYang100);
+ }
+ }
+
+ &:not(:disabled):hover {
+ background-color: var(--colorsActionMinor600);
+ color: var(--colorsActionMinorYang100);
+
+ ${StyledIcon} {
+ color: var(--colorsActionMinorYang100);
+ }
+ }
+
+ &[aria-pressed="true"]:not(:hover) {
+ box-shadow: inset 0px 0px 0px 3px var(--colorsActionMinor500);
+ background-color: transparent;
+ :focus {
+ box-shadow: inset 0px 0px 0px 3px var(--colorsActionMinor500),
+ 0px 0px 0px var(--borderWidth300) var(--colorsSemanticFocus500),
+ 0px 0px 0px var(--borderWidth600) var(--colorsUtilityYin090);
+ }
+ }
+=======
+ ${({ variant }) =>
+ variant === "minor" &&
+ css`
+=======
+
+>>>>>>> 0a84e5447 (feat(button-toggle): rm variant prop)
+>>>>>>> df20abe7b (feat(button-toggle): rm variant prop)
+ & ${StyledIcon} {
+ color: var(--colorsActionMinor500);
+ :not([aria-pressed="true"]):not(:disabled):hover {
+ color: var(--colorsActionMinorYang100);
+ }
+ }
+
+ color: var(--colorsActionMinor500);
+ border: 1px solid var(--colorsActionMinor500);
+
+ :not([aria-pressed="true"]):not(:disabled):hover {
+ color: var(--colorsActionMinorYang100);
+ background-color: var(--colorsActionMinor600);
+ ${StyledIcon} {
+ color: var(--colorsActionMinorYang100);
+ }
+ }
+
+ &:not(:disabled):hover {
+ background-color: var(--colorsActionMinor600);
+ color: var(--colorsActionMinorYang100);
+
+ ${StyledIcon} {
+ color: var(--colorsActionMinorYang100);
+ }
+ }
+
+<<<<<<< HEAD
+=======
+<<<<<<< HEAD
+ &[aria-pressed="true"]:not(:hover) {
+ box-shadow: inset 0px 0px 0px 3px var(--colorsActionMinor500);
+ background-color: transparent;
+ :focus {
+ box-shadow: inset 0px 0px 0px 3px var(--colorsActionMinor500),
+ 0px 0px 0px var(--borderWidth300) var(--colorsSemanticFocus500),
+ 0px 0px 0px var(--borderWidth600) var(--colorsUtilityYin090);
+ }
+ }
+ `}
+>>>>>>> 8c445eebb (feat(button-toggle): add minor child)
+=======
+>>>>>>> df20abe7b (feat(button-toggle): rm variant prop)
+ &[aria-pressed="true"]:not(:hover) {
+ box-shadow: inset 0px 0px 0px 3px var(--colorsActionMinor500);
+ background-color: transparent;
+ :focus {
+ box-shadow: inset 0px 0px 0px 3px var(--colorsActionMinor500),
+ 0px 0px 0px var(--borderWidth300) var(--colorsSemanticFocus500),
+ 0px 0px 0px var(--borderWidth600) var(--colorsUtilityYin090);
+ }
+ }
+<<<<<<< HEAD
+=======
+>>>>>>> 0a84e5447 (feat(button-toggle): rm variant prop)
+>>>>>>> df20abe7b (feat(button-toggle): rm variant prop)
`;
const iconFontSizes = {
@@ -188,7 +295,21 @@ const StyledButtonToggleWrapper = styled.div`
css`
&&&& {
${StyledButtonToggle} {
- border-radius: var(--borderRadius400);
+<<<<<<< HEAD
+ border-radius: var(--borderRadius050);
+=======
+<<<<<<< HEAD
+<<<<<<< HEAD
+ border-radius: var(--borderRadius050);
+=======
+ border-radius: ${variant === "minor"
+ ? "var(--borderRadius050)"
+ : "var(--borderRadius400)"};
+>>>>>>> 8c445eebb (feat(button-toggle): add minor child)
+=======
+ border-radius: var(--borderRadius050);
+>>>>>>> 0a84e5447 (feat(button-toggle): rm variant prop)
+>>>>>>> df20abe7b (feat(button-toggle): rm variant prop)
}
}
`}
@@ -198,15 +319,53 @@ const StyledButtonToggleWrapper = styled.div`
&&&& {
:first-of-type {
${StyledButtonToggle} {
- border-top-left-radius: var(--borderRadius400);
- border-bottom-left-radius: var(--borderRadius400);
+<<<<<<< HEAD
+ border-top-left-radius: var(--borderRadius050);
+ border-bottom-left-radius: var(--borderRadius050);
+=======
+<<<<<<< HEAD
+<<<<<<< HEAD
+ border-top-left-radius: var(--borderRadius050);
+ border-bottom-left-radius: var(--borderRadius050);
+=======
+ border-top-left-radius: ${variant === "minor"
+ ? "var(--borderRadius050)"
+ : "var(--borderRadius400)"};
+ border-bottom-left-radius: ${variant === "minor"
+ ? "var(--borderRadius050)"
+ : "var(--borderRadius400)"};
+>>>>>>> 8c445eebb (feat(button-toggle): add minor child)
+=======
+ border-top-left-radius: var(--borderRadius050);
+ border-bottom-left-radius: var(--borderRadius050);
+>>>>>>> 0a84e5447 (feat(button-toggle): rm variant prop)
+>>>>>>> df20abe7b (feat(button-toggle): rm variant prop)
}
}
:last-of-type {
${StyledButtonToggle} {
- border-top-right-radius: var(--borderRadius400);
- border-bottom-right-radius: var(--borderRadius400);
+<<<<<<< HEAD
+ border-top-right-radius: var(--borderRadius050);
+ border-bottom-right-radius: var(--borderRadius050);
+=======
+<<<<<<< HEAD
+<<<<<<< HEAD
+ border-top-right-radius: var(--borderRadius050);
+ border-bottom-right-radius: var(--borderRadius050);
+=======
+ border-top-right-radius: ${variant === "minor"
+ ? "var(--borderRadius050)"
+ : "var(--borderRadius400)"};
+ border-bottom-right-radius: ${variant === "minor"
+ ? "var(--borderRadius050)"
+ : "var(--borderRadius400)"};
+>>>>>>> 8c445eebb (feat(button-toggle): add minor child)
+=======
+ border-top-right-radius: var(--borderRadius050);
+ border-bottom-right-radius: var(--borderRadius050);
+>>>>>>> 0a84e5447 (feat(button-toggle): rm variant prop)
+>>>>>>> df20abe7b (feat(button-toggle): rm variant prop)
}
}
}