diff --git a/playbook-website/app/javascript/components/VisualGuidelines/Examples/GroupHover.tsx b/playbook-website/app/javascript/components/VisualGuidelines/Examples/GroupHover.tsx index 4e262da48b..b58b4267f0 100644 --- a/playbook-website/app/javascript/components/VisualGuidelines/Examples/GroupHover.tsx +++ b/playbook-website/app/javascript/components/VisualGuidelines/Examples/GroupHover.tsx @@ -1,17 +1,19 @@ /* eslint-disable flowtype/no-types-missing-file-annotation */ -import React from 'react' - import { Card, Title, + User, + Flex, + Avatar, + Icon, } from 'playbook-ui' import Example from '../Templates/Example' const GroupHoverDescription = () => ( <> - You can hover over a kit and its children's hover affects will be applied. Check out {"our hover affects here."} + You can hover over a kit and its children's hover effects will be applied. Check out {"our hover effects here."} ) @@ -23,25 +25,48 @@ const GroupHover = ({ example }: {example: string}) => ( title="Group Hover" > - - <Title - alignSelf="center" - paddingY="lg" - text="I don't have any hover effect on me" - /> - <Title - alignSelf="center" - hover={{ scale: "lg"}} - text="I need to be hovered over directly" - /> + <Flex align="center" justify="between"> + <Flex align="center"> + {/* Individual hover effects show when hovered over directly */} + <Avatar + hover={{ scale: "lg" }} + imageAlt="Anna Black" + imageUrl="https://randomuser.me/api/portraits/women/44.jpg" + marginRight="xs" + name="Anna Black" + size="md" + /> + <User + align="center" + name="Anna Black" + orientation="horizontal" + size="md" + title="Remodeling Consultant" + /> + </Flex> + + {/* Group hover effects show when the outside card is hovered over */} + <Card + background="product_4_highlight" + borderRadius="rounded" + borderNone + hover={{ visibility: true }} + padding="xs" + groupHover + > + <Flex align="center"> + <Title dark size={4} marginRight="xs">Promote + + + + + ) diff --git a/playbook-website/app/javascript/components/VisualGuidelines/Examples/Hover.tsx b/playbook-website/app/javascript/components/VisualGuidelines/Examples/Hover.tsx index 5b01d98ac4..6aecbb8869 100644 --- a/playbook-website/app/javascript/components/VisualGuidelines/Examples/Hover.tsx +++ b/playbook-website/app/javascript/components/VisualGuidelines/Examples/Hover.tsx @@ -18,6 +18,7 @@ import Example from '../Templates/Example' const shadowArr = ['deep', 'deeper', 'deepest'] const scaleObj = { 'sm': '@1.05', 'md': '@1.10', 'lg': '@1.15' } +const visibilityArr = ['true', 'false'] const Hover = ({ example }: { example: string }) => ( @@ -183,6 +184,27 @@ const Hover = ({ example }: { example: string }) => ( })} + + + + + + {visibilityArr.map((value) => { + return ( + + ) + })} + + diff --git a/playbook-website/app/views/pages/code_snippets/group_hover_jsx.txt b/playbook-website/app/views/pages/code_snippets/group_hover_jsx.txt index 6366242b5d..70478ad3df 100644 --- a/playbook-website/app/views/pages/code_snippets/group_hover_jsx.txt +++ b/playbook-website/app/views/pages/code_snippets/group_hover_jsx.txt @@ -1,21 +1,44 @@ - - <Title - alignSelf="center" - paddingY="lg" - text="I don't have any hover effect on me" - /> - <Title - alignSelf="center" - hover={{ scale: "lg"}} - text="I need to be hovered over directly" - /> -</Card> + <Flex align="center" justify="between"> + <Flex align="center"> + {/* Individual hover effects show when hovered over directly */} + <Avatar + hover={{ scale: "lg" }} + imageAlt="Anna Black" + imageUrl="https://randomuser.me/api/portraits/women/44.jpg" + marginRight="xs" + name="Anna Black" + size="md" + /> + <User + align="center" + name="Anna Black" + orientation="horizontal" + size="md" + title="Remodeling Consultant" + /> + </Flex> + + {/* Group hover effects show when the outside card is hovered over */} + <Card + background="product_4_highlight" + borderRadius="rounded" + borderNone + hover={{ visibility: true }} + padding="xs" + groupHover + > + <Flex align="center"> + <Title dark size={4} marginRight="xs">Promote + + + + + + \ No newline at end of file diff --git a/playbook-website/app/views/pages/code_snippets/hover_jsx.txt b/playbook-website/app/views/pages/code_snippets/hover_jsx.txt index c7319ebc16..c4b09671b4 100644 --- a/playbook-website/app/views/pages/code_snippets/hover_jsx.txt +++ b/playbook-website/app/views/pages/code_snippets/hover_jsx.txt @@ -7,7 +7,7 @@