Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Iconset update #1656

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react/src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

import { AlertIcon, CheckmarkIcon, InfoIcon } from '@amsterdam/design-system-react-icons'
import { CheckmarkIcon, InfoIcon, WarningIcon } from '@amsterdam/design-system-react-icons'
import clsx from 'clsx'
import { forwardRef } from 'react'
import type { ForwardedRef, HTMLAttributes, PropsWithChildren } from 'react'
Expand Down Expand Up @@ -31,10 +31,10 @@ export type AlertProps = {
} & PropsWithChildren<HTMLAttributes<HTMLDivElement>>

const iconSvgBySeverity = {
error: AlertIcon,
error: WarningIcon,
info: InfoIcon,
success: CheckmarkIcon,
warning: AlertIcon,
warning: WarningIcon,
}

export const Alert = forwardRef(
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

import { PersonalLoginIcon } from '@amsterdam/design-system-react-icons'
import { UserIcon } from '@amsterdam/design-system-react-icons'
import clsx from 'clsx'
import { forwardRef } from 'react'
import type { ForwardedRef, HTMLAttributes } from 'react'
Expand Down Expand Up @@ -43,7 +43,7 @@ const AvatarContent = ({ imageSrc, initials }: AvatarContentProps) => {
return <span aria-hidden={true}>{initials}</span>
}

return <Icon svg={PersonalLoginIcon} size="level-6" />
return <Icon svg={UserIcon} size="level-6" />
}

export type AvatarProps = {
Expand Down
22 changes: 11 additions & 11 deletions packages/react/src/Icon/Icon.test.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import { AlertIcon } from '@amsterdam/design-system-react-icons'
import { WarningIcon } from '@amsterdam/design-system-react-icons'
import { render } from '@testing-library/react'
import { createRef } from 'react'
import { Icon } from './Icon'
import '@testing-library/jest-dom'

describe('Icon', () => {
it('renders a span element', () => {
const { container } = render(<Icon svg={AlertIcon} />)
const { container } = render(<Icon svg={WarningIcon} />)

const icon = container.querySelector('span:only-child')

expect(icon).toBeInTheDocument()
})

it('renders a design system BEM class name', () => {
const { container } = render(<Icon svg={AlertIcon} />)
const { container } = render(<Icon svg={WarningIcon} />)

const icon = container.querySelector(':only-child')

expect(icon).toHaveClass('ams-icon')
})

it('renders an svg child', () => {
const { container } = render(<Icon svg={AlertIcon} />)
const { container } = render(<Icon svg={WarningIcon} />)

const svg = container.querySelector(':only-child svg')

expect(svg).toBeInTheDocument()
})

it('renders the right size classes', () => {
const { container: level3 } = render(<Icon svg={AlertIcon} size="level-3" />)
const { container: level4 } = render(<Icon svg={AlertIcon} size="level-4" />)
const { container: level5 } = render(<Icon svg={AlertIcon} size="level-5" />)
const { container: level6 } = render(<Icon svg={AlertIcon} size="level-6" />)
const { container: level3 } = render(<Icon svg={WarningIcon} size="level-3" />)
const { container: level4 } = render(<Icon svg={WarningIcon} size="level-4" />)
const { container: level5 } = render(<Icon svg={WarningIcon} size="level-5" />)
const { container: level6 } = render(<Icon svg={WarningIcon} size="level-6" />)

expect(level3.firstChild).toHaveClass('ams-icon--size-3')
expect(level4.firstChild).toHaveClass('ams-icon--size-4')
Expand All @@ -42,15 +42,15 @@ describe('Icon', () => {
})

it('renders the right square class', () => {
const { container } = render(<Icon svg={AlertIcon} square />)
const { container } = render(<Icon svg={WarningIcon} square />)

const icon = container.querySelector('span:only-child')

expect(icon).toHaveClass('ams-icon--square')
})

it('renders an additional class name', () => {
const { container } = render(<Icon svg={AlertIcon} className="large" />)
const { container } = render(<Icon svg={WarningIcon} className="large" />)

const icon = container.querySelector(':only-child')

Expand All @@ -61,7 +61,7 @@ describe('Icon', () => {
it('supports ForwardRef in React', () => {
const ref = createRef<HTMLSpanElement>()

const { container } = render(<Icon svg={AlertIcon} ref={ref} />)
const { container } = render(<Icon svg={WarningIcon} ref={ref} />)

const icon = container.querySelector(':only-child')

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/Radio/Radio.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FavouriteIcon } from '@amsterdam/design-system-react-icons'
import { HeartIcon } from '@amsterdam/design-system-react-icons'
import { render, screen } from '@testing-library/react'
import { createRef } from 'react'
import { Radio } from './Radio'
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('Radio', () => {
})

it('shows a custom icon', () => {
const { container } = render(<Radio icon={<FavouriteIcon className="test-class" />} />)
const { container } = render(<Radio icon={<HeartIcon className="test-class" />} />)

const icon = container.querySelector('svg')

Expand Down
1 change: 1 addition & 0 deletions proprietary/assets/icons/Account.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions proprietary/assets/icons/AccountOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion proprietary/assets/icons/Alert.svg

This file was deleted.

2 changes: 1 addition & 1 deletion proprietary/assets/icons/Announcement.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion proprietary/assets/icons/Api.svg

This file was deleted.

1 change: 0 additions & 1 deletion proprietary/assets/icons/Ball.svg

This file was deleted.

1 change: 0 additions & 1 deletion proprietary/assets/icons/Bell.svg

This file was deleted.

1 change: 1 addition & 0 deletions proprietary/assets/icons/Bike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion proprietary/assets/icons/Broom.svg

This file was deleted.

2 changes: 1 addition & 1 deletion proprietary/assets/icons/Building.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions proprietary/assets/icons/BuildingOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion proprietary/assets/icons/Buildings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions proprietary/assets/icons/BuildingsOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion proprietary/assets/icons/Calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions proprietary/assets/icons/CalendarOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion proprietary/assets/icons/Camera.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions proprietary/assets/icons/CameraOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion proprietary/assets/icons/Car.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions proprietary/assets/icons/CarOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion proprietary/assets/icons/Card.svg

This file was deleted.

1 change: 0 additions & 1 deletion proprietary/assets/icons/ChargingPoint.svg

This file was deleted.

1 change: 1 addition & 0 deletions proprietary/assets/icons/Chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion proprietary/assets/icons/ChatBubble.svg

This file was deleted.

1 change: 1 addition & 0 deletions proprietary/assets/icons/ChatOutline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading