@thecb/components 4.0.24 → 4.1.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 -1
- package/dist/index.cjs.js +3907 -3876
- package/package.json +1 -1
- package/src/components/atoms/box-with-shadow/BoxWithShadow.js +55 -0
- package/src/components/atoms/box-with-shadow/BoxWithShadow.theme.js +7 -0
- package/src/components/atoms/box-with-shadow/index.js +3 -0
- package/src/components/atoms/index.js +1 -0
- package/src/constants/colors.js +2 -1
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { rgba } from "polished";
|
|
3
|
+
import { fallbackValues } from "./BoxWithShadow.theme";
|
|
4
|
+
import Box from "../layouts/Box";
|
|
5
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
6
|
+
import { BLACK } from "../../../constants/colors";
|
|
7
|
+
|
|
8
|
+
const BoxWithShadow = ({ variant, themeValues, children, ...props }) => {
|
|
9
|
+
const shadowRegistry = {
|
|
10
|
+
baseStandard: `0px 3px 7px 2px ${rgba(BLACK, 0.1)}, 0px 1px 2px 1px ${rgba(
|
|
11
|
+
BLACK,
|
|
12
|
+
0.1
|
|
13
|
+
)};`,
|
|
14
|
+
baseHover: `0px 1px 7px 0px ${rgba(BLACK, 0.3)}, 0px 1px 4px 0px ${rgba(
|
|
15
|
+
BLACK,
|
|
16
|
+
0.2
|
|
17
|
+
)}, 0px 7px 12px 0px ${rgba(BLACK, 0.2)};`,
|
|
18
|
+
baseClick: `0px 4px 7px 0px ${rgba(BLACK, 0.3)}, 0px 1px 4px 0px ${rgba(
|
|
19
|
+
BLACK,
|
|
20
|
+
0.2
|
|
21
|
+
)}, 0px 7px 12px 0px ${rgba(BLACK, 0.2)};`,
|
|
22
|
+
insetStandard: `0px 1px 4px 2px ${rgba(BLACK, 0.1)}, 0px 2px 1px 0px ${rgba(
|
|
23
|
+
BLACK,
|
|
24
|
+
0.15
|
|
25
|
+
)};`,
|
|
26
|
+
insetHover: `0px 1px 4px 0px ${rgba(BLACK, 0.3)}, 0px 1px 2px 2px ${rgba(
|
|
27
|
+
BLACK,
|
|
28
|
+
0.2
|
|
29
|
+
)}, 0px 4px 8px 0px ${rgba(BLACK, 0.2)};`,
|
|
30
|
+
insetClick: `0px 4px 4px 0px ${rgba(BLACK, 0.3)}, 0px 1px 2px 2px ${rgba(
|
|
31
|
+
BLACK,
|
|
32
|
+
0.2
|
|
33
|
+
)}, 0px 4px 8px 0px ${rgba(BLACK, 0.2)};`,
|
|
34
|
+
linkShadowFocus: `0px 0px 5px 2px ${rgba(
|
|
35
|
+
themeValues.linkColor,
|
|
36
|
+
0.3
|
|
37
|
+
)}, 0px 1px 2px 0px ${rgba(
|
|
38
|
+
themeValues.linkColor,
|
|
39
|
+
0.3
|
|
40
|
+
)}, 0px 4px 8px 0px ${rgba(themeValues.linkColor, 0.2)};`,
|
|
41
|
+
overlayShadow: `0px 1px 8px -1px ${rgba(
|
|
42
|
+
BLACK,
|
|
43
|
+
0.3
|
|
44
|
+
)}, 0px 1px 4px 0px ${rgba(BLACK, 0.2)}, 0px 7px 32px 0px ${rgba(
|
|
45
|
+
BLACK,
|
|
46
|
+
0.2
|
|
47
|
+
)};`
|
|
48
|
+
};
|
|
49
|
+
return (
|
|
50
|
+
<Box boxShadow={shadowRegistry[variant]} {...props}>
|
|
51
|
+
{children}
|
|
52
|
+
</Box>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export default themeComponent(BoxWithShadow, "BoxWithShadow", fallbackValues);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as AddObligation } from "./add-obligation";
|
|
2
2
|
export { default as Alert } from "./alert";
|
|
3
3
|
export { default as AmountCallout } from "./amount-callout";
|
|
4
|
+
export { default as BoxWithShadow } from "./box-with-shadow";
|
|
4
5
|
export { default as Breadcrumb } from "./breadcrumb";
|
|
5
6
|
export { default as ButtonWithAction } from "./button-with-action";
|
|
6
7
|
export { default as ButtonWithLink } from "./button-with-link";
|
package/src/constants/colors.js
CHANGED
|
@@ -4,7 +4,7 @@ Need to add a new color? Visit http://chir.ag/projects/name-that-color to genera
|
|
|
4
4
|
Name already taken? If you can't use the existing color, then use thesaurus.com to pick a similar name
|
|
5
5
|
to the one generated by name-that-color.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
const BLACK = "#000000";
|
|
8
8
|
const TRANSPARENT = "transparent";
|
|
9
9
|
// WHITE
|
|
10
10
|
const WHITE = "#FFFFFF";
|
|
@@ -110,6 +110,7 @@ const ALERT_COLORS = {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
export {
|
|
113
|
+
BLACK,
|
|
113
114
|
TRANSPARENT,
|
|
114
115
|
WHITE,
|
|
115
116
|
SOLITUDE_WHITE,
|