@uncinc/uncinc-react-kitchen-sink 2.10.1 → 2.10.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.
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
export function Checkbox(props: any): React.JSX.Element;
|
|
2
2
|
export namespace Checkbox {
|
|
3
3
|
namespace defaultProps {
|
|
4
|
+
let required: boolean;
|
|
5
|
+
let description: undefined;
|
|
6
|
+
let validation: undefined;
|
|
4
7
|
function onChange(): void;
|
|
8
|
+
let className: undefined;
|
|
9
|
+
let wrapperClassName: undefined;
|
|
10
|
+
let disabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
namespace propTypes {
|
|
13
|
+
export let title: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
14
|
+
let required_1: PropTypes.Requireable<boolean>;
|
|
15
|
+
export { required_1 as required };
|
|
16
|
+
let description_1: PropTypes.Requireable<string>;
|
|
17
|
+
export { description_1 as description };
|
|
18
|
+
export let fieldName: PropTypes.Validator<string>;
|
|
19
|
+
let validation_1: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
+
export { validation_1 as validation };
|
|
21
|
+
let onChange_1: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
export { onChange_1 as onChange };
|
|
23
|
+
let className_1: PropTypes.Requireable<string>;
|
|
24
|
+
export { className_1 as className };
|
|
25
|
+
let wrapperClassName_1: PropTypes.Requireable<string>;
|
|
26
|
+
export { wrapperClassName_1 as wrapperClassName };
|
|
27
|
+
let disabled_1: PropTypes.Requireable<boolean>;
|
|
28
|
+
export { disabled_1 as disabled };
|
|
5
29
|
}
|
|
6
30
|
}
|
|
7
31
|
declare const _default: (props: any) => React.JSX.Element;
|
|
8
32
|
export default _default;
|
|
9
33
|
import React from 'react';
|
|
34
|
+
import PropTypes from 'prop-types';
|
|
@@ -2,6 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Field } from 'formik';
|
|
4
4
|
import c from 'classnames';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { useTranslation } from 'react-i18next';
|
|
6
7
|
import ReactHtmlParser from 'react-html-parser';
|
|
7
8
|
import GenericFormElement from '../GenericFormElement';
|
|
@@ -17,8 +18,7 @@ export var Checkbox = function Checkbox(props) {
|
|
|
17
18
|
_onChange = props.onChange,
|
|
18
19
|
className = props.className,
|
|
19
20
|
wrapperClassName = props.wrapperClassName,
|
|
20
|
-
|
|
21
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
21
|
+
disabled = props.disabled;
|
|
22
22
|
var _useExtendedFormikCon = useExtendedFormikContext(),
|
|
23
23
|
values = _useExtendedFormikCon.values,
|
|
24
24
|
errors = _useExtendedFormikCon.errors,
|
|
@@ -81,10 +81,27 @@ export var Checkbox = function Checkbox(props) {
|
|
|
81
81
|
required: required,
|
|
82
82
|
"aria-describedby": "".concat(errorId, " ").concat(descriptionId),
|
|
83
83
|
"aria-invalid": Boolean(error)
|
|
84
|
-
})), ReactHtmlParser(title));
|
|
84
|
+
})), typeof title === 'string' ? ReactHtmlParser(title) : title);
|
|
85
85
|
}));
|
|
86
86
|
};
|
|
87
87
|
Checkbox.defaultProps = {
|
|
88
|
-
|
|
88
|
+
required: false,
|
|
89
|
+
description: undefined,
|
|
90
|
+
validation: undefined,
|
|
91
|
+
onChange: function onChange() {},
|
|
92
|
+
className: undefined,
|
|
93
|
+
wrapperClassName: undefined,
|
|
94
|
+
disabled: false
|
|
95
|
+
};
|
|
96
|
+
Checkbox.propTypes = {
|
|
97
|
+
title: PropTypes.node.isRequired,
|
|
98
|
+
required: PropTypes.bool,
|
|
99
|
+
description: PropTypes.string,
|
|
100
|
+
fieldName: PropTypes.string.isRequired,
|
|
101
|
+
validation: PropTypes.func,
|
|
102
|
+
onChange: PropTypes.func,
|
|
103
|
+
className: PropTypes.string,
|
|
104
|
+
wrapperClassName: PropTypes.string,
|
|
105
|
+
disabled: PropTypes.bool
|
|
89
106
|
};
|
|
90
107
|
export default withMapping(Checkbox);
|
|
@@ -24,34 +24,12 @@ $material-icon-styles: (
|
|
|
24
24
|
two-tone
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
@mixin icon-color($color: #000000
|
|
28
|
-
|
|
29
|
-
$g: calc(color.green($color) / 255);
|
|
30
|
-
$b: calc(color.blue($color) / 255);
|
|
31
|
-
$a: $opacity;
|
|
32
|
-
|
|
33
|
-
// grayscale fallback if SVG from data url is not supported
|
|
34
|
-
$lightness: color.lightness($color);
|
|
35
|
-
filter: saturate(0%) brightness(0%) invert($lightness) opacity($opacity);
|
|
36
|
-
|
|
37
|
-
// color filter
|
|
38
|
-
$svg-filter-id: "recolor";
|
|
39
|
-
filter: url('data:image/svg+xml;utf8,\
|
|
40
|
-
<svg xmlns="http://www.w3.org/2000/svg">\
|
|
41
|
-
<filter id="#{$svg-filter-id}" color-interpolation-filters="sRGB">\
|
|
42
|
-
<feColorMatrix type="matrix" values="\
|
|
43
|
-
0 0 0 0 #{$r}\
|
|
44
|
-
0 0 0 0 #{$g}\
|
|
45
|
-
0 0 0 0 #{$b}\
|
|
46
|
-
0 0 0 #{$a} 0\
|
|
47
|
-
"/>\
|
|
48
|
-
</filter>\
|
|
49
|
-
</svg>\
|
|
50
|
-
##{$svg-filter-id}');
|
|
27
|
+
@mixin icon-color($color: #000000) {
|
|
28
|
+
background-color: $color;
|
|
51
29
|
}
|
|
52
30
|
|
|
53
31
|
@mixin unset-icon-color() {
|
|
54
|
-
|
|
32
|
+
background-color: none;
|
|
55
33
|
}
|
|
56
34
|
|
|
57
35
|
@mixin generateMaterialIconClasses() {
|
|
@@ -62,7 +40,9 @@ $material-icon-styles: (
|
|
|
62
40
|
$name: list.nth($material-icon-names, $nameIndex);
|
|
63
41
|
|
|
64
42
|
.Icon-#{$style}-#{$name} {
|
|
65
|
-
|
|
43
|
+
mask-image: url('~@material-design-icons/svg/#{$style}/#{$name}.svg');
|
|
44
|
+
mask-repeat: no-repeat;
|
|
45
|
+
mask-size: contain;
|
|
66
46
|
font-size: 100%;
|
|
67
47
|
vertical-align: middle;
|
|
68
48
|
text-indent: -9999px;
|
|
@@ -80,7 +60,9 @@ $material-icon-styles: (
|
|
|
80
60
|
$name: list.nth($custom-icon-names, $nameIndex);
|
|
81
61
|
|
|
82
62
|
.Icon-#{$name} {
|
|
83
|
-
|
|
63
|
+
mask-image: url('#{$custom-icon-path}/#{$name}.svg');
|
|
64
|
+
mask-repeat: no-repeat;
|
|
65
|
+
mask-size: contain;
|
|
84
66
|
font-size: 100%;
|
|
85
67
|
vertical-align: middle;
|
|
86
68
|
text-indent: -9999px;
|
|
@@ -132,9 +114,9 @@ $material-icon-styles: (
|
|
|
132
114
|
}
|
|
133
115
|
|
|
134
116
|
@if not $custom {
|
|
135
|
-
|
|
117
|
+
mask-image: url('~@material-design-icons/svg/#{$style}/#{$icon-name}.svg');
|
|
136
118
|
} @else {
|
|
137
|
-
|
|
119
|
+
mask-image: url('#{$custom-icon-path}/#{$icon-name}.svg');
|
|
138
120
|
}
|
|
139
121
|
|
|
140
122
|
display: block;
|