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,4 +1,4 @@
|
||||
import type { PaymentIconProps } from './IconProps'
|
||||
import type { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const AmericanExpressIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
@@ -16,7 +16,7 @@ export const AmericanExpressIcon = (props: PaymentIconProps) => (
|
||||
/>
|
||||
<mask
|
||||
id="mask0_5382_46857"
|
||||
style={{ maskType: 'luminance' }}
|
||||
style={{ maskType: "luminance" }}
|
||||
maskUnits="userSpaceOnUse"
|
||||
x="16"
|
||||
y="0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PaymentIconProps } from './IconProps'
|
||||
import type { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const ApplePayIcon = (props: PaymentIconProps) => {
|
||||
return (
|
||||
@@ -13,7 +13,7 @@ export const ApplePayIcon = (props: PaymentIconProps) => {
|
||||
<g clipPath="url(#clip0_5382_46859)">
|
||||
<mask
|
||||
id="mask0_5382_46859"
|
||||
style={{ maskType: 'luminance' }}
|
||||
style={{ maskType: "luminance" }}
|
||||
maskUnits="userSpaceOnUse"
|
||||
x="0"
|
||||
y="0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const ChinaUnionPayIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const DanKortIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const DinersClubIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const DiscoverIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const GenericCardIcon = (props: PaymentIconProps) => {
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const GooglePayIcon = (props: PaymentIconProps) => {
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type PaymentIconProps = {
|
||||
className?: string
|
||||
alt?: string
|
||||
role: 'img'
|
||||
role: "img"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const JcbIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const KlarnaIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const MaestroIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const MasterCardIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const MobilePayIcon = (props: PaymentIconProps) => {
|
||||
return (
|
||||
@@ -18,13 +18,13 @@ export const MobilePayIcon = (props: PaymentIconProps) => {
|
||||
fill="#5A78FF"
|
||||
/>
|
||||
<path
|
||||
style={{ mixBlendMode: 'multiply' }}
|
||||
style={{ mixBlendMode: "multiply" }}
|
||||
opacity="0.7"
|
||||
d="M24.1699 5.49788L23.5317 5.76221L25.2864 9.99829L25.9245 9.73396L24.1699 5.49788Z"
|
||||
fill="url(#paint0_linear_5597_450)"
|
||||
/>
|
||||
<path
|
||||
style={{ mixBlendMode: 'multiply' }}
|
||||
style={{ mixBlendMode: "multiply" }}
|
||||
opacity="0.7"
|
||||
d="M27.3755 15.0441L28.0137 14.7798L26.0275 9.9847L25.3893 10.249L27.3755 15.0441Z"
|
||||
fill="url(#paint1_linear_5597_450)"
|
||||
@@ -33,7 +33,7 @@ export const MobilePayIcon = (props: PaymentIconProps) => {
|
||||
d="M26.5698 11.8656C25.2424 12.416 24.134 13.1748 23.4082 14.0894L21.5371 9.57038C22.3906 8.57877 23.477 7.81462 24.6987 7.34652C26.0262 6.79607 27.3673 6.52964 28.5068 6.68487L30.3784 11.2037C29.0736 11.1054 27.7649 11.3329 26.5698 11.8656Z"
|
||||
fill="#5A78FF"
|
||||
/>
|
||||
<g style={{ mixBlendMode: 'multiply' }} opacity="0.4">
|
||||
<g style={{ mixBlendMode: "multiply" }} opacity="0.4">
|
||||
<path
|
||||
opacity="0.9"
|
||||
d="M26.5694 11.8656C25.2419 12.416 24.1335 13.1748 23.4077 14.0894L21.5366 9.57038C22.3901 8.57877 23.4765 7.81462 24.6982 7.34652C26.0257 6.79607 27.3669 6.52964 28.5063 6.68487L30.3779 11.2037C29.0731 11.1054 27.7644 11.3329 26.5694 11.8656Z"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const PayPalIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const SwishIcon = (props: PaymentIconProps) => {
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const VippsIcon = (props: PaymentIconProps) => {
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PaymentIconProps } from './IconProps'
|
||||
import { PaymentIconProps } from "./IconProps"
|
||||
|
||||
export const VisaIcon = (props: PaymentIconProps) => (
|
||||
<svg
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { PaymentMethodIcon } from './PaymentMethodIcon'
|
||||
import { PaymentMethodEnum } from '@scandic-hotels/common/constants/paymentMethod'
|
||||
import { Typography } from '../Typography'
|
||||
import { expect } from 'storybook/test'
|
||||
import { PaymentMethodIcon } from "./PaymentMethodIcon"
|
||||
import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
import { Typography } from "../Typography"
|
||||
import { expect } from "storybook/test"
|
||||
|
||||
const methods = Object.values(PaymentMethodEnum).toSorted()
|
||||
|
||||
const meta: Meta<typeof PaymentMethodIcon> = {
|
||||
title: 'Product Components/Payment/PaymentMethodIcon',
|
||||
title: "Product Components/Payment/PaymentMethodIcon",
|
||||
component: PaymentMethodIcon,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
layout: "centered",
|
||||
},
|
||||
argTypes: {
|
||||
paymentMethod: {
|
||||
control: { type: 'select' },
|
||||
control: { type: "select" },
|
||||
options: methods,
|
||||
description: 'Payment method to display',
|
||||
description: "Payment method to display",
|
||||
},
|
||||
alt: {
|
||||
control: { type: 'text' },
|
||||
description: 'Alt text for the icon',
|
||||
control: { type: "text" },
|
||||
description: "Alt text for the icon",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -32,25 +32,25 @@ type Story = StoryObj<typeof PaymentMethodIcon>
|
||||
export const Playground: Story = {
|
||||
args: {
|
||||
paymentMethod: PaymentMethodEnum.visa,
|
||||
alt: 'Visa payment method',
|
||||
alt: "Visa payment method",
|
||||
},
|
||||
play: async ({ canvas, args }) => {
|
||||
const img = await canvas.findByRole('img')
|
||||
const img = await canvas.findByRole("img")
|
||||
|
||||
expect(img).toBeInTheDocument()
|
||||
expect(img).toHaveAttribute('alt', args.alt)
|
||||
expect(img).toHaveAttribute("alt", args.alt)
|
||||
},
|
||||
}
|
||||
|
||||
export const All: Story = {
|
||||
parameters: {
|
||||
layout: 'padded',
|
||||
layout: "padded",
|
||||
},
|
||||
render: (args) => (
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'repeat(auto-fill, minmax(80px, 1fr))',
|
||||
display: "grid",
|
||||
gridTemplateColumns: "repeat(auto-fill, minmax(80px, 1fr))",
|
||||
gap: 16,
|
||||
}}
|
||||
>
|
||||
@@ -58,10 +58,10 @@ export const All: Story = {
|
||||
<div
|
||||
key={m}
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 12,
|
||||
padding: 8,
|
||||
borderRadius: 8,
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { PaymentMethodEnum } from '@scandic-hotels/common/constants/paymentMethod'
|
||||
import { GenericCardIcon } from './Icons/GenericCardIcon'
|
||||
import { SwishIcon } from './Icons/SwishIcon'
|
||||
import { VippsIcon } from './Icons/VippsIcon'
|
||||
import { MobilePayIcon } from './Icons/MobilePayIcon'
|
||||
import { ApplePayIcon } from './Icons/ApplePayIcon'
|
||||
import { GooglePayIcon } from './Icons/GooglePayIcon'
|
||||
import { PayPalIcon } from './Icons/PayPalIcon'
|
||||
import { KlarnaIcon } from './Icons/KlarnaIcon'
|
||||
import { AmericanExpressIcon } from './Icons/AmericanExpressIcon'
|
||||
import { DanKortIcon } from './Icons/DanKortIcon'
|
||||
import { DinersClubIcon } from './Icons/DinersClubIcon'
|
||||
import { JcbIcon } from './Icons/JcbIcon'
|
||||
import { MasterCardIcon } from './Icons/MasterCardIcon'
|
||||
import { VisaIcon } from './Icons/VisaIcon'
|
||||
import { MaestroIcon } from './Icons/MaestroIcon'
|
||||
import { ChinaUnionPayIcon } from './Icons/ChinaUnionPayIcon'
|
||||
import { DiscoverIcon } from './Icons/DiscoverIcon'
|
||||
import { PaymentIconProps } from './Icons/IconProps'
|
||||
import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
import { GenericCardIcon } from "./Icons/GenericCardIcon"
|
||||
import { SwishIcon } from "./Icons/SwishIcon"
|
||||
import { VippsIcon } from "./Icons/VippsIcon"
|
||||
import { MobilePayIcon } from "./Icons/MobilePayIcon"
|
||||
import { ApplePayIcon } from "./Icons/ApplePayIcon"
|
||||
import { GooglePayIcon } from "./Icons/GooglePayIcon"
|
||||
import { PayPalIcon } from "./Icons/PayPalIcon"
|
||||
import { KlarnaIcon } from "./Icons/KlarnaIcon"
|
||||
import { AmericanExpressIcon } from "./Icons/AmericanExpressIcon"
|
||||
import { DanKortIcon } from "./Icons/DanKortIcon"
|
||||
import { DinersClubIcon } from "./Icons/DinersClubIcon"
|
||||
import { JcbIcon } from "./Icons/JcbIcon"
|
||||
import { MasterCardIcon } from "./Icons/MasterCardIcon"
|
||||
import { VisaIcon } from "./Icons/VisaIcon"
|
||||
import { MaestroIcon } from "./Icons/MaestroIcon"
|
||||
import { ChinaUnionPayIcon } from "./Icons/ChinaUnionPayIcon"
|
||||
import { DiscoverIcon } from "./Icons/DiscoverIcon"
|
||||
import { PaymentIconProps } from "./Icons/IconProps"
|
||||
|
||||
const paymentMethods: Partial<
|
||||
Record<
|
||||
|
||||
Reference in New Issue
Block a user