Skip to content

Commit

Permalink
Toggleのレイアウト調整 (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
noronaoki committed Dec 5, 2023
1 parent 5594f26 commit 3373f15
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-buttons-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ingred-ui": patch
---

Modify toggle layout
6 changes: 3 additions & 3 deletions src/components/ToggleButton/ToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const ToggleButton = React.forwardRef<HTMLDivElement, ToggleButtonProps>(
checked = false,
disabled = false,
onChange,
width = "56px",
checkedText = "ON",
unCheckedText = "OFF",
width = "48px",
checkedText = "",
unCheckedText = "",
inputRef,
} = props;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
exports[`ToggleButton component testing ToggleButton 1`] = `
<DocumentFragment>
<div
class="sc-gsnTZi dImlRj"
width="56px"
class="sc-gsnTZi cFtvDM"
width="48px"
>
<label
class="sc-gKXOVf dUNjkq"
width="56px"
class="sc-gKXOVf hllYLd"
width="48px"
>
<input
class="sc-iBkjds hZpMas"
Expand All @@ -22,9 +22,7 @@ exports[`ToggleButton component testing ToggleButton 1`] = `
class="sc-bczRLJ glkMsN"
color="#0B82F4"
font-size="12px"
>
ON
</div>
/>
</div>
<div
class="sc-hKMtZM sc-jSMfEi fEjsWu kqRAsJ"
Expand All @@ -33,12 +31,10 @@ exports[`ToggleButton component testing ToggleButton 1`] = `
class="sc-bczRLJ jjEXQA"
color="#596978"
font-size="12px"
>
OFF
</div>
/>
</div>
<span
class="sc-dkzDqf kcKGiQ"
class="sc-dkzDqf dOoUqQ"
/>
</label>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/ToggleButton/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const ToggleButton = styled.span<{
top: 50%;
left: 4px;
transform: translateY(-50%);
width: 14px;
height: 14px;
width: 16px;
height: 16px;
border-radius: 14px;
background-color: ${({ checked, disabled, theme }) => {
let backgroundColor = theme.palette.background.default;
Expand Down Expand Up @@ -104,7 +104,7 @@ export const Label = styled.label<LabelProps>`
checked &&
css`
& > ${ToggleButton} {
left: calc(100% - 14px - 4px);
left: calc(100% - 14px - 6px);
}
& > ${CheckedLabelText} {
opacity: 1;
Expand Down

0 comments on commit 3373f15

Please sign in to comment.