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!: New Component: IconList #1691

Merged
merged 27 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
de855d8
Fix typo in Icon name
brandonlenz Oct 12, 2021
c15a539
First pass of IconList
brandonlenz Oct 13, 2021
e7543ed
Export components from Index.ts
brandonlenz Oct 13, 2021
0f77b10
feat!: Use "dot" syntax for Icons to avoid name collision
brandonlenz Oct 25, 2021
6a3f3ab
Update IconList stories to use new syntax
brandonlenz Oct 25, 2021
6330b71
Extract components instead of encapsulating
brandonlenz Oct 26, 2021
36727e1
Add tests
brandonlenz Oct 26, 2021
54b7360
Remove todos
brandonlenz Oct 26, 2021
0993c92
Fix imports
brandonlenz Oct 26, 2021
b017d1b
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Oct 26, 2021
99c6aff
Unify naming convention to match uswds classes
brandonlenz Oct 27, 2021
1d68b14
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Oct 29, 2021
c53a6ea
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Nov 5, 2021
a6dff58
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Nov 9, 2021
6c3661e
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Nov 12, 2021
2893554
Just export IconList now that name conflict is resolved
brandonlenz Nov 12, 2021
9c8e432
Merge branch 'bl-new-component-icon-list-1234' of github.com:trusswor…
brandonlenz Nov 12, 2021
09a5401
Merge branch 'main' into bl-new-component-icon-list-1234
haworku Nov 18, 2021
290c921
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Nov 22, 2021
9bc9119
Update Input Prefix and Suffix Icon stories to use new Icon
brandonlenz Nov 22, 2021
b70261a
Merge branch 'main' into bl-new-component-icon-list-1234
haworku Dec 2, 2021
222438c
Merge branch 'main' into bl-new-component-icon-list-1234
haworku Dec 11, 2021
fbd90e6
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Dec 29, 2021
5f06139
Merge branch 'main' into bl-new-component-icon-list-1234
haworku Jan 4, 2022
7878b2f
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Apr 14, 2022
0010755
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Apr 19, 2022
e697c53
Merge branch 'main' into bl-new-component-icon-list-1234
brandonlenz Apr 20, 2022
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
717 changes: 239 additions & 478 deletions example/src/pages/Icons.tsx

Large diffs are not rendered by default.

938 changes: 460 additions & 478 deletions src/components/Icon/Icon.stories.tsx

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/components/Icon/Icon.test.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import React from 'react'
import { render, screen } from '@testing-library/react'

import { IconAccessibilityNew } from './Icons'
import { Icon } from './Icons'

describe('Icon component', () => {
it('renders without errors', () => {
render(<IconAccessibilityNew />)
render(<Icon.AccessibilityNew />)

expect(screen.getByRole('img')).toBeInTheDocument()
})

it('accepts a size prop', () => {
render(<IconAccessibilityNew size={7} />)
render(<Icon.AccessibilityNew size={7} />)

expect(screen.getByRole('img')).toHaveClass('usa-icon--size-7')
})

it('accepts a className', () => {
render(<IconAccessibilityNew className="custom-class" />)
render(<Icon.AccessibilityNew className="custom-class" />)

expect(screen.getByRole('img')).toHaveClass('custom-class')
})

it('accepts an aria-label', () => {
render(<IconAccessibilityNew aria-label="build icon component" />)
render(<Icon.AccessibilityNew aria-label="build icon component" />)

expect(screen.getByRole('img')).toHaveAttribute(
'aria-label',
Expand Down
Loading