@helpdice/ui 1.4.9 → 1.5.1
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/CircularProgress/index.js +6 -6
- package/dist/Placeholder/index.js +41 -41
- package/dist/auto-complete/index.js +60 -60
- package/dist/avatar/index.js +28 -28
- package/dist/badge/index.js +27 -27
- package/dist/breadcrumbs/index.js +34 -34
- package/dist/button/button.compact.d.ts +2 -2
- package/dist/button/index.js +46 -45
- package/dist/button-dropdown/index.js +34 -34
- package/dist/button-group/index.js +25 -25
- package/dist/capacity/index.js +26 -26
- package/dist/card/index.js +44 -44
- package/dist/checkbox/index.js +30 -30
- package/dist/code/index.js +27 -27
- package/dist/col/index.js +8 -8
- package/dist/collapse/index.js +30 -30
- package/dist/css-baseline/index.js +6 -6
- package/dist/description/index.js +26 -26
- package/dist/display/index.js +26 -26
- package/dist/divider/index.js +26 -26
- package/dist/dot/index.js +25 -25
- package/dist/drawer/index.js +53 -53
- package/dist/fieldset/index.js +33 -33
- package/dist/form/FormWrapper.d.ts +7 -7
- package/dist/form/connect.d.ts +1 -0
- package/dist/grid/index.js +33 -33
- package/dist/html-renderer/index.d.ts +6 -0
- package/dist/image/index.js +37 -37
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1899 -547
- package/dist/input/index.js +40 -40
- package/dist/keyboard/index.js +28 -28
- package/dist/link/index.js +29 -29
- package/dist/loading/index.js +26 -26
- package/dist/modal/index.js +75 -75
- package/dist/note/index.js +27 -27
- package/dist/page/index.js +30 -30
- package/dist/pagination/index.js +27 -27
- package/dist/popover/index.js +57 -57
- package/dist/progress/index.js +29 -29
- package/dist/radio/index.js +30 -30
- package/dist/rating/index.js +29 -29
- package/dist/row/index.js +11 -11
- package/dist/search-bar/index.js +1826 -61
- package/dist/select/index.js +60 -60
- package/dist/slider/index.js +35 -35
- package/dist/snippet/index.js +30 -30
- package/dist/spacer/index.js +25 -25
- package/dist/spinner/index.js +24 -24
- package/dist/table/index.js +224 -211
- package/dist/tabs/index.js +39 -39
- package/dist/tag/index.js +26 -26
- package/dist/text/index.js +40 -40
- package/dist/textarea/index.js +29 -29
- package/dist/themes/index.js +2 -2
- package/dist/toggle/index.js +27 -27
- package/dist/tooltip/index.js +42 -42
- package/dist/tree/index.js +23 -23
- package/dist/ui-provider/index.js +48 -48
- package/dist/use-all-themes/index.js +2 -2
- package/dist/use-body-scroll/index.js +5 -5
- package/dist/use-clipboard/index.js +1 -1
- package/dist/use-current-state/index.js +1 -1
- package/dist/use-input/index.js +1 -1
- package/dist/use-keyboard/index.js +5 -5
- package/dist/use-media-query/index.js +5 -5
- package/dist/use-modal/index.js +1 -1
- package/dist/use-scale/index.js +19 -19
- package/dist/use-tabs/index.js +1 -1
- package/dist/use-theme/index.js +2 -2
- package/dist/use-toasts/index.js +3 -3
- package/dist/user/index.js +36 -36
- package/esm/button/button.compact.d.ts +2 -2
- package/esm/button/button.compact.js +4 -2
- package/esm/form/FastField.js +1 -1
- package/esm/form/FormWrapper.d.ts +7 -7
- package/esm/form/FormWrapper.js +2 -2
- package/esm/form/connect.d.ts +1 -0
- package/esm/form/connect.js +2 -1
- package/esm/html-renderer/index.d.ts +6 -0
- package/esm/html-renderer/index.js +12 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/link/link.js +2 -0
- package/esm/login-with/LoginSocialAmazon/index.js +162 -134
- package/esm/login-with/index.js +2 -0
- package/esm/search-bar/components/index.js +4 -7
- package/esm/table/data-table.js +6 -4
- package/esm/table/table.js +12 -1
- package/package.json +5 -3
- package/esm/formik-native/src/index.js +0 -12
- package/esm/formik-native/test/blah.test.js +0 -5
package/dist/user/index.js
CHANGED
|
@@ -151,8 +151,8 @@ function _slicedToArray(r, e) {
|
|
|
151
151
|
function _toPrimitive(t, r) {
|
|
152
152
|
if ("object" != typeof t || !t) return t;
|
|
153
153
|
var e = t[Symbol.toPrimitive];
|
|
154
|
-
if (
|
|
155
|
-
var i = e.call(t, r
|
|
154
|
+
if (void 0 !== e) {
|
|
155
|
+
var i = e.call(t, r);
|
|
156
156
|
if ("object" != typeof i) return i;
|
|
157
157
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
158
158
|
}
|
|
@@ -175,7 +175,7 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
175
175
|
if (r) {
|
|
176
176
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
177
177
|
var t = {}.toString.call(r).slice(8, -1);
|
|
178
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) :
|
|
178
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
@@ -209,7 +209,7 @@ function requireIndex () {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
212
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
212
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
213
213
|
return Constructor;
|
|
214
214
|
}
|
|
215
215
|
var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
|
|
@@ -218,7 +218,7 @@ function requireIndex () {
|
|
|
218
218
|
};
|
|
219
219
|
var StyleSheet = /*#__PURE__*/ function() {
|
|
220
220
|
function StyleSheet(param) {
|
|
221
|
-
var ref = param ===
|
|
221
|
+
var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
|
|
222
222
|
invariant$1(isString(name), "`name` must be a string");
|
|
223
223
|
this._name = name;
|
|
224
224
|
this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
|
|
@@ -476,7 +476,7 @@ function requireIndex () {
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
function mapRulesToStyle(cssRules, options) {
|
|
479
|
-
if (options ===
|
|
479
|
+
if (options === void 0) options = {};
|
|
480
480
|
return cssRules.map(function(args) {
|
|
481
481
|
var id = args[0];
|
|
482
482
|
var css = args[1];
|
|
@@ -493,7 +493,7 @@ function requireIndex () {
|
|
|
493
493
|
}
|
|
494
494
|
var StyleSheetRegistry = /*#__PURE__*/ function() {
|
|
495
495
|
function StyleSheetRegistry(param) {
|
|
496
|
-
var ref = param ===
|
|
496
|
+
var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
|
|
497
497
|
this._sheet = styleSheet || new StyleSheet({
|
|
498
498
|
name: "styled-jsx",
|
|
499
499
|
optimizeForSpeed: optimizeForSpeed
|
|
@@ -1082,9 +1082,9 @@ var withScale = function withScale(Render) {
|
|
|
1082
1082
|
margin = props.margin,
|
|
1083
1083
|
padding = props.padding,
|
|
1084
1084
|
_props$unit = props.unit,
|
|
1085
|
-
unit = _props$unit ===
|
|
1085
|
+
unit = _props$unit === void 0 ? layout.unit : _props$unit,
|
|
1086
1086
|
_props$scale = props.scale,
|
|
1087
|
-
scale = _props$scale ===
|
|
1087
|
+
scale = _props$scale === void 0 ? 1 : _props$scale;
|
|
1088
1088
|
var makeScaleHandler = function makeScaleHandler(attrValue) {
|
|
1089
1089
|
return function (scale1x, defaultValue) {
|
|
1090
1090
|
// 0 means disable scale and the default value is 0
|
|
@@ -1105,20 +1105,20 @@ var withScale = function withScale(Render) {
|
|
|
1105
1105
|
var value = {
|
|
1106
1106
|
unit: unit,
|
|
1107
1107
|
SCALES: {
|
|
1108
|
-
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !==
|
|
1109
|
-
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !==
|
|
1110
|
-
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !==
|
|
1111
|
-
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !==
|
|
1112
|
-
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !==
|
|
1113
|
-
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !==
|
|
1114
|
-
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !==
|
|
1115
|
-
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !==
|
|
1116
|
-
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !==
|
|
1117
|
-
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !==
|
|
1118
|
-
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !==
|
|
1119
|
-
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !==
|
|
1120
|
-
width: makeScaleHandler(width !== null && width !==
|
|
1121
|
-
height: makeScaleHandler(height !== null && height !==
|
|
1108
|
+
pt: makeScaleHandler((_ref2 = (_ref3 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : pt) !== null && _ref3 !== void 0 ? _ref3 : py) !== null && _ref2 !== void 0 ? _ref2 : padding),
|
|
1109
|
+
pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== void 0 ? paddingRight : pr) !== null && _ref5 !== void 0 ? _ref5 : px) !== null && _ref4 !== void 0 ? _ref4 : padding),
|
|
1110
|
+
pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : pb) !== null && _ref7 !== void 0 ? _ref7 : py) !== null && _ref6 !== void 0 ? _ref6 : padding),
|
|
1111
|
+
pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : pl) !== null && _ref9 !== void 0 ? _ref9 : px) !== null && _ref8 !== void 0 ? _ref8 : padding),
|
|
1112
|
+
px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== void 0 ? px : paddingLeft) !== null && _ref13 !== void 0 ? _ref13 : paddingRight) !== null && _ref12 !== void 0 ? _ref12 : pl) !== null && _ref11 !== void 0 ? _ref11 : pr) !== null && _ref10 !== void 0 ? _ref10 : padding),
|
|
1113
|
+
py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== void 0 ? py : paddingTop) !== null && _ref17 !== void 0 ? _ref17 : paddingBottom) !== null && _ref16 !== void 0 ? _ref16 : pt) !== null && _ref15 !== void 0 ? _ref15 : pb) !== null && _ref14 !== void 0 ? _ref14 : padding),
|
|
1114
|
+
mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== void 0 ? marginTop : mt) !== null && _ref19 !== void 0 ? _ref19 : my) !== null && _ref18 !== void 0 ? _ref18 : margin),
|
|
1115
|
+
mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== void 0 ? marginRight : mr) !== null && _ref21 !== void 0 ? _ref21 : mx) !== null && _ref20 !== void 0 ? _ref20 : margin),
|
|
1116
|
+
mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : mb) !== null && _ref23 !== void 0 ? _ref23 : my) !== null && _ref22 !== void 0 ? _ref22 : margin),
|
|
1117
|
+
ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : ml) !== null && _ref25 !== void 0 ? _ref25 : mx) !== null && _ref24 !== void 0 ? _ref24 : margin),
|
|
1118
|
+
mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== void 0 ? mx : marginLeft) !== null && _ref29 !== void 0 ? _ref29 : marginRight) !== null && _ref28 !== void 0 ? _ref28 : ml) !== null && _ref27 !== void 0 ? _ref27 : mr) !== null && _ref26 !== void 0 ? _ref26 : margin),
|
|
1119
|
+
my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== void 0 ? my : marginTop) !== null && _ref33 !== void 0 ? _ref33 : marginBottom) !== null && _ref32 !== void 0 ? _ref32 : mt) !== null && _ref31 !== void 0 ? _ref31 : mb) !== null && _ref30 !== void 0 ? _ref30 : margin),
|
|
1120
|
+
width: makeScaleHandler(width !== null && width !== void 0 ? width : w),
|
|
1121
|
+
height: makeScaleHandler(height !== null && height !== void 0 ? height : h),
|
|
1122
1122
|
font: makeScaleHandler(font)
|
|
1123
1123
|
},
|
|
1124
1124
|
getScaleProps: generateGetScaleProps(props),
|
|
@@ -1181,13 +1181,13 @@ var safeText = function safeText(text) {
|
|
|
1181
1181
|
var AvatarComponent = function AvatarComponent(_ref) {
|
|
1182
1182
|
var src = _ref.src,
|
|
1183
1183
|
_ref$stacked = _ref.stacked,
|
|
1184
|
-
stacked = _ref$stacked ===
|
|
1184
|
+
stacked = _ref$stacked === void 0 ? false : _ref$stacked,
|
|
1185
1185
|
_ref$text = _ref.text,
|
|
1186
|
-
text = _ref$text ===
|
|
1186
|
+
text = _ref$text === void 0 ? '' : _ref$text,
|
|
1187
1187
|
_ref$isSquare = _ref.isSquare,
|
|
1188
|
-
isSquare = _ref$isSquare ===
|
|
1188
|
+
isSquare = _ref$isSquare === void 0 ? false : _ref$isSquare,
|
|
1189
1189
|
_ref$className = _ref.className,
|
|
1190
|
-
className = _ref$className ===
|
|
1190
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1191
1191
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1192
1192
|
var theme = useTheme();
|
|
1193
1193
|
var _useScale = useScale(),
|
|
@@ -1217,7 +1217,7 @@ var Avatar = withScale(AvatarComponent);
|
|
|
1217
1217
|
var AvatarGroupComponent = function AvatarGroupComponent(_ref) {
|
|
1218
1218
|
var count = _ref.count,
|
|
1219
1219
|
_ref$className = _ref.className,
|
|
1220
|
-
className = _ref$className ===
|
|
1220
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1221
1221
|
children = _ref.children;
|
|
1222
1222
|
var theme = useTheme();
|
|
1223
1223
|
var _useScale = useScale(),
|
|
@@ -1245,7 +1245,7 @@ var UserComponent = function UserComponent(_ref) {
|
|
|
1245
1245
|
name = _ref.name,
|
|
1246
1246
|
children = _ref.children,
|
|
1247
1247
|
_ref$className = _ref.className,
|
|
1248
|
-
className = _ref$className ===
|
|
1248
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1249
1249
|
altText = _ref.altText,
|
|
1250
1250
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1251
1251
|
var theme = useTheme();
|
|
@@ -1340,18 +1340,18 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
|
1340
1340
|
var _excluded$1 = ["href", "showColor", "underline", "children", "className", "block", "icon"];
|
|
1341
1341
|
var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1342
1342
|
var _ref$href = _ref.href,
|
|
1343
|
-
href = _ref$href ===
|
|
1343
|
+
href = _ref$href === void 0 ? '' : _ref$href,
|
|
1344
1344
|
_ref$showColor = _ref.showColor,
|
|
1345
|
-
showColor = _ref$showColor ===
|
|
1345
|
+
showColor = _ref$showColor === void 0 ? false : _ref$showColor,
|
|
1346
1346
|
_ref$underline = _ref.underline,
|
|
1347
|
-
underline = _ref$underline ===
|
|
1347
|
+
underline = _ref$underline === void 0 ? false : _ref$underline,
|
|
1348
1348
|
children = _ref.children,
|
|
1349
1349
|
_ref$className = _ref.className,
|
|
1350
|
-
className = _ref$className ===
|
|
1350
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1351
1351
|
_ref$block = _ref.block,
|
|
1352
|
-
block = _ref$block ===
|
|
1352
|
+
block = _ref$block === void 0 ? false : _ref$block,
|
|
1353
1353
|
_ref$icon = _ref.icon,
|
|
1354
|
-
icon = _ref$icon ===
|
|
1354
|
+
icon = _ref$icon === void 0 ? false : _ref$icon,
|
|
1355
1355
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
1356
1356
|
var theme = useTheme();
|
|
1357
1357
|
var _useScale = useScale(),
|
|
@@ -1379,7 +1379,7 @@ var _excluded = ["href", "className", "children"];
|
|
|
1379
1379
|
var UserLink = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1380
1380
|
var href = _ref.href,
|
|
1381
1381
|
_ref$className = _ref.className,
|
|
1382
|
-
className = _ref$className ===
|
|
1382
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1383
1383
|
children = _ref.children,
|
|
1384
1384
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
1385
1385
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
@@ -11,5 +11,5 @@ type CompactButtonProps = {
|
|
|
11
11
|
target?: string;
|
|
12
12
|
onClick?: () => void;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
export
|
|
14
|
+
declare const _default: import("react").NamedExoticComponent<CompactButtonProps>;
|
|
15
|
+
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
1
2
|
import Button from './button';
|
|
2
|
-
|
|
3
|
+
var CompactButton = function CompactButton(_ref) {
|
|
3
4
|
var _ref$to = _ref.to,
|
|
4
5
|
to = _ref$to === void 0 ? '/' : _ref$to,
|
|
5
6
|
children = _ref.children,
|
|
@@ -74,4 +75,5 @@ export default function CompactButton(_ref) {
|
|
|
74
75
|
px: 0.6,
|
|
75
76
|
iconRight: iconRight
|
|
76
77
|
}, children);
|
|
77
|
-
}
|
|
78
|
+
};
|
|
79
|
+
export default /*#__PURE__*/memo(CompactButton);
|
package/esm/form/FastField.js
CHANGED
|
@@ -15,7 +15,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import invariant from 'tiny-warning';
|
|
17
17
|
import { getIn, isEmptyChildren, isFunction } from './utils';
|
|
18
|
-
import
|
|
18
|
+
import connect from './connect';
|
|
19
19
|
/**
|
|
20
20
|
* Custom Field component for quickly hooking into Formik
|
|
21
21
|
* context and wiring up forms.
|
|
@@ -3,8 +3,8 @@ import { FieldConfig } from './Field';
|
|
|
3
3
|
import { FieldHelperProps, FieldInputProps, FieldMetaProps, FormikConfig, FormikErrors, FormikState, FormikTouched, FormikValues } from './types';
|
|
4
4
|
export declare function useFormik<Values extends FormikValues = FormikValues>({ validateOnChange, validateOnBlur, validateOnMount, isInitialValid, enableReinitialize, onSubmit, ...rest }: FormikConfig<Values>): {
|
|
5
5
|
initialValues: Values;
|
|
6
|
-
initialErrors: FormikErrors<
|
|
7
|
-
initialTouched: FormikTouched<
|
|
6
|
+
initialErrors: FormikErrors<any>;
|
|
7
|
+
initialTouched: FormikTouched<any>;
|
|
8
8
|
initialStatus: any;
|
|
9
9
|
handleBlur: {
|
|
10
10
|
(e: React.FocusEvent<any>): void;
|
|
@@ -19,15 +19,15 @@ export declare function useFormik<Values extends FormikValues = FormikValues>({
|
|
|
19
19
|
resetForm: (nextState?: Partial<FormikState<Values>>) => void;
|
|
20
20
|
setErrors: (errors: FormikErrors<Values>) => void;
|
|
21
21
|
setFormikState: (stateOrCb: FormikState<Values> | ((state: FormikState<Values>) => FormikState<Values>)) => void;
|
|
22
|
-
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
23
|
-
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
22
|
+
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
23
|
+
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
24
24
|
setFieldError: (field: string, value: string | undefined) => void;
|
|
25
25
|
setStatus: (status: any) => void;
|
|
26
26
|
setSubmitting: (isSubmitting: boolean) => void;
|
|
27
|
-
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
28
|
-
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<void> | Promise<
|
|
27
|
+
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
28
|
+
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<void> | Promise<FormikErrors<Values>>;
|
|
29
29
|
submitForm: () => Promise<any>;
|
|
30
|
-
validateForm: (values?: Values) => Promise<
|
|
30
|
+
validateForm: (values?: Values) => Promise<FormikErrors<Values>>;
|
|
31
31
|
validateField: (name: string) => Promise<void> | Promise<string | undefined>;
|
|
32
32
|
isValid: boolean;
|
|
33
33
|
dirty: boolean;
|
package/esm/form/FormWrapper.js
CHANGED
|
@@ -83,7 +83,7 @@ function formikReducer(state, msg) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// Initial empty states // objects
|
|
86
|
+
// Initial empty states // objects // FormikErrors<unkown>
|
|
87
87
|
var emptyErrors = {};
|
|
88
88
|
var emptyTouched = {};
|
|
89
89
|
|
|
@@ -273,7 +273,7 @@ export function useFormik(_ref) {
|
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
return combinedErrors;
|
|
276
|
-
});
|
|
276
|
+
}); // CODE UPDATED
|
|
277
277
|
});
|
|
278
278
|
React.useEffect(function () {
|
|
279
279
|
if (validateOnMount && isMounted.current === true && isEqual(initialValues.current, props.initialValues)) {
|
package/esm/form/connect.d.ts
CHANGED
package/esm/form/connect.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DOMPurify from 'dompurify';
|
|
3
|
+
var HtmlRenderer = function HtmlRenderer(_ref) {
|
|
4
|
+
var htmlString = _ref.htmlString;
|
|
5
|
+
var sanitizedHTML = DOMPurify.sanitize(htmlString);
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
dangerouslySetInnerHTML: {
|
|
8
|
+
__html: sanitizedHTML
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export default HtmlRenderer;
|
package/esm/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type { UiProviderProps } from './ui-provider';
|
|
|
41
41
|
export { default as Grid } from './grid';
|
|
42
42
|
export { default as Container } from './grid/grid-container';
|
|
43
43
|
export type { GridProps, GridContainerProps } from './grid';
|
|
44
|
+
export { default as HtmlRenderer } from './html-renderer';
|
|
44
45
|
export { default as Image } from './image';
|
|
45
46
|
export type { ImageProps, ImageBrowserProps } from './image';
|
|
46
47
|
export { default as Input } from './input';
|
package/esm/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export * from './form';
|
|
|
27
27
|
export { default as UiProvider } from './ui-provider';
|
|
28
28
|
export { default as Grid } from './grid';
|
|
29
29
|
export { default as Container } from './grid/grid-container';
|
|
30
|
+
export { default as HtmlRenderer } from './html-renderer';
|
|
30
31
|
export { default as Image } from './image';
|
|
31
32
|
export { default as Input } from './input';
|
|
32
33
|
export { default as Keyboard } from './keyboard';
|
package/esm/link/link.js
CHANGED
|
@@ -1,141 +1,169 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
1
|
/* eslint-disable camelcase */
|
|
6
2
|
/**
|
|
7
3
|
*
|
|
8
4
|
* LoginSocialAmazon
|
|
9
5
|
*
|
|
10
6
|
*/
|
|
11
|
-
|
|
7
|
+
// "use client"
|
|
12
8
|
|
|
13
|
-
import React, { memo, useEffect, useState, useCallback, useRef } from 'react';
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
9
|
+
// import React, { memo, useEffect, useState, useCallback, useRef } from 'react';
|
|
10
|
+
// import { IResolveParams, objectType } from '../';
|
|
11
|
+
|
|
12
|
+
// interface Props {
|
|
13
|
+
// scope?: string;
|
|
14
|
+
// state?: string;
|
|
15
|
+
// client_id: string;
|
|
16
|
+
// className?: string;
|
|
17
|
+
// redirect_uri?: string;
|
|
18
|
+
// response_type?: string;
|
|
19
|
+
// scope_data?: objectType;
|
|
20
|
+
// isOnlyGetToken?: boolean;
|
|
21
|
+
// children?: React.ReactNode;
|
|
22
|
+
// onLoginStart?: () => void;
|
|
23
|
+
// onReject: (reject: string | objectType) => void;
|
|
24
|
+
// onResolve: ({ provider, data }: IResolveParams) => void;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
// const JS_SRC = 'https://assets.loginwithamazon.com/sdk/na/login1.js';
|
|
28
|
+
// const SCRIPT_ID = 'amazon-login';
|
|
29
|
+
// const _window = global.window;
|
|
30
|
+
|
|
31
|
+
// export const LoginSocialAmazon = ({
|
|
32
|
+
// state = '',
|
|
33
|
+
// client_id,
|
|
34
|
+
// className,
|
|
35
|
+
// redirect_uri,
|
|
36
|
+
// scope = 'profile',
|
|
37
|
+
// isOnlyGetToken: onlyGetToken = false,
|
|
38
|
+
// scope_data = {
|
|
39
|
+
// profile: { essential: true },
|
|
40
|
+
// },
|
|
41
|
+
// response_type = 'token',
|
|
42
|
+
// children,
|
|
43
|
+
// onReject,
|
|
44
|
+
// onResolve,
|
|
45
|
+
// onLoginStart,
|
|
46
|
+
// }: Props) => {
|
|
47
|
+
// const scriptNodeRef = useRef<HTMLScriptElement>(null!);
|
|
48
|
+
// const [isSdkLoaded, setIsSdkLoaded] = useState(false);
|
|
49
|
+
|
|
50
|
+
// useEffect(() => {
|
|
51
|
+
// !isSdkLoaded && load();
|
|
52
|
+
// }, [isSdkLoaded]);
|
|
53
|
+
|
|
54
|
+
// useEffect(
|
|
55
|
+
// () => () => {
|
|
56
|
+
// if (scriptNodeRef.current) scriptNodeRef.current.remove();
|
|
57
|
+
// },
|
|
58
|
+
// [],
|
|
59
|
+
// );
|
|
60
|
+
|
|
61
|
+
// const checkIsExistsSDKScript = useCallback(() => {
|
|
62
|
+
// return !!document.getElementById(SCRIPT_ID);
|
|
63
|
+
// }, []);
|
|
64
|
+
|
|
65
|
+
// const insertScriptGoogle = useCallback(
|
|
66
|
+
// (
|
|
67
|
+
// d: HTMLDocument,
|
|
68
|
+
// s: string = 'script',
|
|
69
|
+
// id: string,
|
|
70
|
+
// jsSrc: string,
|
|
71
|
+
// cb: () => void,
|
|
72
|
+
// ) => {
|
|
73
|
+
// const ggScriptTag: any = d.createElement(s);
|
|
74
|
+
// ggScriptTag.id = id;
|
|
75
|
+
// ggScriptTag.src = jsSrc;
|
|
76
|
+
// ggScriptTag.async = true;
|
|
77
|
+
// ggScriptTag.defer = true;
|
|
78
|
+
// const scriptNode = document.getElementsByTagName('script')![0];
|
|
79
|
+
// scriptNodeRef.current = ggScriptTag;
|
|
80
|
+
// scriptNode &&
|
|
81
|
+
// scriptNode.parentNode &&
|
|
82
|
+
// scriptNode.parentNode.insertBefore(ggScriptTag, scriptNode);
|
|
83
|
+
// ggScriptTag.onload = cb;
|
|
84
|
+
// },
|
|
85
|
+
// [],
|
|
86
|
+
// );
|
|
87
|
+
|
|
88
|
+
// const getUserInfo = useCallback(
|
|
89
|
+
// async (res: objectType) => {
|
|
90
|
+
// fetch(`https://api.amazon.com/user/profile`, {
|
|
91
|
+
// headers: {
|
|
92
|
+
// Authorization: `Bearer ${res.access_token}`,
|
|
93
|
+
// },
|
|
94
|
+
// })
|
|
95
|
+
// .then(data => data.json())
|
|
96
|
+
// .then(data => {
|
|
97
|
+
// onResolve({ provider: 'amazon', data: { ...data, ...res } });
|
|
98
|
+
// })
|
|
99
|
+
// .catch(err => {
|
|
100
|
+
// onReject(err);
|
|
101
|
+
// })
|
|
102
|
+
// .finally(() => {});
|
|
103
|
+
// },
|
|
104
|
+
// [onReject, onResolve],
|
|
105
|
+
// );
|
|
106
|
+
|
|
107
|
+
// const handleResponse = useCallback(
|
|
108
|
+
// (res: objectType) => {
|
|
109
|
+
// if (onlyGetToken) onResolve({ provider: 'amazon', data: { ...res } });
|
|
110
|
+
// else getUserInfo(res);
|
|
111
|
+
// },
|
|
112
|
+
// [getUserInfo, onResolve, onlyGetToken],
|
|
113
|
+
// );
|
|
114
|
+
|
|
115
|
+
// const handleError = useCallback(
|
|
116
|
+
// (err: objectType | string) => {
|
|
117
|
+
// onReject(err);
|
|
118
|
+
// },
|
|
119
|
+
// [onReject],
|
|
120
|
+
// );
|
|
121
|
+
|
|
122
|
+
// const load = useCallback(() => {
|
|
123
|
+
// if (checkIsExistsSDKScript()) {
|
|
124
|
+
// setIsSdkLoaded(true);
|
|
125
|
+
// } else {
|
|
126
|
+
// insertScriptGoogle(document, 'script', SCRIPT_ID, JS_SRC, () => {
|
|
127
|
+
// _window.amazon.Login.setClientId(client_id);
|
|
128
|
+
// setIsSdkLoaded(true);
|
|
129
|
+
// });
|
|
130
|
+
// }
|
|
131
|
+
// }, [checkIsExistsSDKScript, client_id, insertScriptGoogle]);
|
|
132
|
+
|
|
133
|
+
// const onLogin = useCallback(() => {
|
|
134
|
+
// if (!isSdkLoaded) return;
|
|
135
|
+
// if (!_window.amazon) {
|
|
136
|
+
// load();
|
|
137
|
+
// onReject("Google SDK isn't loaded!");
|
|
138
|
+
// } else {
|
|
139
|
+
// onLoginStart && onLoginStart();
|
|
140
|
+
// _window.amazon.Login.authorize(
|
|
141
|
+
// { scope, scope_data, response_type, redirect_uri, state },
|
|
142
|
+
// (res: objectType) => {
|
|
143
|
+
// if (res.error) handleError(res.error);
|
|
144
|
+
// else handleResponse(res);
|
|
145
|
+
// },
|
|
146
|
+
// );
|
|
147
|
+
// }
|
|
148
|
+
// }, [
|
|
149
|
+
// load,
|
|
150
|
+
// scope,
|
|
151
|
+
// state,
|
|
152
|
+
// onReject,
|
|
153
|
+
// scope_data,
|
|
154
|
+
// isSdkLoaded,
|
|
155
|
+
// handleError,
|
|
156
|
+
// onLoginStart,
|
|
157
|
+
// redirect_uri,
|
|
158
|
+
// response_type,
|
|
159
|
+
// handleResponse,
|
|
160
|
+
// ]);
|
|
161
|
+
|
|
162
|
+
// return (
|
|
163
|
+
// <div className={className} onClick={onLogin}>
|
|
164
|
+
// {children}
|
|
165
|
+
// </div>
|
|
166
|
+
// );
|
|
167
|
+
// };
|
|
168
|
+
|
|
169
|
+
// export default memo(LoginSocialAmazon);
|