@thecb/components 6.0.0-beta.27 → 6.0.0-beta.28
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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
1
|
+
import React, { Fragment, forwardRef } from "react";
|
|
2
2
|
import { BoxWrapper } from "./Box.styled";
|
|
3
3
|
import { safeChildren, screenReaderOnlyStyle } from "../../../util/general";
|
|
4
4
|
|
|
@@ -10,80 +10,84 @@ import { safeChildren, screenReaderOnlyStyle } from "../../../util/general";
|
|
|
10
10
|
completely off screen (only for users of screen readers)
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const Box = (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
13
|
+
const Box = forwardRef(
|
|
14
|
+
(
|
|
15
|
+
{
|
|
16
|
+
padding = "16px",
|
|
17
|
+
borderSize = "0px",
|
|
18
|
+
borderColor = "transparent",
|
|
19
|
+
borderRadius,
|
|
20
|
+
boxShadow = "none",
|
|
21
|
+
background,
|
|
22
|
+
color,
|
|
23
|
+
minHeight,
|
|
24
|
+
width,
|
|
25
|
+
minWidth,
|
|
26
|
+
maxWidth,
|
|
27
|
+
borderWidthOverride,
|
|
28
|
+
border,
|
|
29
|
+
textAlign,
|
|
30
|
+
hoverStyles,
|
|
31
|
+
activeStyles,
|
|
32
|
+
disabledStyles,
|
|
33
|
+
variant,
|
|
34
|
+
as,
|
|
35
|
+
onClick,
|
|
36
|
+
onKeyDown,
|
|
37
|
+
onMouseEnter,
|
|
38
|
+
onMouseLeave,
|
|
39
|
+
onFocus,
|
|
40
|
+
onBlur,
|
|
41
|
+
onTouchEnd,
|
|
42
|
+
theme,
|
|
43
|
+
hiddenStyles,
|
|
44
|
+
extraStyles,
|
|
45
|
+
srOnly = false,
|
|
46
|
+
dataQa,
|
|
47
|
+
children,
|
|
48
|
+
...rest
|
|
49
|
+
},
|
|
50
|
+
ref
|
|
51
|
+
) => (
|
|
52
|
+
<BoxWrapper
|
|
53
|
+
padding={padding}
|
|
54
|
+
borderSize={borderSize}
|
|
55
|
+
borderColor={borderColor}
|
|
56
|
+
boxShadow={boxShadow}
|
|
57
|
+
color={color}
|
|
58
|
+
minHeight={minHeight}
|
|
59
|
+
width={width}
|
|
60
|
+
minWidth={minWidth}
|
|
61
|
+
maxWidth={maxWidth}
|
|
62
|
+
background={background}
|
|
63
|
+
borderRadius={borderRadius}
|
|
64
|
+
borderWidthOverride={borderWidthOverride}
|
|
65
|
+
border={border}
|
|
66
|
+
hoverStyles={hoverStyles}
|
|
67
|
+
activeStyles={activeStyles}
|
|
68
|
+
disabledStyles={disabledStyles}
|
|
69
|
+
variant={variant}
|
|
70
|
+
as={as}
|
|
71
|
+
onClick={onClick}
|
|
72
|
+
hiddenStyles={hiddenStyles}
|
|
73
|
+
onKeyDown={onKeyDown}
|
|
74
|
+
extraStyles={
|
|
75
|
+
srOnly ? `${screenReaderOnlyStyle}${extraStyles}` : extraStyles
|
|
76
|
+
}
|
|
77
|
+
theme={theme}
|
|
78
|
+
textAlign={textAlign}
|
|
79
|
+
data-qa={dataQa}
|
|
80
|
+
onMouseEnter={onMouseEnter}
|
|
81
|
+
onMouseLeave={onMouseLeave}
|
|
82
|
+
onFocus={onFocus}
|
|
83
|
+
onBlur={onBlur}
|
|
84
|
+
onTouchEnd={onTouchEnd}
|
|
85
|
+
ref={ref}
|
|
86
|
+
{...rest}
|
|
87
|
+
>
|
|
88
|
+
{children && safeChildren(children, <Fragment />)}
|
|
89
|
+
</BoxWrapper>
|
|
90
|
+
)
|
|
87
91
|
);
|
|
88
92
|
|
|
89
93
|
export default Box;
|
|
@@ -29,16 +29,8 @@ export const BoxWrapper = styled(
|
|
|
29
29
|
hiddenStyles,
|
|
30
30
|
ariaControls,
|
|
31
31
|
ariaLabel,
|
|
32
|
-
ref,
|
|
33
32
|
...props
|
|
34
|
-
}) =>
|
|
35
|
-
<div
|
|
36
|
-
aria-controls={ariaControls}
|
|
37
|
-
aria-label={ariaLabel}
|
|
38
|
-
ref={ref}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
)
|
|
33
|
+
}) => <div aria-controls={ariaControls} aria-label={ariaLabel} {...props} />
|
|
42
34
|
)`
|
|
43
35
|
position: relative;
|
|
44
36
|
box-sizing: border-box;
|