Merged in feat/SW-2038-static-map-button (pull request #2715)

feat(SW-2038): refactor and create wrapper for static map and button

* feat(SW-2038): refactor and create wrapper for static map and button

* feature: use button from design-system over creating a new one

* remove unused fragment

* fix(SW-2038): add removed css

* fix(SW-2038): update fake button component

* fix(SW-2038): move FakeButton to design system


Approved-by: Erik Tiekstra
Approved-by: Joakim Jäderberg
This commit is contained in:
Matilda Landström
2025-09-01 08:16:27 +00:00
parent 19063da08a
commit 93a90bef9d
16 changed files with 164 additions and 174 deletions

View File

@@ -0,0 +1,6 @@
.fakeButton {
display: flex;
align-items: center;
border-radius: var(--Corner-radius-rounded);
gap: var(--Space-x05);
}

View File

@@ -0,0 +1,39 @@
'use client'
import { variants } from './variants'
import type { VariantProps } from 'class-variance-authority'
import type { ComponentProps, PropsWithChildren } from 'react'
import type { Button } from 'react-aria-components'
interface FakeButtonProps
extends PropsWithChildren,
Omit<ComponentProps<typeof Button>, 'children' | 'onPress'>,
VariantProps<typeof variants> {}
export function FakeButton({
variant,
color,
size,
typography,
children,
className,
...props
}: FakeButtonProps) {
const classNames = variants({
color,
size,
variant,
typography,
className,
})
return (
<span
className={classNames}
{...(props as React.HTMLProps<HTMLSpanElement>)}
>
{children}
</span>
)
}

View File

@@ -0,0 +1,6 @@
import { cva } from 'class-variance-authority'
import styles from './fakeButton.module.css'
import { withButton } from '../Button'
export const variants = cva(styles.fakeButton, withButton({}))

View File

@@ -70,6 +70,5 @@ export default async function StaticMap({
}
const src = getUrlWithSignature(url, googleMapSecret)
return <img src={src} alt={altText} />
}

View File

@@ -24,6 +24,7 @@
"./DeprecatedSelect": "./lib/components/DeprecatedSelect/index.tsx",
"./Divider": "./lib/components/Divider/index.tsx",
"./FacilityToIcon": "./lib/components/FacilityToIcon/index.tsx",
"./FakeButton": "./lib/components/FakeButton/index.tsx",
"./Footnote": "./lib/components/Footnote/index.tsx",
"./Form/Checkbox": "./lib/components/Form/Checkbox/index.tsx",
"./Form/Country": "./lib/components/Form/Country/index.tsx",