Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(components-react): add visual baseline section #346

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
import tokens from '@lux-design-system/design-tokens/dist/index.json';
import type { Meta, StoryObj } from '@storybook/react';
import { type HTMLAttributes, type PropsWithChildren } from 'react';
import { VisualStates } from './visual/States';
import { createVisualRegressionStory, VisualRegressionWrapper } from '../../utils';

const LuxSection = (props: PropsWithChildren<LuxSectionProps> & HTMLAttributes<HTMLDivElement>) => (
<Section {...props} />
Expand All @@ -18,7 +20,6 @@ const meta = {
title: 'React Components/Section',
id: 'react-components-section',
component: LuxSection,
subcomponents: {},
parameters: {
tokens,
tokensPrefix: 'react-section',
Expand Down Expand Up @@ -76,3 +77,16 @@ export const Playground: Story = {
},
tags: ['!autodocs'],
};

export const Visual = createVisualRegressionStory(() => (
<>
<h4 className="utrecht-heading-3">Light</h4>
<VisualRegressionWrapper className="lux-theme--logius-light">
<VisualStates />
</VisualRegressionWrapper>
<h4 className="utrecht-heading-3">Dark</h4>
<VisualRegressionWrapper className="lux-theme--logius-dark">
<VisualStates />
</VisualRegressionWrapper>
</>
));
21 changes: 21 additions & 0 deletions packages/storybook/src/react-components/section/visual/States.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { LuxHeading, LuxParagraph, LuxSection } from '@lux-design-system/components-react';

export const VisualStates = () => (
<LuxSection>
<LuxHeading level={5} appearance={3}>
Section Heading
</LuxHeading>
<LuxParagraph appearance="lead">
Lead Lorem ipsum dolor sit amet consectetur adipisicing elit. Deserunt ab, sint quas voluptate iste optio possimus
deleniti repellendus? Molestiae nemo nihil voluptatum dignissimos ut consequatur optio ducimus facilis nulla
alias?
</LuxParagraph>
<LuxParagraph>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Tempore tenetur autem blanditiis quas reprehenderit
velit labore necessitatibus cumque accusamus, corporis perspiciatis. Minima optio omnis excepturi dolor sint
voluptatibus aut expedita! Aperiam tempore, sapiente sequi expedita commodi praesentium ut, qui eius non at quae
fuga accusantium! Dolorem dicta provident, ratione facilis corporis vero nesciunt cumque, assumenda velit quia,
quod culpa quidem.
</LuxParagraph>
</LuxSection>
);
Loading