Skip to content

Commit

Permalink
fix: Icon refactor pre-patches (#2030)
Browse files Browse the repository at this point in the history
Patches minor issues found during icon refactor

* Rationalize icon position a bi
* Snapshot updates (#2031)
* Mitigate dependency on icon display="inline-flex"
* Remove unneeded flex params on Icon
  • Loading branch information
Luke Bowerman authored Mar 12, 2021
1 parent 8e45200 commit 776216b
Show file tree
Hide file tree
Showing 43 changed files with 25 additions and 82 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/DataTable/Basic-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/DataTable/Filters-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/DataTable/Primary Action-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/DataTable/Select-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/FieldDateRange/Basic-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/FieldDateRange/Disabled-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/FieldDateRange/Error-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/Icon/Basic-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/Icon/Large-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/Icon/Small-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/InputDateRange/Basic-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/InputDateRange/Disabled-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/InputDateRange/Mobile UI-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/InputDateRange/Read Only-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/components/snapshots/Status/Critical-snap.png
Binary file modified packages/components/snapshots/Status/Inform-snap.png
Binary file modified packages/components/snapshots/Status/Large-snap.png
Binary file modified packages/components/snapshots/Status/Neutral-snap.png
Binary file modified packages/components/snapshots/Status/Positive-snap.png
Binary file modified packages/components/snapshots/Status/Small-snap.png
Binary file modified packages/components/snapshots/Status/Warn-snap.png
Diff not rendered.
Binary file modified packages/components/snapshots/Status/X Small-snap.png
Binary file modified packages/components/snapshots/Status/XX Small-snap.png
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ const InputTextGroupWrapper = styled.div<InputTextGroupWrapperProps>`
${inputCSS}
align-items: center;
display: grid;
font-family: ${({ theme }) => theme.fonts.body};
grid-gap: ${({ theme }) => theme.space.xsmall};
grid-template-columns: auto auto auto 1fr;
padding: 0 ${({ theme: { space } }) => space.small};
Expand Down
4 changes: 1 addition & 3 deletions packages/components/src/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,12 @@ const IconLayout = forwardRef(
IconLayout.displayName = 'IconLayout'

export const Icon = styled(IconLayout).attrs<IconProps>(
({ display = 'inline-flex', size = 'medium' }) => ({
display,
({ size = 'medium' }) => ({
size,
})
)<IconProps>`
${sizeSimpleLayoutCSS}
${color}
align-items: center;
flex-shrink: 0;
svg {
Expand Down
32 changes: 0 additions & 32 deletions packages/components/src/Icon/__snapshots__/Icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ exports[`Icon Default 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1.5rem;
height: 1.5rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -48,14 +40,6 @@ exports[`Icon Explicit size - integer as pixels 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 12px;
height: 12px;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -91,14 +75,6 @@ exports[`Icon Explicit size - string 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1rem;
height: 1rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -134,14 +110,6 @@ exports[`Icon Styled system size 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 2rem;
height: 2rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Layout/Box/Box.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const responsiveArgs: BoxStoryProps = {
borderRadius: 'medium',
children: (
<>
<Icon name="LogoRings" size="medium" /> Looker
<Icon display="inline-flex" name="LogoRings" size="medium" /> Looker
</>
),
color: 'key',
Expand Down
22 changes: 22 additions & 0 deletions packages/components/src/List/ListItem.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ Icon.args = {
icon: 'User',
}

export const IconColor = Template.bind({})
IconColor.args = {
...Basic.args,
color: 'warn',
icon: 'User',
}

export const IconCustomColor = Template.bind({})
IconCustomColor.args = {
...Basic.args,
color: '#cc00cc',
icon: 'User',
}

export const IconColorDisabled = Template.bind({})
IconColorDisabled.args = {
...Basic.args,
color: 'warn',
disabled: true,
icon: 'User',
}

export const Detail = Template.bind({})
Detail.args = {
...Basic.args,
Expand Down
6 changes: 0 additions & 6 deletions packages/components/src/Status/Status.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ Large.args = {
size: 'large',
}

export const XLarge = Template.bind({})
XLarge.args = {
...Inform.args,
size: 'xlarge',
}

export default {
component: Status,
title: 'Status',
Expand Down
40 changes: 0 additions & 40 deletions packages/components/src/Status/__snapshots__/Status.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ exports[`critical Status 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1.5rem;
height: 1.5rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
color: #CC1F36;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -58,15 +50,7 @@ exports[`inform Status 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1.5rem;
height: 1.5rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
color: #0087e1;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -111,15 +95,7 @@ exports[`neutral status 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1.5rem;
height: 1.5rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
color: #71767a;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -161,15 +137,7 @@ exports[`positive Status 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1.5rem;
height: 1.5rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
color: #24b25f;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down Expand Up @@ -214,15 +182,7 @@ exports[`warn Status 1`] = `
font-family: Roboto,'Noto Sans','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI',Helvetica,Arial,sans-serif;
width: 1.5rem;
height: 1.5rem;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
color: #FFA800;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
Expand Down

0 comments on commit 776216b

Please sign in to comment.