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:
@@ -0,0 +1,6 @@
|
||||
.fakeButton {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: var(--Corner-radius-rounded);
|
||||
gap: var(--Space-x05);
|
||||
}
|
||||
39
packages/design-system/lib/components/FakeButton/index.tsx
Normal file
39
packages/design-system/lib/components/FakeButton/index.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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({}))
|
||||
@@ -70,6 +70,5 @@ export default async function StaticMap({
|
||||
}
|
||||
|
||||
const src = getUrlWithSignature(url, googleMapSecret)
|
||||
|
||||
return <img src={src} alt={altText} />
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user