@uncinc/uncinc-react-kitchen-sink 2.10.0 → 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.
- package/dist/components/Form/Checkbox/index.d.ts +25 -0
- package/dist/components/Form/Checkbox/index.js +21 -4
- package/dist/components/Form/DatePickerRange/index.js +2 -0
- package/dist/components/Form/RadioButtons/index.js +1 -1
- package/dist/components/Icon/style.scss +11 -29
- package/dist/components/WysiwygField/index.d.ts +2 -3
- package/dist/components/WysiwygField/index.js +2 -5
- package/package.json +1 -1
|
@@ -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);
|
|
@@ -92,6 +92,8 @@ var DatePickerRange = function DatePickerRange(props) {
|
|
|
92
92
|
touched: isTouched,
|
|
93
93
|
error: error,
|
|
94
94
|
displayRequiredIndicator: displayRequiredIndicator,
|
|
95
|
+
errorId: errorId,
|
|
96
|
+
descriptionId: descriptionId,
|
|
95
97
|
includeFieldSet: includeFieldSet
|
|
96
98
|
}, /*#__PURE__*/React.createElement(Field, {
|
|
97
99
|
name: fieldName,
|
|
@@ -106,7 +106,7 @@ var RadioButtons = function RadioButtons(props) {
|
|
|
106
106
|
displayRequiredIndicator = _useExtendedFormikCon.displayRequiredIndicator;
|
|
107
107
|
var isTouched = touched[fieldName];
|
|
108
108
|
var error = errors[fieldName];
|
|
109
|
-
var errorId = "".concat(props.fieldName, "--
|
|
109
|
+
var errorId = "".concat(props.fieldName, "--error");
|
|
110
110
|
var descriptionId = "".concat(props.fieldName, "--description");
|
|
111
111
|
var handleValidation = function handleValidation(value) {
|
|
112
112
|
if (validation) {
|
|
@@ -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;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export default WysiwygField;
|
|
2
|
-
declare function WysiwygField({ html,
|
|
2
|
+
declare function WysiwygField({ html, customElementHandler, className, ...props }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
html: any;
|
|
5
|
-
id?: string | undefined;
|
|
6
5
|
customElementHandler?: (() => void) | undefined;
|
|
7
6
|
className?: string | undefined;
|
|
8
7
|
}): React.JSX.Element;
|
|
@@ -18,7 +17,7 @@ declare namespace WysiwygField {
|
|
|
18
17
|
export { customElementHandler_1 as customElementHandler };
|
|
19
18
|
let className_1: string;
|
|
20
19
|
export { className_1 as className };
|
|
21
|
-
let id_1:
|
|
20
|
+
let id_1: null;
|
|
22
21
|
export { id_1 as id };
|
|
23
22
|
}
|
|
24
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["html", "
|
|
1
|
+
var _excluded = ["html", "customElementHandler", "className"];
|
|
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; }
|
|
@@ -9,8 +9,6 @@ import c from 'classnames';
|
|
|
9
9
|
import Button from '../Button';
|
|
10
10
|
var WysiwygField = function WysiwygField(_ref) {
|
|
11
11
|
var html = _ref.html,
|
|
12
|
-
_ref$id = _ref.id,
|
|
13
|
-
id = _ref$id === void 0 ? '' : _ref$id,
|
|
14
12
|
_ref$customElementHan = _ref.customElementHandler,
|
|
15
13
|
customElementHandler = _ref$customElementHan === void 0 ? function () {} : _ref$customElementHan,
|
|
16
14
|
_ref$className = _ref.className,
|
|
@@ -48,7 +46,6 @@ var WysiwygField = function WysiwygField(_ref) {
|
|
|
48
46
|
}
|
|
49
47
|
});
|
|
50
48
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
51
|
-
id: id,
|
|
52
49
|
className: classes
|
|
53
50
|
}, props), parsedHtml);
|
|
54
51
|
};
|
|
@@ -61,6 +58,6 @@ WysiwygField.propTypes = {
|
|
|
61
58
|
WysiwygField.defaultProps = {
|
|
62
59
|
customElementHandler: function customElementHandler() {},
|
|
63
60
|
className: '',
|
|
64
|
-
id:
|
|
61
|
+
id: null
|
|
65
62
|
};
|
|
66
63
|
export default WysiwygField;
|