@telefonica/mistica 16.5.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.
- package/css/mistica.css +1 -1
- package/dist/callout.js +27 -15
- package/dist/card.css-mistica.js +5 -5
- package/dist/card.d.ts +9 -1
- package/dist/card.js +611 -475
- package/dist/community/advanced-data-card.css-mistica.js +14 -11
- package/dist/community/advanced-data-card.css.d.ts +1 -0
- package/dist/community/advanced-data-card.d.ts +1 -1
- package/dist/community/advanced-data-card.js +172 -85
- package/dist/cover-hero.css-mistica.js +14 -11
- package/dist/cover-hero.css.d.ts +1 -0
- package/dist/cover-hero.d.ts +1 -0
- package/dist/cover-hero.js +101 -59
- package/dist/empty-state.js +24 -15
- package/dist/header.css-mistica.js +6 -3
- package/dist/header.css.d.ts +1 -0
- package/dist/header.d.ts +3 -2
- package/dist/header.js +148 -79
- package/dist/hero.css-mistica.js +11 -8
- package/dist/hero.css.d.ts +1 -0
- package/dist/hero.d.ts +2 -1
- package/dist/hero.js +102 -68
- package/dist/highlighted-card.js +32 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/maybe-dismissable.js +8 -5
- package/dist/meter.d.ts +23 -0
- package/dist/meter.js +400 -0
- package/dist/package-version.js +1 -1
- package/dist/sheet-common.css-mistica.js +16 -10
- package/dist/sheet-common.css.d.ts +3 -1
- package/dist/sheet-common.js +78 -70
- package/dist/sheet-info.css-mistica.js +15 -4
- package/dist/sheet-info.css.d.ts +2 -0
- package/dist/sheet-info.d.ts +3 -0
- package/dist/sheet-info.js +61 -43
- package/dist/sheet-native.js +59 -48
- package/dist/sheet-types.d.ts +6 -1
- package/dist/sheet-web.js +6 -4
- package/dist/text-tokens.d.ts +10 -0
- package/dist/text-tokens.js +54 -38
- package/dist/theme-context-provider.js +60 -50
- package/dist/theme.d.ts +3 -2
- package/dist/utils/headings.d.ts +2 -0
- package/dist/utils/headings.js +11 -0
- package/dist/utils/types.d.ts +1 -0
- package/dist-es/callout.js +55 -43
- package/dist-es/card.css-mistica.js +2 -2
- package/dist-es/card.js +721 -588
- package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
- package/dist-es/community/advanced-data-card.js +217 -130
- package/dist-es/cover-hero.css-mistica.js +3 -3
- package/dist-es/cover-hero.js +132 -90
- package/dist-es/empty-state.js +40 -31
- package/dist-es/header.css-mistica.js +2 -2
- package/dist-es/header.js +174 -104
- package/dist-es/hero.css-mistica.js +2 -2
- package/dist-es/hero.js +150 -115
- package/dist-es/highlighted-card.js +36 -27
- package/dist-es/index.js +1839 -1838
- package/dist-es/maybe-dismissable.js +17 -14
- package/dist-es/meter.js +346 -0
- package/dist-es/package-version.js +1 -1
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/sheet-common.js +124 -116
- package/dist-es/sheet-info.css-mistica.js +2 -2
- package/dist-es/sheet-info.js +74 -56
- package/dist-es/sheet-native.js +59 -48
- package/dist-es/sheet-web.js +10 -8
- package/dist-es/style.css +1 -1
- package/dist-es/text-tokens.js +30 -20
- package/dist-es/theme-context-provider.js +88 -78
- package/dist-es/utils/headings.js +2 -0
- package/package.json +2 -1
package/dist-es/sheet-native.js
CHANGED
|
@@ -29,13 +29,13 @@ function _async_to_generator(fn) {
|
|
|
29
29
|
}
|
|
30
30
|
const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
|
|
31
31
|
|
|
32
|
-
`) : void 0 : e,
|
|
33
|
-
let { title:
|
|
32
|
+
`) : void 0 : e, l = (e, param)=>{
|
|
33
|
+
let { title: i, subtitle: t, description: r, selectedId: s, items: n } = param;
|
|
34
34
|
return e({
|
|
35
|
-
title:
|
|
35
|
+
title: i,
|
|
36
36
|
subtitle: t,
|
|
37
37
|
// TODO: add multiline support to native sheet
|
|
38
|
-
description: I(
|
|
38
|
+
description: I(r),
|
|
39
39
|
content: [
|
|
40
40
|
{
|
|
41
41
|
type: "LIST",
|
|
@@ -45,26 +45,26 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
|
|
|
45
45
|
selectedIds: typeof s == "string" ? [
|
|
46
46
|
s
|
|
47
47
|
] : [],
|
|
48
|
-
items:
|
|
48
|
+
items: n
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
}).then((param)=>{
|
|
52
|
-
let { action:
|
|
53
|
-
return
|
|
54
|
-
action:
|
|
52
|
+
let { action: o, result: d } = param;
|
|
53
|
+
return o === "SUBMIT" ? {
|
|
54
|
+
action: o,
|
|
55
55
|
selectedId: d[0].selectedIds[0]
|
|
56
56
|
} : {
|
|
57
|
-
action:
|
|
57
|
+
action: o,
|
|
58
58
|
selectedId: null
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
61
|
}, T = (e, param)=>{
|
|
62
|
-
let { title:
|
|
62
|
+
let { title: i, subtitle: t, description: r, items: s } = param;
|
|
63
63
|
return e({
|
|
64
|
-
title:
|
|
64
|
+
title: i,
|
|
65
65
|
subtitle: t,
|
|
66
66
|
// TODO: add multiline support to native sheet
|
|
67
|
-
description: I(
|
|
67
|
+
description: I(r),
|
|
68
68
|
content: [
|
|
69
69
|
{
|
|
70
70
|
type: "LIST",
|
|
@@ -76,61 +76,72 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
|
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
}).then((param)=>{
|
|
79
|
-
let { action:
|
|
80
|
-
return
|
|
81
|
-
action:
|
|
82
|
-
selectedId:
|
|
79
|
+
let { action: n, result: o } = param;
|
|
80
|
+
return n === "SUBMIT" ? {
|
|
81
|
+
action: n,
|
|
82
|
+
selectedId: o[0].selectedIds[0]
|
|
83
83
|
} : {
|
|
84
|
-
action:
|
|
84
|
+
action: n,
|
|
85
85
|
selectedId: null
|
|
86
86
|
};
|
|
87
87
|
});
|
|
88
88
|
}, N = function() {
|
|
89
89
|
var _ref = _async_to_generator(function*(e, param) {
|
|
90
|
-
let { title:
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
let { title: i, subtitle: t, description: r, items: s, button: n } = param;
|
|
91
|
+
const o = {
|
|
92
|
+
type: "LIST",
|
|
93
|
+
id: "list-0",
|
|
94
|
+
listType: "INFORMATIVE",
|
|
95
|
+
autoSubmit: !1,
|
|
96
|
+
selectedIds: [],
|
|
97
|
+
items: s
|
|
98
|
+
};
|
|
99
|
+
return yield e({
|
|
100
|
+
title: i,
|
|
93
101
|
subtitle: t,
|
|
94
102
|
// TODO: add multiline support to native sheet
|
|
95
|
-
description: I(
|
|
96
|
-
content: [
|
|
103
|
+
description: I(r),
|
|
104
|
+
content: n ? [
|
|
105
|
+
o,
|
|
97
106
|
{
|
|
98
|
-
type: "
|
|
99
|
-
id: "
|
|
100
|
-
|
|
101
|
-
autoSubmit: !1,
|
|
102
|
-
selectedIds: [],
|
|
103
|
-
items: s
|
|
107
|
+
type: "BOTTOM_ACTIONS",
|
|
108
|
+
id: "bottom-actions-0",
|
|
109
|
+
button: n
|
|
104
110
|
}
|
|
111
|
+
] : [
|
|
112
|
+
o
|
|
105
113
|
]
|
|
106
|
-
})
|
|
114
|
+
}).then(()=>({
|
|
115
|
+
// this is an informative sheet, it can only be dismissed
|
|
116
|
+
action: "DISMISS"
|
|
117
|
+
}));
|
|
107
118
|
});
|
|
108
119
|
return function N(e, _) {
|
|
109
120
|
return _ref.apply(this, arguments);
|
|
110
121
|
};
|
|
111
|
-
}(),
|
|
112
|
-
let { title:
|
|
122
|
+
}(), h = (e, param)=>{
|
|
123
|
+
let { title: i, subtitle: t, description: r, button: s, secondaryButton: n, link: o } = param;
|
|
113
124
|
return e({
|
|
114
|
-
title:
|
|
125
|
+
title: i,
|
|
115
126
|
subtitle: t,
|
|
116
127
|
// TODO: add multiline support to native sheet
|
|
117
|
-
description: I(
|
|
128
|
+
description: I(r),
|
|
118
129
|
content: [
|
|
119
130
|
{
|
|
120
131
|
type: "BOTTOM_ACTIONS",
|
|
121
132
|
id: "bottom-actions-0",
|
|
122
133
|
button: s,
|
|
123
|
-
secondaryButton:
|
|
124
|
-
link:
|
|
134
|
+
secondaryButton: n,
|
|
135
|
+
link: o
|
|
125
136
|
}
|
|
126
137
|
]
|
|
127
138
|
}).then((param)=>{
|
|
128
|
-
let { action: d, result:
|
|
139
|
+
let { action: d, result: u } = param;
|
|
129
140
|
if (d === "SUBMIT") {
|
|
130
|
-
const
|
|
131
|
-
let { id:
|
|
132
|
-
return
|
|
133
|
-
}), c =
|
|
141
|
+
const S = u.find((param)=>{
|
|
142
|
+
let { id: a } = param;
|
|
143
|
+
return a === "bottom-actions-0";
|
|
144
|
+
}), c = S == null ? void 0 : S.selectedIds[0];
|
|
134
145
|
if (c === "PRIMARY" || c === "SECONDARY" || c === "LINK") return {
|
|
135
146
|
action: c
|
|
136
147
|
};
|
|
@@ -139,10 +150,10 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
|
|
|
139
150
|
action: "DISMISS"
|
|
140
151
|
};
|
|
141
152
|
});
|
|
142
|
-
},
|
|
153
|
+
}, p = (e, i)=>{
|
|
143
154
|
let t;
|
|
144
|
-
const { type:
|
|
145
|
-
switch(
|
|
155
|
+
const { type: r, props: s } = i;
|
|
156
|
+
switch(r){
|
|
146
157
|
case "INFO":
|
|
147
158
|
t = N(e, s);
|
|
148
159
|
break;
|
|
@@ -150,15 +161,15 @@ const I = (e)=>Array.isArray(e) ? e.length ? e.join(`
|
|
|
150
161
|
t = T(e, s);
|
|
151
162
|
break;
|
|
152
163
|
case "RADIO_LIST":
|
|
153
|
-
t =
|
|
164
|
+
t = l(e, s);
|
|
154
165
|
break;
|
|
155
166
|
case "ACTIONS":
|
|
156
|
-
t =
|
|
167
|
+
t = h(e, s);
|
|
157
168
|
break;
|
|
158
169
|
default:
|
|
159
|
-
const
|
|
160
|
-
throw new Error(`Unknown sheet type: ${
|
|
170
|
+
const n = r;
|
|
171
|
+
throw new Error(`Unknown sheet type: ${n}`);
|
|
161
172
|
}
|
|
162
173
|
return t;
|
|
163
174
|
};
|
|
164
|
-
export {
|
|
175
|
+
export { p as showNativeSheet };
|
package/dist-es/sheet-web.js
CHANGED
|
@@ -53,17 +53,19 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
}
|
|
54
54
|
import { jsx as c } from "react/jsx-runtime";
|
|
55
55
|
import * as o from "react";
|
|
56
|
-
import { useTheme as
|
|
57
|
-
import
|
|
58
|
-
const
|
|
56
|
+
import { useTheme as S } from "./hooks.js";
|
|
57
|
+
import l from "./image.js";
|
|
58
|
+
const u = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "sheet-actions" */ "./sheet-actions.js")), I = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "sheet-info" */ "./sheet-info.js")), p = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "sheet-action-list" */ "./sheet-actions-list.js")), f = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "sheet-radio-list" */ "./sheet-radio-list.js")), w = (param)=>{
|
|
59
59
|
let { sheetProps: t, onResolve: e } = param;
|
|
60
|
-
const { isDarkMode: s } =
|
|
60
|
+
const { isDarkMode: s } = S(), r = o.useRef(null), i = (n)=>{
|
|
61
61
|
r.current = n;
|
|
62
62
|
}, a = ()=>{
|
|
63
63
|
if (!e) throw new Error("onResolve handler is not set");
|
|
64
64
|
switch(t.type){
|
|
65
65
|
case "INFO":
|
|
66
|
-
e(
|
|
66
|
+
e({
|
|
67
|
+
action: "DISMISS"
|
|
68
|
+
});
|
|
67
69
|
break;
|
|
68
70
|
case "ACTIONS_LIST":
|
|
69
71
|
r.current ? e({
|
|
@@ -104,9 +106,9 @@ const S = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "sheet-actions" *
|
|
|
104
106
|
onSelect: i
|
|
105
107
|
}));
|
|
106
108
|
case "RADIO_LIST":
|
|
107
|
-
return /* @__PURE__ */ c(
|
|
109
|
+
return /* @__PURE__ */ c(f, _object_spread_props(_object_spread({}, t.props), {
|
|
108
110
|
items: t.props.items.map((n)=>_object_spread_props(_object_spread({}, n), {
|
|
109
|
-
asset: n.icon && /* @__PURE__ */ c(
|
|
111
|
+
asset: n.icon && /* @__PURE__ */ c(l, {
|
|
110
112
|
circular: !0,
|
|
111
113
|
src: s && n.icon.urlDark ? n.icon.urlDark : n.icon.url,
|
|
112
114
|
width: n.icon.size === "small" ? 24 : 40
|
|
@@ -116,7 +118,7 @@ const S = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "sheet-actions" *
|
|
|
116
118
|
onSelect: i
|
|
117
119
|
}));
|
|
118
120
|
case "ACTIONS":
|
|
119
|
-
return /* @__PURE__ */ c(
|
|
121
|
+
return /* @__PURE__ */ c(u, _object_spread_props(_object_spread({}, t.props), {
|
|
120
122
|
buttonLink: t.props.link,
|
|
121
123
|
onClose: a,
|
|
122
124
|
onPressButton: i
|