@uncinc/uncinc-react-kitchen-sink 2.8.10 → 2.8.12
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function Button({ href, dispatch, className, children, primary, inverted, language, enableLoader, loading, htmlType, target, ...props }: {
|
|
1
|
+
export function Button({ href, dispatch, className, children, primary, inverted, language, enableLoader, loading, htmlType, target, forwardRef, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
href: any;
|
|
4
4
|
dispatch: any;
|
|
@@ -11,6 +11,7 @@ export function Button({ href, dispatch, className, children, primary, inverted,
|
|
|
11
11
|
loading: any;
|
|
12
12
|
htmlType: any;
|
|
13
13
|
target: any;
|
|
14
|
+
forwardRef: any;
|
|
14
15
|
}): React.JSX.Element;
|
|
15
16
|
export namespace Button {
|
|
16
17
|
namespace defaultProps {
|
|
@@ -21,6 +22,7 @@ export namespace Button {
|
|
|
21
22
|
let enableLoader: boolean;
|
|
22
23
|
let htmlType: string;
|
|
23
24
|
let target: string;
|
|
25
|
+
let forwardRef: null;
|
|
24
26
|
}
|
|
25
27
|
namespace propTypes {
|
|
26
28
|
let href_1: PropTypes.Requireable<string>;
|
|
@@ -37,6 +39,10 @@ export namespace Button {
|
|
|
37
39
|
export { htmlType_1 as htmlType };
|
|
38
40
|
let target_1: PropTypes.Requireable<string>;
|
|
39
41
|
export { target_1 as target };
|
|
42
|
+
let forwardRef_1: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
43
|
+
current: PropTypes.Requireable<Element>;
|
|
44
|
+
}> | null | undefined>>;
|
|
45
|
+
export { forwardRef_1 as forwardRef };
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
declare const _default: (props: any) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["href", "dispatch", "className", "children", "primary", "inverted", "language", "enableLoader", "loading", "htmlType", "target"];
|
|
1
|
+
var _excluded = ["href", "dispatch", "className", "children", "primary", "inverted", "language", "enableLoader", "loading", "htmlType", "target", "forwardRef"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -22,6 +22,7 @@ export var Button = function Button(_ref) {
|
|
|
22
22
|
loading = _ref.loading,
|
|
23
23
|
htmlType = _ref.htmlType,
|
|
24
24
|
target = _ref.target,
|
|
25
|
+
forwardRef = _ref.forwardRef,
|
|
25
26
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
27
|
var classes = classNames('Button', className, {
|
|
27
28
|
'Button--primary': primary,
|
|
@@ -48,6 +49,7 @@ export var Button = function Button(_ref) {
|
|
|
48
49
|
className: classes,
|
|
49
50
|
href: href
|
|
50
51
|
}, props, {
|
|
52
|
+
ref: forwardRef,
|
|
51
53
|
onClick: onClick
|
|
52
54
|
}), children)
|
|
53
55
|
);
|
|
@@ -58,12 +60,14 @@ export var Button = function Button(_ref) {
|
|
|
58
60
|
target: "_blank",
|
|
59
61
|
rel: "noreferrer noopener"
|
|
60
62
|
}, props, {
|
|
63
|
+
ref: forwardRef,
|
|
61
64
|
onClick: onClick
|
|
62
65
|
}), children) : /*#__PURE__*/React.createElement(Link, _extends({
|
|
63
66
|
to: href,
|
|
64
67
|
className: classes,
|
|
65
68
|
target: target
|
|
66
69
|
}, props, {
|
|
70
|
+
ref: forwardRef,
|
|
67
71
|
onClick: onClick
|
|
68
72
|
}), children);
|
|
69
73
|
};
|
|
@@ -74,7 +78,8 @@ Button.defaultProps = {
|
|
|
74
78
|
href: null,
|
|
75
79
|
enableLoader: false,
|
|
76
80
|
htmlType: 'button',
|
|
77
|
-
target: '_self'
|
|
81
|
+
target: '_self',
|
|
82
|
+
forwardRef: null
|
|
78
83
|
};
|
|
79
84
|
Button.propTypes = {
|
|
80
85
|
href: PropTypes.string,
|
|
@@ -83,6 +88,9 @@ Button.propTypes = {
|
|
|
83
88
|
inverted: PropTypes.bool,
|
|
84
89
|
enableLoader: PropTypes.bool,
|
|
85
90
|
htmlType: PropTypes.oneOf(['button', 'submit', 'reset']),
|
|
86
|
-
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])
|
|
91
|
+
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
92
|
+
forwardRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
93
|
+
current: PropTypes.instanceOf(Element)
|
|
94
|
+
})])
|
|
87
95
|
};
|
|
88
96
|
export default withMapping(Button);
|
|
@@ -6,16 +6,31 @@
|
|
|
6
6
|
flex-wrap: nowrap;
|
|
7
7
|
align-items: center;
|
|
8
8
|
|
|
9
|
+
&__link,
|
|
10
|
+
&__link:hover,
|
|
11
|
+
&__link:active,
|
|
12
|
+
&__link:focus {
|
|
13
|
+
text-decoration: inherit;
|
|
14
|
+
color: inherit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__button,
|
|
18
|
+
&__delete-button {
|
|
19
|
+
padding: 0;
|
|
20
|
+
border: 0;
|
|
21
|
+
background-color: transparent;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
|
|
9
25
|
&__delete-button {
|
|
10
26
|
// Expanding the clickable area by adding padding,
|
|
11
27
|
// and compensating this, using negative margin.
|
|
12
28
|
margin: -10px;
|
|
13
|
-
border: 0;
|
|
14
29
|
padding: 10px;
|
|
15
|
-
background-color: transparent;
|
|
16
|
-
cursor: pointer;
|
|
17
30
|
}
|
|
18
31
|
|
|
32
|
+
&--stretch-clickable-area .Tag__link,
|
|
33
|
+
&--stretch-clickable-area .Tag__button,
|
|
19
34
|
&--stretch-clickable-area .Tag__delete-button {
|
|
20
35
|
margin: 0;
|
|
21
36
|
padding: 0;
|