Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import { expect } from 'storybook/test'
|
||||
import { InfoBox, Props } from './InfoBox'
|
||||
import { IconName } from '../Icons/iconName'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
import { expect } from "storybook/test"
|
||||
import { InfoBox, Props } from "./InfoBox"
|
||||
import { IconName } from "../Icons/iconName"
|
||||
|
||||
const meta: Meta<typeof InfoBox> = {
|
||||
title: 'Core Components/InfoBox',
|
||||
title: "Core Components/InfoBox",
|
||||
component: InfoBox,
|
||||
parameters: {
|
||||
layout: 'padded',
|
||||
layout: "padded",
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
tags: ["autodocs"],
|
||||
}
|
||||
|
||||
export default meta
|
||||
@@ -17,27 +17,27 @@ type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
theme: 'Default',
|
||||
theme: "Default",
|
||||
icon: IconName.Accessibility,
|
||||
heading: 'Heading',
|
||||
text: 'This is an informational message',
|
||||
heading: "Heading",
|
||||
text: "This is an informational message",
|
||||
},
|
||||
argTypes: {
|
||||
icon: {
|
||||
control: { type: 'select' },
|
||||
control: { type: "select" },
|
||||
options: Object.values(IconName),
|
||||
},
|
||||
theme: {
|
||||
control: { type: 'select' },
|
||||
options: ['Default', 'SAS-Blue'] satisfies Props['theme'][],
|
||||
control: { type: "select" },
|
||||
options: ["Default", "SAS-Blue"] satisfies Props["theme"][],
|
||||
},
|
||||
},
|
||||
|
||||
play: async ({ canvas, args }) => {
|
||||
const article = await canvas.findByRole('article')
|
||||
const article = await canvas.findByRole("article")
|
||||
await expect(article).toBeVisible()
|
||||
|
||||
const heading = await canvas.findByRole('heading', { name: args.heading })
|
||||
const heading = await canvas.findByRole("heading", { name: args.heading })
|
||||
await expect(heading).toBeVisible()
|
||||
|
||||
const paragraph = await canvas.findByText(args.text)
|
||||
@@ -47,7 +47,7 @@ export const Default: Story = {
|
||||
|
||||
export const WithoutIcon: Story = {
|
||||
args: {
|
||||
heading: 'Heading',
|
||||
text: 'This is an informational message',
|
||||
heading: "Heading",
|
||||
text: "This is an informational message",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { IconByIconName } from '../Icons/IconByIconName'
|
||||
import { IconName } from '../Icons/iconName'
|
||||
import { Typography } from '../Typography'
|
||||
import styles from './InfoBox.module.css'
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import { cva } from "class-variance-authority"
|
||||
import { IconByIconName } from "../Icons/IconByIconName"
|
||||
import { IconName } from "../Icons/iconName"
|
||||
import { Typography } from "../Typography"
|
||||
import styles from "./InfoBox.module.css"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
const infoBoxVariants = cva(styles.infoBox, {
|
||||
variants: {
|
||||
theme: {
|
||||
'SAS-Blue': styles.sasBlue,
|
||||
"SAS-Blue": styles.sasBlue,
|
||||
Default: styles.default,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
theme: 'Default',
|
||||
theme: "Default",
|
||||
},
|
||||
})
|
||||
|
||||
const iconVariants = cva(styles.iconContainer, {
|
||||
variants: {
|
||||
theme: {
|
||||
'SAS-Blue': styles.sasBlue,
|
||||
"SAS-Blue": styles.sasBlue,
|
||||
Default: styles.default,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
theme: 'Default',
|
||||
theme: "Default",
|
||||
},
|
||||
})
|
||||
|
||||
export type Props = {
|
||||
heading: string
|
||||
text: string
|
||||
theme?: VariantProps<typeof infoBoxVariants>['theme']
|
||||
theme?: VariantProps<typeof infoBoxVariants>["theme"]
|
||||
icon?: IconName
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user