@telefonica/mistica 12.5.0 → 12.6.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.
@@ -355,8 +355,6 @@ var BurgerMenuIcon = function(param) {
355
355
  };
356
356
  var NAVBAR_ZINDEX = 25;
357
357
  var BURGER_ZINDEX = 26;
358
- var DESKTOP_NAVBAR_HEIGHT = 80;
359
- var MOBILE_NAVBAR_HEIGHT = 56;
360
358
  var BURGER_MENU_ANIMATION_DURATION_MS = 300;
361
359
  var useStyles = createUseStyles(function(theme) {
362
360
  var shadowAlpha = theme.isDarkMode ? 1 : 0.2;
@@ -383,7 +381,7 @@ var useStyles = createUseStyles(function(theme) {
383
381
  var isInverse = param.isInverse;
384
382
  return isInverse ? theme.colors.navigationBarBackground : theme.colors.background;
385
383
  },
386
- height: DESKTOP_NAVBAR_HEIGHT,
384
+ height: theme.dimensions.headerDesktopHeight,
387
385
  padding: "16px 0",
388
386
  borderBottomStyle: "solid",
389
387
  borderBottomWidth: function(param) {
@@ -400,11 +398,11 @@ var useStyles = createUseStyles(function(theme) {
400
398
  var isMenuOpen = param.isMenuOpen, isInverse = param.isInverse;
401
399
  return isMenuOpen || isInverse && !theme.isDarkMode ? "transparent" : theme.colors.divider;
402
400
  },
403
- height: MOBILE_NAVBAR_HEIGHT,
401
+ height: theme.dimensions.headerMobileHeight,
404
402
  padding: "8px 0"
405
403
  }),
406
404
  section: _defineProperty({
407
- height: DESKTOP_NAVBAR_HEIGHT,
405
+ height: theme.dimensions.headerDesktopHeight,
408
406
  display: "flex",
409
407
  alignItems: "center",
410
408
  padding: "0 8px",
@@ -425,17 +423,17 @@ var useStyles = createUseStyles(function(theme) {
425
423
  }
426
424
  },
427
425
  spacer: _defineProperty({
428
- height: DESKTOP_NAVBAR_HEIGHT
426
+ height: theme.dimensions.headerDesktopHeight
429
427
  }, theme.mq.tabletOrSmaller, {
430
- height: MOBILE_NAVBAR_HEIGHT
428
+ height: theme.dimensions.headerMobileHeight
431
429
  }),
432
430
  burgerMenu: {
433
431
  zIndex: BURGER_ZINDEX,
434
432
  position: "fixed",
435
- top: MOBILE_NAVBAR_HEIGHT,
433
+ top: theme.dimensions.headerMobileHeight,
436
434
  left: 0,
437
435
  right: 0,
438
- height: "calc(100vh - ".concat(MOBILE_NAVBAR_HEIGHT, "px)"),
436
+ height: "calc(100vh - ".concat(theme.dimensions.headerMobileHeight, "px)"),
439
437
  overflowY: "auto",
440
438
  background: theme.colors.background,
441
439
  boxShadow: function(param) {
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "12.5.0";
2
+ export var PACKAGE_VERSION = "12.6.0";
@@ -104,8 +104,8 @@ import * as React from "react";
104
104
  import { createUseStyles } from "./jss";
105
105
  import { Label, HelperText, FieldContainer, LABEL_LEFT_POSITION, LABEL_SCALE_MOBILE, LABEL_SCALE_DESKTOP } from "./text-field-components";
106
106
  import { Text3 } from "./text";
107
- import { isIos, isRunningAcceptanceTest, isFirefox } from "./utils/platform";
108
- import { useAriaId, useTheme, useScreenSize } from "./hooks";
107
+ import { isIos, isRunningAcceptanceTest, isFirefox, isSafari } from "./utils/platform";
108
+ import { useAriaId, useTheme, useScreenSize, useIsomorphicLayoutEffect } from "./hooks";
109
109
  import classNames from "classnames";
110
110
  import { combineRefs } from "./utils/common";
111
111
  var commonInputStyles = function(theme) {
@@ -270,7 +270,10 @@ var useStyles = createUseStyles(function(theme) {
270
270
  position: "absolute"
271
271
  },
272
272
  prefix: (_obj2 = {
273
- alignSelf: "baseline",
273
+ alignSelf: function(param) {
274
+ var prefixAlignSelf = param.prefixAlignSelf;
275
+ return prefixAlignSelf;
276
+ },
274
277
  paddingTop: function(param) {
275
278
  var hasLabel = param.hasLabel;
276
279
  return hasLabel ? 28 : 16;
@@ -315,7 +318,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
315
318
  "fullWidth"
316
319
  ]);
317
320
  var id = useAriaId(idProp);
318
- var _$ref3 = _slicedToArray(React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) ? "filled" : "default"), 2), inputState = _$ref3[0], setInputState = _$ref3[1];
321
+ var _$ref4 = _slicedToArray(React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) ? "filled" : "default"), 2), inputState = _$ref4[0], setInputState = _$ref4[1];
319
322
  var colors = useTheme().colors;
320
323
  var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
321
324
  var _$ref1;
@@ -324,6 +327,18 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
324
327
  // this shrinkLabel override is a workaround because I was unable to find a way to hide date
325
328
  // and date-time native placeholders when the input is not required
326
329
  var shrinkLabel = shrinkLabelProp || (rest.type === "date" || rest.type === "datetime-local" || rest.type === "month") && !rest.required;
330
+ var _$ref3 = _slicedToArray(React.useState("baseline"), 2), prefixAlignSelf = _$ref3[0], setPrefixAlignSelf = _$ref3[1];
331
+ useIsomorphicLayoutEffect(function() {
332
+ /**
333
+ * Safari check to workaround https://jira.tid.es/browse/WEB-648
334
+ * For some reason it is super hard to align the prefix text with the input text
335
+ * and get the same result in chrome and safari
336
+ *
337
+ * Using an effect to set the style to avoid problems with SSR
338
+ */ if (isSafari()) {
339
+ setPrefixAlignSelf("initial");
340
+ }
341
+ }, []);
327
342
  var classes = useStyles({
328
343
  inputState: inputState,
329
344
  error: error,
@@ -334,7 +349,8 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
334
349
  prefix: prefix,
335
350
  multiline: multiline,
336
351
  type: rest.type,
337
- disabled: rest.disabled
352
+ disabled: rest.disabled,
353
+ prefixAlignSelf: prefixAlignSelf
338
354
  });
339
355
  React.useEffect(function() {
340
356
  if (inputState !== "focused" && (value === null || value === void 0 ? void 0 : value.length)) {
@@ -500,10 +516,10 @@ var TextFieldBaseAutosuggest = /*#__PURE__*/ React.forwardRef(function(_param, r
500
516
  "getSuggestions",
501
517
  "id"
502
518
  ]);
503
- var _$ref5 = _slicedToArray(React.useState([]), 2), suggestions = _$ref5[0], setSuggestions = _$ref5[1];
519
+ var _$ref6 = _slicedToArray(React.useState([]), 2), suggestions = _$ref6[0], setSuggestions = _$ref6[1];
504
520
  var inputRef = React.useRef(null);
505
521
  var classes = useSuggestionsStyles();
506
- var _$ref4 = useTheme(), platformOverrides = _$ref4.platformOverrides, texts = _$ref4.texts;
522
+ var _$ref5 = useTheme(), platformOverrides = _$ref5.platformOverrides, texts = _$ref5.texts;
507
523
  var id = useAriaId(idProp);
508
524
  var autoSuggestId = useAriaId();
509
525
  if (getSuggestions && (props.value === undefined || props.defaultValue !== undefined)) {
@@ -54,6 +54,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
54
54
  return target;
55
55
  }
56
56
  import { jsx as _jsx } from "react/jsx-runtime";
57
+ // Specs: https://www.figma.com/file/koROdh3HpEPG2O8jG52Emh/Buttons-Component-Specs?node-id=0%3A1
57
58
  import * as React from "react";
58
59
  import { createUseStyles } from "./jss";
59
60
  import Touchable from "./touchable";
@@ -69,7 +70,7 @@ var useStyles = createUseStyles(function(param) {
69
70
  textLink: (_obj = {
70
71
  width: "auto",
71
72
  lineHeight: "inherit",
72
- display: "inline-block",
73
+ display: "inline",
73
74
  color: colors.textLink,
74
75
  wordBreak: "break-word",
75
76
  cursor: "pointer"
@@ -123,6 +124,7 @@ var TextLink = function(_param) {
123
124
  var _trackingEvent;
124
125
  var _obj;
125
126
  return /*#__PURE__*/ _jsx(Touchable, _objectSpread({}, props, {
127
+ as: props.onPress ? "a" : undefined,
126
128
  trackingEvent: (_trackingEvent = props.trackingEvent) !== null && _trackingEvent !== void 0 ? _trackingEvent : props.trackEvent ? createDefaultTrackingEvent() : undefined,
127
129
  disabled: disabled || formStatus === "sending",
128
130
  className: classnames(classes.textLink, className, (_obj = {}, _defineProperty(_obj, classes.small, small), _defineProperty(_obj, classes.inverse, isInverse), _obj)),
package/dist-es/theme.js CHANGED
@@ -204,7 +204,8 @@ export var getTexts = function(locale) {
204
204
  }
205
205
  };
206
206
  export var dimensions = {
207
- headerMobileHeight: 56
207
+ headerMobileHeight: 56,
208
+ headerDesktopHeight: 80
208
209
  };
209
210
  export var mediaQueriesConfig = {
210
211
  tabletMinWidth: 768,
@@ -102,19 +102,27 @@ function _unsupportedIterableToArray(o, minLen) {
102
102
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
103
103
  import * as React from "react";
104
104
  import classnames from "classnames";
105
+ import { CSSTransition } from "react-transition-group";
105
106
  import { useAriaId, useScreenSize } from "./hooks";
106
107
  import { Portal } from "./portal";
107
108
  import Overlay from "./overlay";
109
+ import { Text2 } from "./text";
108
110
  import * as key from "./utils/key-codes";
109
111
  import { createUseStyles } from "./jss";
112
+ import Stack from "./stack";
110
113
  var defaultPositionDesktop = "bottom";
111
114
  var defaultPositionMobile = "top";
112
115
  var arrowSize = 12;
113
- var distanceToTarget = 8 + arrowSize;
116
+ var distanceToTarget = 4 + arrowSize;
114
117
  var marginLeftRightMobile = 16;
115
118
  var defaultWidthDesktop = 340;
116
119
  var arrowWrapperWidth = arrowSize * 2;
117
120
  var arrowWrapperHeight = arrowSize;
121
+ var transitionDurationMs = 500;
122
+ var animationMovement = 12;
123
+ var animationTiming = "cubic-bezier(0.215, 0.61, 0.355, 1)";
124
+ var defaultShowTooltipDelayMs = 500;
125
+ var noOp = function() {};
118
126
  var useStyles = createUseStyles(function(theme) {
119
127
  var shadowAlpha = theme.isDarkMode ? 1 : 0.2;
120
128
  return {
@@ -126,7 +134,7 @@ var useStyles = createUseStyles(function(theme) {
126
134
  top: 0,
127
135
  left: "50%",
128
136
  transform: "translate(-50%, -50%) rotate(45deg)",
129
- border: "1px solid ".concat(theme.colors.divider),
137
+ border: "1px solid ".concat(theme.colors.border),
130
138
  borderRadius: 2
131
139
  },
132
140
  arrowTop: {
@@ -175,42 +183,142 @@ var useStyles = createUseStyles(function(theme) {
175
183
  left: 16,
176
184
  width: "auto",
177
185
  boxShadow: "0 2px 4px 0 rgba(0, 0, 0, ".concat(shadowAlpha, ")"),
178
- padding: 16,
186
+ padding: 8,
179
187
  backgroundColor: theme.colors.backgroundContainer,
180
- zIndex: 12,
181
- border: "1px solid ".concat(theme.colors.divider),
188
+ zIndex: 50,
189
+ border: "1px solid ".concat(theme.colors.border),
182
190
  borderRadius: 8
191
+ }
192
+ };
193
+ });
194
+ var useAnimationStyles = createUseStyles(function() {
195
+ return {
196
+ enter: {
197
+ transform: function(param) {
198
+ var position = param.position;
199
+ if (position === "bottom") {
200
+ return "translateY(".concat(animationMovement, "px)");
201
+ }
202
+ if (position === "top") {
203
+ return "translateY(calc(-100% - ".concat(animationMovement, "px))");
204
+ }
205
+ if (position === "right") {
206
+ return "translateX(".concat(animationMovement, "px) translateY(-50%)");
207
+ }
208
+ if (position === "left") {
209
+ return "translateX(-".concat(animationMovement, "px) translateY(-50%)");
210
+ }
211
+ return "translateY(-".concat(animationMovement, "px)");
212
+ }
213
+ },
214
+ enterActive: {
215
+ animationName: function(param) {
216
+ var position = param.position;
217
+ if (position === "top") return "$fadeInTop";
218
+ if (position === "bottom") return "$fadeInBottom";
219
+ return "$fadeInX";
220
+ },
221
+ animationFillMode: "both",
222
+ animationDuration: "".concat(transitionDurationMs, "ms"),
223
+ animationTimingFunction: animationTiming
224
+ },
225
+ enterDone: {
226
+ transform: function(param) {
227
+ var position = param.position;
228
+ if (position === "top") return "translateY(-100%)";
229
+ if (position === "bottom") return "translateY(0)";
230
+ return "translateY(-50%)";
231
+ }
232
+ },
233
+ exit: {
234
+ transform: function(param) {
235
+ var position = param.position;
236
+ if (position === "bottom") {
237
+ return "translateY(0)";
238
+ }
239
+ if (position === "top") {
240
+ return "translateY(-100%)";
241
+ }
242
+ if (position === "right") {
243
+ return "translateX(0px) translateY(-50%)";
244
+ }
245
+ if (position === "left") {
246
+ return "translateX(0px) translateY(-50%)";
247
+ }
248
+ return "translateY(0px)";
249
+ },
250
+ opacity: 1,
251
+ transition: "opacity 0.3s ".concat(animationTiming)
252
+ },
253
+ exitActive: {
254
+ animation: "$fadeOut 0.3s ".concat(animationTiming, " both")
255
+ },
256
+ "@keyframes fadeInBottom": {
257
+ from: {
258
+ opacity: 0
259
+ },
260
+ "40%": {
261
+ opacity: 1
262
+ },
263
+ to: {
264
+ opacity: 1,
265
+ transform: "translateY(0)"
266
+ }
183
267
  },
184
- title: {
185
- margin: 0,
186
- marginBottom: 12,
187
- color: theme.colors.textPrimary,
188
- lineHeight: 1.42857142,
189
- fontSize: 14
268
+ "@keyframes fadeInTop": {
269
+ from: {
270
+ opacity: 0
271
+ },
272
+ "40%": {
273
+ opacity: 1
274
+ },
275
+ to: {
276
+ opacity: 1,
277
+ transform: "translateY(-100%)"
278
+ }
190
279
  },
191
- description: {
192
- margin: 0,
193
- color: theme.colors.textPrimary,
194
- lineHeight: 1.42857142,
195
- fontSize: 14
280
+ "@keyframes fadeInX": {
281
+ from: {
282
+ opacity: 0
283
+ },
284
+ "40%": {
285
+ opacity: 1
286
+ },
287
+ to: {
288
+ opacity: 1,
289
+ transform: "translateX(0) translateY(-50%)"
290
+ }
291
+ },
292
+ "@keyframes fadeOut": {
293
+ from: {
294
+ opacity: 1
295
+ },
296
+ to: {
297
+ opacity: 0
298
+ }
196
299
  }
197
300
  };
198
301
  });
199
302
  var getWidthDesktop = function(customWidth) {
200
303
  return customWidth ? customWidth : defaultWidthDesktop;
201
304
  };
202
- var EVENT_THROTTLE_TIME = process.env.NODE_ENV === "test" ? 0 : 200;
203
305
  var Tooltip = function(_param) {
204
- var children = _param.children, description = _param.description, target = _param.target, title = _param.title, targetLabel = _param.targetLabel, rest = _objectWithoutProperties(_param, [
306
+ var children = _param.children, extra = _param.extra, description = _param.description, target = _param.target, title = _param.title, targetLabel = _param.targetLabel, _delay = _param.delay, delay = _delay === void 0 ? true : _delay, rest = _objectWithoutProperties(_param, [
205
307
  "children",
308
+ "extra",
206
309
  "description",
207
310
  "target",
208
311
  "title",
209
- "targetLabel"
312
+ "targetLabel",
313
+ "delay"
210
314
  ]);
211
315
  var ref = _slicedToArray(React.useState(false), 2), isVisible = ref[0], setIsVisible = ref[1];
212
316
  var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
213
317
  var ariaId = useAriaId();
318
+ var isPointerOver = React.useRef(false);
319
+ var closeTooltipTimeoutId = React.useRef(null);
320
+ var showTooltipTimeoutId = React.useRef(null);
321
+ var targetRef = React.useRef(null);
214
322
  var targetBoundingClientRect = React.useRef({
215
323
  top: 0,
216
324
  right: 0,
@@ -219,10 +327,16 @@ var Tooltip = function(_param) {
219
327
  width: 0,
220
328
  height: 0
221
329
  });
222
- // This property is needed because safari is making a mess with the events (it has problems
223
- // when the overlay layer appears and disappears). This way we ensure that events don't get handled twice
224
- var lastChangeTime = React.useRef(0);
330
+ var getPosition = function() {
331
+ var position = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultPositionDesktop;
332
+ return isTabletOrSmaller && (position === "left" || position === "right") ? defaultPositionMobile : position;
333
+ };
334
+ var position1 = getPosition(rest.position);
225
335
  var classes = useStyles();
336
+ var animationClasses = useAnimationStyles({
337
+ position: position1
338
+ });
339
+ var isTouchableDevice = typeof window !== "undefined" ? window.matchMedia("(pointer: coarse)").matches : false;
226
340
  var closeTooltip = function() {
227
341
  if (isVisible) {
228
342
  setIsVisible(false);
@@ -235,23 +349,16 @@ var Tooltip = function(_param) {
235
349
  };
236
350
  });
237
351
  var handleClickOutside = function() {
238
- if (Date.now() - lastChangeTime.current < EVENT_THROTTLE_TIME) {
239
- return;
240
- }
241
- lastChangeTime.current = Date.now();
242
352
  setIsVisible(false);
243
353
  };
244
- var toggleVisibility = function(e) {
245
- if (Date.now() - lastChangeTime.current < EVENT_THROTTLE_TIME) {
246
- return;
247
- }
248
- lastChangeTime.current = Date.now();
249
- targetBoundingClientRect.current = e.currentTarget.getBoundingClientRect();
354
+ var toggleVisibility = function() {
355
+ if (!targetRef.current) return;
356
+ targetBoundingClientRect.current = targetRef.current.getBoundingClientRect();
250
357
  setIsVisible(!isVisible);
251
358
  };
252
- var handleFocus = function(e) {
359
+ var handleFocus = function() {
253
360
  if (!isVisible) {
254
- toggleVisibility(e);
361
+ toggleVisibility();
255
362
  }
256
363
  };
257
364
  var handleKeyDown = function(event) {
@@ -260,22 +367,19 @@ var Tooltip = function(_param) {
260
367
  }
261
368
  };
262
369
  var getContainerPosition = function(position, width) {
370
+ if (typeof window === "undefined") {
371
+ return {};
372
+ }
263
373
  var containerPos = {
264
374
  right: {
265
375
  left: targetBoundingClientRect.current.right + distanceToTarget,
266
- top: window.pageYOffset + targetBoundingClientRect.current.top + targetBoundingClientRect.current.height / 2,
267
- transform: "translateY(-50%)",
268
- WebKitTransform: "translateY(-50%)"
376
+ top: window.pageYOffset + targetBoundingClientRect.current.top + targetBoundingClientRect.current.height / 2
269
377
  },
270
378
  left: {
271
379
  left: targetBoundingClientRect.current.left - width - distanceToTarget,
272
- top: window.pageYOffset + targetBoundingClientRect.current.top + targetBoundingClientRect.current.height / 2,
273
- transform: "translateY(-50%)",
274
- WebKitTransform: "translateY(-50%)"
380
+ top: window.pageYOffset + targetBoundingClientRect.current.top + targetBoundingClientRect.current.height / 2
275
381
  },
276
382
  top: {
277
- transform: "translateY(-100%)",
278
- WebKitTransform: "translateY(-100%)",
279
383
  top: window.pageYOffset + targetBoundingClientRect.current.top - distanceToTarget,
280
384
  left: isTabletOrSmaller ? marginLeftRightMobile : window.pageXOffset + targetBoundingClientRect.current.left + targetBoundingClientRect.current.width / 2 - width / 2
281
385
  },
@@ -286,10 +390,6 @@ var Tooltip = function(_param) {
286
390
  };
287
391
  return containerPos[position];
288
392
  };
289
- var getPosition = function() {
290
- var position = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultPositionDesktop;
291
- return isTabletOrSmaller && (position === "left" || position === "right") ? defaultPositionMobile : position;
292
- };
293
393
  var getCustomStylesForMobile = function() {
294
394
  return isTabletOrSmaller ? {
295
395
  left: targetBoundingClientRect.current.left + targetBoundingClientRect.current.width / 2 - marginLeftRightMobile
@@ -298,7 +398,6 @@ var Tooltip = function(_param) {
298
398
  var getWidth = function() {
299
399
  return isTabletOrSmaller ? window.innerWidth - marginLeftRightMobile * 2 : getWidthDesktop(rest.width);
300
400
  };
301
- var position1 = getPosition(rest.position);
302
401
  var width1 = getWidth();
303
402
  var classNameByPosition = {
304
403
  top: classes.arrowTop,
@@ -309,8 +408,38 @@ var Tooltip = function(_param) {
309
408
  return /*#__PURE__*/ _jsxs(_Fragment, {
310
409
  children: [
311
410
  /*#__PURE__*/ _jsx("div", {
411
+ ref: targetRef,
312
412
  className: classes.wrapper,
313
- onPointerDown: toggleVisibility,
413
+ onPointerOver: function() {
414
+ if (closeTooltipTimeoutId.current) {
415
+ clearTimeout(closeTooltipTimeoutId.current);
416
+ closeTooltipTimeoutId.current = null;
417
+ }
418
+ if (isPointerOver.current) return;
419
+ isPointerOver.current = true;
420
+ if (delay) {
421
+ showTooltipTimeoutId.current = setTimeout(function() {
422
+ showTooltipTimeoutId.current = null;
423
+ toggleVisibility();
424
+ }, defaultShowTooltipDelayMs);
425
+ } else {
426
+ toggleVisibility();
427
+ }
428
+ },
429
+ onPointerLeave: isTouchableDevice ? noOp : function() {
430
+ if (showTooltipTimeoutId.current) {
431
+ clearTimeout(showTooltipTimeoutId.current);
432
+ showTooltipTimeoutId.current = null;
433
+ isPointerOver.current = false;
434
+ return;
435
+ }
436
+ closeTooltipTimeoutId.current = setTimeout(function() {
437
+ if (!isPointerOver.current) return;
438
+ closeTooltipTimeoutId.current = null;
439
+ isPointerOver.current = false;
440
+ toggleVisibility();
441
+ }, 100);
442
+ },
314
443
  onFocus: handleFocus,
315
444
  onKeyDown: handleKeyDown,
316
445
  "touch-action": "auto" // Prop needed for Pointer Events Polyfill to work properly
@@ -322,40 +451,67 @@ var Tooltip = function(_param) {
322
451
  "aria-label": targetLabel,
323
452
  children: target
324
453
  }),
325
- isVisible && /*#__PURE__*/ _jsxs(Portal, {
454
+ /*#__PURE__*/ _jsxs(Portal, {
326
455
  children: [
327
- /*#__PURE__*/ _jsx(Overlay, {
456
+ isVisible && isTouchableDevice && /*#__PURE__*/ _jsx(Overlay, {
328
457
  onPress: handleClickOutside
329
458
  }),
330
- /*#__PURE__*/ _jsxs("div", {
331
- role: "tooltip",
332
- id: ariaId,
333
- className: classes.container,
334
- style: _objectSpread({
335
- width: width1
336
- }, getContainerPosition(position1, width1)),
337
- children: [
338
- /*#__PURE__*/ _jsx("div", {
339
- className: classnames(classes.arrowWrapper, classNameByPosition[position1]),
340
- style: getCustomStylesForMobile(),
341
- children: /*#__PURE__*/ _jsx("div", {
342
- className: classes.arrow
343
- })
344
- }),
345
- (title || description) && /*#__PURE__*/ _jsxs(_Fragment, {
346
- children: [
347
- title && /*#__PURE__*/ _jsx("p", {
348
- className: classes.title,
349
- children: title
350
- }),
351
- description && /*#__PURE__*/ _jsx("p", {
352
- className: classes.description,
353
- children: description
459
+ /*#__PURE__*/ _jsx(CSSTransition, {
460
+ in: isVisible,
461
+ timeout: transitionDurationMs,
462
+ classNames: {
463
+ enter: animationClasses.enter,
464
+ enterActive: animationClasses.enterActive,
465
+ enterDone: animationClasses.enterDone,
466
+ exit: animationClasses.exit,
467
+ exitActive: animationClasses.exitActive
468
+ },
469
+ unmountOnExit: true,
470
+ children: /*#__PURE__*/ _jsxs("div", {
471
+ role: "tooltip",
472
+ id: ariaId,
473
+ className: classes.container,
474
+ style: _objectSpread({
475
+ width: width1
476
+ }, getContainerPosition(position1, width1)),
477
+ onPointerOver: function() {
478
+ if (closeTooltipTimeoutId.current) {
479
+ clearTimeout(closeTooltipTimeoutId.current);
480
+ closeTooltipTimeoutId.current = null;
481
+ }
482
+ },
483
+ onPointerLeave: isTouchableDevice ? noOp : function() {
484
+ closeTooltipTimeoutId.current = setTimeout(function() {
485
+ if (!isPointerOver.current) return;
486
+ closeTooltipTimeoutId.current = null;
487
+ isPointerOver.current = false;
488
+ toggleVisibility();
489
+ }, 100);
490
+ },
491
+ children: [
492
+ /*#__PURE__*/ _jsx("div", {
493
+ className: classnames(classes.arrowWrapper, classNameByPosition[position1]),
494
+ style: getCustomStylesForMobile(),
495
+ children: /*#__PURE__*/ _jsx("div", {
496
+ className: classes.arrow
354
497
  })
355
- ]
356
- }),
357
- children
358
- ]
498
+ }),
499
+ (title || description) && /*#__PURE__*/ _jsxs(Stack, {
500
+ space: 4,
501
+ children: [
502
+ title && /*#__PURE__*/ _jsx(Text2, {
503
+ medium: true,
504
+ children: title
505
+ }),
506
+ description && /*#__PURE__*/ _jsx(Text2, {
507
+ regular: true,
508
+ children: description
509
+ })
510
+ ]
511
+ }),
512
+ extra || children
513
+ ]
514
+ })
359
515
  })
360
516
  ]
361
517
  })
@@ -205,7 +205,12 @@ var Touchable = /*#__PURE__*/ React.forwardRef(function(props, ref) {
205
205
  }));
206
206
  }
207
207
  if (props.onPress) {
208
- return /*#__PURE__*/ _jsx("button", _objectSpread({}, commonProps, {
208
+ var _as;
209
+ var elementType = (_as = props.as) !== null && _as !== void 0 ? _as : "button";
210
+ var _role;
211
+ var role = (_role = commonProps.role) !== null && _role !== void 0 ? _role : props.as === "a" ? "button" : undefined;
212
+ return /*#__PURE__*/ React.createElement(elementType, _objectSpread({}, commonProps, {
213
+ role: role,
209
214
  // this "form" attribute is useful when the form's submit button
210
215
  // is located outside the <form> element, for example if you use
211
216
  // a ButtonFixedFooter layout inside a form with the submit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "12.5.0",
3
+ "version": "12.6.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,6 +49,7 @@
49
49
  "acceptanceTests": {
50
50
  "devServer": {
51
51
  "command": "yarn storybook-for-acceptance-tests",
52
+ "host": "0.0.0.0",
52
53
  "port": 6006
53
54
  },
54
55
  "ciServer": {