@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/dist/inline.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>k
7
+ get: ()=>A
8
8
  });
9
9
  const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
10
10
  const _classnames = /*#__PURE__*/ _interopRequireDefault(require("classnames"));
@@ -109,19 +109,19 @@ function _objectSpreadProps(target, source) {
109
109
  }
110
110
  return target;
111
111
  }
112
- const k = (param)=>{
113
- let { space: r , className: e , children: l , role: o , alignItems: s = "stretch" , "aria-labelledby": a , fullWidth: m , dataAttributes: n } = param;
114
- const f = m || typeof r == "string";
112
+ const A = (param)=>{
113
+ let { space: r , className: e , children: l , role: o , alignItems: a = "stretch" , "aria-labelledby": s , fullWidth: m , wrap: n , dataAttributes: f } = param;
114
+ const p = m || typeof r == "string";
115
115
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", _objectSpreadProps(_objectSpread({
116
116
  className: (0, _classnames.default)(e, (0, _sprinklesCssMisticaJs.sprinkles)({
117
- alignItems: s
118
- }), f ? _inlineCssMisticaJs.fullWidth : _inlineCssMisticaJs.noFullWidth, typeof r != "number" && _inlineCssMisticaJs.justifyVariants[r]),
117
+ alignItems: a
118
+ }), n ? _inlineCssMisticaJs.wrap : p ? _inlineCssMisticaJs.fullWidth : _inlineCssMisticaJs.noFullWidth, typeof r != "number" && _inlineCssMisticaJs.justifyVariants[r]),
119
119
  style: typeof r == "number" ? (0, _dynamic.assignInlineVars)({
120
120
  [_inlineCssMisticaJs.vars.space]: `${r}px`
121
121
  }) : void 0,
122
122
  role: o,
123
- "aria-labelledby": a
124
- }, (0, _domJs.getPrefixedDataAttributes)(n)), {
123
+ "aria-labelledby": s
124
+ }, (0, _domJs.getPrefixedDataAttributes)(f)), {
125
125
  children: _react.Children.map(l, (t)=>!!t || t === 0 ? /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
126
126
  children: t
127
127
  }) : null)
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "PACKAGE_VERSION", {
6
6
  enumerable: true,
7
7
  get: ()=>o
8
8
  });
9
- const o = "14.2.0";
9
+ const o = "14.4.0";
package/dist/popover.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>ut
7
+ get: ()=>pt
8
8
  });
9
9
  const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
10
10
  const _iconCloseRegularJs = /*#__PURE__*/ _interopRequireDefault(require("./generated/mistica-icons/icon-close-regular.js"));
@@ -115,10 +115,10 @@ function _objectSpreadProps(target, source) {
115
115
  }
116
116
  return target;
117
117
  }
118
- const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget: m , marginLeftRightMobile: d , maxWidthDesktop: Z , arrowSize: L } = _popoverCssMisticaJs, V = (t)=>t || Z, tt = function() {
119
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Q, r = arguments.length > 1 ? arguments[1] : void 0;
120
- return r && (t === "left" || t === "right") ? U : t;
121
- }, et = (t, r, e)=>t ? (r ? window.screen.width : window.innerWidth) - d * 2 : V(e), rt = (t, r, e, s)=>{
118
+ const { defaultPositionDesktop: K , defaultPositionMobile: Q , distanceToTarget: m , marginLeftRightMobile: d , maxWidthDesktop: U , arrowSize: L } = _popoverCssMisticaJs, Z = (t)=>t || U, V = function() {
119
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K, r = arguments.length > 1 ? arguments[1] : void 0;
120
+ return r && (t === "left" || t === "right") ? Q : t;
121
+ }, tt = (t, r, e)=>t ? (r ? window.screen.width : window.innerWidth) - d * 2 : Z(e), et = (t, r, e, s)=>{
122
122
  const a = {
123
123
  right: {
124
124
  left: e.width + m,
@@ -176,11 +176,11 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
176
176
  width: t.offsetWidth,
177
177
  height: t.offsetHeight,
178
178
  parentLeft: t.parentNode.offsetLeft
179
- } : null, ut = (param)=>{
179
+ } : null, pt = (param)=>{
180
180
  let { description: t , title: r , onClose: e , trackingEvent: s , position: n , width: a , target: w , asset: f , isVisible: g = !0 , extra: Y , dataAttributes: B } = param;
181
181
  const { texts: R , isIos: z , isDarkMode: D } = (0, _hooksJs.useTheme)(), { isTabletOrSmaller: h } = (0, _hooksJs.useScreenSize)(), [x, b] = _react.useState(null), p = _react.useRef(null);
182
- n = tt(n, h);
183
- const y = et(h, z, a), S = D ? 1 : 0.2;
182
+ n = V(n, h);
183
+ const y = tt(h, z, a), S = D ? 1 : 0.2;
184
184
  _react.useEffect(()=>{
185
185
  const l = ()=>{
186
186
  b(N(p.current));
@@ -195,7 +195,7 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
195
195
  ]);
196
196
  let v = null;
197
197
  if (g && x) {
198
- const { containerStyles: l , arrowStyles: I } = rt(n, y, x, h);
198
+ const { containerStyles: l , arrowStyles: I } = et(n, y, x, h);
199
199
  v = /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", _objectSpreadProps(_objectSpread({
200
200
  className: _popoverCssMisticaJs.container,
201
201
  style: _objectSpread({
@@ -252,8 +252,8 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
252
252
  }),
253
253
  /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconButtonJs.default, {
254
254
  className: _popoverCssMisticaJs.closeButtonIcon,
255
- onPress: (M)=>{
256
- e == null || e(), M.stopPropagation();
255
+ onPress: ()=>{
256
+ e == null || e();
257
257
  },
258
258
  trackingEvent: s,
259
259
  "aria-label": R.modalClose,
package/dist/text-link.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>A
7
+ get: ()=>j
8
8
  });
9
9
  const _touchableJs = require("./touchable.js");
10
10
  const _classnames = /*#__PURE__*/ _interopRequireDefault(require("classnames"));
@@ -99,7 +99,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
99
99
  }
100
100
  return target;
101
101
  }
102
- const A = (_param)=>{
102
+ const j = (_param)=>{
103
103
  var { children: t , className: a = "" , disabled: s , style: i } = _param, e = _objectWithoutProperties(_param, [
104
104
  "children",
105
105
  "className",
@@ -107,7 +107,7 @@ const A = (_param)=>{
107
107
  "style"
108
108
  ]);
109
109
  var r;
110
- const m = (0, _themeVariantContextJs.useIsInverseVariant)(), { isDarkMode: c } = (0, _hooksJs.useTheme)(), { formStatus: f } = (0, _formContextJs.useForm)(), { eventFormat: v } = (0, _analyticsJs.useTrackingConfig)(), u = ()=>v === "google-analytics-4" ? {
110
+ const m = (0, _themeVariantContextJs.useIsInverseVariant)(), { isDarkMode: c } = (0, _hooksJs.useTheme)(), { formStatus: f } = (0, _formContextJs.useForm)(), { eventFormat: u } = (0, _analyticsJs.useTrackingConfig)(), v = ()=>u === "google-analytics-4" ? {
111
111
  name: _analyticsJs.eventNames.userInteraction,
112
112
  component_type: "link",
113
113
  component_copy: (0, _commonJs.getTextFromChildren)(t)
@@ -117,8 +117,9 @@ const A = (_param)=>{
117
117
  label: (0, _commonJs.getTextFromChildren)(t)
118
118
  };
119
119
  return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, _objectSpreadProps(_objectSpread({}, e), {
120
+ stopPropagation: !0,
120
121
  as: e.onPress ? "a" : void 0,
121
- trackingEvent: (r = e.trackingEvent) != null ? r : e.trackEvent ? u() : void 0,
122
+ trackingEvent: (r = e.trackingEvent) != null ? r : e.trackEvent ? v() : void 0,
122
123
  disabled: s || f === "sending",
123
124
  className: (0, _classnames.default)(m ? c ? _textLinkCssMisticaJs.variants.inverseDark : _textLinkCssMisticaJs.variants.inverseLight : _textLinkCssMisticaJs.variants.default, a),
124
125
  style: i,
@@ -22,6 +22,7 @@ interface CommonProps {
22
22
  type?: 'button' | 'submit';
23
23
  tabIndex?: number;
24
24
  as?: 'a';
25
+ stopPropagation?: boolean;
25
26
  }
26
27
  export interface PropsHref extends CommonProps {
27
28
  href: string;
package/dist/touchable.js CHANGED
@@ -9,8 +9,8 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- BaseTouchable: ()=>Y,
13
- default: ()=>X
12
+ BaseTouchable: ()=>$,
13
+ default: ()=>Z
14
14
  });
15
15
  const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
16
16
  const _classnames = /*#__PURE__*/ _interopRequireDefault(require("classnames"));
@@ -117,12 +117,12 @@ function _objectSpreadProps(target, source) {
117
117
  }
118
118
  return target;
119
119
  }
120
- const L = function(e) {
120
+ const z = function(e) {
121
121
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
122
122
  t ? window.open(e, "_blank") : d ? window.open(e, "_top") : document.location.href = e;
123
- }, T = /*#__PURE__*/ _react.forwardRef((e, t)=>{
124
- var w, g;
125
- const { texts: d , analytics: N , platformOverrides: E , Link: P , useHrefDecorator: x } = (0, _hooksJs.useTheme)(), C = x(), f = _react.useRef(!1);
123
+ }, N = /*#__PURE__*/ _react.forwardRef((e, t)=>{
124
+ var T, v;
125
+ const { texts: d , analytics: P , platformOverrides: E , Link: C , useHrefDecorator: x } = (0, _hooksJs.useTheme)(), R = x(), f = _react.useRef(!1);
126
126
  let i = [];
127
127
  e.trackingEvent && (Array.isArray(e.trackingEvent) ? i = e.trackingEvent : i = [
128
128
  e.trackingEvent
@@ -140,31 +140,35 @@ const L = function(e) {
140
140
  "aria-live": e["aria-live"],
141
141
  tabIndex: e.tabIndex
142
142
  }, (0, _domJs.getPrefixedDataAttributes)(e.dataAttributes, "Touchable")), m = e.type ? e.type : "button", r = !!e.href && !!e.newTab, u = !r && !!e.href && !!e.loadOnTop, s = (a)=>{
143
+ e.stopPropagation && a.stopPropagation();
144
+ }, h = (a)=>{
143
145
  e.onPress && e.onPress(a);
144
- }, h = ()=>{
146
+ }, k = ()=>{
145
147
  var a;
146
- return e.href ? C(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (a = e.to.pathname) != null ? a : "" : "";
147
- }, y = ()=>Promise.all(i.map((a)=>N.logEvent(a))), k = (a)=>{
148
+ return e.href ? R(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (a = e.to.pathname) != null ? a : "" : "";
149
+ }, y = ()=>Promise.all(i.map((a)=>P.logEvent(a))), g = (a)=>{
148
150
  f.current || (f.current = !0, y().finally(()=>{
149
151
  f.current = !1, a();
150
152
  }));
151
- }, R = (a)=>{
152
- if (!i.length) {
153
- s(a);
153
+ }, D = (a)=>{
154
+ if (s(a), !i.length) {
155
+ h(a);
154
156
  return;
155
157
  }
156
- k(()=>s(a));
157
- }, D = (a)=>{
158
- !i.length || (a.preventDefault(), k(()=>L(h(), r, u)));
159
- }, v = (a)=>{
158
+ g(()=>h(a));
159
+ }, O = (a)=>{
160
+ s(a), i.length && (a.preventDefault(), g(()=>z(k(), r, u)));
161
+ }, I = (a)=>{
162
+ s(a), y();
163
+ }, w = (a)=>{
160
164
  (a.keyCode === _keyCodesJs.ENTER || a.keyCode === _keyCodesJs.SPACE) && (a.preventDefault(), a.currentTarget.click());
161
165
  };
162
166
  if (!!e.href || e.to && e.fullPageOnWebView && (0, _platformJs.isInsideNovumNativeApp)(E)) return /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("a", _objectSpreadProps(_objectSpread({}, n), {
163
167
  "aria-label": e["aria-label"],
164
168
  "aria-labelledby": e["aria-labelledby"],
165
- onClick: D,
166
- onKeyDown: v,
167
- href: e.disabled ? void 0 : h(),
169
+ onClick: O,
170
+ onKeyDown: w,
171
+ href: e.disabled ? void 0 : k(),
168
172
  target: (()=>{
169
173
  if (r) return "_blank";
170
174
  if (u) return "_top";
@@ -180,26 +184,26 @@ const L = function(e) {
180
184
  })
181
185
  ]
182
186
  }));
183
- if (e.to) return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(P, _objectSpreadProps(_objectSpread({}, n), {
187
+ if (e.to) return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(C, _objectSpreadProps(_objectSpread({}, n), {
184
188
  "aria-label": e["aria-label"],
185
189
  "aria-labelledby": e["aria-labelledby"],
186
190
  innerRef: t,
187
191
  to: e.disabled ? "" : e.to,
188
192
  replace: e.replace,
189
- onClick: y,
190
- onKeyDown: v,
193
+ onClick: I,
194
+ onKeyDown: w,
191
195
  children: o
192
196
  }));
193
197
  if (e.onPress) {
194
- const a = (w = e.as) != null ? w : "button", O = (g = n.role) != null ? g : e.as === "a" ? "button" : void 0;
198
+ const a = (T = e.as) != null ? T : "button", A = (v = n.role) != null ? v : e.as === "a" ? "button" : void 0;
195
199
  return /*#__PURE__*/ _react.createElement(a, _objectSpreadProps(_objectSpread({}, n), {
196
- role: O,
200
+ role: A,
197
201
  form: m === "submit" && e.formId ? e.formId : void 0,
198
202
  "aria-label": e["aria-label"],
199
203
  "aria-labelledby": e["aria-labelledby"],
200
204
  type: m,
201
205
  ref: t,
202
- onClick: R,
206
+ onClick: D,
203
207
  children: o
204
208
  }));
205
209
  }
@@ -208,10 +212,10 @@ const L = function(e) {
208
212
  className: (0, _classnames.default)(n.className, _touchableCssMisticaJs.notTouchable),
209
213
  children: o
210
214
  }));
211
- }), X = /*#__PURE__*/ _react.forwardRef((e, t)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(T, _objectSpreadProps(_objectSpread({}, e), {
215
+ }), Z = /*#__PURE__*/ _react.forwardRef((e, t)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(N, _objectSpreadProps(_objectSpread({}, e), {
212
216
  className: (0, _classnames.default)(_touchableCssMisticaJs.touchable, e.className),
213
217
  ref: t
214
- }))), Y = /*#__PURE__*/ _react.forwardRef((e, t)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(T, _objectSpreadProps(_objectSpread({}, e), {
218
+ }))), $ = /*#__PURE__*/ _react.forwardRef((e, t)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(N, _objectSpreadProps(_objectSpread({}, e), {
215
219
  className: (0, _classnames.default)(_touchableCssMisticaJs.base, e.className),
216
220
  ref: t
217
221
  })));
@@ -1,4 +1,4 @@
1
1
  import "./sprinkles.css.ts.vanilla.js";
2
2
  import "./card.css.ts.vanilla.js";
3
- var _ = "_15e54s91 _1y2v1nf5i _1y2v1nf64 _1y2v1nf5y", y = "_1y2v1nf5i", f = "_15e54s9i _1y2v1nf7y _1y2v1nf8d _1y2v1nf5i _1y2v1nf5x _1y2v1nf5r _1y2v1nf9h", a = "_1y2v1nf5i _1y2v1nf80 _1y2v1nf8f _1y2v1nf5x _1y2v1nf5r", r = "_15e54s9j _1y2v1nf7y _1y2v1nf8d _1y2v1nf5i _1y2v1nf5x _1y2v1nf5r _1y2v1nf9h", e = "_15e54s97 _1y2v1nf72 _1y2v1nf7g _1y2v1nf6b _1y2v1nf6p _1y2v1nf5i _1y2v1nf64 _1y2v1nf5o _1y2v1nf7p", i = "_15e54s9e _1y2v1nf5i _1y2v1nf64 _1y2v1nf5o _1y2v1nf5u", o = "_15e54s9f", d = "_1y2v1nf5i _1y2v1nf5o _1y2v1nf85 _1y2v1nf7p", s = "_15e54s95 _1y2v1nf72 _1y2v1nf7g _1y2v1nf5i _1y2v1nf64 _1y2v1nf6a _1y2v1nf6p _1y2v1nf5o", p = "_15e54s99 _1y2v1nf6a _1y2v1nf6o _1y2v1nf72 _1y2v1nf7g _1y2v1nf5i _1y2v1nf85 _1y2v1nf5o _1y2v1nf5u _1y2v1nf64", t = "_15e54s9b _1y2v1nf65 _1y2v1nf6j _1y2v1nf6x _1y2v1nf7b _1y2v1nf5i _1y2v1nf85 _1y2v1nf7p _1y2v1nf9g _1y2v1nf5c", c = "_15e54s9c _1y2v1nf65 _1y2v1nf6j _1y2v1nf6x _1y2v1nf7b _1y2v1nf5i _1y2v1nf85 _1y2v1nf7p _1y2v1nf9g _1y2v1nf5c";
4
- export { _ as actions, y as boxed, f as cardAction, a as cardActionIconButton, r as cardActionInverse, e as dataCard, i as displayCard, o as displayCardGradient, d as mediaCard, s as mediaCardContent, p as snapCard, t as snapCardTouchableHover, c as snapCardTouchableHoverTransparent };
3
+ var _ = "_15e54s91 _1y2v1nf5i _1y2v1nf64 _1y2v1nf5y", y = "_15e54s93 _1y2v1nf5i", f = "_15e54s9j _1y2v1nf7y _1y2v1nf8d _1y2v1nf5i _1y2v1nf5x _1y2v1nf5r _1y2v1nf9h", a = "_1y2v1nf5i _1y2v1nf80 _1y2v1nf8f _1y2v1nf5x _1y2v1nf5r", r = "_15e54s9k _1y2v1nf7y _1y2v1nf8d _1y2v1nf5i _1y2v1nf5x _1y2v1nf5r _1y2v1nf9h", e = "_15e54s98 _1y2v1nf72 _1y2v1nf7g _1y2v1nf6b _1y2v1nf6p _1y2v1nf5i _1y2v1nf64 _1y2v1nf5o _1y2v1nf7p", i = "_15e54s9f _1y2v1nf5i _1y2v1nf64 _1y2v1nf5o _1y2v1nf5u", d = "_15e54s9g", o = "_1y2v1nf5i _1y2v1nf5o _1y2v1nf85 _1y2v1nf7p", s = "_15e54s96 _1y2v1nf72 _1y2v1nf7g _1y2v1nf5i _1y2v1nf64 _1y2v1nf6a _1y2v1nf6p _1y2v1nf5o _1y2v1nf5u", p = "_15e54s9a _1y2v1nf6a _1y2v1nf6o _1y2v1nf72 _1y2v1nf7g _1y2v1nf5i _1y2v1nf85 _1y2v1nf5o _1y2v1nf5u _1y2v1nf64", t = "_15e54s9c _1y2v1nf65 _1y2v1nf6j _1y2v1nf6x _1y2v1nf7b _1y2v1nf5i _1y2v1nf85 _1y2v1nf7p _1y2v1nf9g _1y2v1nf5c", c = "_15e54s9d _1y2v1nf65 _1y2v1nf6j _1y2v1nf6x _1y2v1nf7b _1y2v1nf5i _1y2v1nf85 _1y2v1nf7p _1y2v1nf9g _1y2v1nf5c";
4
+ export { _ as actions, y as boxed, f as cardAction, a as cardActionIconButton, r as cardActionInverse, e as dataCard, i as displayCard, d as displayCardGradient, o as mediaCard, s as mediaCardContent, p as snapCard, t as snapCardTouchableHover, c as snapCardTouchableHoverTransparent };