diff --git a/cardigan/stories/components/WobblyEdge/WobblyBottom.stories.tsx b/cardigan/stories/components/WobblyEdge/WobblyBottom.stories.tsx new file mode 100644 index 0000000000..87035457ce --- /dev/null +++ b/cardigan/stories/components/WobblyEdge/WobblyBottom.stories.tsx @@ -0,0 +1,34 @@ +import { Meta, StoryObj } from '@storybook/react'; + +import { ReadMeInfo } from '@weco/cardigan/config/decorators'; +import { image as contentImage } from '@weco/cardigan/stories/data/images'; +import PrismicImage from '@weco/common/views/components/PrismicImage/PrismicImage'; +import { WobblyBottom } from '@weco/common/views/components/WobblyEdge'; +import Readme from '@weco/common/views/components/WobblyEdge/README.mdx'; + +const Template = args => ( + <> +
+ +
+ + +); + +const meta: Meta = { + title: 'Components/WobblyEdge/WobblyBottom', + component: WobblyBottom, + args: { + backgroundColor: 'warmNeutral.300', + children: , + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Basic: Story = { + name: 'WobblyBottom', + render: Template, +}; diff --git a/cardigan/stories/components/WobblyEdge/WobblyEdge.stories.tsx b/cardigan/stories/components/WobblyEdge/WobblyEdge.stories.tsx index e4408558a0..e32f89f587 100644 --- a/cardigan/stories/components/WobblyEdge/WobblyEdge.stories.tsx +++ b/cardigan/stories/components/WobblyEdge/WobblyEdge.stories.tsx @@ -3,32 +3,72 @@ import { Meta, StoryObj } from '@storybook/react'; import { ReadMeInfo } from '@weco/cardigan/config/decorators'; import { image as contentImage } from '@weco/cardigan/stories/data/images'; import PrismicImage from '@weco/common/views/components/PrismicImage/PrismicImage'; -import { WobblyBottom } from '@weco/common/views/components/WobblyEdge'; +import { WobblyEdge } from '@weco/common/views/components/WobblyEdge'; import Readme from '@weco/common/views/components/WobblyEdge/README.mdx'; -const Template = args => ( - <> -
- -
- - -); +const Template = args => { + const { isRotated } = args; -const meta: Meta = { - title: 'Components/WobblyBottom', - component: WobblyBottom, + return ( + <> +
+ {isRotated && ( +
+ +
+ )} + + {!isRotated && } +
+ + + ); +}; + +const meta: Meta = { + title: 'Components/WobblyEdge/WobblyEdge', + component: WobblyEdge, args: { backgroundColor: 'warmNeutral.300', - children: , + isValley: false, + isRotated: false, + intensity: 50, + points: 5, + isStatic: false, + }, + argTypes: { + backgroundColor: { + options: ['warmNeutral.300', 'white'], + control: { type: 'radio' }, + }, + intensity: { + control: { + type: 'number', + min: 0, + max: 100, + step: 10, + }, + }, }, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Basic: Story = { - name: 'WobblyBottom', + name: 'WobblyEdge', render: Template, }; diff --git a/common/views/components/RecommendedStories/index.tsx b/common/views/components/RecommendedStories/index.tsx index c89801ef6b..062c3eea98 100644 --- a/common/views/components/RecommendedStories/index.tsx +++ b/common/views/components/RecommendedStories/index.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components'; import { font } from '@weco/common/utils/classnames'; import { Container } from '@weco/common/views/components/styled/Container'; import Space from '@weco/common/views/components/styled/Space'; -import { WobblyBottom } from '@weco/common/views/components/WobblyEdge'; +import { WobblyEdge } from '@weco/common/views/components/WobblyEdge'; const RecommendedSection = styled(Space).attrs({ $v: { size: 'l', properties: ['margin-bottom', 'margin-top'] }, @@ -12,21 +12,25 @@ const RecommendedSection = styled(Space).attrs({ background-color: ${props => props.theme.color('white')}; `; +const RecommendedWrapper = styled.div` + h2 { + padding: 16px 24px; + margin: 0; + } + + ${props => props.theme.media('xlarge', 'min-width')` + max-width: 2200px; + margin: 0 auto; + justify-content: center; + `} +`; + const StoryPromoContainer = styled(Container)` - padding: 0 24px ${props => props.theme.containerPadding.small}px; + padding: 0 24px 32px; max-width: none; width: auto; overflow: auto; margin: 0 auto; - margin-bottom: ${props => props.theme.containerPadding.medium}px; - - ${props => - props.theme.media( - 'medium', - 'max-width' - )(` - margin-bottom: ${props.theme.containerPadding.small}px; - `)} &::-webkit-scrollbar { height: 18px; @@ -40,6 +44,10 @@ const StoryPromoContainer = styled(Container)` border-color: ${props => props.theme.color('white')}; } + ${props => props.theme.media('medium', 'max-width')` + padding-bottom: 24px; + `} + -webkit-overflow-scrolling: touch; `; @@ -53,6 +61,11 @@ const StoriesContainer = styled.ul` margin-left: 0; display: flex; flex-wrap: nowrap; + + ${props => props.theme.media('xlarge', 'min-width')` + max-width: 2200px; + margin: 0 auto; + `} `; const StoryLink = styled.a` @@ -75,12 +88,16 @@ const StoryWrapper = styled.li` padding-bottom: 0; } + ${props => props.theme.media('xlarge', 'min-width')` + min-width: 345px; + `} + ${props => props.theme.media('large', 'max-width')` min-width: 40vw; - max-width: 300px; `} ${props => props.theme.media('medium', 'max-width')` + max-width: 300px; min-width: 80vw; `} `; @@ -179,28 +196,33 @@ const RecommendedStories = () => { return ( -

- Popular stories -

- - - - {stories.map(story => { - return ( - - - - {story.title} -

{story.title}

-
-
-
- ); - })} -
-
- - + + + +

Popular stories

+ + + + {stories.map(story => { + return ( + + + + {story.title} +

{story.title}

+
+
+
+ ); + })} +
+
+
); };