mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Dark Mode: Swap hex colors in ui/components/ui folder (#14191)
This commit is contained in:
parent
57818fabbe
commit
e8d4f11cbf
@ -110,7 +110,7 @@ export const WithIcon = (args) => <ActionableMessage {...args} />;
|
|||||||
WithIcon.args = {
|
WithIcon.args = {
|
||||||
className: 'actionable-message--left-aligned actionable-message--warning',
|
className: 'actionable-message--left-aligned actionable-message--warning',
|
||||||
useIcon: true,
|
useIcon: true,
|
||||||
iconFillColor: '#f8c000',
|
iconFillColor: 'var(--color-waring-default)',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PrimaryV2Action = (args) => <ActionableMessage {...args} />;
|
export const PrimaryV2Action = (args) => <ActionableMessage {...args} />;
|
||||||
@ -119,7 +119,7 @@ PrimaryV2Action.args = {
|
|||||||
message:
|
message:
|
||||||
'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.',
|
'We were not able to estimate gas. There might be an error in the contract and this transaction may fail.',
|
||||||
useIcon: true,
|
useIcon: true,
|
||||||
iconFillColor: '#d73a49',
|
iconFillColor: 'var(--color-error-default)',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
primaryActionV2: {
|
primaryActionV2: {
|
||||||
label: 'I want to proceed anyway',
|
label: 'I want to proceed anyway',
|
||||||
|
@ -21,7 +21,10 @@ export default class Breadcrumbs extends PureComponent {
|
|||||||
key={i}
|
key={i}
|
||||||
className="breadcrumb"
|
className="breadcrumb"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: i === currentIndex ? '#D8D8D8' : '#FFFFFF',
|
backgroundColor:
|
||||||
|
i === currentIndex
|
||||||
|
? 'var(--color-background-alternative)'
|
||||||
|
: 'var(--color-background-default)',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -11,12 +11,12 @@ describe('Breadcrumbs Component', () => {
|
|||||||
expect(wrapper.find('.breadcrumb')).toHaveLength(3);
|
expect(wrapper.find('.breadcrumb')).toHaveLength(3);
|
||||||
expect(
|
expect(
|
||||||
wrapper.find('.breadcrumb').at(0).props().style.backgroundColor,
|
wrapper.find('.breadcrumb').at(0).props().style.backgroundColor,
|
||||||
).toStrictEqual('#FFFFFF');
|
).toStrictEqual('var(--color-background-default)');
|
||||||
expect(
|
expect(
|
||||||
wrapper.find('.breadcrumb').at(1).props().style.backgroundColor,
|
wrapper.find('.breadcrumb').at(1).props().style.backgroundColor,
|
||||||
).toStrictEqual('#D8D8D8');
|
).toStrictEqual('var(--color-background-alternative)');
|
||||||
expect(
|
expect(
|
||||||
wrapper.find('.breadcrumb').at(2).props().style.backgroundColor,
|
wrapper.find('.breadcrumb').at(2).props().style.backgroundColor,
|
||||||
).toStrictEqual('#FFFFFF');
|
).toStrictEqual('var(--color-background-default)');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@ function ExportTextContainer({ text = '' }) {
|
|||||||
handleCopy(text);
|
handleCopy(text);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Copy size={17} color="#3098DC" />
|
<Copy size={17} color="var(--color-primary-default)" />
|
||||||
<div className="export-text-container__button-text">
|
<div className="export-text-container__button-text">
|
||||||
{copied ? t('copiedExclamation') : t('copyToClipboard')}
|
{copied ? t('copiedExclamation') : t('copyToClipboard')}
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,7 +55,11 @@ export const FormFieldWithTitleDetail = (args) => {
|
|||||||
text: <div style={{ fontSize: '12px' }}>Detail</div>,
|
text: <div style={{ fontSize: '12px' }}>Detail</div>,
|
||||||
button: (
|
button: (
|
||||||
<button
|
<button
|
||||||
style={{ backgroundColor: clicked ? 'orange' : 'rgb(239, 239, 239)' }}
|
style={{
|
||||||
|
backgroundColor: clicked
|
||||||
|
? 'var(--color-secondary-default)'
|
||||||
|
: 'var(--color-background-alternative)',
|
||||||
|
}}
|
||||||
onClick={() => setClicked(!clicked)}
|
onClick={() => setClicked(!clicked)}
|
||||||
>
|
>
|
||||||
Click Me
|
Click Me
|
||||||
|
@ -7,7 +7,6 @@ import CopyIcon from './copy-icon.component';
|
|||||||
import InfoIcon from './info-icon.component';
|
import InfoIcon from './info-icon.component';
|
||||||
import InfoIconInverted from './info-icon-inverted.component';
|
import InfoIconInverted from './info-icon-inverted.component';
|
||||||
import Interaction from './interaction-icon.component';
|
import Interaction from './interaction-icon.component';
|
||||||
import PaperAirplane from './paper-airplane-icon';
|
|
||||||
import Preloader from './preloader';
|
import Preloader from './preloader';
|
||||||
import ReceiveIcon from './receive-icon.component';
|
import ReceiveIcon from './receive-icon.component';
|
||||||
import SendIcon from './send-icon.component';
|
import SendIcon from './send-icon.component';
|
||||||
@ -176,12 +175,6 @@ Use the `className` prop to add an additional class to the icon. This additional
|
|||||||
|
|
||||||
<ArgsTable of={SwapIconComponent} />
|
<ArgsTable of={SwapIconComponent} />
|
||||||
|
|
||||||
## PaperAirplane
|
|
||||||
|
|
||||||
<Canvas>
|
|
||||||
<Story id="ui-components-ui-icon-icon-stories-js--paper-airplane-story" />
|
|
||||||
</Canvas>
|
|
||||||
|
|
||||||
## CopyIcon
|
## CopyIcon
|
||||||
|
|
||||||
<Canvas>
|
<Canvas>
|
||||||
|
@ -17,7 +17,6 @@ import CopyIcon from './copy-icon.component';
|
|||||||
import InfoIcon from './info-icon.component';
|
import InfoIcon from './info-icon.component';
|
||||||
import InfoIconInverted from './info-icon-inverted.component';
|
import InfoIconInverted from './info-icon-inverted.component';
|
||||||
import Interaction from './interaction-icon.component';
|
import Interaction from './interaction-icon.component';
|
||||||
import PaperAirplane from './paper-airplane-icon';
|
|
||||||
import Preloader from './preloader';
|
import Preloader from './preloader';
|
||||||
import ReceiveIcon from './receive-icon.component';
|
import ReceiveIcon from './receive-icon.component';
|
||||||
import SendIcon from './send-icon.component';
|
import SendIcon from './send-icon.component';
|
||||||
@ -152,7 +151,6 @@ export const DefaultStory = (args) => (
|
|||||||
<IconItem Component={<BuyIcon {...args} />} />
|
<IconItem Component={<BuyIcon {...args} />} />
|
||||||
<IconItem Component={<SwapIcon {...args} />} />
|
<IconItem Component={<SwapIcon {...args} />} />
|
||||||
<IconItem Component={<SwapIconComponent {...args} />} />
|
<IconItem Component={<SwapIconComponent {...args} />} />
|
||||||
<IconItem Component={<PaperAirplane {...args} />} />
|
|
||||||
<IconItem Component={<CopyIcon {...args} />} />
|
<IconItem Component={<CopyIcon {...args} />} />
|
||||||
<IconItem Component={<Preloader {...args} />} />
|
<IconItem Component={<Preloader {...args} />} />
|
||||||
<IconItem Component={<IconEye {...args} />} />
|
<IconItem Component={<IconEye {...args} />} />
|
||||||
@ -279,7 +277,7 @@ export const BuyIconStory = (args) => <BuyIcon {...args} />;
|
|||||||
BuyIconStory.args = {
|
BuyIconStory.args = {
|
||||||
width: '17',
|
width: '17',
|
||||||
height: '21',
|
height: '21',
|
||||||
fill: '#2F80ED',
|
fill: 'var(--color-primary-default)',
|
||||||
};
|
};
|
||||||
BuyIconStory.storyName = 'BuyIcon';
|
BuyIconStory.storyName = 'BuyIcon';
|
||||||
|
|
||||||
@ -287,7 +285,7 @@ export const SwapIconStory = (args) => <SwapIcon {...args} />;
|
|||||||
SwapIconStory.args = {
|
SwapIconStory.args = {
|
||||||
width: '17',
|
width: '17',
|
||||||
height: '21',
|
height: '21',
|
||||||
fill: '#2F80ED',
|
fill: 'var(--color-primary-default)',
|
||||||
};
|
};
|
||||||
SwapIconStory.storyName = 'SwapIcon';
|
SwapIconStory.storyName = 'SwapIcon';
|
||||||
|
|
||||||
@ -299,13 +297,6 @@ SendSwapIconStory.args = {
|
|||||||
};
|
};
|
||||||
SendSwapIconStory.storyName = 'Send/SwapIcon';
|
SendSwapIconStory.storyName = 'Send/SwapIcon';
|
||||||
|
|
||||||
export const PaperAirplaneStory = (args) => <PaperAirplane {...args} />;
|
|
||||||
PaperAirplaneStory.args = {
|
|
||||||
size: 40,
|
|
||||||
color: 'var(--color-icon-default)',
|
|
||||||
};
|
|
||||||
PaperAirplaneStory.storyName = 'PaperAirplane';
|
|
||||||
|
|
||||||
export const CopyIconStory = (args) => <CopyIcon {...args} />;
|
export const CopyIconStory = (args) => <CopyIcon {...args} />;
|
||||||
CopyIconStory.args = {
|
CopyIconStory.args = {
|
||||||
size: 40,
|
size: 40,
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
export default function PaperAirplane({ size, className, color }) {
|
|
||||||
return (
|
|
||||||
<svg
|
|
||||||
className={className}
|
|
||||||
width={size}
|
|
||||||
height={size}
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
fillRule="evenodd"
|
|
||||||
clipRule="evenodd"
|
|
||||||
d="M22.6001 0.0846465C22.9027 -0.0485745 23.2611 -0.0263377 23.5508 0.164104C23.9463 0.424137 24.1048 0.926235 23.9302 1.36621L15.1985 23.3701C15.0453 23.7562 14.6689 24.0071 14.2535 23.9999C13.8381 23.9926 13.4707 23.7289 13.3309 23.3376L9.99771 14.0046L0.662377 10.6706C0.271138 10.5308 0.00736766 10.1634 0.000151723 9.74798C-0.00706558 9.3326 0.24378 8.95619 0.629931 8.80296L22.6001 0.0846465ZM11.9306 13.4818L20.2936 5.11878L14.32 20.1722L11.9306 13.4818ZM18.8812 3.70792L3.82785 9.68148L10.5182 12.0709L18.8812 3.70792Z"
|
|
||||||
fill={color}
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
PaperAirplane.defaultProps = {
|
|
||||||
color: '#FFFFFF',
|
|
||||||
};
|
|
||||||
|
|
||||||
PaperAirplane.propTypes = {
|
|
||||||
/**
|
|
||||||
* Additional className
|
|
||||||
*/
|
|
||||||
className: PropTypes.string,
|
|
||||||
/**
|
|
||||||
* Size of the icon should adhere to 8px grid. e.g: 8, 16, 24, 32, 40 and is required
|
|
||||||
*/
|
|
||||||
size: PropTypes.number.isRequired,
|
|
||||||
/**
|
|
||||||
* Color of the icon should be a valid design system color
|
|
||||||
*/
|
|
||||||
color: PropTypes.string,
|
|
||||||
};
|
|
@ -2,8 +2,12 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
export default function SunCheck({ reverseColors }) {
|
export default function SunCheck({ reverseColors }) {
|
||||||
const sunColor = reverseColors ? '#037DD6' : 'white';
|
const sunColor = reverseColors
|
||||||
const checkColor = reverseColors ? 'white' : '#037DD6';
|
? 'var(--color-primary-default)'
|
||||||
|
: 'var(--color-primary-inverse)';
|
||||||
|
const checkColor = reverseColors
|
||||||
|
? 'var(--color-primary-inverse)'
|
||||||
|
: 'var(--color-primary-default)';
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
width="15"
|
width="15"
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
export default function InfoTooltipIcon({ fillColor = '#b8b8b8' }) {
|
export default function InfoTooltipIcon({
|
||||||
|
fillColor = 'var(--color-icon-default)',
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path
|
<path
|
||||||
|
@ -17,7 +17,7 @@ export default function InfoTooltip({
|
|||||||
containerClassName,
|
containerClassName,
|
||||||
wrapperClassName,
|
wrapperClassName,
|
||||||
wide,
|
wide,
|
||||||
iconFillColor = '#b8b8b8',
|
iconFillColor = 'var(--color-icon-default)',
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="info-tooltip">
|
<div className="info-tooltip">
|
||||||
|
@ -28,13 +28,13 @@ Currencies.propTypes = {
|
|||||||
secondary: PropTypes.string,
|
secondary: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
const okColor = '#2F80ED';
|
const okColor = 'var(--color-primary-default)';
|
||||||
const failColor = '#D73A49';
|
const failColor = 'var(--color-error-default';
|
||||||
|
|
||||||
export const SendComponent = () => (
|
export const SendComponent = () => (
|
||||||
<ListItem
|
<ListItem
|
||||||
icon={<Send color={okColor} size={28} />}
|
icon={<Send color={okColor} size={28} />}
|
||||||
titleIcon={<Preloader size={16} color="#D73A49" />}
|
titleIcon={<Preloader size={16} color={failColor} />}
|
||||||
title={text('title', 'Send DAI')}
|
title={text('title', 'Send DAI')}
|
||||||
className="list-item"
|
className="list-item"
|
||||||
subtitle={text('subtitle', 'Sept 20 · To: 00X4...3058')}
|
subtitle={text('subtitle', 'Sept 20 · To: 00X4...3058')}
|
||||||
@ -61,7 +61,10 @@ export const PendingComponent = () => (
|
|||||||
className="list-item"
|
className="list-item"
|
||||||
subtitleStatus={
|
subtitleStatus={
|
||||||
<span>
|
<span>
|
||||||
<span style={{ color: '#F56821' }}>Unapproved</span> ·{' '}
|
<span style={{ color: 'var(--color-warning-default)' }}>
|
||||||
|
Unapproved
|
||||||
|
</span>{' '}
|
||||||
|
·{' '}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
subtitle={text('subtitle', 'Turtlefarm.com')}
|
subtitle={text('subtitle', 'Turtlefarm.com')}
|
||||||
|
@ -34,7 +34,10 @@ class LoadingScreen extends Component {
|
|||||||
{this.props.header}
|
{this.props.header}
|
||||||
<div className="loading-overlay__container">
|
<div className="loading-overlay__container">
|
||||||
{this.props.showLoadingSpinner && (
|
{this.props.showLoadingSpinner && (
|
||||||
<Spinner color="#F7C06C" className="loading-overlay__spinner" />
|
<Spinner
|
||||||
|
color="var(--color-secondary-muted)"
|
||||||
|
className="loading-overlay__spinner"
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{this.renderMessage()}
|
{this.renderMessage()}
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,7 +51,7 @@ const NicknamePopover = ({
|
|||||||
}}
|
}}
|
||||||
title=""
|
title=""
|
||||||
>
|
>
|
||||||
<CopyIcon size={11} color="#989a9b" />
|
<CopyIcon size={11} color="var(--color-icon-default)" />
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,12 +19,12 @@ const styles = {
|
|||||||
},
|
},
|
||||||
rail: {
|
rail: {
|
||||||
borderRadius: 50,
|
borderRadius: 50,
|
||||||
background: '#D6D9DC',
|
background: 'var(--color-background-alternative)',
|
||||||
height: 6,
|
height: 6,
|
||||||
},
|
},
|
||||||
track: {
|
track: {
|
||||||
borderRadius: 50,
|
borderRadius: 50,
|
||||||
background: '#037DD6',
|
background: 'var(--color-primary-default)',
|
||||||
height: 6,
|
height: 6,
|
||||||
},
|
},
|
||||||
thumb: {
|
thumb: {
|
||||||
@ -32,8 +32,8 @@ const styles = {
|
|||||||
width: 20,
|
width: 20,
|
||||||
marginTop: -7,
|
marginTop: -7,
|
||||||
marginLeft: -7,
|
marginLeft: -7,
|
||||||
backgroundColor: '#037DD6',
|
backgroundColor: 'var(--color-primary-default)',
|
||||||
border: '1px solid #EAF6FF',
|
border: '1px solid var(--color-border-muted)',
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
boxShadow: '0px 0px 14px 0px rgba(0, 0, 0, 0.18)',
|
boxShadow: '0px 0px 14px 0px rgba(0, 0, 0, 0.18)',
|
||||||
'&:focus, &$active': {
|
'&:focus, &$active': {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
const Spinner = ({ className = '', color = '#000000' }) => {
|
const Spinner = ({ className = '', color = 'var(--color-text-default)' }) => {
|
||||||
return (
|
return (
|
||||||
<div className={`spinner ${className}`}>
|
<div className={`spinner ${className}`}>
|
||||||
<svg
|
<svg
|
||||||
|
@ -27,7 +27,7 @@ const styles = {
|
|||||||
borderBottom: '1px solid var(--color-text-default) !important', // Visible bottom border
|
borderBottom: '1px solid var(--color-text-default) !important', // Visible bottom border
|
||||||
},
|
},
|
||||||
'&:after': {
|
'&:after': {
|
||||||
borderBottom: `2px solid rgb(3, 125, 214)`, // Animated bottom border
|
borderBottom: `2px solid var(--color-primary-default)`, // Animated bottom border
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
materialError: {},
|
materialError: {},
|
||||||
@ -46,16 +46,16 @@ const styles = {
|
|||||||
},
|
},
|
||||||
materialWhitePaddedUnderline: {
|
materialWhitePaddedUnderline: {
|
||||||
'&:after': {
|
'&:after': {
|
||||||
borderBottom: '2px solid #fff',
|
borderBottom: '2px solid var(--color-background-default)', // @TODO: Replace with border-muted ?
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Non-material styles
|
// Non-material styles
|
||||||
formLabel: {
|
formLabel: {
|
||||||
'&$formLabelFocused': {
|
'&$formLabelFocused': {
|
||||||
color: '#5b5b5b',
|
color: 'var(--color-text-alternative)',
|
||||||
},
|
},
|
||||||
'&$materialError': {
|
'&$materialError': {
|
||||||
color: '#5b5b5b',
|
color: 'var(--color-text-alternative)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
formLabelFocused: {},
|
formLabelFocused: {},
|
||||||
|
@ -8,7 +8,7 @@ const trackStyle = {
|
|||||||
height: '24px',
|
height: '24px',
|
||||||
padding: '0px',
|
padding: '0px',
|
||||||
borderRadius: '26px',
|
borderRadius: '26px',
|
||||||
border: '2px solid rgb(3, 125, 214)',
|
border: '2px solid var(--color-primary-default)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
@ -16,7 +16,7 @@ const trackStyle = {
|
|||||||
|
|
||||||
const offTrackStyle = {
|
const offTrackStyle = {
|
||||||
...trackStyle,
|
...trackStyle,
|
||||||
border: '2px solid #8E8E8E',
|
border: '2px solid var(--color-border-default)',
|
||||||
};
|
};
|
||||||
|
|
||||||
const thumbStyle = {
|
const thumbStyle = {
|
||||||
@ -31,18 +31,18 @@ const thumbStyle = {
|
|||||||
|
|
||||||
const colors = {
|
const colors = {
|
||||||
activeThumb: {
|
activeThumb: {
|
||||||
base: '#037DD6',
|
base: 'var(--color-primary-default)',
|
||||||
},
|
},
|
||||||
inactiveThumb: {
|
inactiveThumb: {
|
||||||
base: '#6A737D',
|
base: 'var(--color-icon-default)',
|
||||||
},
|
},
|
||||||
active: {
|
active: {
|
||||||
base: '#ffffff',
|
base: 'var(--color-background-default)',
|
||||||
hover: '#ffffff',
|
hover: 'var(--color-background-default)',
|
||||||
},
|
},
|
||||||
inactive: {
|
inactive: {
|
||||||
base: '#DADADA',
|
base: 'var(--color-background-alternative)',
|
||||||
hover: '#DADADA',
|
hover: 'var(color-background-alternative)',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user