@telefonica/mistica 16.4.0 → 16.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.
Files changed (108) hide show
  1. package/css/mistica.css +1 -1
  2. package/css/vivo-new.css +11 -11
  3. package/dist/accordion.css-mistica.js +16 -13
  4. package/dist/accordion.css.d.ts +1 -0
  5. package/dist/accordion.d.ts +4 -0
  6. package/dist/accordion.js +110 -93
  7. package/dist/callout.js +27 -15
  8. package/dist/card.css-mistica.js +5 -5
  9. package/dist/card.d.ts +9 -1
  10. package/dist/card.js +611 -475
  11. package/dist/community/advanced-data-card.css-mistica.js +14 -11
  12. package/dist/community/advanced-data-card.css.d.ts +1 -0
  13. package/dist/community/advanced-data-card.d.ts +1 -1
  14. package/dist/community/advanced-data-card.js +172 -85
  15. package/dist/cover-hero.css-mistica.js +14 -11
  16. package/dist/cover-hero.css.d.ts +1 -0
  17. package/dist/cover-hero.d.ts +1 -0
  18. package/dist/cover-hero.js +101 -59
  19. package/dist/empty-state.js +24 -15
  20. package/dist/header.css-mistica.js +6 -3
  21. package/dist/header.css.d.ts +1 -0
  22. package/dist/header.d.ts +3 -2
  23. package/dist/header.js +148 -79
  24. package/dist/hero.css-mistica.js +11 -8
  25. package/dist/hero.css.d.ts +1 -0
  26. package/dist/hero.d.ts +2 -1
  27. package/dist/hero.js +102 -68
  28. package/dist/highlighted-card.js +32 -23
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +4 -0
  31. package/dist/maybe-dismissable.js +8 -5
  32. package/dist/meter.d.ts +23 -0
  33. package/dist/meter.js +400 -0
  34. package/dist/mosaic.d.ts +6 -2
  35. package/dist/mosaic.js +50 -48
  36. package/dist/navigation-bar.css-mistica.js +96 -37
  37. package/dist/navigation-bar.css.d.ts +27 -1
  38. package/dist/navigation-bar.d.ts +65 -30
  39. package/dist/navigation-bar.js +818 -193
  40. package/dist/package-version.js +1 -1
  41. package/dist/sheet-common.css-mistica.js +16 -10
  42. package/dist/sheet-common.css.d.ts +3 -1
  43. package/dist/sheet-common.js +78 -70
  44. package/dist/sheet-info.css-mistica.js +15 -4
  45. package/dist/sheet-info.css.d.ts +2 -0
  46. package/dist/sheet-info.d.ts +3 -0
  47. package/dist/sheet-info.js +61 -43
  48. package/dist/sheet-native.js +59 -48
  49. package/dist/sheet-types.d.ts +6 -1
  50. package/dist/sheet-web.js +6 -4
  51. package/dist/skins/blau.js +94 -94
  52. package/dist/skins/movistar.js +94 -94
  53. package/dist/skins/o2-new.js +94 -94
  54. package/dist/skins/o2.js +94 -94
  55. package/dist/skins/telefonica.js +94 -94
  56. package/dist/skins/tu.js +94 -94
  57. package/dist/skins/vivo-new.js +98 -98
  58. package/dist/skins/vivo.js +94 -94
  59. package/dist/text-tokens.d.ts +14 -0
  60. package/dist/text-tokens.js +134 -102
  61. package/dist/theme-context-provider.js +60 -50
  62. package/dist/theme.d.ts +3 -2
  63. package/dist/theme.js +20 -17
  64. package/dist/utils/headings.d.ts +2 -0
  65. package/dist/utils/headings.js +11 -0
  66. package/dist/utils/types.d.ts +1 -0
  67. package/dist-es/accordion.css-mistica.js +7 -7
  68. package/dist-es/accordion.js +140 -123
  69. package/dist-es/callout.js +55 -43
  70. package/dist-es/card.css-mistica.js +2 -2
  71. package/dist-es/card.js +721 -588
  72. package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
  73. package/dist-es/community/advanced-data-card.js +217 -130
  74. package/dist-es/cover-hero.css-mistica.js +3 -3
  75. package/dist-es/cover-hero.js +132 -90
  76. package/dist-es/empty-state.js +40 -31
  77. package/dist-es/header.css-mistica.js +2 -2
  78. package/dist-es/header.js +174 -104
  79. package/dist-es/hero.css-mistica.js +2 -2
  80. package/dist-es/hero.js +150 -115
  81. package/dist-es/highlighted-card.js +36 -27
  82. package/dist-es/index.js +1839 -1838
  83. package/dist-es/maybe-dismissable.js +17 -14
  84. package/dist-es/meter.js +346 -0
  85. package/dist-es/mosaic.js +73 -71
  86. package/dist-es/navigation-bar.css-mistica.js +14 -15
  87. package/dist-es/navigation-bar.js +864 -240
  88. package/dist-es/package-version.js +1 -1
  89. package/dist-es/sheet-common.css-mistica.js +2 -2
  90. package/dist-es/sheet-common.js +124 -116
  91. package/dist-es/sheet-info.css-mistica.js +2 -2
  92. package/dist-es/sheet-info.js +74 -56
  93. package/dist-es/sheet-native.js +59 -48
  94. package/dist-es/sheet-web.js +10 -8
  95. package/dist-es/skins/blau.js +94 -94
  96. package/dist-es/skins/movistar.js +94 -94
  97. package/dist-es/skins/o2-new.js +94 -94
  98. package/dist-es/skins/o2.js +94 -94
  99. package/dist-es/skins/telefonica.js +94 -94
  100. package/dist-es/skins/tu.js +94 -94
  101. package/dist-es/skins/vivo-new.js +98 -98
  102. package/dist-es/skins/vivo.js +94 -94
  103. package/dist-es/style.css +1 -1
  104. package/dist-es/text-tokens.js +72 -52
  105. package/dist-es/theme-context-provider.js +88 -78
  106. package/dist-es/theme.js +20 -20
  107. package/dist-es/utils/headings.js +2 -0
  108. package/package.json +2 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  Object.defineProperty(exports, "showNativeSheet", {
6
6
  enumerable: true,
7
7
  get: function() {
8
- return h;
8
+ return p;
9
9
  }
10
10
  });
11
11
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -39,13 +39,13 @@ function _async_to_generator(fn) {
39
39
  }
40
40
  const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
41
41
 
42
- `) : void 0 : e, a = (e, param)=>{
43
- let { title: r, subtitle: t, description: n, selectedId: s, items: o } = param;
42
+ `) : void 0 : e, l = (e, param)=>{
43
+ let { title: i, subtitle: t, description: r, selectedId: s, items: n } = param;
44
44
  return e({
45
- title: r,
45
+ title: i,
46
46
  subtitle: t,
47
47
  // TODO: add multiline support to native sheet
48
- description: I(n),
48
+ description: I(r),
49
49
  content: [
50
50
  {
51
51
  type: "LIST",
@@ -55,26 +55,26 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
55
55
  selectedIds: typeof s == "string" ? [
56
56
  s
57
57
  ] : [],
58
- items: o
58
+ items: n
59
59
  }
60
60
  ]
61
61
  }).then((param)=>{
62
- let { action: i, result: d } = param;
63
- return i === "SUBMIT" ? {
64
- action: i,
62
+ let { action: o, result: d } = param;
63
+ return o === "SUBMIT" ? {
64
+ action: o,
65
65
  selectedId: d[0].selectedIds[0]
66
66
  } : {
67
- action: i,
67
+ action: o,
68
68
  selectedId: null
69
69
  };
70
70
  });
71
71
  }, T = (e, param)=>{
72
- let { title: r, subtitle: t, description: n, items: s } = param;
72
+ let { title: i, subtitle: t, description: r, items: s } = param;
73
73
  return e({
74
- title: r,
74
+ title: i,
75
75
  subtitle: t,
76
76
  // TODO: add multiline support to native sheet
77
- description: I(n),
77
+ description: I(r),
78
78
  content: [
79
79
  {
80
80
  type: "LIST",
@@ -86,61 +86,72 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
86
86
  }
87
87
  ]
88
88
  }).then((param)=>{
89
- let { action: o, result: i } = param;
90
- return o === "SUBMIT" ? {
91
- action: o,
92
- selectedId: i[0].selectedIds[0]
89
+ let { action: n, result: o } = param;
90
+ return n === "SUBMIT" ? {
91
+ action: n,
92
+ selectedId: o[0].selectedIds[0]
93
93
  } : {
94
- action: o,
94
+ action: n,
95
95
  selectedId: null
96
96
  };
97
97
  });
98
98
  }, N = function() {
99
99
  var _ref = _async_to_generator(function*(e, param) {
100
- let { title: r, subtitle: t, description: n, items: s } = param;
101
- yield e({
102
- title: r,
100
+ let { title: i, subtitle: t, description: r, items: s, button: n } = param;
101
+ const o = {
102
+ type: "LIST",
103
+ id: "list-0",
104
+ listType: "INFORMATIVE",
105
+ autoSubmit: !1,
106
+ selectedIds: [],
107
+ items: s
108
+ };
109
+ return yield e({
110
+ title: i,
103
111
  subtitle: t,
104
112
  // TODO: add multiline support to native sheet
105
- description: I(n),
106
- content: [
113
+ description: I(r),
114
+ content: n ? [
115
+ o,
107
116
  {
108
- type: "LIST",
109
- id: "list-0",
110
- listType: "INFORMATIVE",
111
- autoSubmit: !1,
112
- selectedIds: [],
113
- items: s
117
+ type: "BOTTOM_ACTIONS",
118
+ id: "bottom-actions-0",
119
+ button: n
114
120
  }
121
+ ] : [
122
+ o
115
123
  ]
116
- });
124
+ }).then(()=>({
125
+ // this is an informative sheet, it can only be dismissed
126
+ action: "DISMISS"
127
+ }));
117
128
  });
118
129
  return function N(e, _) {
119
130
  return _ref.apply(this, arguments);
120
131
  };
121
- }(), p = (e, param)=>{
122
- let { title: r, subtitle: t, description: n, button: s, secondaryButton: o, link: i } = param;
132
+ }(), h = (e, param)=>{
133
+ let { title: i, subtitle: t, description: r, button: s, secondaryButton: n, link: o } = param;
123
134
  return e({
124
- title: r,
135
+ title: i,
125
136
  subtitle: t,
126
137
  // TODO: add multiline support to native sheet
127
- description: I(n),
138
+ description: I(r),
128
139
  content: [
129
140
  {
130
141
  type: "BOTTOM_ACTIONS",
131
142
  id: "bottom-actions-0",
132
143
  button: s,
133
- secondaryButton: o,
134
- link: i
144
+ secondaryButton: n,
145
+ link: o
135
146
  }
136
147
  ]
137
148
  }).then((param)=>{
138
- let { action: d, result: l } = param;
149
+ let { action: d, result: u } = param;
139
150
  if (d === "SUBMIT") {
140
- const u = l.find((param)=>{
141
- let { id: S } = param;
142
- return S === "bottom-actions-0";
143
- }), c = u == null ? void 0 : u.selectedIds[0];
151
+ const S = u.find((param)=>{
152
+ let { id: a } = param;
153
+ return a === "bottom-actions-0";
154
+ }), c = S == null ? void 0 : S.selectedIds[0];
144
155
  if (c === "PRIMARY" || c === "SECONDARY" || c === "LINK") return {
145
156
  action: c
146
157
  };
@@ -149,10 +160,10 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
149
160
  action: "DISMISS"
150
161
  };
151
162
  });
152
- }, h = (e, r)=>{
163
+ }, p = (e, i)=>{
153
164
  let t;
154
- const { type: n, props: s } = r;
155
- switch(n){
165
+ const { type: r, props: s } = i;
166
+ switch(r){
156
167
  case "INFO":
157
168
  t = N(e, s);
158
169
  break;
@@ -160,14 +171,14 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
160
171
  t = T(e, s);
161
172
  break;
162
173
  case "RADIO_LIST":
163
- t = a(e, s);
174
+ t = l(e, s);
164
175
  break;
165
176
  case "ACTIONS":
166
- t = p(e, s);
177
+ t = h(e, s);
167
178
  break;
168
179
  default:
169
- const o = n;
170
- throw new Error(`Unknown sheet type: ${o}`);
180
+ const n = r;
181
+ throw new Error(`Unknown sheet type: ${n}`);
171
182
  }
172
183
  return t;
173
184
  };
@@ -44,6 +44,9 @@ export type SheetPropsByType = {
44
44
  description?: string;
45
45
  icon: InfoIcon;
46
46
  }>;
47
+ button?: {
48
+ text: string;
49
+ };
47
50
  }>;
48
51
  ACTIONS: SheetProps<{
49
52
  button: {
@@ -72,7 +75,9 @@ export type SheetResultByType = {
72
75
  } | {
73
76
  action: 'DISMISS';
74
77
  };
75
- INFO: void;
78
+ INFO: {
79
+ action: 'DISMISS';
80
+ };
76
81
  ACTIONS: {
77
82
  action: 'PRIMARY' | 'SECONDARY' | 'LINK' | 'DISMISS';
78
83
  };
package/dist/sheet-web.js CHANGED
@@ -111,7 +111,7 @@ function _object_spread_props(target, source) {
111
111
  }
112
112
  return target;
113
113
  }
114
- const S = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-actions" */ "./sheet-actions.js")))), I = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-info" */ "./sheet-info.js")))), p = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-action-list" */ "./sheet-actions-list.js")))), d = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-radio-list" */ "./sheet-radio-list.js")))), w = (param)=>{
114
+ const u = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-actions" */ "./sheet-actions.js")))), I = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-info" */ "./sheet-info.js")))), p = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-action-list" */ "./sheet-actions-list.js")))), f = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "sheet-radio-list" */ "./sheet-radio-list.js")))), w = (param)=>{
115
115
  let { sheetProps: t, onResolve: e } = param;
116
116
  const { isDarkMode: s } = (0, _hooks.useTheme)(), r = _react.useRef(null), i = (n)=>{
117
117
  r.current = n;
@@ -119,7 +119,9 @@ const S = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/
119
119
  if (!e) throw new Error("onResolve handler is not set");
120
120
  switch(t.type){
121
121
  case "INFO":
122
- e(void 0);
122
+ e({
123
+ action: "DISMISS"
124
+ });
123
125
  break;
124
126
  case "ACTIONS_LIST":
125
127
  r.current ? e({
@@ -160,7 +162,7 @@ const S = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/
160
162
  onSelect: i
161
163
  }));
162
164
  case "RADIO_LIST":
163
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(d, _object_spread_props(_object_spread({}, t.props), {
165
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(f, _object_spread_props(_object_spread({}, t.props), {
164
166
  items: t.props.items.map((n)=>_object_spread_props(_object_spread({}, n), {
165
167
  asset: n.icon && /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.default, {
166
168
  circular: !0,
@@ -172,7 +174,7 @@ const S = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/
172
174
  onSelect: i
173
175
  }));
174
176
  case "ACTIONS":
175
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(S, _object_spread_props(_object_spread({}, t.props), {
177
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(u, _object_spread_props(_object_spread({}, t.props), {
176
178
  buttonLink: t.props.link,
177
179
  onClose: a,
178
180
  onPressButton: i
@@ -340,154 +340,154 @@ const e = {
340
340
  mediaSmall: "8px"
341
341
  },
342
342
  textPresets: {
343
+ button: {
344
+ weight: "medium"
345
+ },
343
346
  cardTitle: {
344
347
  weight: "regular"
345
348
  },
346
- button: {
349
+ indicator: {
347
350
  weight: "medium"
348
351
  },
349
- tabsLabel: {
350
- weight: "medium",
351
- size: {
352
- mobile: 16,
353
- desktop: 18
354
- },
355
- lineHeight: {
356
- mobile: 24,
357
- desktop: 24
358
- }
359
- },
360
352
  link: {
361
353
  weight: "medium"
362
354
  },
363
- title1: {
355
+ navigationBar: {
364
356
  weight: "medium"
365
357
  },
366
- title2: {
367
- weight: "light"
368
- },
369
- title3: {
370
- weight: "light",
358
+ tabsLabel: {
359
+ lineHeight: {
360
+ desktop: 24,
361
+ mobile: 24
362
+ },
371
363
  size: {
372
- mobile: 20,
373
- desktop: 28
364
+ desktop: 18,
365
+ mobile: 16
374
366
  },
375
- lineHeight: {
376
- mobile: 24,
377
- desktop: 32
378
- }
379
- },
380
- indicator: {
381
- weight: "medium"
382
- },
383
- navigationBar: {
384
367
  weight: "medium"
385
368
  },
386
369
  text1: {
387
- size: {
388
- mobile: 12,
389
- desktop: 14
390
- },
391
370
  lineHeight: {
392
- mobile: 16,
393
- desktop: 20
371
+ desktop: 20,
372
+ mobile: 16
373
+ },
374
+ size: {
375
+ desktop: 14,
376
+ mobile: 12
394
377
  }
395
378
  },
396
379
  text2: {
397
- size: {
398
- mobile: 14,
399
- desktop: 16
400
- },
401
380
  lineHeight: {
402
- mobile: 20,
403
- desktop: 24
381
+ desktop: 24,
382
+ mobile: 20
383
+ },
384
+ size: {
385
+ desktop: 16,
386
+ mobile: 14
404
387
  }
405
388
  },
406
389
  text3: {
407
- size: {
408
- mobile: 16,
409
- desktop: 18
410
- },
411
390
  lineHeight: {
412
- mobile: 24,
413
- desktop: 24
391
+ desktop: 24,
392
+ mobile: 24
393
+ },
394
+ size: {
395
+ desktop: 18,
396
+ mobile: 16
414
397
  }
415
398
  },
416
399
  text4: {
417
- size: {
418
- mobile: 18,
419
- desktop: 20
420
- },
421
400
  lineHeight: {
422
- mobile: 24,
423
- desktop: 28
401
+ desktop: 28,
402
+ mobile: 24
403
+ },
404
+ size: {
405
+ desktop: 20,
406
+ mobile: 18
424
407
  }
425
408
  },
426
409
  text5: {
427
- weight: "light",
410
+ lineHeight: {
411
+ desktop: 32,
412
+ mobile: 24
413
+ },
428
414
  size: {
429
- mobile: 20,
430
- desktop: 28
415
+ desktop: 28,
416
+ mobile: 20
431
417
  },
432
- lineHeight: {
433
- mobile: 24,
434
- desktop: 32
435
- }
418
+ weight: "light"
436
419
  },
437
420
  text6: {
438
- weight: "light",
421
+ lineHeight: {
422
+ desktop: 40,
423
+ mobile: 32
424
+ },
439
425
  size: {
440
- mobile: 24,
441
- desktop: 32
426
+ desktop: 32,
427
+ mobile: 24
442
428
  },
443
- lineHeight: {
444
- mobile: 32,
445
- desktop: 40
446
- }
429
+ weight: "light"
447
430
  },
448
431
  text7: {
449
- weight: "light",
432
+ lineHeight: {
433
+ desktop: 48,
434
+ mobile: 32
435
+ },
450
436
  size: {
451
- mobile: 28,
452
- desktop: 40
437
+ desktop: 40,
438
+ mobile: 28
453
439
  },
454
- lineHeight: {
455
- mobile: 32,
456
- desktop: 48
457
- }
440
+ weight: "light"
458
441
  },
459
442
  text8: {
460
- weight: "light",
443
+ lineHeight: {
444
+ desktop: 56,
445
+ mobile: 40
446
+ },
461
447
  size: {
462
- mobile: 32,
463
- desktop: 48
448
+ desktop: 48,
449
+ mobile: 32
464
450
  },
465
- lineHeight: {
466
- mobile: 40,
467
- desktop: 56
468
- }
451
+ weight: "light"
469
452
  },
470
453
  text9: {
471
- weight: "light",
454
+ lineHeight: {
455
+ desktop: 64,
456
+ mobile: 48
457
+ },
472
458
  size: {
473
- mobile: 40,
474
- desktop: 56
459
+ desktop: 56,
460
+ mobile: 40
475
461
  },
476
- lineHeight: {
477
- mobile: 48,
478
- desktop: 64
479
- }
462
+ weight: "light"
480
463
  },
481
464
  text10: {
482
- weight: "light",
465
+ lineHeight: {
466
+ desktop: 72,
467
+ mobile: 56
468
+ },
483
469
  size: {
484
- mobile: 48,
485
- desktop: 64
470
+ desktop: 64,
471
+ mobile: 48
486
472
  },
473
+ weight: "light"
474
+ },
475
+ title1: {
476
+ weight: "medium"
477
+ },
478
+ title2: {
479
+ weight: "light"
480
+ },
481
+ title3: {
487
482
  lineHeight: {
488
- mobile: 56,
489
- desktop: 72
490
- }
483
+ desktop: 32,
484
+ mobile: 24
485
+ },
486
+ size: {
487
+ desktop: 28,
488
+ mobile: 20
489
+ },
490
+ weight: "light"
491
491
  }
492
492
  }
493
493
  });