1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/ui/helpers/constants/design-system.js

186 lines
3.3 KiB
JavaScript
Raw Normal View History

2021-01-27 18:54:25 +01:00
/**
* A note about the existence of both singular and plural variable names here:
* When dealing with a literal property name, e.g. ALIGN_ITEMS, the constant
* should match the property. When detailing a collection of things, it should
* match the plural form of the thing. e.g. COLORS, TYPOGRAPHY
*/
2021-01-19 17:30:29 +01:00
export const COLORS = {
UI1: 'ui-1',
UI2: 'ui-2',
UI3: 'ui-3',
UI4: 'ui-4',
BLACK: 'black',
2021-10-30 20:04:09 +02:00
GREY: 'grey',
2021-01-19 17:30:29 +01:00
WHITE: 'white',
PRIMARY1: 'primary-1',
PRIMARY2: 'primary-2',
PRIMARY3: 'primary-3',
SECONDARY1: 'secondary-1',
SECONDARY2: 'secondary-2',
SECONDARY3: 'secondary-3',
SUCCESS1: 'success-1',
SUCCESS2: 'success-2',
SUCCESS3: 'success-3',
ERROR1: 'error-1',
ERROR2: 'error-2',
ERROR3: 'error-3',
2021-01-19 17:30:29 +01:00
ALERT1: 'alert-1',
ALERT2: 'alert-2',
ALERT3: 'alert-3',
MAINNET: 'mainnet',
ROPSTEN: 'ropsten',
KOVAN: 'kovan',
RINKEBY: 'rinkeby',
GOERLI: 'goerli',
2021-01-21 00:06:01 +01:00
TRANSPARENT: 'transparent',
Implement Network Switcher designs (#12260) * Show test networks toggle button in settings/advanced tab. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Apply toggle testnet settings and show/hide testnets when on/off Add localhost to testnet. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Show add network button Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Open full screen when add network is called. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Show custonm rpc before testnet rpcs lint fixes. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Test cases for network dropdown. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Test cases for toggle test networks in advanced tab component. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix Locales. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * E2E Tests: Custom RPC is now called Add Network Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fix Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * E2E: When Add Network button is clicked, wait for the full screen window to be visible Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * findVisibleElement should use a class. i.e start with a dot Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Hide Dropdown when Add Netwok is clicked. Only show full screen if it's not already showing. E2E tests passing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix tests for jest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Testnets are not being shown by default anymore, tests should use Mainnet instead. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Import Button from ui Change selector name to getShowTestnetworks Fix button to show full width Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix e2e tests Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove localhost from INFURA provider types. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix errors in Advanced Tab Component tests Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for advanced tab component. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove deleted elements from e2e tests Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Make sure all tests passed. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-10-28 21:31:05 +02:00
LOCALHOST: 'localhost',
};
2021-01-19 17:30:29 +01:00
export const TYPOGRAPHY = {
H1: 'h1',
H2: 'h2',
H3: 'h3',
H4: 'h4',
H5: 'h5',
H6: 'h6',
H7: 'h7',
H8: 'h8',
H9: 'h9',
Paragraph: 'p',
};
2021-01-27 18:54:25 +01:00
const NONE = 'none';
2021-01-27 18:54:25 +01:00
export const SIZES = {
XS: 'xs',
SM: 'sm',
MD: 'md',
LG: 'lg',
XL: 'xl',
NONE,
};
2021-01-27 18:54:25 +01:00
export const BORDER_STYLE = {
DASHED: 'dashed',
SOLID: 'solid',
DOTTED: 'dotted',
DOUBLE: 'double',
NONE,
};
2021-01-27 18:54:25 +01:00
const FLEX_END = 'flex-end';
const FLEX_START = 'flex-start';
const CENTER = 'center';
2021-01-27 18:54:25 +01:00
export const ALIGN_ITEMS = {
FLEX_START,
FLEX_END,
CENTER,
BASELINE: 'baseline',
STRETCH: 'stretch',
};
2021-01-27 18:54:25 +01:00
export const JUSTIFY_CONTENT = {
FLEX_START,
FLEX_END,
CENTER,
SPACE_AROUND: 'space-around',
SPACE_BETWEEN: 'space-between',
SPACE_EVENLY: 'space-evenly',
};
2021-01-27 18:54:25 +01:00
export const FLEX_DIRECTION = {
ROW: 'row',
ROW_REVERSE: 'row-reverse',
COLUMN: 'column',
COLUMN_REVERSE: 'column-reverse',
};
2021-11-01 20:16:23 +01:00
export const FLEX_WRAP = {
WRAP: 'wrap',
WRAP_REVERSE: 'wrap-reverse',
NO_WRAP: 'nowrap',
};
2021-01-27 18:54:25 +01:00
export const DISPLAY = {
BLOCK: 'block',
FLEX: 'flex',
GRID: 'grid',
INLINE_BLOCK: 'inline-block',
INLINE_FLEX: 'inline-flex',
INLINE_GRID: 'inline-grid',
LIST_ITEM: 'list-item',
};
2021-01-27 18:54:25 +01:00
const FRACTIONS = {
HALF: '1/2',
ONE_THIRD: '1/3',
TWO_THIRDS: '2/3',
ONE_FOURTH: '1/4',
TWO_FOURTHS: '2/4',
THREE_FOURTHS: '3/4',
ONE_FIFTH: '1/5',
TWO_FIFTHS: '2/5',
THREE_FIFTHS: '3/5',
FOUR_FIFTHS: '4/5',
ONE_SIXTH: '1/6',
TWO_SIXTHS: '2/6',
THREE_SIXTHS: '3/6',
FOUR_SIXTHS: '4/6',
FIVE_SIXTHS: '5/6',
ONE_TWELFTH: '1/12',
TWO_TWELFTHS: '2/12',
THREE_TWELFTHS: '3/12',
FOUR_TWELFTHS: '4/12',
FIVE_TWELFTHS: '5/12',
SIX_TWELFTHS: '6/12',
SEVEN_TWELFTHS: '7/12',
EIGHT_TWELFTHS: '8/12',
NINE_TWELFTHS: '9/12',
TEN_TWELFTHS: '10/12',
ELEVEN_TWELFTHS: '11/12',
};
2021-01-27 18:54:25 +01:00
export const BLOCK_SIZES = {
...FRACTIONS,
SCREEN: 'screen',
MAX: 'max',
MIN: 'min',
FULL: 'full',
};
2021-01-27 18:54:25 +01:00
export const TEXT_ALIGN = {
LEFT: 'left',
CENTER: 'center',
RIGHT: 'right',
JUSTIFY: 'justify',
END: 'end',
};
2021-01-27 18:54:25 +01:00
export const FONT_WEIGHT = {
BOLD: 'bold',
NORMAL: 'normal',
100: 100,
200: 200,
300: 300,
400: 400,
500: 500,
600: 600,
700: 700,
800: 800,
900: 900,
};
export const FONT_STYLE = {
ITALIC: 'italic',
NORMAL: 'normal',
OBLIQUE: 'oblique',
};
export const SEVERITIES = {
DANGER: 'danger',
WARNING: 'warning',
INFO: 'info',
SUCCESS: 'success',
};