@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.
Files changed (92) hide show
  1. package/dist/CircularProgress/index.js +6 -6
  2. package/dist/Placeholder/index.js +41 -41
  3. package/dist/auto-complete/index.js +60 -60
  4. package/dist/avatar/index.js +28 -28
  5. package/dist/badge/index.js +27 -27
  6. package/dist/breadcrumbs/index.js +34 -34
  7. package/dist/button/button.compact.d.ts +2 -2
  8. package/dist/button/index.js +46 -45
  9. package/dist/button-dropdown/index.js +34 -34
  10. package/dist/button-group/index.js +25 -25
  11. package/dist/capacity/index.js +26 -26
  12. package/dist/card/index.js +44 -44
  13. package/dist/checkbox/index.js +30 -30
  14. package/dist/code/index.js +27 -27
  15. package/dist/col/index.js +8 -8
  16. package/dist/collapse/index.js +30 -30
  17. package/dist/css-baseline/index.js +6 -6
  18. package/dist/description/index.js +26 -26
  19. package/dist/display/index.js +26 -26
  20. package/dist/divider/index.js +26 -26
  21. package/dist/dot/index.js +25 -25
  22. package/dist/drawer/index.js +53 -53
  23. package/dist/fieldset/index.js +33 -33
  24. package/dist/form/FormWrapper.d.ts +7 -7
  25. package/dist/form/connect.d.ts +1 -0
  26. package/dist/grid/index.js +33 -33
  27. package/dist/html-renderer/index.d.ts +6 -0
  28. package/dist/image/index.js +37 -37
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +1899 -547
  31. package/dist/input/index.js +40 -40
  32. package/dist/keyboard/index.js +28 -28
  33. package/dist/link/index.js +29 -29
  34. package/dist/loading/index.js +26 -26
  35. package/dist/modal/index.js +75 -75
  36. package/dist/note/index.js +27 -27
  37. package/dist/page/index.js +30 -30
  38. package/dist/pagination/index.js +27 -27
  39. package/dist/popover/index.js +57 -57
  40. package/dist/progress/index.js +29 -29
  41. package/dist/radio/index.js +30 -30
  42. package/dist/rating/index.js +29 -29
  43. package/dist/row/index.js +11 -11
  44. package/dist/search-bar/index.js +1826 -61
  45. package/dist/select/index.js +60 -60
  46. package/dist/slider/index.js +35 -35
  47. package/dist/snippet/index.js +30 -30
  48. package/dist/spacer/index.js +25 -25
  49. package/dist/spinner/index.js +24 -24
  50. package/dist/table/index.js +224 -211
  51. package/dist/tabs/index.js +39 -39
  52. package/dist/tag/index.js +26 -26
  53. package/dist/text/index.js +40 -40
  54. package/dist/textarea/index.js +29 -29
  55. package/dist/themes/index.js +2 -2
  56. package/dist/toggle/index.js +27 -27
  57. package/dist/tooltip/index.js +42 -42
  58. package/dist/tree/index.js +23 -23
  59. package/dist/ui-provider/index.js +48 -48
  60. package/dist/use-all-themes/index.js +2 -2
  61. package/dist/use-body-scroll/index.js +5 -5
  62. package/dist/use-clipboard/index.js +1 -1
  63. package/dist/use-current-state/index.js +1 -1
  64. package/dist/use-input/index.js +1 -1
  65. package/dist/use-keyboard/index.js +5 -5
  66. package/dist/use-media-query/index.js +5 -5
  67. package/dist/use-modal/index.js +1 -1
  68. package/dist/use-scale/index.js +19 -19
  69. package/dist/use-tabs/index.js +1 -1
  70. package/dist/use-theme/index.js +2 -2
  71. package/dist/use-toasts/index.js +3 -3
  72. package/dist/user/index.js +36 -36
  73. package/esm/button/button.compact.d.ts +2 -2
  74. package/esm/button/button.compact.js +4 -2
  75. package/esm/form/FastField.js +1 -1
  76. package/esm/form/FormWrapper.d.ts +7 -7
  77. package/esm/form/FormWrapper.js +2 -2
  78. package/esm/form/connect.d.ts +1 -0
  79. package/esm/form/connect.js +2 -1
  80. package/esm/html-renderer/index.d.ts +6 -0
  81. package/esm/html-renderer/index.js +12 -0
  82. package/esm/index.d.ts +1 -0
  83. package/esm/index.js +1 -0
  84. package/esm/link/link.js +2 -0
  85. package/esm/login-with/LoginSocialAmazon/index.js +162 -134
  86. package/esm/login-with/index.js +2 -0
  87. package/esm/search-bar/components/index.js +4 -7
  88. package/esm/table/data-table.js +6 -4
  89. package/esm/table/table.js +12 -1
  90. package/package.json +5 -3
  91. package/esm/formik-native/src/index.js +0 -12
  92. package/esm/formik-native/test/blah.test.js +0 -5
@@ -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 (undefined !== e) {
155
- var i = e.call(t, r || "default");
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) : undefined;
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 === undefined ? {} : param, _name = ref.name, name = _name === undefined ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === undefined ? isProd : _optimizeForSpeed;
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 === undefined) 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 === undefined ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === undefined ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === undefined ? false : _optimizeForSpeed;
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 === undefined ? layout.unit : _props$unit,
1085
+ unit = _props$unit === void 0 ? layout.unit : _props$unit,
1086
1086
  _props$scale = props.scale,
1087
- scale = _props$scale === undefined ? 1 : _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 !== undefined ? paddingTop : pt) !== null && _ref3 !== undefined ? _ref3 : py) !== null && _ref2 !== undefined ? _ref2 : padding),
1109
- pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== undefined ? paddingRight : pr) !== null && _ref5 !== undefined ? _ref5 : px) !== null && _ref4 !== undefined ? _ref4 : padding),
1110
- pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : pb) !== null && _ref7 !== undefined ? _ref7 : py) !== null && _ref6 !== undefined ? _ref6 : padding),
1111
- pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : pl) !== null && _ref9 !== undefined ? _ref9 : px) !== null && _ref8 !== undefined ? _ref8 : padding),
1112
- px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== undefined ? px : paddingLeft) !== null && _ref13 !== undefined ? _ref13 : paddingRight) !== null && _ref12 !== undefined ? _ref12 : pl) !== null && _ref11 !== undefined ? _ref11 : pr) !== null && _ref10 !== undefined ? _ref10 : padding),
1113
- py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== undefined ? py : paddingTop) !== null && _ref17 !== undefined ? _ref17 : paddingBottom) !== null && _ref16 !== undefined ? _ref16 : pt) !== null && _ref15 !== undefined ? _ref15 : pb) !== null && _ref14 !== undefined ? _ref14 : padding),
1114
- mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== undefined ? marginTop : mt) !== null && _ref19 !== undefined ? _ref19 : my) !== null && _ref18 !== undefined ? _ref18 : margin),
1115
- mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== undefined ? marginRight : mr) !== null && _ref21 !== undefined ? _ref21 : mx) !== null && _ref20 !== undefined ? _ref20 : margin),
1116
- mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== undefined ? marginBottom : mb) !== null && _ref23 !== undefined ? _ref23 : my) !== null && _ref22 !== undefined ? _ref22 : margin),
1117
- ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== undefined ? marginLeft : ml) !== null && _ref25 !== undefined ? _ref25 : mx) !== null && _ref24 !== undefined ? _ref24 : margin),
1118
- mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== undefined ? mx : marginLeft) !== null && _ref29 !== undefined ? _ref29 : marginRight) !== null && _ref28 !== undefined ? _ref28 : ml) !== null && _ref27 !== undefined ? _ref27 : mr) !== null && _ref26 !== undefined ? _ref26 : margin),
1119
- my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== undefined ? my : marginTop) !== null && _ref33 !== undefined ? _ref33 : marginBottom) !== null && _ref32 !== undefined ? _ref32 : mt) !== null && _ref31 !== undefined ? _ref31 : mb) !== null && _ref30 !== undefined ? _ref30 : margin),
1120
- width: makeScaleHandler(width !== null && width !== undefined ? width : w),
1121
- height: makeScaleHandler(height !== null && height !== undefined ? height : h),
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 === undefined ? false : _ref$stacked,
1184
+ stacked = _ref$stacked === void 0 ? false : _ref$stacked,
1185
1185
  _ref$text = _ref.text,
1186
- text = _ref$text === undefined ? '' : _ref$text,
1186
+ text = _ref$text === void 0 ? '' : _ref$text,
1187
1187
  _ref$isSquare = _ref.isSquare,
1188
- isSquare = _ref$isSquare === undefined ? false : _ref$isSquare,
1188
+ isSquare = _ref$isSquare === void 0 ? false : _ref$isSquare,
1189
1189
  _ref$className = _ref.className,
1190
- className = _ref$className === undefined ? '' : _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 === undefined ? '' : _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 === undefined ? '' : _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 === undefined ? '' : _ref$href,
1343
+ href = _ref$href === void 0 ? '' : _ref$href,
1344
1344
  _ref$showColor = _ref.showColor,
1345
- showColor = _ref$showColor === undefined ? false : _ref$showColor,
1345
+ showColor = _ref$showColor === void 0 ? false : _ref$showColor,
1346
1346
  _ref$underline = _ref.underline,
1347
- underline = _ref$underline === undefined ? false : _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 === undefined ? '' : _ref$className,
1350
+ className = _ref$className === void 0 ? '' : _ref$className,
1351
1351
  _ref$block = _ref.block,
1352
- block = _ref$block === undefined ? false : _ref$block,
1352
+ block = _ref$block === void 0 ? false : _ref$block,
1353
1353
  _ref$icon = _ref.icon,
1354
- icon = _ref$icon === undefined ? false : _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 === undefined ? '' : _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
- export default function CompactButton({ to, children, iconRight, icon, scale, type, style, a, target, onClick }: CompactButtonProps): import("react").JSX.Element;
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
- export default function CompactButton(_ref) {
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);
@@ -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 { connect } from './connect';
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<unknown>;
7
- initialTouched: FormikTouched<unknown>;
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<object>;
23
- setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void> | Promise<object>;
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<object>;
28
- setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<void> | Promise<object>;
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<object>;
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;
@@ -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)) {
@@ -10,3 +10,4 @@ export default function connect<OuterProps, Values = {}>(Comp: React.ComponentTy
10
10
  }>): React.FC<OuterProps> & hoistNonReactStatics.NonReactStatics<React.ComponentClass<OuterProps & {
11
11
  formik: FormikContextType<Values>;
12
12
  }, any>, {}>;
13
+ export { connect };
@@ -27,4 +27,5 @@ export default function connect(Comp) {
27
27
 
28
28
  // cast type to ComponentClass (even if SFC)
29
29
  );
30
- }
30
+ }
31
+ export { connect };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type RendererProps = {
3
+ htmlString: string;
4
+ };
5
+ declare const HtmlRenderer: React.FC<RendererProps>;
6
+ export default HtmlRenderer;
@@ -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,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
5
  var _excluded = ["href", "showColor", "underline", "children", "className", "block", "icon"];
@@ -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
- /* "use client" */
7
+ // "use client"
12
8
 
13
- import React, { memo, useEffect, useState, useCallback, useRef } from 'react';
14
- var JS_SRC = 'https://assets.loginwithamazon.com/sdk/na/login1.js';
15
- var SCRIPT_ID = 'amazon-login';
16
- var _window = global.window;
17
- export var LoginSocialAmazon = function LoginSocialAmazon(_ref) {
18
- var _ref$state = _ref.state,
19
- state = _ref$state === void 0 ? '' : _ref$state,
20
- client_id = _ref.client_id,
21
- className = _ref.className,
22
- redirect_uri = _ref.redirect_uri,
23
- _ref$scope = _ref.scope,
24
- scope = _ref$scope === void 0 ? 'profile' : _ref$scope,
25
- _ref$isOnlyGetToken = _ref.isOnlyGetToken,
26
- onlyGetToken = _ref$isOnlyGetToken === void 0 ? false : _ref$isOnlyGetToken,
27
- _ref$scope_data = _ref.scope_data,
28
- scope_data = _ref$scope_data === void 0 ? {
29
- profile: {
30
- essential: true
31
- }
32
- } : _ref$scope_data,
33
- _ref$response_type = _ref.response_type,
34
- response_type = _ref$response_type === void 0 ? 'token' : _ref$response_type,
35
- children = _ref.children,
36
- onReject = _ref.onReject,
37
- onResolve = _ref.onResolve,
38
- onLoginStart = _ref.onLoginStart;
39
- var scriptNodeRef = useRef(null);
40
- var _useState = useState(false),
41
- _useState2 = _slicedToArray(_useState, 2),
42
- isSdkLoaded = _useState2[0],
43
- setIsSdkLoaded = _useState2[1];
44
- useEffect(function () {
45
- !isSdkLoaded && load();
46
- }, [isSdkLoaded]);
47
- useEffect(function () {
48
- return function () {
49
- if (scriptNodeRef.current) scriptNodeRef.current.remove();
50
- };
51
- }, []);
52
- var checkIsExistsSDKScript = useCallback(function () {
53
- return !!document.getElementById(SCRIPT_ID);
54
- }, []);
55
- var insertScriptGoogle = useCallback(function (d) {
56
- var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'script';
57
- var id = arguments.length > 2 ? arguments[2] : undefined;
58
- var jsSrc = arguments.length > 3 ? arguments[3] : undefined;
59
- var cb = arguments.length > 4 ? arguments[4] : undefined;
60
- var ggScriptTag = d.createElement(s);
61
- ggScriptTag.id = id;
62
- ggScriptTag.src = jsSrc;
63
- ggScriptTag.async = true;
64
- ggScriptTag.defer = true;
65
- var scriptNode = document.getElementsByTagName('script')[0];
66
- scriptNodeRef.current = ggScriptTag;
67
- scriptNode && scriptNode.parentNode && scriptNode.parentNode.insertBefore(ggScriptTag, scriptNode);
68
- ggScriptTag.onload = cb;
69
- }, []);
70
- var getUserInfo = useCallback(/*#__PURE__*/function () {
71
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(res) {
72
- return _regeneratorRuntime.wrap(function _callee$(_context) {
73
- while (1) switch (_context.prev = _context.next) {
74
- case 0:
75
- fetch("https://api.amazon.com/user/profile", {
76
- headers: {
77
- Authorization: "Bearer ".concat(res.access_token)
78
- }
79
- }).then(function (data) {
80
- return data.json();
81
- }).then(function (data) {
82
- onResolve({
83
- provider: 'amazon',
84
- data: _extends({}, data, res)
85
- });
86
- })["catch"](function (err) {
87
- onReject(err);
88
- })["finally"](function () {});
89
- case 1:
90
- case "end":
91
- return _context.stop();
92
- }
93
- }, _callee);
94
- }));
95
- return function (_x) {
96
- return _ref2.apply(this, arguments);
97
- };
98
- }(), [onReject, onResolve]);
99
- var handleResponse = useCallback(function (res) {
100
- if (onlyGetToken) onResolve({
101
- provider: 'amazon',
102
- data: _extends({}, res)
103
- });else getUserInfo(res);
104
- }, [getUserInfo, onResolve, onlyGetToken]);
105
- var handleError = useCallback(function (err) {
106
- onReject(err);
107
- }, [onReject]);
108
- var load = useCallback(function () {
109
- if (checkIsExistsSDKScript()) {
110
- setIsSdkLoaded(true);
111
- } else {
112
- insertScriptGoogle(document, 'script', SCRIPT_ID, JS_SRC, function () {
113
- _window.amazon.Login.setClientId(client_id);
114
- setIsSdkLoaded(true);
115
- });
116
- }
117
- }, [checkIsExistsSDKScript, client_id, insertScriptGoogle]);
118
- var onLogin = useCallback(function () {
119
- if (!isSdkLoaded) return;
120
- if (!_window.amazon) {
121
- load();
122
- onReject("Google SDK isn't loaded!");
123
- } else {
124
- onLoginStart && onLoginStart();
125
- _window.amazon.Login.authorize({
126
- scope: scope,
127
- scope_data: scope_data,
128
- response_type: response_type,
129
- redirect_uri: redirect_uri,
130
- state: state
131
- }, function (res) {
132
- if (res.error) handleError(res.error);else handleResponse(res);
133
- });
134
- }
135
- }, [load, scope, state, onReject, scope_data, isSdkLoaded, handleError, onLoginStart, redirect_uri, response_type, handleResponse]);
136
- return /*#__PURE__*/React.createElement("div", {
137
- className: className,
138
- onClick: onLogin
139
- }, children);
140
- };
141
- export default /*#__PURE__*/memo(LoginSocialAmazon);
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);