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,10 +1,10 @@
|
||||
import { MaterialIcon } from '../../Icons/MaterialIcon'
|
||||
import { OldDSButton as Button } from '../../OldDSButton'
|
||||
import Subtitle from '../../Subtitle'
|
||||
import { MaterialIcon } from "../../Icons/MaterialIcon"
|
||||
import { OldDSButton as Button } from "../../OldDSButton"
|
||||
import Subtitle from "../../Subtitle"
|
||||
|
||||
import styles from './modalContent.module.css'
|
||||
import styles from "./modalContent.module.css"
|
||||
|
||||
import type { ReactNode } from 'react'
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
interface ModalContentProps {
|
||||
title?: string
|
||||
@@ -12,14 +12,14 @@ interface ModalContentProps {
|
||||
primaryAction: {
|
||||
label: string
|
||||
onClick: () => void
|
||||
intent?: 'primary' | 'secondary' | 'text'
|
||||
intent?: "primary" | "secondary" | "text"
|
||||
isLoading?: boolean
|
||||
disabled?: boolean
|
||||
} | null
|
||||
secondaryAction: {
|
||||
label: string
|
||||
onClick: () => void
|
||||
intent?: 'primary' | 'secondary' | 'text'
|
||||
intent?: "primary" | "secondary" | "text"
|
||||
} | null
|
||||
onClose?: () => void
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export function ModalContentWithActions({
|
||||
{secondaryAction && (
|
||||
<Button
|
||||
theme="base"
|
||||
intent={secondaryAction.intent ?? 'text'}
|
||||
intent={secondaryAction.intent ?? "text"}
|
||||
color="burgundy"
|
||||
onClick={secondaryAction.onClick}
|
||||
>
|
||||
@@ -56,7 +56,7 @@ export function ModalContentWithActions({
|
||||
{primaryAction && (
|
||||
<Button
|
||||
theme="base"
|
||||
intent={primaryAction.intent ?? 'secondary'}
|
||||
intent={primaryAction.intent ?? "secondary"}
|
||||
onClick={primaryAction.onClick}
|
||||
disabled={primaryAction.isLoading || primaryAction.disabled}
|
||||
>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { cx } from 'class-variance-authority'
|
||||
import { AnimatePresence, motion } from 'motion/react'
|
||||
import { type PropsWithChildren, useEffect, useState } from 'react'
|
||||
import { cx } from "class-variance-authority"
|
||||
import { AnimatePresence, motion } from "motion/react"
|
||||
import { type PropsWithChildren, useEffect, useState } from "react"
|
||||
import {
|
||||
Modal as AriaModal,
|
||||
Dialog,
|
||||
DialogTrigger,
|
||||
ModalOverlay,
|
||||
} from 'react-aria-components'
|
||||
import { useIntl } from 'react-intl'
|
||||
} from "react-aria-components"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import {
|
||||
type AnimationState,
|
||||
AnimationStateEnum,
|
||||
type InnerModalProps,
|
||||
type ModalProps,
|
||||
} from './modal'
|
||||
import { fade, slideInOut } from './motionVariants'
|
||||
import { modalContentVariants } from './variants'
|
||||
} from "./modal"
|
||||
import { fade, slideInOut } from "./motionVariants"
|
||||
import { modalContentVariants } from "./variants"
|
||||
|
||||
import { IconButton } from '../IconButton'
|
||||
import { Typography } from '../Typography'
|
||||
import styles from './modal.module.css'
|
||||
import { IconButton } from "../IconButton"
|
||||
import { Typography } from "../Typography"
|
||||
import styles from "./modal.module.css"
|
||||
|
||||
const MotionOverlay = motion.create(ModalOverlay)
|
||||
const MotionModal = motion.create(AriaModal)
|
||||
@@ -89,8 +89,8 @@ function InnerModal({
|
||||
<Dialog
|
||||
className={styles.dialog}
|
||||
aria-label={intl.formatMessage({
|
||||
id: 'modal.dialog',
|
||||
defaultMessage: 'Dialog',
|
||||
id: "modal.dialog",
|
||||
defaultMessage: "Dialog",
|
||||
})}
|
||||
>
|
||||
{({ close }) => (
|
||||
@@ -119,8 +119,8 @@ function InnerModal({
|
||||
className={styles.close}
|
||||
type="button"
|
||||
aria-label={intl.formatMessage({
|
||||
id: 'common.close',
|
||||
defaultMessage: 'Close',
|
||||
id: "common.close",
|
||||
defaultMessage: "Close",
|
||||
})}
|
||||
variant="Muted"
|
||||
emphasis
|
||||
@@ -149,15 +149,15 @@ export default function Modal({
|
||||
children,
|
||||
withActions = false,
|
||||
hideHeader = false,
|
||||
className = '',
|
||||
contentClassName = '',
|
||||
className = "",
|
||||
contentClassName = "",
|
||||
}: PropsWithChildren<ModalProps>) {
|
||||
const [animation, setAnimation] = useState<AnimationState>(
|
||||
AnimationStateEnum.visible
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof isOpen === 'boolean') {
|
||||
if (typeof isOpen === "boolean") {
|
||||
setAnimation(
|
||||
isOpen ? AnimationStateEnum.visible : AnimationStateEnum.hidden
|
||||
)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Dispatch, JSX, SetStateAction } from 'react'
|
||||
import type { Dispatch, JSX, SetStateAction } from "react"
|
||||
|
||||
export enum AnimationStateEnum {
|
||||
unmounted = 'unmounted',
|
||||
hidden = 'hidden',
|
||||
visible = 'visible',
|
||||
unmounted = "unmounted",
|
||||
hidden = "hidden",
|
||||
visible = "visible",
|
||||
}
|
||||
|
||||
export type AnimationState = keyof typeof AnimationStateEnum
|
||||
@@ -31,7 +31,7 @@ export type ModalProps = {
|
||||
}
|
||||
)
|
||||
|
||||
export type InnerModalProps = Omit<ModalProps, 'trigger'> & {
|
||||
export type InnerModalProps = Omit<ModalProps, "trigger"> & {
|
||||
animation: AnimationState
|
||||
setAnimation: Dispatch<SetStateAction<AnimationState>>
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export const fade = {
|
||||
hidden: {
|
||||
opacity: 0,
|
||||
transition: { duration: 0.4, ease: 'easeInOut' as const },
|
||||
transition: { duration: 0.4, ease: "easeInOut" as const },
|
||||
},
|
||||
visible: {
|
||||
opacity: 1,
|
||||
transition: { duration: 0.4, ease: 'easeInOut' as const },
|
||||
transition: { duration: 0.4, ease: "easeInOut" as const },
|
||||
},
|
||||
} as const
|
||||
|
||||
@@ -13,11 +13,11 @@ export const slideInOut = {
|
||||
hidden: {
|
||||
opacity: 0,
|
||||
y: 32,
|
||||
transition: { duration: 0.4, ease: 'easeInOut' as const },
|
||||
transition: { duration: 0.4, ease: "easeInOut" as const },
|
||||
},
|
||||
visible: {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
transition: { duration: 0.4, ease: 'easeInOut' as const },
|
||||
transition: { duration: 0.4, ease: "easeInOut" as const },
|
||||
},
|
||||
} as const
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from './modal.module.css'
|
||||
import styles from "./modal.module.css"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
|
||||
Reference in New Issue
Block a user