@dtdot/lego 1.8.0 → 2.0.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/ActionMenu/ActionMenu.component.d.ts +9 -4
- package/build/components/ActionMenu/ActionMenu.component.js +17 -10
- package/build/components/ActionMenu/ActionMenu.context.d.ts +6 -0
- package/build/components/ActionMenu/ActionMenu.context.js +6 -0
- package/build/components/ActionMenu/_ActionMenuCheckbox.component.d.ts +9 -0
- package/build/components/ActionMenu/_ActionMenuCheckbox.component.js +30 -0
- package/build/components/ActionMenu/_ActionMenuItem.component.d.ts +5 -4
- package/build/components/ActionMenu/_ActionMenuItem.component.js +14 -4
- package/build/components/ActionMenu/_ActionMenuPanel.component.d.ts +3 -4
- package/build/components/ActionMenu/_ActionMenuPanel.component.js +1 -2
- package/build/components/Badge/Badge.component.d.ts +5 -1
- package/build/components/Badge/Badge.component.js +20 -2
- package/build/components/BadgeSelector/BadgeSelector.component.js +1 -1
- package/build/components/Checklist/_ChecklistItem.component.js +4 -22
- package/build/components/Select/Select.component.js +17 -2
- package/build/components/Table/_TableActionMenu.js +1 -1
- package/build/components/common/Checkmark.component.d.ts +6 -0
- package/build/components/common/Checkmark.component.js +23 -0
- package/build/theme/dark.theme.js +4 -0
- package/build/theme/default.theme.js +4 -0
- package/build/theme/theme.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
3
|
import { ColourVariant } from '../../theme/theme.types';
|
|
3
|
-
import { IActionMenuItem } from './_ActionMenu.types';
|
|
4
4
|
export interface ActionMenuProps {
|
|
5
|
-
'
|
|
5
|
+
'children': React.ReactNode;
|
|
6
6
|
'variant'?: ColourVariant;
|
|
7
|
+
'icon'?: IconProp;
|
|
7
8
|
'data-cy'?: string;
|
|
8
9
|
}
|
|
9
|
-
declare const ActionMenu:
|
|
10
|
+
declare const ActionMenu: {
|
|
11
|
+
({ children, variant, icon, "data-cy": dataCy }: ActionMenuProps): JSX.Element;
|
|
12
|
+
Item: ({ children, onClick, "data-cy": dataCy }: import("./_ActionMenuItem.component").ActionMenuItemProps) => JSX.Element;
|
|
13
|
+
Checkbox: ({ children, checked, onClick, "data-cy": dataCy }: import("./_ActionMenuCheckbox.component").ActionMenuCheckboxProps) => JSX.Element;
|
|
14
|
+
};
|
|
10
15
|
export default ActionMenu;
|
|
@@ -5,12 +5,22 @@ import { usePopper } from 'react-popper';
|
|
|
5
5
|
import { faEllipsisV } from '@fortawesome/free-solid-svg-icons';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import Button from '../Button/Button.component';
|
|
8
|
+
import ActionMenuContext from './ActionMenu.context';
|
|
9
|
+
import ActionMenuCheckbox from './_ActionMenuCheckbox.component';
|
|
10
|
+
import ActionMenuItem from './_ActionMenuItem.component';
|
|
8
11
|
import ActionMenuPanel from './_ActionMenuPanel.component';
|
|
12
|
+
const IconWrapper = styled.div `
|
|
13
|
+
width: 0;
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
`;
|
|
9
19
|
const StyledIcon = styled(FontAwesomeIcon) `
|
|
10
20
|
font-size: 18px;
|
|
11
21
|
`;
|
|
12
22
|
const offsetFn = () => [70, 4];
|
|
13
|
-
const ActionMenu = ({
|
|
23
|
+
const ActionMenu = ({ children, variant, icon, 'data-cy': dataCy }) => {
|
|
14
24
|
const [shown, setShown] = useState(false);
|
|
15
25
|
const [referenceElement, setReferenceElement] = useState();
|
|
16
26
|
const [popperElement, setPopperElement] = useState();
|
|
@@ -35,18 +45,15 @@ const ActionMenu = ({ items, variant, 'data-cy': dataCy }) => {
|
|
|
35
45
|
document.removeEventListener('mouseup', handleGlobalClick);
|
|
36
46
|
};
|
|
37
47
|
}, [handleGlobalClick, popperElement]);
|
|
38
|
-
const augmentedItems = items.map((item) => ({
|
|
39
|
-
...item,
|
|
40
|
-
onClick: () => {
|
|
41
|
-
setShown(false);
|
|
42
|
-
item.onClick();
|
|
43
|
-
},
|
|
44
|
-
}));
|
|
45
48
|
return (React.createElement(React.Fragment, null,
|
|
46
49
|
React.createElement(Button, { variant: variant, "data-cy": dataCy || 'action-menu-button', ref: setReferenceElement, onClick: () => setShown(true) },
|
|
47
|
-
React.createElement(
|
|
50
|
+
React.createElement(IconWrapper, null,
|
|
51
|
+
React.createElement(StyledIcon, { icon: icon || faEllipsisV }))),
|
|
48
52
|
shown &&
|
|
49
53
|
ReactDOM.createPortal(React.createElement("div", { ref: setPopperElement, style: styles.popper, ...attributes.popper },
|
|
50
|
-
React.createElement(
|
|
54
|
+
React.createElement(ActionMenuContext.Provider, { value: { closeActionMenu: () => setShown(false) } },
|
|
55
|
+
React.createElement(ActionMenuPanel, null, children))), document.querySelector('body'))));
|
|
51
56
|
};
|
|
57
|
+
ActionMenu.Item = ActionMenuItem;
|
|
58
|
+
ActionMenu.Checkbox = ActionMenuCheckbox;
|
|
52
59
|
export default ActionMenu;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ActionMenuCheckboxProps {
|
|
3
|
+
'children': React.ReactNode;
|
|
4
|
+
'checked': boolean;
|
|
5
|
+
'onClick': () => void;
|
|
6
|
+
'data-cy'?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const ActionMenuCheckbox: ({ children, checked, onClick, "data-cy": dataCy }: ActionMenuCheckboxProps) => JSX.Element;
|
|
9
|
+
export default ActionMenuCheckbox;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import { Checkmark } from '../common/Checkmark.component';
|
|
5
|
+
const ActionMenuCheckboxOuter = styled(motion.div) `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
height: 42px;
|
|
10
|
+
|
|
11
|
+
padding: 0px 16px;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
|
|
14
|
+
color: ${(props) => props.theme.colours.defaultFont};
|
|
15
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
16
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
17
|
+
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
18
|
+
`;
|
|
19
|
+
const Spacer = styled.div `
|
|
20
|
+
width: 16px;
|
|
21
|
+
`;
|
|
22
|
+
const ActionMenuCheckbox = ({ children, checked, onClick, 'data-cy': dataCy }) => {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
return (React.createElement(React.Fragment, null,
|
|
25
|
+
React.createElement(ActionMenuCheckboxOuter, { style: { backgroundColor: theme.colours.tertiary.main }, whileHover: { backgroundColor: theme.colours.tertiary.hover }, onClick: onClick, "data-cy": dataCy || 'action-menu-checkbox' },
|
|
26
|
+
children,
|
|
27
|
+
React.createElement(Spacer, null),
|
|
28
|
+
React.createElement(Checkmark, { checked: checked, large: false }))));
|
|
29
|
+
};
|
|
30
|
+
export default ActionMenuCheckbox;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface ActionMenuItemProps {
|
|
3
|
-
|
|
4
|
-
onClick: () => void;
|
|
3
|
+
'children': React.ReactNode;
|
|
4
|
+
'onClick': () => void;
|
|
5
|
+
'data-cy'?: string;
|
|
5
6
|
}
|
|
6
|
-
declare const ActionMenuItem: ({
|
|
7
|
+
declare const ActionMenuItem: ({ children, onClick, "data-cy": dataCy }: ActionMenuItemProps) => JSX.Element;
|
|
7
8
|
export default ActionMenuItem;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
3
|
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import ActionMenuContext from './ActionMenu.context';
|
|
4
5
|
const ActionMenuItemOuter = styled(motion.div) `
|
|
5
|
-
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
height: 42px;
|
|
9
|
+
|
|
10
|
+
padding: 0px 16px;
|
|
6
11
|
cursor: pointer;
|
|
7
12
|
|
|
8
13
|
color: ${(props) => props.theme.colours.defaultFont};
|
|
@@ -10,9 +15,14 @@ const ActionMenuItemOuter = styled(motion.div) `
|
|
|
10
15
|
font-size: ${(props) => props.theme.fonts.default.size};
|
|
11
16
|
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
12
17
|
`;
|
|
13
|
-
const ActionMenuItem = ({
|
|
18
|
+
const ActionMenuItem = ({ children, onClick, 'data-cy': dataCy }) => {
|
|
14
19
|
const theme = useTheme();
|
|
20
|
+
const { closeActionMenu } = useContext(ActionMenuContext);
|
|
21
|
+
const handleClick = () => {
|
|
22
|
+
onClick();
|
|
23
|
+
closeActionMenu();
|
|
24
|
+
};
|
|
15
25
|
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement(ActionMenuItemOuter, { style: { backgroundColor: theme.colours.tertiary.main }, whileHover: { backgroundColor: theme.colours.tertiary.hover }, onClick:
|
|
26
|
+
React.createElement(ActionMenuItemOuter, { style: { backgroundColor: theme.colours.tertiary.main }, whileHover: { backgroundColor: theme.colours.tertiary.hover }, onClick: handleClick, "data-cy": dataCy || 'action-menu-item' }, children)));
|
|
17
27
|
};
|
|
18
28
|
export default ActionMenuItem;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { IActionMenuItem } from './_ActionMenu.types';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
export interface ActionMenuPanelProps {
|
|
4
|
-
|
|
3
|
+
children: React.ReactNode;
|
|
5
4
|
}
|
|
6
|
-
declare const ActionMenuPanel: ({
|
|
5
|
+
declare const ActionMenuPanel: ({ children }: ActionMenuPanelProps) => JSX.Element;
|
|
7
6
|
export default ActionMenuPanel;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import ActionMenuItem from './_ActionMenuItem.component';
|
|
4
3
|
const ActionMenuPanelOuter = styled.div `
|
|
5
4
|
background-color: ${(props) => props.theme.colours.tertiary.main};
|
|
6
5
|
min-width: 160px;
|
|
7
6
|
`;
|
|
8
|
-
const ActionMenuPanel = ({
|
|
7
|
+
const ActionMenuPanel = ({ children }) => (React.createElement(ActionMenuPanelOuter, { "data-cy": 'action-menu-popover' }, children));
|
|
9
8
|
export default ActionMenuPanel;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
3
|
import { Status } from '../../theme/theme.types';
|
|
3
4
|
interface BadgeSpanProps {
|
|
4
5
|
variant: BadgeVariant;
|
|
6
|
+
useHover: boolean;
|
|
5
7
|
}
|
|
6
8
|
export declare const BadgeSpan: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, BadgeSpanProps, never>;
|
|
7
9
|
export type BadgeVariant = Status;
|
|
8
10
|
export interface BadgeProps {
|
|
9
11
|
children: React.ReactNode;
|
|
10
12
|
variant: BadgeVariant;
|
|
13
|
+
actionIcon?: IconProp;
|
|
14
|
+
onAction?: () => void;
|
|
11
15
|
}
|
|
12
|
-
declare const Badge: ({ children, variant }: BadgeProps) => JSX.Element;
|
|
16
|
+
declare const Badge: ({ children, variant, actionIcon, onAction }: BadgeProps) => JSX.Element;
|
|
13
17
|
export default Badge;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import getThemeStatusColour from '../../theme/helpers/getThemeStatusColour';
|
|
@@ -11,10 +12,27 @@ export const BadgeSpan = styled.span `
|
|
|
11
12
|
font-family: ${(props) => props.theme.fonts.default.family};
|
|
12
13
|
font-size: ${(props) => props.theme.fonts.default.size};
|
|
13
14
|
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
15
|
+
line-height: ${(props) => props.theme.fonts.default.size};
|
|
14
16
|
|
|
15
17
|
text-transform: lowercase;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background-color: ${(props) => props.useHover && getThemeStatusColour(props.variant, props.theme).hover};
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
const ActionSpan = styled.span `
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
padding: 3px 7px;
|
|
26
|
+
margin: -3px -7px -3px 0;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
user-select: none;
|
|
29
|
+
|
|
30
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
16
31
|
`;
|
|
17
|
-
const Badge = ({ children, variant }) => {
|
|
18
|
-
return (React.createElement(BadgeSpan, { variant: variant, "data-cy": 'badge' },
|
|
32
|
+
const Badge = ({ children, variant, actionIcon, onAction }) => {
|
|
33
|
+
return (React.createElement(BadgeSpan, { variant: variant, useHover: !!actionIcon, "data-cy": 'badge' },
|
|
34
|
+
children,
|
|
35
|
+
actionIcon && (React.createElement(ActionSpan, { onClick: onAction },
|
|
36
|
+
React.createElement(FontAwesomeIcon, { icon: actionIcon })))));
|
|
19
37
|
};
|
|
20
38
|
export default Badge;
|
|
@@ -24,6 +24,6 @@ const BadgeSelector = ({ options, value, onChange }) => {
|
|
|
24
24
|
const handleClick = (_value) => {
|
|
25
25
|
onChange([_value]);
|
|
26
26
|
};
|
|
27
|
-
return (React.createElement(BadgeSelectorOuter, { "data-cy": 'badge-selector' }, options.map((option) => (React.createElement(InteractiveBadge, { key: option.value, variant: option.variant, inactive: !value.includes(option.value), onClick: () => handleClick(option.value), "data-cy": value.includes(option.value) ? 'badge-selected' : 'badge' }, option.name)))));
|
|
27
|
+
return (React.createElement(BadgeSelectorOuter, { "data-cy": 'badge-selector' }, options.map((option) => (React.createElement(InteractiveBadge, { useHover: false, key: option.value, variant: option.variant, inactive: !value.includes(option.value), onClick: () => handleClick(option.value), "data-cy": value.includes(option.value) ? 'badge-selected' : 'badge' }, option.name)))));
|
|
28
28
|
};
|
|
29
29
|
export default BadgeSelector;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
3
|
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import { Checkmark } from '../common/Checkmark.component';
|
|
4
5
|
const Outerlabel = styled(motion.label) `
|
|
5
6
|
position: relative;
|
|
6
7
|
margin-bottom: 4px;
|
|
@@ -26,28 +27,8 @@ const HiddenCheckbox = styled.input `
|
|
|
26
27
|
height: 0;
|
|
27
28
|
width: 0;
|
|
28
29
|
`;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
height: ${(props) => (props.large ? '36px' : '24px')};
|
|
32
|
-
width: ${(props) => (props.large ? '36px' : '24px')};
|
|
33
|
-
margin-right: 8px;
|
|
34
|
-
background-color: ${(props) => props.theme.colours.cardBackground};
|
|
35
|
-
|
|
36
|
-
&:after {
|
|
37
|
-
content: '';
|
|
38
|
-
position: absolute;
|
|
39
|
-
display: ${(props) => (props.checked ? 'block' : 'none')};
|
|
40
|
-
|
|
41
|
-
left: ${(props) => (props.large ? '14px' : '9px')};
|
|
42
|
-
top: ${(props) => (props.large ? '7px' : '5px')};
|
|
43
|
-
width: ${(props) => (props.large ? '7px' : '5px')};
|
|
44
|
-
height: ${(props) => (props.large ? '16px' : '10px')};
|
|
45
|
-
border: solid ${(props) => props.theme.colours.defaultFont};
|
|
46
|
-
border-width: 0 3px 3px 0;
|
|
47
|
-
-webkit-transform: rotate(45deg);
|
|
48
|
-
-ms-transform: rotate(45deg);
|
|
49
|
-
transform: rotate(45deg);
|
|
50
|
-
}
|
|
30
|
+
const Spacer = styled.div `
|
|
31
|
+
width: 8px;
|
|
51
32
|
`;
|
|
52
33
|
const Strikethrough = styled.div `
|
|
53
34
|
position: absolute;
|
|
@@ -71,6 +52,7 @@ const ChecklistItem = ({ label, value, onChange, large }) => {
|
|
|
71
52
|
};
|
|
72
53
|
return (React.createElement(Outerlabel, { checked: value, whileHover: { backgroundColor: theme.colours.cardBackground }, "data-cy": value ? 'checklist-item-checked' : 'checklist-item' },
|
|
73
54
|
React.createElement(Checkmark, { checked: value, large: large }),
|
|
55
|
+
React.createElement(Spacer, null),
|
|
74
56
|
label,
|
|
75
57
|
React.createElement(HiddenCheckbox, { type: 'checkbox', checked: value, onChange: handleChange }),
|
|
76
58
|
value && React.createElement(Strikethrough, { large: large }, label)));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
1
2
|
import React, { useState } from 'react';
|
|
3
|
+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
2
4
|
import { motion } from 'framer-motion';
|
|
3
5
|
import styled, { useTheme } from 'styled-components';
|
|
4
6
|
import ControlDescription from '../../shared/ControlDescription';
|
|
@@ -18,6 +20,15 @@ const TextContainer = styled.div `
|
|
|
18
20
|
align-items: center;
|
|
19
21
|
height: 100%;
|
|
20
22
|
`;
|
|
23
|
+
const IconContainer = styled.div `
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 0;
|
|
26
|
+
top: 0;
|
|
27
|
+
height: 48px;
|
|
28
|
+
padding: 0 16px;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
`;
|
|
21
32
|
const PlaceholderText = styled.div `
|
|
22
33
|
color: ${(props) => getThemeControlColours(props.theme).placeholder};
|
|
23
34
|
`;
|
|
@@ -29,10 +40,12 @@ const OptionsContainer = styled.div `
|
|
|
29
40
|
position: absolute;
|
|
30
41
|
background-color: ${(props) => props.theme.colours.controlBackground};
|
|
31
42
|
z-index: 10000;
|
|
43
|
+
|
|
44
|
+
box-shadow: ${(props) => props.theme.shadows.small};
|
|
32
45
|
`;
|
|
33
46
|
const Option = styled(motion.div) `
|
|
34
47
|
color: ${(props) => getThemeControlColours(props.theme).font};
|
|
35
|
-
background-color: ${(props) => props.theme.colours.
|
|
48
|
+
background-color: ${(props) => props.theme.colours.controlBackgroundDisabled};
|
|
36
49
|
height: 36px;
|
|
37
50
|
display: flex;
|
|
38
51
|
align-items: center;
|
|
@@ -62,7 +75,9 @@ const Select = (props) => {
|
|
|
62
75
|
React.createElement(SelectControl, { "data-cy": dataCy, onClick: () => setIsOpen(!isOpen) },
|
|
63
76
|
React.createElement(TextContainer, null,
|
|
64
77
|
!value && placeholder && React.createElement(PlaceholderText, null, placeholder),
|
|
65
|
-
value && React.createElement(ValueText, null, valueLabel))
|
|
78
|
+
value && React.createElement(ValueText, null, valueLabel)),
|
|
79
|
+
React.createElement(IconContainer, null,
|
|
80
|
+
React.createElement(FontAwesomeIcon, { icon: isOpen ? faChevronUp : faChevronDown }))),
|
|
66
81
|
isOpen && (React.createElement(OptionsContainer, null, options.map((option) => (React.createElement(Option, { whileHover: { backgroundColor: theme.colours.controlBorder }, transition: { type: 'spring', duration: 0.2 }, key: option.value, onClick: () => selectValue(option) }, option.label)))))),
|
|
67
82
|
splitDescription && (React.createElement(ControlDescription, null, splitDescription.map((line, index) => (React.createElement(React.Fragment, null,
|
|
68
83
|
index !== 0 && React.createElement("br", null),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ActionMenu from '../ActionMenu/ActionMenu.component';
|
|
3
3
|
const TableActionMenu = ({ items, 'data-cy': dataCy }) => {
|
|
4
|
-
return React.createElement(ActionMenu, { variant: 'tertiary',
|
|
4
|
+
return (React.createElement(ActionMenu, { variant: 'tertiary', "data-cy": dataCy }, items.map((item) => (React.createElement(ActionMenu.Item, { key: item.label, onClick: item.onClick }, item.label)))));
|
|
5
5
|
};
|
|
6
6
|
export default TableActionMenu;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const Checkmark = styled.div `
|
|
3
|
+
position: relative;
|
|
4
|
+
height: ${(props) => (props.large ? '36px' : '24px')};
|
|
5
|
+
width: ${(props) => (props.large ? '36px' : '24px')};
|
|
6
|
+
background-color: ${(props) => props.theme.colours.controlBackground};
|
|
7
|
+
|
|
8
|
+
&:after {
|
|
9
|
+
content: '';
|
|
10
|
+
position: absolute;
|
|
11
|
+
display: ${(props) => (props.checked ? 'block' : 'none')};
|
|
12
|
+
|
|
13
|
+
left: ${(props) => (props.large ? '14px' : '9px')};
|
|
14
|
+
top: ${(props) => (props.large ? '7px' : '5px')};
|
|
15
|
+
width: ${(props) => (props.large ? '7px' : '5px')};
|
|
16
|
+
height: ${(props) => (props.large ? '16px' : '10px')};
|
|
17
|
+
border: solid ${(props) => props.theme.colours.defaultFont};
|
|
18
|
+
border-width: 0 3px 3px 0;
|
|
19
|
+
-webkit-transform: rotate(45deg);
|
|
20
|
+
-ms-transform: rotate(45deg);
|
|
21
|
+
transform: rotate(45deg);
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -38,21 +38,25 @@ const darkTheme = {
|
|
|
38
38
|
main: '#83bfff',
|
|
39
39
|
contrast: '#191919',
|
|
40
40
|
dull: '#0070e8',
|
|
41
|
+
hover: '#8fc5ff',
|
|
41
42
|
},
|
|
42
43
|
statusSuccess: {
|
|
43
44
|
main: '#8ddaa9',
|
|
44
45
|
contrast: '#191919',
|
|
45
46
|
dull: '#35a35d',
|
|
47
|
+
hover: '#98deb2',
|
|
46
48
|
},
|
|
47
49
|
statusWarn: {
|
|
48
50
|
main: '#f1a374',
|
|
49
51
|
contrast: '#191919',
|
|
50
52
|
dull: '#c35514',
|
|
53
|
+
hover: '#f2ac82',
|
|
51
54
|
},
|
|
52
55
|
statusDanger: {
|
|
53
56
|
main: '#e87a7a',
|
|
54
57
|
contrast: '#191919',
|
|
55
58
|
dull: '#b51f1f',
|
|
59
|
+
hover: '#ea8787',
|
|
56
60
|
},
|
|
57
61
|
},
|
|
58
62
|
fonts: {
|
|
@@ -39,21 +39,25 @@ const defaultTheme = {
|
|
|
39
39
|
main: colours.blue,
|
|
40
40
|
contrast: colours.blue,
|
|
41
41
|
dull: colours.blue,
|
|
42
|
+
hover: colours.blue,
|
|
42
43
|
},
|
|
43
44
|
statusSuccess: {
|
|
44
45
|
main: colours.green,
|
|
45
46
|
contrast: colours.green,
|
|
46
47
|
dull: colours.green,
|
|
48
|
+
hover: colours.green,
|
|
47
49
|
},
|
|
48
50
|
statusWarn: {
|
|
49
51
|
main: colours.yellow,
|
|
50
52
|
contrast: colours.yellow,
|
|
51
53
|
dull: colours.yellow,
|
|
54
|
+
hover: colours.yellow,
|
|
52
55
|
},
|
|
53
56
|
statusDanger: {
|
|
54
57
|
main: colours.red,
|
|
55
58
|
contrast: colours.red,
|
|
56
59
|
dull: colours.red,
|
|
60
|
+
hover: colours.red,
|
|
57
61
|
},
|
|
58
62
|
},
|
|
59
63
|
fonts: {
|