@telefonica/mistica 10.15.0 → 10.19.0

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 (68) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/card.d.ts +10 -1
  3. package/dist/card.js +4 -1
  4. package/dist/card.js.flow +16 -1
  5. package/dist/credit-card-expiration-field.js +2 -7
  6. package/dist/credit-card-number-field.js +2 -2
  7. package/dist/cvv-field.js +2 -2
  8. package/dist/date-field.js +2 -2
  9. package/dist/date-time-field.js +2 -2
  10. package/dist/date-time-picker.js +2 -2
  11. package/dist/decimal-field.js +2 -7
  12. package/dist/email-field.js +2 -7
  13. package/dist/feedback.js +5 -8
  14. package/dist/iban-field.js +2 -7
  15. package/dist/icons/icon-success.js +14 -6
  16. package/dist/image.d.ts +25 -4
  17. package/dist/image.js +67 -9
  18. package/dist/image.js.flow +33 -4
  19. package/dist/index.d.ts +3 -1
  20. package/dist/index.js +20 -0
  21. package/dist/index.js.flow +3 -1
  22. package/dist/integer-field.js +2 -7
  23. package/dist/menu.d.ts +1 -1
  24. package/dist/menu.js +34 -27
  25. package/dist/menu.js.flow +1 -1
  26. package/dist/month-field.js +2 -2
  27. package/dist/package-version.js +1 -1
  28. package/dist/password-field.js +2 -2
  29. package/dist/phone-number-field.js +2 -7
  30. package/dist/search-field.js +2 -2
  31. package/dist/section-title.d.ts +1 -3
  32. package/dist/section-title.js.flow +1 -2
  33. package/dist/select.js +2 -2
  34. package/dist/text-field-base.d.ts +3 -2
  35. package/dist/text-field-base.js +12 -16
  36. package/dist/text-field-base.js.flow +6 -2
  37. package/dist/text-field.d.ts +2 -1
  38. package/dist/text-field.js +10 -16
  39. package/dist/text-field.js.flow +5 -1
  40. package/dist/video.d.ts +32 -0
  41. package/dist/video.js +161 -0
  42. package/dist/video.js.flow +50 -0
  43. package/dist-es/card.js +4 -1
  44. package/dist-es/credit-card-expiration-field.js +2 -2
  45. package/dist-es/credit-card-number-field.js +2 -2
  46. package/dist-es/cvv-field.js +2 -2
  47. package/dist-es/date-field.js +2 -2
  48. package/dist-es/date-time-field.js +2 -2
  49. package/dist-es/date-time-picker.js +2 -2
  50. package/dist-es/decimal-field.js +2 -2
  51. package/dist-es/email-field.js +2 -2
  52. package/dist-es/feedback.js +5 -8
  53. package/dist-es/iban-field.js +2 -2
  54. package/dist-es/icons/icon-success.js +14 -6
  55. package/dist-es/image.js +41 -8
  56. package/dist-es/index.js +3 -1
  57. package/dist-es/integer-field.js +2 -2
  58. package/dist-es/menu.js +35 -28
  59. package/dist-es/month-field.js +2 -2
  60. package/dist-es/package-version.js +1 -1
  61. package/dist-es/password-field.js +2 -2
  62. package/dist-es/phone-number-field.js +2 -2
  63. package/dist-es/search-field.js +2 -2
  64. package/dist-es/select.js +2 -2
  65. package/dist-es/text-field-base.js +12 -15
  66. package/dist-es/text-field.js +9 -12
  67. package/dist-es/video.js +123 -0
  68. package/package.json +1 -1
package/dist/video.js ADDED
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.default = exports.RATIO = void 0;
6
+ var _jsxRuntime = require("react/jsx-runtime");
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _image = require("./image");
9
+ var _jss = require("./jss");
10
+ var _common = require("./utils/common");
11
+ function _interopRequireWildcard(obj) {
12
+ if (obj && obj.__esModule) {
13
+ return obj;
14
+ } else {
15
+ var newObj = {
16
+ };
17
+ if (obj != null) {
18
+ for(var key in obj){
19
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
20
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
21
+ };
22
+ if (desc.get || desc.set) {
23
+ Object.defineProperty(newObj, key, desc);
24
+ } else {
25
+ newObj[key] = obj[key];
26
+ }
27
+ }
28
+ }
29
+ }
30
+ newObj.default = obj;
31
+ return newObj;
32
+ }
33
+ }
34
+ function _objectWithoutProperties(source, excluded) {
35
+ if (source == null) return {
36
+ };
37
+ var target = _objectWithoutPropertiesLoose(source, excluded);
38
+ var key, i;
39
+ if (Object.getOwnPropertySymbols) {
40
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
41
+ for(i = 0; i < sourceSymbolKeys.length; i++){
42
+ key = sourceSymbolKeys[i];
43
+ if (excluded.indexOf(key) >= 0) continue;
44
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
45
+ target[key] = source[key];
46
+ }
47
+ }
48
+ return target;
49
+ }
50
+ function _objectWithoutPropertiesLoose(source, excluded) {
51
+ if (source == null) return {
52
+ };
53
+ var target = {
54
+ };
55
+ var sourceKeys = Object.keys(source);
56
+ var key, i;
57
+ for(i = 0; i < sourceKeys.length; i++){
58
+ key = sourceKeys[i];
59
+ if (excluded.indexOf(key) >= 0) continue;
60
+ target[key] = source[key];
61
+ }
62
+ return target;
63
+ }
64
+ var RATIO = {
65
+ '1:1': 1,
66
+ '16:9': 16 / 9,
67
+ '12:5': 12 / 5
68
+ };
69
+ exports.RATIO = RATIO;
70
+ var useStyles = (0, _jss).createUseStyles(function() {
71
+ return {
72
+ video: {
73
+ borderRadius: function borderRadius(param) {
74
+ var noBorderRadius = param.noBorderRadius;
75
+ return noBorderRadius ? 0 : 4;
76
+ },
77
+ display: 'block',
78
+ maxWidth: '100%',
79
+ maxHeight: '100%',
80
+ objectFit: 'cover',
81
+ aspectRatio: function aspectRatio(param) {
82
+ var aspectRatio1 = param.aspectRatio;
83
+ return aspectRatio1 !== null && aspectRatio1 !== void 0 ? aspectRatio1 : 'unset';
84
+ }
85
+ }
86
+ };
87
+ });
88
+ /** Transparent 1x1px PNG */ var TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';
89
+ var Video = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
90
+ var src = _param.src, poster = _param.poster, _autoPlay = _param.autoPlay, autoPlay = _autoPlay === void 0 ? true : _autoPlay, _muted = _param.muted, muted = _muted === void 0 ? true : _muted, _loop = _param.loop, loop = _loop === void 0 ? true : _loop, _preload = _param.preload, preload = _preload === void 0 ? 'none' : _preload, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, props = _objectWithoutProperties(_param, [
91
+ "src",
92
+ "poster",
93
+ "autoPlay",
94
+ "muted",
95
+ "loop",
96
+ "preload",
97
+ "aspectRatio"
98
+ ]);
99
+ var noBorderRadius = (0, _image).useDisableBorderRadius();
100
+ var classes = useStyles({
101
+ noBorderRadius: noBorderRadius,
102
+ aspectRatio: !props.width && !props.height ? RATIO[aspectRatio] : undefined
103
+ });
104
+ var videoRef = React.useRef(null);
105
+ React.useEffect(function() {
106
+ var video = videoRef.current;
107
+ if (video && autoPlay && video.paused) {
108
+ video.play();
109
+ }
110
+ }, [
111
+ autoPlay
112
+ ]);
113
+ // normalize sources
114
+ var sources = (Array.isArray(src) ? src : [
115
+ src
116
+ ]).map(function(source) {
117
+ if (typeof source === 'string') {
118
+ return {
119
+ src: source
120
+ };
121
+ } else {
122
+ return source;
123
+ }
124
+ });
125
+ var width = props.width;
126
+ var height = props.height;
127
+ if (props.width !== undefined && props.height !== undefined) {
128
+ width = props.width;
129
+ height = props.height;
130
+ } else if (props.width !== undefined) {
131
+ height = props.width / RATIO[aspectRatio];
132
+ } else if (props.height !== undefined) {
133
+ width = props.height * RATIO[aspectRatio];
134
+ } else {
135
+ width = '100%';
136
+ }
137
+ return(/*#__PURE__*/ (0, _jsxRuntime).jsx("video", {
138
+ ref: (0, _common).combineRefs(ref, videoRef),
139
+ playsInline: true,
140
+ disablePictureInPicture: true,
141
+ disableRemotePlayback: true,
142
+ autoPlay: autoPlay,
143
+ muted: muted,
144
+ loop: loop,
145
+ width: width,
146
+ height: height,
147
+ className: classes.video,
148
+ preload: preload,
149
+ // This transparent pixel fallback avoids showing the ugly "play" image in android webviews
150
+ poster: poster || TRANSPARENT_PIXEL,
151
+ children: sources.map(function(param, index) {
152
+ var src = param.src, type = param.type;
153
+ /*#__PURE__*/ return (0, _jsxRuntime).jsx("source", {
154
+ src: src,
155
+ type: type
156
+ }, index);
157
+ })
158
+ }));
159
+ });
160
+ var _default = Video;
161
+ exports.default = _default;
@@ -0,0 +1,50 @@
1
+ // @flow
2
+
3
+ import * as React from "react";
4
+ export type AspectRatio = "1:1" | "16:9" | "12:5";
5
+ declare export var RATIO: {
6
+ "1:1": number,
7
+ "16:9": number,
8
+ "12:5": number,
9
+ };
10
+ declare type VideoSource = {
11
+ src: string,
12
+ type?: string,
13
+ };
14
+ export type VideoProps = {
15
+ /**
16
+ * defaults to 100% when no width and no height are given
17
+ */
18
+ width?: number,
19
+ height?: number,
20
+ /**
21
+ * defaults to 1:1, if both width and height are given, aspectRatio is ignored
22
+ */
23
+ aspectRatio?: AspectRatio,
24
+ /**
25
+ * accepts multiple sources
26
+ */
27
+ src: string | Array<string> | VideoSource | Array<VideoSource>,
28
+ /**
29
+ * defaults to true
30
+ */
31
+ loop?: boolean,
32
+ /**
33
+ * defaults to true
34
+ */
35
+ muted?: boolean,
36
+ /**
37
+ * defaults to true
38
+ */
39
+ autoPlay?: boolean,
40
+ poster?: string,
41
+ /**
42
+ * defaults to none
43
+ */
44
+ preload?: "none" | "metadata" | "auto",
45
+ };
46
+ declare var Video: React.ComponentType<{
47
+ ...VideoProps,
48
+ ref?: React.Ref<HTMLVideoElement>,
49
+ }>;
50
+ declare export default typeof Video;
package/dist-es/card.js CHANGED
@@ -8,6 +8,7 @@ import { Text1, Text2, Text4 } from './text';
8
8
  import { createUseStyles } from './jss';
9
9
  import { Boxed } from './boxed';
10
10
  import ButtonGroup from './button-group';
11
+ import { DisableBorderRadiusProvider } from './image';
11
12
  var useCardContentStyles = createUseStyles(function() {
12
13
  return {
13
14
  actions: {
@@ -141,8 +142,10 @@ export var MediaCard = /*#__PURE__*/ React.forwardRef(function(param, ref) {
141
142
  className: classes.mediaCard,
142
143
  "aria-label": ariaLabel,
143
144
  children: [
144
- /*#__PURE__*/ _jsx("div", {
145
+ typeof media.src === 'string' ? /*#__PURE__*/ _jsx("div", {
145
146
  className: classes.media
147
+ }) : /*#__PURE__*/ _jsx(DisableBorderRadiusProvider, {
148
+ children: media
146
149
  }),
147
150
  /*#__PURE__*/ _jsx("div", {
148
151
  className: classes.content,
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useForm, useFieldProps } from './form-context';
4
4
  import { useTheme } from './hooks';
5
- import TextFieldBase from './text-field-base';
5
+ import { TextFieldBaseAutosuggest } from './text-field-base';
6
6
  function _arrayWithHoles(arr) {
7
7
  if (Array.isArray(arr)) return arr;
8
8
  }
@@ -192,7 +192,7 @@ var CreditCardExpirationField = function(_param) {
192
192
  onChange: onChange,
193
193
  onChangeValue: onChangeValue
194
194
  });
195
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
195
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
196
196
  }, rest, fieldProps, {
197
197
  onChange: function(event) {
198
198
  fieldProps.onChange(event);
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { useForm, useFieldProps } from './form-context';
4
4
  import { useTheme } from './hooks';
5
5
  import { getCreditCardNumberLength, isAmericanExpress, isVisa, isMasterCard, isValidCreditCardNumber } from './utils/credit-card';
6
- import TextFieldBase from './text-field-base';
6
+ import { TextFieldBaseAutosuggest } from './text-field-base';
7
7
  import IconCreditcard from './icons/icon-creditcard';
8
8
  import IconVisa from './icons/icon-visa';
9
9
  import IconMastercard from './icons/icon-mastercard';
@@ -305,7 +305,7 @@ var CreditCardNumberField = function(_param) {
305
305
  onChangeValue: onChangeValue
306
306
  });
307
307
  var ref2;
308
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
308
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
309
309
  }, rest, fieldProps, {
310
310
  onChange: function(event) {
311
311
  fieldProps.onChange(event);
@@ -7,7 +7,7 @@ import Tooltip from './tooltip';
7
7
  import IconButton from './icon-button';
8
8
  import IcnInfo from './icons/icon-info-cvv';
9
9
  import { useFieldProps, useForm } from './form-context';
10
- import TextFieldBase from './text-field-base';
10
+ import { TextFieldBaseAutosuggest } from './text-field-base';
11
11
  import { IntegerInput } from './integer-field';
12
12
  function _defineProperty(obj, key, value) {
13
13
  if (key in obj) {
@@ -152,7 +152,7 @@ var CvvField = function(_param) {
152
152
  onChange: onChange,
153
153
  onChangeValue: onChangeValue
154
154
  });
155
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
155
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
156
156
  }, rest, fieldProps, {
157
157
  maxLength: maxLength,
158
158
  onChange: function(event) {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useFieldProps } from './form-context';
4
- import TextFieldBase from './text-field-base';
4
+ import { TextFieldBaseAutosuggest } from './text-field-base';
5
5
  import { isInputTypeSupported } from './utils/dom';
6
6
  import { isServerSide } from './utils/environment';
7
7
  import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
@@ -118,7 +118,7 @@ var DateField = function(_param) {
118
118
  onChange: onChange,
119
119
  onChangeValue: onChangeValue
120
120
  });
121
- var nativePicker = /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
121
+ var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
122
122
  }, rest, fieldProps, {
123
123
  min: min ? getLocalDateString(min) : undefined,
124
124
  max: max ? getLocalDateString(max) : undefined,
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useFieldProps } from './form-context';
4
- import TextFieldBase from './text-field-base';
4
+ import { TextFieldBaseAutosuggest } from './text-field-base';
5
5
  import { isInputTypeSupported } from './utils/dom';
6
6
  import { isServerSide } from './utils/environment';
7
7
  import { getLocalDateTimeString } from './utils/time';
@@ -119,7 +119,7 @@ var FormDateField = function(_param) {
119
119
  onChange: onChange,
120
120
  onChangeValue: onChangeValue
121
121
  });
122
- var nativePicker = /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
122
+ var nativePicker = /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
123
123
  }, rest, fieldProps, {
124
124
  min: min ? getLocalDateTimeString(min) : undefined,
125
125
  max: max ? getLocalDateTimeString(max) : undefined,
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
- import TextFieldBase from './text-field-base';
3
+ import { TextFieldBaseAutosuggest } from './text-field-base';
4
4
  import IconCalendarRegular from './generated/mistica-icons/icon-calendar-regular';
5
5
  import Datetime from 'react-datetime';
6
6
  import Overlay from './overlay';
@@ -367,7 +367,7 @@ var DateTimePicker = function(_param) {
367
367
  };
368
368
  return(/*#__PURE__*/ _jsxs(_Fragment, {
369
369
  children: [
370
- /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
370
+ /*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
371
371
  }, rest, {
372
372
  style: {
373
373
  cursor: 'default'
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useFieldProps } from './form-context';
4
4
  import { useTheme } from './hooks';
5
- import TextFieldBase from './text-field-base';
5
+ import { TextFieldBaseAutosuggest } from './text-field-base';
6
6
  import { createChangeEvent } from './utils/dom';
7
7
  import { useRifm } from 'rifm';
8
8
  import { combineRefs } from './utils/common';
@@ -191,7 +191,7 @@ var DecimalField = function(_param) {
191
191
  onChange: onChange,
192
192
  onChangeValue: onChangeValue
193
193
  });
194
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
194
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
195
195
  }, rest, fieldProps, {
196
196
  inputComponent: DecimalInput,
197
197
  inputProps: {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useFieldProps } from './form-context';
3
3
  import { useTheme } from './hooks';
4
- import TextFieldBase from './text-field-base';
4
+ import { TextFieldBaseAutosuggest } from './text-field-base';
5
5
  function _defineProperty(obj, key, value) {
6
6
  if (key in obj) {
7
7
  Object.defineProperty(obj, key, {
@@ -92,7 +92,7 @@ var EmailField = function(_param) {
92
92
  onChange: onChange,
93
93
  onChangeValue: onChangeValue
94
94
  });
95
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
95
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
96
96
  }, rest, fieldProps, {
97
97
  type: "email",
98
98
  inputMode: "email",
@@ -420,13 +420,12 @@ export var SuccessFeedbackScreen = function(props) {
420
420
  };
421
421
  var ErrorFeedbackScreen = function(_param) {
422
422
  var children = _param.children, errorReference = _param.errorReference, otherProps = _objectWithoutProperties(_param, ["children", "errorReference"]);
423
- var ref = useTheme(), skinName = ref.skinName, colors = ref.colors;
424
- var hasIcon = skinName !== VIVO_SKIN;
423
+ var ref = useTheme(), colors = ref.colors;
425
424
  return(/*#__PURE__*/ _jsxs(FeedbackScreen, _objectSpread({
426
425
  }, otherProps, {
427
426
  hapticFeedback: "error",
428
- icon: hasIcon ? /*#__PURE__*/ _jsx(IcnError, {
429
- }) : undefined,
427
+ icon: /*#__PURE__*/ _jsx(IcnError, {
428
+ }),
430
429
  animateText: true,
431
430
  children: [
432
431
  children,
@@ -440,12 +439,10 @@ var ErrorFeedbackScreen = function(_param) {
440
439
  };
441
440
  export { ErrorFeedbackScreen };
442
441
  export var InfoFeedbackScreen = function(props) {
443
- var ref = useTheme(), skinName = ref.skinName;
444
- var hasIcon = skinName !== VIVO_SKIN;
445
442
  return(/*#__PURE__*/ _jsx(FeedbackScreen, _objectSpread({
446
443
  }, props, {
447
- icon: hasIcon ? /*#__PURE__*/ _jsx(IcnInfo, {
448
- }) : undefined
444
+ icon: /*#__PURE__*/ _jsx(IcnInfo, {
445
+ })
449
446
  })));
450
447
  };
451
448
  export var SuccessFeedback = function(param) {
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useRifm } from 'rifm';
4
4
  import { useFieldProps } from './form-context';
5
- import TextFieldBase from './text-field-base';
5
+ import { TextFieldBaseAutosuggest } from './text-field-base';
6
6
  import { createChangeEvent } from './utils/dom';
7
7
  import { combineRefs } from './utils/common';
8
8
  import { useTheme } from './hooks';
@@ -246,7 +246,7 @@ var IbanField = function(_param) {
246
246
  onChange: onChange,
247
247
  onChangeValue: onChangeValue
248
248
  });
249
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
249
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
250
250
  }, rest, fieldProps, {
251
251
  inputComponent: IbanInput
252
252
  })));
@@ -59,21 +59,29 @@ var IconSuccessO2 = function(param) {
59
59
  children: /*#__PURE__*/ _jsxs("g", {
60
60
  className: classnames(_defineProperty({
61
61
  }, classes.iconContainer, !color)),
62
- strokeWidth: "2",
63
62
  strokeLinecap: "round",
64
63
  strokeLinejoin: "round",
65
64
  children: [
66
65
  /*#__PURE__*/ _jsx("path", _objectSpread({
67
66
  fill: "none",
67
+ strokeWidth: "2",
68
68
  stroke: color ? color : undefined,
69
- strokeMiterlimit: "10",
70
- d: "M21.7,35.6l2.8,2.8c1.1,1.1,2.9,1.1,4.1,0l17.3-17.3"
71
- }, !skipAnimation && mergeProperties(getAnimateDrawLineProps('33', '0.9s', platformOverrides), getAnimateHopInProps('0.9s', platformOverrides)))),
69
+ d: "M45.64 53.84A25.599 25.599 0 0 1 32 57.75C17.78 57.75 6.25 46.22 6.25 32S17.78 6.25 32 6.25 57.75 17.78 57.75 32c0 5.13-1.5 9.92-4.09 13.93"
70
+ }, !skipAnimation && getAnimateDrawLineProps('202', '0.3s', platformOverrides))),
72
71
  /*#__PURE__*/ _jsx("path", _objectSpread({
73
72
  fill: "none",
73
+ strokeWidth: "2",
74
+ stroke: color ? color : undefined,
75
+ d: "m19.33 30.39 9.88 10.95 18.13-19.23"
76
+ }, !skipAnimation && mergeProperties(getAnimateDrawLineProps('44', '0.6s', platformOverrides), getAnimateHopInProps('0.6', platformOverrides)))),
77
+ /*#__PURE__*/ _jsx("circle", _objectSpread({
78
+ fill: "none",
79
+ strokeWidth: "2",
74
80
  stroke: color ? color : undefined,
75
- d: "M49.1,57.9C44.2,61.1,38.3,63,32,63C14.9,63,1,49.1,1,32C1,14.9,14.9,1,32,1c17.1,0,31,13.9,31,31c0,7.5-2.6,14.3-7.1,19.7"
76
- }, !skipAnimation && getAnimateDrawLineProps('186', '0.5s', platformOverrides)))
81
+ cx: "50.18",
82
+ cy: "50.1",
83
+ r: ".89"
84
+ }, !skipAnimation && getAnimateDrawLineProps('180', '0.2s', platformOverrides)))
77
85
  ]
78
86
  })
79
87
  }));
package/dist-es/image.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
2
3
  import { createUseStyles } from './jss';
3
4
  function _objectWithoutProperties(source, excluded) {
4
5
  if (source == null) return {
@@ -30,38 +31,70 @@ function _objectWithoutPropertiesLoose(source, excluded) {
30
31
  }
31
32
  return target;
32
33
  }
34
+ /**
35
+ * This context is used internally to disable the border radius. This is useful for example
36
+ * when using the Image component inside a Card
37
+ */ var DisableBorderRadiusContext = /*#__PURE__*/ React.createContext(false);
38
+ export var useDisableBorderRadius = function() {
39
+ return React.useContext(DisableBorderRadiusContext);
40
+ };
41
+ export var DisableBorderRadiusProvider = function(param) {
42
+ var children = param.children;
43
+ /*#__PURE__*/ return _jsx(DisableBorderRadiusContext.Provider, {
44
+ value: true,
45
+ children: children
46
+ });
47
+ };
33
48
  var useStyles = createUseStyles(function() {
34
49
  return {
35
50
  image: {
36
- borderRadius: 4,
51
+ borderRadius: function(param) {
52
+ var noBorderRadius = param.noBorderRadius;
53
+ return noBorderRadius ? 0 : 4;
54
+ },
37
55
  display: 'block',
38
56
  objectFit: 'cover',
39
57
  maxWidth: '100%',
40
- maxHeight: '100%'
58
+ maxHeight: '100%',
59
+ aspectRatio: function(param) {
60
+ var aspectRatio = param.aspectRatio;
61
+ return aspectRatio !== null && aspectRatio !== void 0 ? aspectRatio : 'unset';
62
+ }
41
63
  }
42
64
  };
43
65
  });
44
- var RATIO = {
66
+ export var RATIO = {
45
67
  '1:1': 1,
46
68
  '16:9': 16 / 9,
47
69
  '7:10': 7 / 10
48
70
  };
49
- var Image = function(_param) {
50
- var url = _param.url, _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, props = _objectWithoutProperties(_param, ["url", "aspectRatio", "alt"]);
51
- var classes = useStyles();
71
+ var Image = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
72
+ var _aspectRatio = _param.aspectRatio, aspectRatio = _aspectRatio === void 0 ? '1:1' : _aspectRatio, _alt = _param.alt, alt = _alt === void 0 ? '' : _alt, props = _objectWithoutProperties(_param, ["aspectRatio", "alt"]);
73
+ var noBorderRadius = useDisableBorderRadius();
74
+ var classes = useStyles({
75
+ noBorderRadius: noBorderRadius,
76
+ aspectRatio: !props.width && !props.height ? RATIO[aspectRatio] : undefined
77
+ });
78
+ var url = props.src || props.url;
52
79
  var width = props.width;
53
80
  var height = props.height;
54
- if (props.width !== undefined) {
81
+ if (props.width !== undefined && props.height !== undefined) {
82
+ width = props.width;
83
+ height = props.height;
84
+ } else if (props.width !== undefined) {
55
85
  height = props.width / RATIO[aspectRatio];
56
86
  } else if (props.height !== undefined) {
57
87
  width = props.height * RATIO[aspectRatio];
88
+ } else {
89
+ width = '100%';
58
90
  }
59
91
  return(/*#__PURE__*/ _jsx("img", {
92
+ ref: ref,
60
93
  src: url,
61
94
  className: classes.image,
62
95
  alt: alt,
63
96
  width: width,
64
97
  height: height
65
98
  }));
66
- };
99
+ });
67
100
  export default Image;
package/dist-es/index.js CHANGED
@@ -56,10 +56,12 @@ export { default as Callout } from './callout';
56
56
  export { useModalState } from './modal-context-provider';
57
57
  export { NavigationBar, MainNavigationBar, FunnelNavigationBar, NavigationBarActionGroup, NavigationBarAction, NavigationBarLogo } from './navigation-bar';
58
58
  export { default as Image } from './image';
59
+ export { default as Video } from './video';
59
60
  // Forms
60
61
  export { default as Form } from './form';
61
62
  export { default as Select } from './select';
62
63
  export { default as TextField } from './text-field';
64
+ export { TextFieldBase } from './text-field-base';
63
65
  export { default as SearchField } from './search-field';
64
66
  export { default as EmailField } from './email-field';
65
67
  export { default as PhoneNumberField } from './phone-number-field';
@@ -75,7 +77,7 @@ export { default as DecimalField } from './decimal-field';
75
77
  export { default as PasswordField } from './password-field';
76
78
  export { default as DoubleField } from './double-field';
77
79
  export { default as IbanField } from './iban-field';
78
- export { useForm } from './form-context';
80
+ export { useForm, useFieldProps } from './form-context';
79
81
  // Icons
80
82
  // @deprecated use IconCloseRegular instead
81
83
  export { default as IconClose } from './icons/icon-close';
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useFieldProps } from './form-context';
3
3
  import { useTheme } from './hooks';
4
- import TextFieldBase from './text-field-base';
4
+ import { TextFieldBaseAutosuggest } from './text-field-base';
5
5
  function _defineProperty(obj, key, value) {
6
6
  if (key in obj) {
7
7
  Object.defineProperty(obj, key, {
@@ -110,7 +110,7 @@ var IntegerField = function(_param) {
110
110
  onChange: onChange,
111
111
  onChangeValue: onChangeValue
112
112
  });
113
- return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
113
+ return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
114
114
  }, rest, fieldProps, {
115
115
  inputComponent: IntegerInput
116
116
  })));