-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lld): 🎠 update react-ui default carousel design (#8371)
* feat(lld): add arrows to the default carousel * feat(lld): update the default carousel bullets * feat(lld): hide carousel controls for a single slide * fix(lld): carousel styling * chore(lld): improve the carousel story * chore: update change log * chore(lld): add handlers for the ChevronArrow onClick functions * fix(lld): storybook's light theme background * fix(lld): do not set a background color for the carousel * chore: set the `@ledgerhq/ui-shared` change to minor instead of patch
- Loading branch information
Showing
11 changed files
with
137 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@ledgerhq/react-ui": minor | ||
"@ledgerhq/ui-shared": minor | ||
--- | ||
|
||
Update the react-ui Carousel based on the portfolio content cards design |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
libs/ui/packages/react/src/components/layout/Carousel/ChevronArrow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { Icons } from "../../../assets"; | ||
|
||
type Props = ContainerProps & { | ||
onClick: () => void; | ||
}; | ||
|
||
export function ChevronArrow(props: Props) { | ||
return ( | ||
<ChevronArrowContainer {...props}> | ||
<Icons.ChevronLeft /> | ||
</ChevronArrowContainer> | ||
); | ||
} | ||
|
||
type ContainerProps = { | ||
direction: "left" | "right"; | ||
}; | ||
|
||
const ChevronArrowContainer = styled.button<ContainerProps>` | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 32px; | ||
height: 32px; | ||
position: absolute; | ||
top: 50%; | ||
left: ${({ direction }) => (direction === "left" ? "0" : "auto")}; | ||
right: ${({ direction }) => (direction === "left" ? "auto" : "0")}; | ||
z-index: 1; | ||
--dir: ${({ direction }) => (direction === "left" ? "1" : "-1")}; | ||
scale: var(--dir) 1; | ||
translate: calc(-50% * var(--dir)) -50%; | ||
background-color: ${({ theme }) => theme.colors.background.default}; // Fake the transparent clip | ||
border-radius: 100%; | ||
border: none; | ||
outline: none; | ||
::before { | ||
content: ""; | ||
display: block; | ||
position: absolute; | ||
z-index: -1; | ||
inset: 3px; | ||
background-color: ${({ theme }) => theme.colors.opacityDefault.c05}; | ||
border-color: ${({ theme }) => theme.colors.opacityDefault.c05}; | ||
border-radius: 100%; | ||
border-style: solid; | ||
border-width: 1px; | ||
} | ||
svg { | ||
color: ${({ theme }) => theme.colors.primary.c100}; | ||
} | ||
::before, | ||
svg { | ||
cursor: pointer; | ||
} | ||
transition: opacity 0.2s ease-in-out; | ||
opacity: var(--hover-transition); | ||
::before, | ||
svg { | ||
transition: translate 0.2s ease-in-out; | ||
translate: calc(-50% + 50% * var(--hover-transition)) 0; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters