@telefonica/mistica 14.2.0 → 14.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/css/mistica.css +1 -1
- package/dist/card.css-mistica.js +3 -3
- package/dist/card.d.ts +8 -6
- package/dist/card.js +208 -179
- package/dist/date-time-picker.js +14 -14
- package/dist/empty-state-card.js +24 -20
- package/dist/header.d.ts +1 -0
- package/dist/header.js +94 -86
- package/dist/highlighted-card.js +18 -12
- package/dist/icon-button.js +8 -6
- package/dist/inline.css-mistica.js +7 -6
- package/dist/inline.css.d.ts +1 -0
- package/dist/inline.d.ts +2 -1
- package/dist/inline.js +8 -8
- package/dist/package-version.js +1 -1
- package/dist/popover.js +11 -11
- package/dist/text-link.js +5 -4
- package/dist/touchable.d.ts +1 -0
- package/dist/touchable.js +31 -27
- package/dist-es/card.css-mistica.js +2 -2
- package/dist-es/card.js +268 -239
- package/dist-es/date-time-picker.js +17 -17
- package/dist-es/empty-state-card.js +42 -38
- package/dist-es/header.js +115 -107
- package/dist-es/highlighted-card.js +35 -29
- package/dist-es/icon-button.js +24 -22
- package/dist-es/inline.css-mistica.js +6 -6
- package/dist-es/inline.js +16 -16
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +34 -34
- package/dist-es/style.css +1 -1
- package/dist-es/text-link.js +15 -14
- package/dist-es/touchable.js +44 -40
- package/package.json +1 -1
package/dist-es/touchable.js
CHANGED
|
@@ -52,19 +52,19 @@ function _objectSpreadProps(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import * as c from "react";
|
|
54
54
|
import b from "classnames";
|
|
55
|
-
import
|
|
56
|
-
import { notTouchable as
|
|
57
|
-
import { useTheme as
|
|
58
|
-
import { isInsideNovumNativeApp as
|
|
59
|
-
import { ENTER as
|
|
60
|
-
import { getPrefixedDataAttributes as
|
|
61
|
-
import { jsxs as
|
|
62
|
-
const
|
|
55
|
+
import _ from "./screen-reader-only.js";
|
|
56
|
+
import { notTouchable as H, touchable as K, base as j } from "./touchable.css-mistica.js";
|
|
57
|
+
import { useTheme as B } from "./hooks.js";
|
|
58
|
+
import { isInsideNovumNativeApp as S } from "./utils/platform.js";
|
|
59
|
+
import { ENTER as V, SPACE as W } from "./utils/key-codes.js";
|
|
60
|
+
import { getPrefixedDataAttributes as L } from "./utils/dom.js";
|
|
61
|
+
import { jsxs as q, jsx as l } from "./_virtual/jsx-runtime.js";
|
|
62
|
+
const z = function(e) {
|
|
63
63
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
64
64
|
t ? window.open(e, "_blank") : d ? window.open(e, "_top") : document.location.href = e;
|
|
65
|
-
},
|
|
66
|
-
var
|
|
67
|
-
const { texts: d , analytics:
|
|
65
|
+
}, N = /*#__PURE__*/ c.forwardRef((e, t)=>{
|
|
66
|
+
var T, v;
|
|
67
|
+
const { texts: d , analytics: P , platformOverrides: E , Link: C , useHrefDecorator: x } = B(), R = x(), f = c.useRef(!1);
|
|
68
68
|
let i = [];
|
|
69
69
|
e.trackingEvent && (Array.isArray(e.trackingEvent) ? i = e.trackingEvent : i = [
|
|
70
70
|
e.trackingEvent
|
|
@@ -81,32 +81,36 @@ const L = function(e) {
|
|
|
81
81
|
"aria-selected": e["aria-selected"],
|
|
82
82
|
"aria-live": e["aria-live"],
|
|
83
83
|
tabIndex: e.tabIndex
|
|
84
|
-
},
|
|
84
|
+
}, L(e.dataAttributes, "Touchable")), m = e.type ? e.type : "button", r = !!e.href && !!e.newTab, u = !r && !!e.href && !!e.loadOnTop, s = (a)=>{
|
|
85
|
+
e.stopPropagation && a.stopPropagation();
|
|
86
|
+
}, h = (a)=>{
|
|
85
87
|
e.onPress && e.onPress(a);
|
|
86
|
-
},
|
|
88
|
+
}, k = ()=>{
|
|
87
89
|
var a;
|
|
88
|
-
return e.href ?
|
|
89
|
-
}, y = ()=>Promise.all(i.map((a)=>
|
|
90
|
+
return e.href ? R(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (a = e.to.pathname) != null ? a : "" : "";
|
|
91
|
+
}, y = ()=>Promise.all(i.map((a)=>P.logEvent(a))), g = (a)=>{
|
|
90
92
|
f.current || (f.current = !0, y().finally(()=>{
|
|
91
93
|
f.current = !1, a();
|
|
92
94
|
}));
|
|
93
|
-
},
|
|
94
|
-
if (!i.length) {
|
|
95
|
-
|
|
95
|
+
}, D = (a)=>{
|
|
96
|
+
if (s(a), !i.length) {
|
|
97
|
+
h(a);
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
(a
|
|
100
|
+
g(()=>h(a));
|
|
101
|
+
}, O = (a)=>{
|
|
102
|
+
s(a), i.length && (a.preventDefault(), g(()=>z(k(), r, u)));
|
|
103
|
+
}, I = (a)=>{
|
|
104
|
+
s(a), y();
|
|
105
|
+
}, w = (a)=>{
|
|
106
|
+
(a.keyCode === V || a.keyCode === W) && (a.preventDefault(), a.currentTarget.click());
|
|
103
107
|
};
|
|
104
|
-
if (!!e.href || e.to && e.fullPageOnWebView &&
|
|
108
|
+
if (!!e.href || e.to && e.fullPageOnWebView && S(E)) return /* @__PURE__ */ q("a", _objectSpreadProps(_objectSpread({}, n), {
|
|
105
109
|
"aria-label": e["aria-label"],
|
|
106
110
|
"aria-labelledby": e["aria-labelledby"],
|
|
107
|
-
onClick:
|
|
108
|
-
onKeyDown:
|
|
109
|
-
href: e.disabled ? void 0 :
|
|
111
|
+
onClick: O,
|
|
112
|
+
onKeyDown: w,
|
|
113
|
+
href: e.disabled ? void 0 : k(),
|
|
110
114
|
target: (()=>{
|
|
111
115
|
if (r) return "_blank";
|
|
112
116
|
if (u) return "_top";
|
|
@@ -115,46 +119,46 @@ const L = function(e) {
|
|
|
115
119
|
ref: t,
|
|
116
120
|
children: [
|
|
117
121
|
o,
|
|
118
|
-
r && /* @__PURE__ */ l(
|
|
122
|
+
r && /* @__PURE__ */ l(_, {
|
|
119
123
|
children: /* @__PURE__ */ l("span", {
|
|
120
124
|
children: d.linkOpensInNewTab
|
|
121
125
|
})
|
|
122
126
|
})
|
|
123
127
|
]
|
|
124
128
|
}));
|
|
125
|
-
if (e.to) return /* @__PURE__ */ l(
|
|
129
|
+
if (e.to) return /* @__PURE__ */ l(C, _objectSpreadProps(_objectSpread({}, n), {
|
|
126
130
|
"aria-label": e["aria-label"],
|
|
127
131
|
"aria-labelledby": e["aria-labelledby"],
|
|
128
132
|
innerRef: t,
|
|
129
133
|
to: e.disabled ? "" : e.to,
|
|
130
134
|
replace: e.replace,
|
|
131
|
-
onClick:
|
|
132
|
-
onKeyDown:
|
|
135
|
+
onClick: I,
|
|
136
|
+
onKeyDown: w,
|
|
133
137
|
children: o
|
|
134
138
|
}));
|
|
135
139
|
if (e.onPress) {
|
|
136
|
-
const a = (
|
|
140
|
+
const a = (T = e.as) != null ? T : "button", A = (v = n.role) != null ? v : e.as === "a" ? "button" : void 0;
|
|
137
141
|
return /*#__PURE__*/ c.createElement(a, _objectSpreadProps(_objectSpread({}, n), {
|
|
138
|
-
role:
|
|
142
|
+
role: A,
|
|
139
143
|
form: m === "submit" && e.formId ? e.formId : void 0,
|
|
140
144
|
"aria-label": e["aria-label"],
|
|
141
145
|
"aria-labelledby": e["aria-labelledby"],
|
|
142
146
|
type: m,
|
|
143
147
|
ref: t,
|
|
144
|
-
onClick:
|
|
148
|
+
onClick: D,
|
|
145
149
|
children: o
|
|
146
150
|
}));
|
|
147
151
|
}
|
|
148
152
|
return /* @__PURE__ */ l("div", _objectSpreadProps(_objectSpread({}, n), {
|
|
149
153
|
ref: t,
|
|
150
|
-
className: b(n.className,
|
|
154
|
+
className: b(n.className, H),
|
|
151
155
|
children: o
|
|
152
156
|
}));
|
|
153
|
-
}),
|
|
154
|
-
className: b(
|
|
157
|
+
}), Z = /*#__PURE__*/ c.forwardRef((e, t)=>/* @__PURE__ */ l(N, _objectSpreadProps(_objectSpread({}, e), {
|
|
158
|
+
className: b(K, e.className),
|
|
155
159
|
ref: t
|
|
156
|
-
}))),
|
|
157
|
-
className: b(
|
|
160
|
+
}))), $ = /*#__PURE__*/ c.forwardRef((e, t)=>/* @__PURE__ */ l(N, _objectSpreadProps(_objectSpread({}, e), {
|
|
161
|
+
className: b(j, e.className),
|
|
158
162
|
ref: t
|
|
159
163
|
})));
|
|
160
|
-
export {
|
|
164
|
+
export { $ as BaseTouchable, Z as default };
|