@telefonica/mistica 11.3.0 → 11.4.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.
package/dist/feedback.js CHANGED
@@ -354,7 +354,7 @@ var FeedbackScreen = function FeedbackScreen(param) {
354
354
  var title = param.title, description = param.description, children = param.children, primaryButton = param.primaryButton, secondaryButton = param.secondaryButton, link = param.link, hapticFeedback = param.hapticFeedback, icon = param.icon, _animateText = param.animateText, animateText = _animateText === void 0 ? false : _animateText, unstable_inlineInDesktop = param.unstable_inlineInDesktop, imageUrl = param.imageUrl, imageFit = param.imageFit, dataAttributes = param.dataAttributes;
355
355
  useHapticFeedback(hapticFeedback);
356
356
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
357
- var ref = (0, _hooks).useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides;
357
+ var ref = (0, _hooks).useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides, isDarkMode = ref.isDarkMode;
358
358
  var windowHeight = (0, _hooks).useWindowHeight();
359
359
  var isTabletOrSmaller = (0, _hooks).useScreenSize().isTabletOrSmaller;
360
360
  var ref1 = _slicedToArray(React.useState(typeof self !== "undefined"), 2), isServerSide = ref1[0], setIsServerSide = ref1[1];
@@ -417,8 +417,8 @@ var FeedbackScreen = function FeedbackScreen(param) {
417
417
  button: primaryButton,
418
418
  secondaryButton: secondaryButton,
419
419
  link: link,
420
- footerBgColor: isInverse ? colors.backgroundFeedbackBottom : undefined,
421
- containerBgColor: isInverse ? colors.navigationBarBackground : undefined,
420
+ footerBgColor: isInverse && !isDarkMode ? colors.backgroundFeedbackBottom : undefined,
421
+ containerBgColor: isInverse && !isDarkMode ? colors.backgroundFeedbackBottom : undefined,
422
422
  onChangeFooterHeight: setFooterHeight,
423
423
  children: feedbackContent
424
424
  })
@@ -110,9 +110,13 @@ var waitForSwitchTransitionToStart = function waitForSwitchTransitionToStart(fn)
110
110
  var useStyles = (0, _jss).createUseStyles(function(theme) {
111
111
  return _defineProperty({
112
112
  footer: {
113
- width: "100%"
113
+ width: "100%",
114
+ backgroundColor: theme.colors.background,
115
+ transition: "background 0.2s linear, box-shadow 0.2s linear"
116
+ },
117
+ elevated: {
118
+ backgroundColor: theme.colors.backgroundContainer
114
119
  },
115
- shadow: {},
116
120
  withoutFooter: {
117
121
  display: "none"
118
122
  },
@@ -133,19 +137,18 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
133
137
  bottom: 0,
134
138
  zIndex: 1
135
139
  },
136
- shadow: {
137
- boxShadow: "0 -3px 8px 0 rgba(0, 0, 0, 0.15)"
140
+ elevated: {
141
+ boxShadow: "0 -2px 8px 0 rgba(0, 0, 0, 0.10)"
138
142
  }
139
143
  });
140
144
  });
141
145
  var FixedFooterLayout = function FixedFooterLayout(param) {
142
146
  var _isFooterVisible = param.isFooterVisible, isFooterVisible = _isFooterVisible === void 0 ? true : _isFooterVisible, footer = param.footer, _footerHeight = param.footerHeight, footerHeight = _footerHeight === void 0 ? "auto" : _footerHeight, footerBgColor = param.footerBgColor, containerBgColor = param.containerBgColor, children = param.children, onChangeFooterHeight = param.onChangeFooterHeight;
143
- var ref = _slicedToArray(React.useState(false), 2), displayShadow = ref[0], setDisplayShadow = ref[1];
147
+ var ref = _slicedToArray(React.useState(false), 2), displayElevation = ref[0], setDisplayElevation = ref[1];
144
148
  var containerRef = React.useRef(null);
145
149
  var isTabletOrSmaller = (0, _hooks).useScreenSize().isTabletOrSmaller;
146
150
  var platformOverrides = (0, _hooks).useTheme().platformOverrides;
147
151
  var ref1 = (0, _hooks).useElementDimensions(), realHeight = ref1.height, ref2 = ref1.ref;
148
- var colors = (0, _hooks).useTheme().colors;
149
152
  (0, _hooks).useIsomorphicLayoutEffect(function() {
150
153
  onChangeFooterHeight === null || onChangeFooterHeight === void 0 ? void 0 : onChangeFooterHeight(realHeight);
151
154
  }, [
@@ -154,7 +157,7 @@ var FixedFooterLayout = function FixedFooterLayout(param) {
154
157
  ]);
155
158
  React.useEffect(function() {
156
159
  var scrollable = (0, _dom).getScrollableParentElement(containerRef.current);
157
- var shouldDisplayShadow = function shouldDisplayShadow() {
160
+ var shouldDisplayElevation = function shouldDisplayElevation() {
158
161
  if ((0, _platform).isRunningAcceptanceTest(platformOverrides)) {
159
162
  return false;
160
163
  }
@@ -163,19 +166,20 @@ var FixedFooterLayout = function FixedFooterLayout(param) {
163
166
  }
164
167
  return false;
165
168
  };
166
- var checkDisplayShadow = (0, _debounce).default(function() {
167
- setDisplayShadow(shouldDisplayShadow());
169
+ var checkDisplayElevation = (0, _debounce).default(function() {
170
+ setDisplayElevation(shouldDisplayElevation());
168
171
  }, 50, {
169
- leading: true
172
+ leading: true,
173
+ maxWait: 200
170
174
  });
171
- var transitionAwaiter = waitForSwitchTransitionToStart(checkDisplayShadow);
175
+ var transitionAwaiter = waitForSwitchTransitionToStart(checkDisplayElevation);
172
176
  var scrollEventTarget = getScrollEventTarget(scrollable);
173
- (0, _dom).addPassiveEventListener(scrollEventTarget, "resize", checkDisplayShadow);
174
- (0, _dom).addPassiveEventListener(scrollEventTarget, "scroll", checkDisplayShadow);
177
+ (0, _dom).addPassiveEventListener(scrollEventTarget, "resize", checkDisplayElevation);
178
+ (0, _dom).addPassiveEventListener(scrollEventTarget, "scroll", checkDisplayElevation);
175
179
  return function() {
176
- checkDisplayShadow.cancel();
177
- (0, _dom).removePassiveEventListener(scrollEventTarget, "scroll", checkDisplayShadow);
178
- (0, _dom).removePassiveEventListener(scrollEventTarget, "resize", checkDisplayShadow);
180
+ checkDisplayElevation.cancel();
181
+ (0, _dom).removePassiveEventListener(scrollEventTarget, "scroll", checkDisplayElevation);
182
+ (0, _dom).removePassiveEventListener(scrollEventTarget, "resize", checkDisplayElevation);
179
183
  transitionAwaiter.cancel();
180
184
  };
181
185
  }, [
@@ -198,12 +202,12 @@ var FixedFooterLayout = function FixedFooterLayout(param) {
198
202
  }),
199
203
  /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
200
204
  ref: ref2,
201
- className: (0, _classnames).default(classes.footer, (_obj = {}, _defineProperty(_obj, classes.withoutFooter, !isFooterVisible), _defineProperty(_obj, classes.shadow, displayShadow), _obj)),
205
+ className: (0, _classnames).default(classes.footer, (_obj = {}, _defineProperty(_obj, classes.withoutFooter, !isFooterVisible), _defineProperty(_obj, classes.elevated, displayElevation), _obj)),
202
206
  /**
203
207
  * This style is inline to avoid creating a class that may collide with
204
208
  * other fixed footers during the page animation transition
205
209
  */ style: {
206
- background: isTabletOrSmaller ? footerBgColor || colors.backgroundContainer : undefined
210
+ background: isTabletOrSmaller ? footerBgColor : undefined
207
211
  },
208
212
  "data-testid": "fixed-footer".concat(isFooterVisible ? "-visible" : "-hidden"),
209
213
  /**
package/dist/list.d.ts CHANGED
@@ -15,7 +15,11 @@ interface CommonProps {
15
15
  extra?: React.ReactNode;
16
16
  dataAttributes?: DataAttributes;
17
17
  disabled?: boolean;
18
+ withChevron?: boolean;
18
19
  }
20
+ declare type Right = (({ centerY }: {
21
+ centerY: boolean;
22
+ }) => React.ReactNode) | React.ReactNode;
19
23
  declare type ControlProps = {
20
24
  name?: string;
21
25
  value?: boolean;
@@ -31,7 +35,7 @@ interface BasicRowContentProps extends CommonProps {
31
35
  radioValue?: undefined;
32
36
  newTab?: undefined;
33
37
  fullPageOnWebView?: undefined;
34
- right?: React.ReactNode;
38
+ right?: Right;
35
39
  }
36
40
  interface SwitchRowContentProps extends CommonProps {
37
41
  href?: undefined;
@@ -76,7 +80,7 @@ interface HrefRowContentProps extends CommonProps {
76
80
  newTab?: boolean;
77
81
  onPress?: undefined;
78
82
  to?: undefined;
79
- right?: React.ReactNode;
83
+ right?: Right;
80
84
  }
81
85
  interface ToRowContentProps extends CommonProps {
82
86
  checkbox?: undefined;
@@ -89,7 +93,7 @@ interface ToRowContentProps extends CommonProps {
89
93
  replace?: boolean;
90
94
  href?: undefined;
91
95
  onPress?: undefined;
92
- right?: React.ReactNode;
96
+ right?: Right;
93
97
  }
94
98
  interface OnPressRowContentProps extends CommonProps {
95
99
  checkbox?: undefined;
@@ -100,7 +104,7 @@ interface OnPressRowContentProps extends CommonProps {
100
104
  onPress: () => void;
101
105
  href?: undefined;
102
106
  to?: undefined;
103
- right?: React.ReactNode;
107
+ right?: Right;
104
108
  }
105
109
  declare type RowContentProps = BasicRowContentProps | SwitchRowContentProps | RadioRowContentProps | CheckboxRowContentProps | HrefRowContentProps | ToRowContentProps | OnPressRowContentProps;
106
110
  export declare const Row: React.ForwardRefExoticComponent<RowContentProps & React.RefAttributes<HTMLAnchorElement | HTMLDivElement | HTMLButtonElement>>;
package/dist/list.js CHANGED
@@ -214,8 +214,21 @@ var useStyles = (0, _jss).createUseStyles(function(param1) {
214
214
  }
215
215
  };
216
216
  });
217
+ var renderRight = function renderRight(right, centerY) {
218
+ if (typeof right === "function") return right === null || right === void 0 ? void 0 : right({
219
+ centerY: centerY
220
+ });
221
+ return centerY ? /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
222
+ style: {
223
+ display: "flex",
224
+ alignItems: "center",
225
+ height: "100%"
226
+ },
227
+ children: right
228
+ }) : right;
229
+ };
217
230
  var Content = function Content(param) {
218
- var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? "basic" : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
231
+ var withChevron = param.withChevron, headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? "basic" : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
219
232
  var isInverse = (0, _themeVariantContext).useIsInverseVariant();
220
233
  var classes = useStyles({
221
234
  isInverse: isInverse
@@ -228,7 +241,7 @@ var Content = function Content(param) {
228
241
  description,
229
242
  extra
230
243
  ].filter(Boolean).length;
231
- var shouldCenter = numTextLines === 1;
244
+ var centerY = numTextLines === 1;
232
245
  var renderBadge = function renderBadge() {
233
246
  if (!badge) {
234
247
  return null;
@@ -243,31 +256,6 @@ var Content = function Content(param) {
243
256
  })
244
257
  });
245
258
  };
246
- var renderRight = function renderRight() {
247
- switch(type){
248
- case "chevron":
249
- return /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
250
- paddingLeft: 16,
251
- className: (0, _classnames).default(classes.center, _defineProperty({}, classes.disabled, disabled)),
252
- children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconChevron.default, {
253
- color: isInverse ? colors.inverse : colors.neutralMedium,
254
- direction: "right"
255
- })
256
- });
257
- case "control":
258
- return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
259
- className: classes.right,
260
- children: right
261
- });
262
- case "custom":
263
- return /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
264
- className: (0, _classnames).default(classes.right, _defineProperty({}, classes.disabled, disabled)),
265
- children: right
266
- });
267
- default:
268
- return null;
269
- }
270
- };
271
259
  var _obj;
272
260
  return /*#__PURE__*/ (0, _jsxRuntime).jsxs(_box.default, {
273
261
  paddingY: 16,
@@ -275,7 +263,7 @@ var Content = function Content(param) {
275
263
  children: [
276
264
  asset && /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
277
265
  paddingRight: 16,
278
- className: (0, _classnames).default((_obj = {}, _defineProperty(_obj, classes.center, shouldCenter), _defineProperty(_obj, classes.disabled, disabled), _obj)),
266
+ className: (0, _classnames).default((_obj = {}, _defineProperty(_obj, classes.center, centerY), _defineProperty(_obj, classes.disabled, disabled), _obj)),
279
267
  children: /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
280
268
  className: classes.asset,
281
269
  children: asset
@@ -284,7 +272,7 @@ var Content = function Content(param) {
284
272
  /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
285
273
  className: (0, _classnames).default(classes.rowBody, _defineProperty({}, classes.disabled, disabled)),
286
274
  style: {
287
- justifyContent: shouldCenter ? "center" : "flex-start"
275
+ justifyContent: centerY ? "center" : "flex-start"
288
276
  },
289
277
  children: /*#__PURE__*/ (0, _jsxRuntime).jsxs(_stack.default, {
290
278
  space: 4,
@@ -327,7 +315,40 @@ var Content = function Content(param) {
327
315
  })
328
316
  }),
329
317
  renderBadge(),
330
- renderRight()
318
+ type === "chevron" && /*#__PURE__*/ (0, _jsxRuntime).jsx(_box.default, {
319
+ paddingLeft: 16,
320
+ className: (0, _classnames).default(classes.center, _defineProperty({}, classes.disabled, disabled)),
321
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconChevron.default, {
322
+ color: isInverse ? colors.inverse : colors.neutralMedium,
323
+ direction: "right"
324
+ })
325
+ }),
326
+ type === "control" && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
327
+ className: classes.right,
328
+ children: renderRight(right, centerY)
329
+ }),
330
+ type === "custom" && /*#__PURE__*/ (0, _jsxRuntime).jsxs(_jsxRuntime.Fragment, {
331
+ children: [
332
+ /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
333
+ className: (0, _classnames).default(classes.right, _defineProperty({}, classes.disabled, disabled)),
334
+ children: renderRight(right, centerY)
335
+ }),
336
+ withChevron && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
337
+ className: (0, _classnames).default(classes.right, _defineProperty({}, classes.disabled, disabled)),
338
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
339
+ style: {
340
+ display: "flex",
341
+ alignItems: "center",
342
+ height: "100%"
343
+ },
344
+ children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_iconChevron.default, {
345
+ color: isInverse ? colors.inverse : colors.neutralMedium,
346
+ direction: "right"
347
+ })
348
+ })
349
+ })
350
+ ]
351
+ })
331
352
  ]
332
353
  });
333
354
  };
@@ -381,7 +402,8 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props1, ref) {
381
402
  right: right,
382
403
  extra: extra,
383
404
  labelId: labelId,
384
- disabled: disabled
405
+ disabled: disabled,
406
+ withChevron: !!props1.onPress || !!props1.href || !!props1.to
385
407
  });
386
408
  };
387
409
  var renderTouchableContent = function renderTouchableContent(props) {
@@ -487,10 +509,12 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props1, ref) {
487
509
  children: renderContent({
488
510
  labelId: labelId,
489
511
  type: "control",
490
- right: /*#__PURE__*/ (0, _jsxRuntime).jsx(_stack.default, {
491
- space: "around",
492
- children: controlElement
493
- })
512
+ right: function right() {
513
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx(_stack.default, {
514
+ space: "around",
515
+ children: controlElement
516
+ });
517
+ }
494
518
  })
495
519
  });
496
520
  }
@@ -518,10 +542,12 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props1, ref) {
518
542
  paddingX: 16,
519
543
  children: renderContent({
520
544
  type: "control",
521
- right: /*#__PURE__*/ (0, _jsxRuntime).jsx(_stack.default, {
522
- space: "around",
523
- children: controlElement
524
- })
545
+ right: function right() {
546
+ return /*#__PURE__*/ (0, _jsxRuntime).jsx(_stack.default, {
547
+ space: "around",
548
+ children: controlElement
549
+ });
550
+ }
525
551
  })
526
552
  });
527
553
  }
package/dist/list.js.flow CHANGED
@@ -16,7 +16,13 @@ declare type CommonProps = {
16
16
  extra?: React.Node,
17
17
  dataAttributes?: DataAttributes,
18
18
  disabled?: boolean,
19
+ withChevron?: boolean,
19
20
  };
21
+ declare type Right =
22
+ | ((x: {
23
+ centerY: boolean,
24
+ }) => React.Node)
25
+ | React.Node;
20
26
  declare type ControlProps = {
21
27
  name?: string,
22
28
  value?: boolean,
@@ -25,7 +31,7 @@ declare type ControlProps = {
25
31
  };
26
32
  declare type BasicRowContentProps = {
27
33
  ...$Exact<CommonProps>,
28
- right?: React.Node,
34
+ right?: Right,
29
35
  };
30
36
  declare type SwitchRowContentProps = {
31
37
  ...$Exact<CommonProps>,
@@ -46,7 +52,7 @@ declare type HrefRowContentProps = {
46
52
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
47
53
  href: string,
48
54
  newTab?: boolean,
49
- right?: React.Node,
55
+ right?: Right,
50
56
  };
51
57
  declare type ToRowContentProps = {
52
58
  ...$Exact<CommonProps>,
@@ -54,13 +60,13 @@ declare type ToRowContentProps = {
54
60
  to: string,
55
61
  fullPageOnWebView?: boolean,
56
62
  replace?: boolean,
57
- right?: React.Node,
63
+ right?: Right,
58
64
  };
59
65
  declare type OnPressRowContentProps = {
60
66
  ...$Exact<CommonProps>,
61
67
  trackingEvent?: TrackingEvent | $ReadOnlyArray<TrackingEvent>,
62
68
  onPress: () => void,
63
- right?: React.Node,
69
+ right?: Right,
64
70
  };
65
71
  declare type RowContentProps =
66
72
  | BasicRowContentProps
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.PACKAGE_VERSION = void 0;
6
- var PACKAGE_VERSION = "11.3.0";
6
+ var PACKAGE_VERSION = "11.4.0";
7
7
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -176,7 +176,7 @@ var getO2ClassicSkin = function getO2ClassicSkin() {
176
176
  borderLight: palette.darkModeBlack,
177
177
  border: palette.darkModeGrey,
178
178
  borderDark: palette.grey5,
179
- borderSelected: palette.o2Gem,
179
+ borderSelected: palette.o2SkyBlue,
180
180
  buttonLinkBackgroundSelected: (0, _color).applyAlpha(palette.white, 0.05),
181
181
  buttonLinkBackgroundSelectedInverse: (0, _color).applyAlpha(palette.white, 0.05),
182
182
  buttonPrimaryBackgroundInverse: palette.o2SkyBlue,
@@ -194,11 +194,11 @@ var getO2ClassicSkin = function getO2ClassicSkin() {
194
194
  textLinkInverse: palette.o2SkyBlueLight,
195
195
  textLinkSnackbar: palette.o2SkyBlueLight,
196
196
  control: palette.darkModeGrey6,
197
- controlActivated: palette.o2Gem,
198
- loadingBar: palette.o2Gem,
197
+ controlActivated: palette.o2SkyBlue,
198
+ loadingBar: palette.o2SkyBlue,
199
199
  loadingBarBackground: palette.darkModeGrey6,
200
200
  toggleAndroidInactive: palette.grey4,
201
- toggleAndroidBackgroundActive: palette.o2GemLight30,
201
+ toggleAndroidBackgroundActive: palette.o2SkyBlueLight45,
202
202
  iosControlKnob: palette.grey2,
203
203
  divider: (0, _color).applyAlpha(palette.white, 0.05),
204
204
  dividerInverse: (0, _color).applyAlpha(palette.white, 0.05),
package/dist/theme.d.ts CHANGED
@@ -75,7 +75,7 @@ declare type LinkComponent = React.ComponentType<{
75
75
  export declare const AnchorLink: LinkComponent;
76
76
  export declare type ColorScheme = 'dark' | 'light' | 'auto';
77
77
  export declare type ThemeConfig = {
78
- skin: Skin;
78
+ skin: Readonly<Skin>;
79
79
  colorScheme?: ColorScheme;
80
80
  i18n: {
81
81
  locale: Locale;
@@ -79,7 +79,7 @@ declare type LinkComponent = React.ComponentType<{
79
79
  declare export var AnchorLink: LinkComponent;
80
80
  export type ColorScheme = "dark" | "light" | "auto";
81
81
  export type ThemeConfig = {
82
- skin: Skin,
82
+ skin: $ReadOnly<Skin>,
83
83
  colorScheme?: ColorScheme,
84
84
  i18n: {
85
85
  locale: Locale,
@@ -322,7 +322,7 @@ export var FeedbackScreen = function(param) {
322
322
  var title = param.title, description = param.description, children = param.children, primaryButton = param.primaryButton, secondaryButton = param.secondaryButton, link = param.link, hapticFeedback = param.hapticFeedback, icon = param.icon, _animateText = param.animateText, animateText = _animateText === void 0 ? false : _animateText, unstable_inlineInDesktop = param.unstable_inlineInDesktop, imageUrl = param.imageUrl, imageFit = param.imageFit, dataAttributes = param.dataAttributes;
323
323
  useHapticFeedback(hapticFeedback);
324
324
  var isInverse = useIsInverseVariant();
325
- var ref = useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides;
325
+ var ref = useTheme(), colors = ref.colors, platformOverrides = ref.platformOverrides, isDarkMode = ref.isDarkMode;
326
326
  var windowHeight = useWindowHeight();
327
327
  var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
328
328
  var ref1 = _slicedToArray(React.useState(typeof self !== "undefined"), 2), isServerSide = ref1[0], setIsServerSide = ref1[1];
@@ -385,8 +385,8 @@ export var FeedbackScreen = function(param) {
385
385
  button: primaryButton,
386
386
  secondaryButton: secondaryButton,
387
387
  link: link,
388
- footerBgColor: isInverse ? colors.backgroundFeedbackBottom : undefined,
389
- containerBgColor: isInverse ? colors.navigationBarBackground : undefined,
388
+ footerBgColor: isInverse && !isDarkMode ? colors.backgroundFeedbackBottom : undefined,
389
+ containerBgColor: isInverse && !isDarkMode ? colors.backgroundFeedbackBottom : undefined,
390
390
  onChangeFooterHeight: setFooterHeight,
391
391
  children: feedbackContent
392
392
  })
@@ -79,9 +79,13 @@ var waitForSwitchTransitionToStart = function(fn) {
79
79
  var useStyles = createUseStyles(function(theme) {
80
80
  return _defineProperty({
81
81
  footer: {
82
- width: "100%"
82
+ width: "100%",
83
+ backgroundColor: theme.colors.background,
84
+ transition: "background 0.2s linear, box-shadow 0.2s linear"
85
+ },
86
+ elevated: {
87
+ backgroundColor: theme.colors.backgroundContainer
83
88
  },
84
- shadow: {},
85
89
  withoutFooter: {
86
90
  display: "none"
87
91
  },
@@ -102,19 +106,18 @@ var useStyles = createUseStyles(function(theme) {
102
106
  bottom: 0,
103
107
  zIndex: 1
104
108
  },
105
- shadow: {
106
- boxShadow: "0 -3px 8px 0 rgba(0, 0, 0, 0.15)"
109
+ elevated: {
110
+ boxShadow: "0 -2px 8px 0 rgba(0, 0, 0, 0.10)"
107
111
  }
108
112
  });
109
113
  });
110
114
  var FixedFooterLayout = function(param) {
111
115
  var _isFooterVisible = param.isFooterVisible, isFooterVisible = _isFooterVisible === void 0 ? true : _isFooterVisible, footer = param.footer, _footerHeight = param.footerHeight, footerHeight = _footerHeight === void 0 ? "auto" : _footerHeight, footerBgColor = param.footerBgColor, containerBgColor = param.containerBgColor, children = param.children, onChangeFooterHeight = param.onChangeFooterHeight;
112
- var ref = _slicedToArray(React.useState(false), 2), displayShadow = ref[0], setDisplayShadow = ref[1];
116
+ var ref = _slicedToArray(React.useState(false), 2), displayElevation = ref[0], setDisplayElevation = ref[1];
113
117
  var containerRef = React.useRef(null);
114
118
  var isTabletOrSmaller = useScreenSize().isTabletOrSmaller;
115
119
  var platformOverrides = useTheme().platformOverrides;
116
120
  var ref1 = useElementDimensions(), realHeight = ref1.height, ref2 = ref1.ref;
117
- var colors = useTheme().colors;
118
121
  useIsomorphicLayoutEffect(function() {
119
122
  onChangeFooterHeight === null || onChangeFooterHeight === void 0 ? void 0 : onChangeFooterHeight(realHeight);
120
123
  }, [
@@ -123,7 +126,7 @@ var FixedFooterLayout = function(param) {
123
126
  ]);
124
127
  React.useEffect(function() {
125
128
  var scrollable = getScrollableParentElement(containerRef.current);
126
- var shouldDisplayShadow = function() {
129
+ var shouldDisplayElevation = function() {
127
130
  if (isRunningAcceptanceTest(platformOverrides)) {
128
131
  return false;
129
132
  }
@@ -132,19 +135,20 @@ var FixedFooterLayout = function(param) {
132
135
  }
133
136
  return false;
134
137
  };
135
- var checkDisplayShadow = debounce(function() {
136
- setDisplayShadow(shouldDisplayShadow());
138
+ var checkDisplayElevation = debounce(function() {
139
+ setDisplayElevation(shouldDisplayElevation());
137
140
  }, 50, {
138
- leading: true
141
+ leading: true,
142
+ maxWait: 200
139
143
  });
140
- var transitionAwaiter = waitForSwitchTransitionToStart(checkDisplayShadow);
144
+ var transitionAwaiter = waitForSwitchTransitionToStart(checkDisplayElevation);
141
145
  var scrollEventTarget = getScrollEventTarget(scrollable);
142
- addPassiveEventListener(scrollEventTarget, "resize", checkDisplayShadow);
143
- addPassiveEventListener(scrollEventTarget, "scroll", checkDisplayShadow);
146
+ addPassiveEventListener(scrollEventTarget, "resize", checkDisplayElevation);
147
+ addPassiveEventListener(scrollEventTarget, "scroll", checkDisplayElevation);
144
148
  return function() {
145
- checkDisplayShadow.cancel();
146
- removePassiveEventListener(scrollEventTarget, "scroll", checkDisplayShadow);
147
- removePassiveEventListener(scrollEventTarget, "resize", checkDisplayShadow);
149
+ checkDisplayElevation.cancel();
150
+ removePassiveEventListener(scrollEventTarget, "scroll", checkDisplayElevation);
151
+ removePassiveEventListener(scrollEventTarget, "resize", checkDisplayElevation);
148
152
  transitionAwaiter.cancel();
149
153
  };
150
154
  }, [
@@ -167,12 +171,12 @@ var FixedFooterLayout = function(param) {
167
171
  }),
168
172
  /*#__PURE__*/ _jsx("div", {
169
173
  ref: ref2,
170
- className: classnames(classes.footer, (_obj = {}, _defineProperty(_obj, classes.withoutFooter, !isFooterVisible), _defineProperty(_obj, classes.shadow, displayShadow), _obj)),
174
+ className: classnames(classes.footer, (_obj = {}, _defineProperty(_obj, classes.withoutFooter, !isFooterVisible), _defineProperty(_obj, classes.elevated, displayElevation), _obj)),
171
175
  /**
172
176
  * This style is inline to avoid creating a class that may collide with
173
177
  * other fixed footers during the page animation transition
174
178
  */ style: {
175
- background: isTabletOrSmaller ? footerBgColor || colors.backgroundContainer : undefined
179
+ background: isTabletOrSmaller ? footerBgColor : undefined
176
180
  },
177
181
  "data-testid": "fixed-footer".concat(isFooterVisible ? "-visible" : "-hidden"),
178
182
  /**
package/dist-es/list.js CHANGED
@@ -72,7 +72,7 @@ function _unsupportedIterableToArray(o, minLen) {
72
72
  if (n === "Map" || n === "Set") return Array.from(n);
73
73
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
74
74
  }
75
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
75
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
76
76
  /*
77
77
  * Specs:
78
78
  * - Structure: https://www.figma.com/file/Be8QB9onmHunKCCAkIBAVr/Lists-Component-Specs?node-id=0%3A2
@@ -187,8 +187,21 @@ var useStyles = createUseStyles(function(param1) {
187
187
  }
188
188
  };
189
189
  });
190
+ var renderRight = function(right, centerY) {
191
+ if (typeof right === "function") return right === null || right === void 0 ? void 0 : right({
192
+ centerY: centerY
193
+ });
194
+ return centerY ? /*#__PURE__*/ _jsx("div", {
195
+ style: {
196
+ display: "flex",
197
+ alignItems: "center",
198
+ height: "100%"
199
+ },
200
+ children: right
201
+ }) : right;
202
+ };
190
203
  var Content = function(param) {
191
- var headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? "basic" : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
204
+ var withChevron = param.withChevron, headline = param.headline, title = param.title, titleLinesMax = param.titleLinesMax, subtitle = param.subtitle, subtitleLinesMax = param.subtitleLinesMax, description = param.description, descriptionLinesMax = param.descriptionLinesMax, asset = param.asset, _type = param.type, type = _type === void 0 ? "basic" : _type, badge = param.badge, right = param.right, extra = param.extra, labelId = param.labelId, disabled = param.disabled;
192
205
  var isInverse = useIsInverseVariant();
193
206
  var classes = useStyles({
194
207
  isInverse: isInverse
@@ -201,7 +214,7 @@ var Content = function(param) {
201
214
  description,
202
215
  extra
203
216
  ].filter(Boolean).length;
204
- var shouldCenter = numTextLines === 1;
217
+ var centerY = numTextLines === 1;
205
218
  var renderBadge = function() {
206
219
  if (!badge) {
207
220
  return null;
@@ -216,31 +229,6 @@ var Content = function(param) {
216
229
  })
217
230
  });
218
231
  };
219
- var renderRight = function() {
220
- switch(type){
221
- case "chevron":
222
- return /*#__PURE__*/ _jsx(Box, {
223
- paddingLeft: 16,
224
- className: classNames(classes.center, _defineProperty({}, classes.disabled, disabled)),
225
- children: /*#__PURE__*/ _jsx(IconChevron, {
226
- color: isInverse ? colors.inverse : colors.neutralMedium,
227
- direction: "right"
228
- })
229
- });
230
- case "control":
231
- return /*#__PURE__*/ _jsx("div", {
232
- className: classes.right,
233
- children: right
234
- });
235
- case "custom":
236
- return /*#__PURE__*/ _jsx("div", {
237
- className: classNames(classes.right, _defineProperty({}, classes.disabled, disabled)),
238
- children: right
239
- });
240
- default:
241
- return null;
242
- }
243
- };
244
232
  var _obj;
245
233
  return /*#__PURE__*/ _jsxs(Box, {
246
234
  paddingY: 16,
@@ -248,7 +236,7 @@ var Content = function(param) {
248
236
  children: [
249
237
  asset && /*#__PURE__*/ _jsx(Box, {
250
238
  paddingRight: 16,
251
- className: classNames((_obj = {}, _defineProperty(_obj, classes.center, shouldCenter), _defineProperty(_obj, classes.disabled, disabled), _obj)),
239
+ className: classNames((_obj = {}, _defineProperty(_obj, classes.center, centerY), _defineProperty(_obj, classes.disabled, disabled), _obj)),
252
240
  children: /*#__PURE__*/ _jsx("div", {
253
241
  className: classes.asset,
254
242
  children: asset
@@ -257,7 +245,7 @@ var Content = function(param) {
257
245
  /*#__PURE__*/ _jsx("div", {
258
246
  className: classNames(classes.rowBody, _defineProperty({}, classes.disabled, disabled)),
259
247
  style: {
260
- justifyContent: shouldCenter ? "center" : "flex-start"
248
+ justifyContent: centerY ? "center" : "flex-start"
261
249
  },
262
250
  children: /*#__PURE__*/ _jsxs(Stack, {
263
251
  space: 4,
@@ -300,7 +288,40 @@ var Content = function(param) {
300
288
  })
301
289
  }),
302
290
  renderBadge(),
303
- renderRight()
291
+ type === "chevron" && /*#__PURE__*/ _jsx(Box, {
292
+ paddingLeft: 16,
293
+ className: classNames(classes.center, _defineProperty({}, classes.disabled, disabled)),
294
+ children: /*#__PURE__*/ _jsx(IconChevron, {
295
+ color: isInverse ? colors.inverse : colors.neutralMedium,
296
+ direction: "right"
297
+ })
298
+ }),
299
+ type === "control" && /*#__PURE__*/ _jsx("div", {
300
+ className: classes.right,
301
+ children: renderRight(right, centerY)
302
+ }),
303
+ type === "custom" && /*#__PURE__*/ _jsxs(_Fragment, {
304
+ children: [
305
+ /*#__PURE__*/ _jsx("div", {
306
+ className: classNames(classes.right, _defineProperty({}, classes.disabled, disabled)),
307
+ children: renderRight(right, centerY)
308
+ }),
309
+ withChevron && /*#__PURE__*/ _jsx("div", {
310
+ className: classNames(classes.right, _defineProperty({}, classes.disabled, disabled)),
311
+ children: /*#__PURE__*/ _jsx("div", {
312
+ style: {
313
+ display: "flex",
314
+ alignItems: "center",
315
+ height: "100%"
316
+ },
317
+ children: /*#__PURE__*/ _jsx(IconChevron, {
318
+ color: isInverse ? colors.inverse : colors.neutralMedium,
319
+ direction: "right"
320
+ })
321
+ })
322
+ })
323
+ ]
324
+ })
304
325
  ]
305
326
  });
306
327
  };
@@ -354,7 +375,8 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props1, ref) {
354
375
  right: right,
355
376
  extra: extra,
356
377
  labelId: labelId,
357
- disabled: disabled
378
+ disabled: disabled,
379
+ withChevron: !!props1.onPress || !!props1.href || !!props1.to
358
380
  });
359
381
  };
360
382
  var renderTouchableContent = function(props) {
@@ -460,10 +482,12 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props1, ref) {
460
482
  children: renderContent({
461
483
  labelId: labelId,
462
484
  type: "control",
463
- right: /*#__PURE__*/ _jsx(Stack, {
464
- space: "around",
465
- children: controlElement
466
- })
485
+ right: function() {
486
+ return /*#__PURE__*/ _jsx(Stack, {
487
+ space: "around",
488
+ children: controlElement
489
+ });
490
+ }
467
491
  })
468
492
  });
469
493
  }
@@ -491,10 +515,12 @@ var RowContent = /*#__PURE__*/ React.forwardRef(function(props1, ref) {
491
515
  paddingX: 16,
492
516
  children: renderContent({
493
517
  type: "control",
494
- right: /*#__PURE__*/ _jsx(Stack, {
495
- space: "around",
496
- children: controlElement
497
- })
518
+ right: function() {
519
+ return /*#__PURE__*/ _jsx(Stack, {
520
+ space: "around",
521
+ children: controlElement
522
+ });
523
+ }
498
524
  })
499
525
  });
500
526
  }
@@ -1,2 +1,2 @@
1
1
  // DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
2
- export var PACKAGE_VERSION = "11.3.0";
2
+ export var PACKAGE_VERSION = "11.4.0";
@@ -172,7 +172,7 @@ export var getO2ClassicSkin = function() {
172
172
  borderLight: palette.darkModeBlack,
173
173
  border: palette.darkModeGrey,
174
174
  borderDark: palette.grey5,
175
- borderSelected: palette.o2Gem,
175
+ borderSelected: palette.o2SkyBlue,
176
176
  buttonLinkBackgroundSelected: applyAlpha(palette.white, 0.05),
177
177
  buttonLinkBackgroundSelectedInverse: applyAlpha(palette.white, 0.05),
178
178
  buttonPrimaryBackgroundInverse: palette.o2SkyBlue,
@@ -190,11 +190,11 @@ export var getO2ClassicSkin = function() {
190
190
  textLinkInverse: palette.o2SkyBlueLight,
191
191
  textLinkSnackbar: palette.o2SkyBlueLight,
192
192
  control: palette.darkModeGrey6,
193
- controlActivated: palette.o2Gem,
194
- loadingBar: palette.o2Gem,
193
+ controlActivated: palette.o2SkyBlue,
194
+ loadingBar: palette.o2SkyBlue,
195
195
  loadingBarBackground: palette.darkModeGrey6,
196
196
  toggleAndroidInactive: palette.grey4,
197
- toggleAndroidBackgroundActive: palette.o2GemLight30,
197
+ toggleAndroidBackgroundActive: palette.o2SkyBlueLight45,
198
198
  iosControlKnob: palette.grey2,
199
199
  divider: applyAlpha(palette.white, 0.05),
200
200
  dividerInverse: applyAlpha(palette.white, 0.05),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "11.3.0",
3
+ "version": "11.4.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",