@thecb/components 3.2.0 → 3.3.0
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/.tool-versions +1 -0
- package/dist/index.cjs.js +14273 -14235
- package/package.json +1 -1
- package/src/components/atoms/add-obligation/AddObligation.js +59 -0
- package/src/components/atoms/add-obligation/AddObligation.stories.js +18 -0
- package/src/components/atoms/add-obligation/AddObligation.theme.js +9 -0
- package/src/components/atoms/add-obligation/index.js +3 -0
- package/src/components/atoms/icons/IconAdd.js +36 -0
- package/src/components/atoms/icons/index.js +3 -1
- package/src/components/atoms/index.js +1 -0
- package/src/components/atoms/placeholder/Placeholder.js +77 -60
- package/src/deprecated/icons/index.js +0 -2
- package/dist/index.esm.js +0 -36100
- package/src/deprecated/icons/IconAdd.js +0 -44
package/package.json
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ButtonWithAction from "../button-with-action";
|
|
3
|
+
import { Box, Center, Cluster, Cover } from "../layouts";
|
|
4
|
+
import { IconAdd } from "../icons";
|
|
5
|
+
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
6
|
+
import { fallbackValues } from "./AddObligation.theme";
|
|
7
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
8
|
+
|
|
9
|
+
const AddObligation = ({
|
|
10
|
+
text,
|
|
11
|
+
action,
|
|
12
|
+
themeValues,
|
|
13
|
+
extraStyles,
|
|
14
|
+
textExtraStyles
|
|
15
|
+
}) => {
|
|
16
|
+
const hoverStyles = `
|
|
17
|
+
&:hover {
|
|
18
|
+
.fill { fill: ${themeValues.hoverColor}; }
|
|
19
|
+
.stroke { stroke: ${themeValues.hoverColor}; }
|
|
20
|
+
}`;
|
|
21
|
+
|
|
22
|
+
const activeStyles = `
|
|
23
|
+
&:active {
|
|
24
|
+
.fill { fill: ${themeValues.activeColor}; }
|
|
25
|
+
.stroke { stroke: ${themeValues.activeColor}; }
|
|
26
|
+
}`;
|
|
27
|
+
|
|
28
|
+
const defaultStyles = `
|
|
29
|
+
min-height: 0;
|
|
30
|
+
.fill { fill: ${themeValues.color}; }
|
|
31
|
+
.stroke { stroke: ${themeValues.color}; }
|
|
32
|
+
`;
|
|
33
|
+
return (
|
|
34
|
+
<Box
|
|
35
|
+
className="button"
|
|
36
|
+
padding="0.5rem 0"
|
|
37
|
+
hoverStyles={hoverStyles}
|
|
38
|
+
activeStyles={activeStyles}
|
|
39
|
+
extraStyles={defaultStyles}
|
|
40
|
+
>
|
|
41
|
+
<Cover singleChild minHeight="100%">
|
|
42
|
+
<Cluster justify="center" align="center" minHeight="100%">
|
|
43
|
+
<IconAdd />
|
|
44
|
+
<Center intrinsic>
|
|
45
|
+
<ButtonWithAction
|
|
46
|
+
action={action}
|
|
47
|
+
text={text}
|
|
48
|
+
variant="smallGhost"
|
|
49
|
+
extraStyles={`min-height: 0; ${extraStyles}`}
|
|
50
|
+
textExtraStyles={`padding: 0 0 0 0.75rem; font-size: 0.875rem; font-weight ${FONT_WEIGHT_SEMIBOLD}; ${textExtraStyles}`}
|
|
51
|
+
/>
|
|
52
|
+
</Center>
|
|
53
|
+
</Cluster>
|
|
54
|
+
</Cover>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default themeComponent(AddObligation, "AddObligation", fallbackValues);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text } from "@storybook/addon-knobs";
|
|
3
|
+
import AddObligation from "./AddObligation";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
export const addObligation = () => (
|
|
7
|
+
<AddObligation
|
|
8
|
+
text={text("text", "Lorem", "props")}
|
|
9
|
+
extraStyles={text("extraStyles", "", "props")}
|
|
10
|
+
textExtraStyles={text("textExtraStyles", "", "props")}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const story = page({
|
|
15
|
+
title: "Components|Atoms/AddObligation",
|
|
16
|
+
Component: AddObligation
|
|
17
|
+
});
|
|
18
|
+
export default story;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const IconAdd = () => (
|
|
4
|
+
<svg
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
7
|
+
width="18"
|
|
8
|
+
height="18"
|
|
9
|
+
viewBox="0 0 18 18"
|
|
10
|
+
className="icon"
|
|
11
|
+
>
|
|
12
|
+
<defs>
|
|
13
|
+
<path
|
|
14
|
+
id="path-1"
|
|
15
|
+
d="M7.91666623 4.78508747L4.78508747 4.78508747 4.78508747 7.91666623 3.74122788 7.91666623 3.74122788 4.78508747 0.609649123 4.78508747 0.609649123 3.74122788 3.74122788 3.74122788 3.74122788 0.609649123 4.78508747 0.609649123 4.78508747 3.74122788 7.91666623 3.74122788z"
|
|
16
|
+
></path>
|
|
17
|
+
</defs>
|
|
18
|
+
<g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
|
|
19
|
+
<g transform="translate(-407 -563)">
|
|
20
|
+
<g transform="translate(408 562)">
|
|
21
|
+
<g transform="translate(0 2)">
|
|
22
|
+
<g transform="translate(3.94 3.858)">
|
|
23
|
+
<mask fill="#fff">
|
|
24
|
+
<use xlinkHref="#path-1"></use>
|
|
25
|
+
</mask>
|
|
26
|
+
<use className="fill" xlinkHref="#path-1"></use>
|
|
27
|
+
</g>
|
|
28
|
+
<circle className="stroke" cx="8.155" cy="8.072" r="8"></circle>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</g>
|
|
32
|
+
</g>
|
|
33
|
+
</svg>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default IconAdd;
|
|
@@ -17,6 +17,7 @@ import CheckmarkIcon from "./CheckmarkIcon";
|
|
|
17
17
|
import BankIcon from "./BankIcon";
|
|
18
18
|
import GenericCard from "./GenericCard";
|
|
19
19
|
import PaymentIcon from "./PaymentIcon";
|
|
20
|
+
import IconAdd from "./IconAdd";
|
|
20
21
|
|
|
21
22
|
export {
|
|
22
23
|
AccountsIcon,
|
|
@@ -37,5 +38,6 @@ export {
|
|
|
37
38
|
CheckmarkIcon,
|
|
38
39
|
BankIcon,
|
|
39
40
|
GenericCard,
|
|
40
|
-
PaymentIcon
|
|
41
|
+
PaymentIcon,
|
|
42
|
+
IconAdd
|
|
41
43
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { ThemeContext } from "styled-components";
|
|
1
|
+
import React from "react";
|
|
3
2
|
import { Link } from "react-router-dom";
|
|
4
3
|
import Text from "../text";
|
|
5
|
-
import { Box, Switcher, Center, Cluster } from "../layouts";
|
|
4
|
+
import { Box, Switcher, Center, Cluster, Cover } from "../layouts";
|
|
6
5
|
import { fallbackValues } from "./Placeholder.theme";
|
|
7
6
|
import { themeComponent } from "../../../util/themeUtils";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import {
|
|
8
|
+
STORM_GREY,
|
|
9
|
+
GRECIAN_GREY,
|
|
10
|
+
CHARADE_GREY
|
|
11
|
+
} from "../../../constants/colors";
|
|
12
|
+
import { AccountsAddIcon, PropertiesAddIcon, IconAdd } from "../icons";
|
|
11
13
|
import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
|
|
12
|
-
import withWindowSize from "../../withWindowSize";
|
|
13
14
|
|
|
14
15
|
const PlaceholderContentWrapper = ({
|
|
15
16
|
isLink,
|
|
@@ -40,30 +41,26 @@ const Placeholder = ({
|
|
|
40
41
|
text,
|
|
41
42
|
action,
|
|
42
43
|
visible = true,
|
|
43
|
-
iconID,
|
|
44
44
|
isLink = false,
|
|
45
45
|
destination,
|
|
46
46
|
variant,
|
|
47
47
|
largeIcon,
|
|
48
48
|
themeValues,
|
|
49
49
|
dataQa
|
|
50
|
-
}) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
minHeight={themeValues.height}
|
|
65
|
-
hiddenStyles={!visible}
|
|
66
|
-
extraStyles={`
|
|
50
|
+
}) => (
|
|
51
|
+
<PlaceholderContentWrapper
|
|
52
|
+
isLink={isLink}
|
|
53
|
+
action={action}
|
|
54
|
+
destination={destination}
|
|
55
|
+
dataQa={dataQa}
|
|
56
|
+
>
|
|
57
|
+
<Box
|
|
58
|
+
padding="0"
|
|
59
|
+
borderRadius="4px"
|
|
60
|
+
border="none"
|
|
61
|
+
minHeight={themeValues.height}
|
|
62
|
+
hiddenStyles={!visible}
|
|
63
|
+
extraStyles={`
|
|
67
64
|
background: linear-gradient(
|
|
68
65
|
to right,
|
|
69
66
|
${STORM_GREY} 40%,
|
|
@@ -78,45 +75,65 @@ const Placeholder = ({
|
|
|
78
75
|
display: flex;
|
|
79
76
|
justify-content: center;
|
|
80
77
|
align-items:center;`}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
hoverStyles={`background-color: ${GRECIAN_GREY};`}
|
|
79
|
+
>
|
|
80
|
+
<Center maxWidth="300px">
|
|
81
|
+
<Box padding="0px 0px 0px 0px">
|
|
82
|
+
<Cluster justify="center" align="center" minHeight="100%">
|
|
83
|
+
<Switcher maxChildren={2} childGap="0">
|
|
84
|
+
{variant === "large" && <div></div>}
|
|
85
|
+
<Box
|
|
86
|
+
padding="0"
|
|
87
|
+
extraStyles={`.fill {
|
|
88
|
+
fill: ${CHARADE_GREY};
|
|
89
|
+
} .stroke {
|
|
90
|
+
stroke: ${CHARADE_GREY};
|
|
91
|
+
}`}
|
|
92
|
+
>
|
|
93
|
+
{variant === "large" ? (
|
|
94
|
+
<Center intrinsic>
|
|
95
|
+
{largeIcon === "accounts" ? (
|
|
91
96
|
<AccountsAddIcon />
|
|
92
97
|
) : (
|
|
93
98
|
<PropertiesAddIcon />
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
99
|
+
)}
|
|
100
|
+
<Text
|
|
101
|
+
variant="pS"
|
|
102
|
+
color={themeValues.color}
|
|
103
|
+
weight={FONT_WEIGHT_REGULAR}
|
|
104
|
+
extraStyles={`text-align: center;`}
|
|
105
|
+
>
|
|
106
|
+
{text}
|
|
107
|
+
</Text>
|
|
108
|
+
</Center>
|
|
109
|
+
) : (
|
|
110
|
+
<Cover singleChild minHeight="100%">
|
|
111
|
+
<Cluster justify="center" align="center">
|
|
112
|
+
<IconAdd />
|
|
113
|
+
<Center intrinsic>
|
|
114
|
+
<Text
|
|
115
|
+
variant="pS"
|
|
116
|
+
color={themeValues.color}
|
|
117
|
+
weight={FONT_WEIGHT_REGULAR}
|
|
118
|
+
extraStyles={`padding: 0 0 0 8px; text-align: center;`}
|
|
119
|
+
>
|
|
120
|
+
{text}
|
|
121
|
+
</Text>
|
|
122
|
+
</Center>
|
|
123
|
+
</Cluster>
|
|
124
|
+
</Cover>
|
|
125
|
+
)}
|
|
126
|
+
</Box>
|
|
127
|
+
</Switcher>
|
|
128
|
+
</Cluster>
|
|
129
|
+
</Box>
|
|
130
|
+
</Center>
|
|
131
|
+
</Box>
|
|
132
|
+
</PlaceholderContentWrapper>
|
|
133
|
+
);
|
|
134
|
+
|
|
118
135
|
export default themeComponent(
|
|
119
|
-
|
|
136
|
+
Placeholder,
|
|
120
137
|
"Placeholder",
|
|
121
138
|
fallbackValues,
|
|
122
139
|
"default"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IconAdd } from "./IconAdd";
|
|
2
1
|
import { IconWarn } from "./IconWarn";
|
|
3
2
|
import { IconCheck } from "./IconCheck";
|
|
4
3
|
import { IconCheckEmail } from "./IconCheckEmail";
|
|
@@ -24,7 +23,6 @@ const AlertIcons = {
|
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export {
|
|
27
|
-
IconAdd,
|
|
28
26
|
IconWarn,
|
|
29
27
|
IconCheck,
|
|
30
28
|
IconCheckEmail,
|