Skip to content

Commit

Permalink
chore(coverage): fix coverage gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
damienrobson-sage committed Jan 13, 2025
1 parent 4b9c25c commit 13216fc
Showing 1 changed file with 10 additions and 47 deletions.
57 changes: 10 additions & 47 deletions src/components/button-toggle/button-toggle.style.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import styled, { css } from "styled-components";

import { IconType } from "../icon";
import StyledIcon from "../icon/icon.style";
import addFocusStyling from "../../style/utils/add-focus-styling";
import baseTheme from "../../style/themes/base";
import addFocusStyling from "../../style/utils/add-focus-styling";

export type ButtonToggleIconSizes = "small" | "large";

Expand Down Expand Up @@ -54,7 +55,6 @@ export interface StyledButtonToggleProps {
disabled?: boolean;
/** ButtonToggle size */
size: "small" | "medium" | "large";
grouped?: boolean;
/** Allow button to be deselected when already selected */
allowDeselect?: boolean;
}
Expand Down Expand Up @@ -93,8 +93,8 @@ const StyledButtonToggle = styled.button<StyledButtonToggleProps>`
min-height: ${heightLargeIconConfig[size]}px;
padding: ${paddingLargeIconConfig[size]};
flex-direction: column;
`}
`}
&:focus {
${addFocusStyling()}
z-index: 100;
Expand Down Expand Up @@ -176,51 +176,14 @@ const StyledButtonToggleIcon = styled.div<StyledButtonToggleIconProps>`

StyledButtonToggle.defaultProps = { theme: baseTheme };

export interface StyledButtonToggleWrapperProps {
grouped?: boolean;
}

const StyledButtonToggleWrapper = styled.div<StyledButtonToggleWrapperProps>`
const StyledButtonToggleWrapper = styled.div`
display: inline-block;
vertical-align: middle;
${({ grouped }) => css`
${!grouped &&
css`
&&&& {
${StyledButtonToggle} {
border-radius: var(--borderRadius050);
}
}
`}
${grouped &&
css`
&&&& {
:first-of-type {
${StyledButtonToggle} {
border-top-left-radius: var(--borderRadius050);
border-bottom-left-radius: var(--borderRadius050);
}
}
:last-of-type {
${StyledButtonToggle} {
border-top-right-radius: var(--borderRadius050);
border-bottom-right-radius: var(--borderRadius050);
}
}
}
`}
`}
${({ grouped }) =>
grouped &&
css`
&:not(:first-of-type) {
margin-left: -1px;
}
`};
&&&& {
${StyledButtonToggle} {
border-radius: var(--borderRadius050);
}
}
`;

export {
Expand Down

0 comments on commit 13216fc

Please sign in to comment.