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

Change disabled color from muted to custom primer disabled color #1512

Merged
merged 7 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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 src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ export interface ItemProps extends SxProp {
const getItemVariant = (variant = 'default', disabled?: boolean) => {
if (disabled) {
return {
color: get('colors.fg.muted'),
iconColor: get('colors.fg.muted'),
annotationColor: get('colors.fg.muted'),
color: get('colors.primer.fg.disabled'),
iconColor: get('colors.primer.fg.disabled'),
annotationColor: get('colors.primer.fg.disabled'),
hoverCursor: 'default'
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Button = styled(ButtonBase)<ButtonBaseProps & ButtonSystemProps & SxProp>`
}

&:disabled {
color: ${get('colors.fg.muted')};
color: ${get('colors.primer.fg.disabled')};
background-color: ${get('colors.btn.bg')};
border-color: ${get('colors.btn.border')};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Button/ButtonTableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ButtonTableList = styled.summary<StyledButtonTableListProps>`
&:disabled {
&,
&:hover {
color: rgba(${get('colors.fg.muted')}, 0.5);
color: ${get('colors.primer.fg.disabled')};
cursor: default;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Page = styled.a`

&[aria-disabled],
&[aria-disabled]:hover {
color: ${get('colors.fg.muted')}; // check
color: ${get('colors.primer.fg.disabled')}; // check
cursor: default;
border-color: transparent;
}
Expand Down
2 changes: 1 addition & 1 deletion src/_TextInputWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const TextInputWrapper = styled.span<StyledWrapperProps>`
${props =>
props.disabled &&
css`
color: ${get('colors.fg.muted')};
color: ${get('colors.primer.fg.disabled')};
background-color: ${get('colors.input.disabledBg')};
border-color: ${get('colors.border.default')};
`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`Pagination renders consistently 1`] = `

.c2[aria-disabled],
.c2[aria-disabled]:hover {
color: #57606a;
color: #8c959f;
cursor: default;
border-color: transparent;
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/ActionMenu.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`ActionMenu renders consistently 1`] = `
}

.c0:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/__snapshots__/AnchoredOverlay.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`AnchoredOverlay renders consistently 1`] = `
}

.c1:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down Expand Up @@ -163,7 +163,7 @@ Object {
}

.c1:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down Expand Up @@ -243,7 +243,7 @@ Object {
<button
aria-haspopup="true"
aria-labelledby="react-aria-1"
class="ButtonBase-sc-181ps9o-0 Button-xjtz72-0 jPURef"
class="ButtonBase-sc-181ps9o-0 Button-xjtz72-0 iRqJHc"
id="react-aria-1"
tabindex="0"
>
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/__snapshots__/Button.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`Button renders consistently 1`] = `
}

.c0:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down Expand Up @@ -134,7 +134,7 @@ exports[`Button respects the "disabled" prop 1`] = `
}

.c0:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down Expand Up @@ -819,7 +819,7 @@ exports[`ButtonTableList renders consistently 1`] = `

.c0:disabled,
.c0:disabled:hover {
color: rgba(#57606a,0.5);
color: #8c959f;
cursor: default;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`ConfirmationDialog renders consistently 1`] = `
}

.c1:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/Dropdown.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports[`Dropdown.Button renders consistently 1`] = `
}

.c0:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/DropdownMenu.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`DropdownMenu renders consistently 1`] = `
}

.c0:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/SelectMenu.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`SelectMenu right-aligned modal has right: 0px 1`] = `
}

.c1:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/SelectPanel.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`SelectPanel renders consistently 1`] = `
}

.c1:disabled {
color: #57606a;
color: #8c959f;
background-color: #f6f8fa;
border-color: rgba(27,31,36,0.15);
}
Expand Down
4 changes: 4 additions & 0 deletions src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export const buttonGroup = (args: StrictButtonStyleProps) => (
export const buttonTableList = (args: ButtonStyleProps) => (
<ButtonTableList {...args}>Button Table List</ButtonTableList>
)
export const disabledButton = (args: ButtonStyleProps) => {
const props = {disabled: true, ...args}
return <Button {...props}>Disabled</Button>
}

defaultButton.args = {variant: 'medium'}
dangerButton.args = {variant: 'medium'}
Expand Down