@telefonica/mistica 14.26.1 → 14.27.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/button.js CHANGED
@@ -10,7 +10,7 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  ButtonDanger: function() {
13
- return Re;
13
+ return xe;
14
14
  },
15
15
  ButtonLink: function() {
16
16
  return Ne;
@@ -161,32 +161,32 @@ function _object_without_properties_loose(source, excluded) {
161
161
  return target;
162
162
  }
163
163
  const N = (param)=>{
164
- let { content: e , defaultIconSize: i , renderText: n } = param;
165
- const c = (0, _utils.flattenChildren)(e), f = c.length, d = [];
166
- let l = [];
164
+ let { content: e , defaultIconSize: r , renderText: n } = param;
165
+ const l = (0, _utils.flattenChildren)(e), f = l.length, d = [];
166
+ let c = [];
167
167
  const g = ()=>{
168
168
  d.push(/* @__PURE__ */ (0, _jsxruntime.jsx)(_react.Fragment, {
169
- children: n(l)
170
- }, d.length)), l = [];
169
+ children: n(c)
170
+ }, d.length)), c = [];
171
171
  };
172
- return c.forEach((u, m)=>{
173
- const a = m === 0, s = m === f - 1;
172
+ return l.forEach((u, m)=>{
173
+ const o = m === 0, s = m === f - 1;
174
174
  if (/*#__PURE__*/ _react.isValidElement(u)) {
175
- l.length && g();
175
+ c.length && g();
176
176
  var _u_props_size;
177
- const v = (_u_props_size = u.props.size) !== null && _u_props_size !== void 0 ? _u_props_size : i;
177
+ const v = (_u_props_size = u.props.size) !== null && _u_props_size !== void 0 ? _u_props_size : r;
178
178
  d.push(/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
179
179
  style: {
180
180
  display: "flex",
181
181
  alignItems: "center",
182
- marginLeft: a ? 0 : _buttoncssmistica.ICON_MARGIN_PX,
182
+ marginLeft: o ? 0 : _buttoncssmistica.ICON_MARGIN_PX,
183
183
  marginRight: s ? 0 : _buttoncssmistica.ICON_MARGIN_PX
184
184
  },
185
185
  children: /*#__PURE__*/ _react.cloneElement(u, {
186
186
  size: (0, _css.pxToRem)(v)
187
187
  })
188
188
  }, d.length));
189
- } else l.push(u), s && g();
189
+ } else c.push(u), s && g();
190
190
  }), d;
191
191
  }, de = ()=>/* @__PURE__ */ (0, _jsxruntime.jsx)("svg", {
192
192
  width: "0.5em",
@@ -197,8 +197,8 @@ const N = (param)=>{
197
197
  fill: "currentColor"
198
198
  })
199
199
  }), z = (param)=>{
200
- let { showSpinner: e , children: i , small: n , loadingText: c , shouldRenderSpinner: f , setShouldRenderSpinner: d , renderText: l , textContentStyle: g , StartIcon: u , EndIcon: m , withChevron: a } = param;
201
- const s = n ? _buttoncssmistica.SMALL_ICON_SIZE : _buttoncssmistica.ICON_SIZE, r = (0, _css.pxToRem)(n ? _buttoncssmistica.SMALL_SPINNER_SIZE : _buttoncssmistica.SPINNER_SIZE);
200
+ let { showSpinner: e , children: r , small: n , loadingText: l , shouldRenderSpinner: f , setShouldRenderSpinner: d , renderText: c , textContentStyle: g , StartIcon: u , EndIcon: m , withChevron: o } = param;
201
+ const s = n ? _buttoncssmistica.SMALL_ICON_SIZE : _buttoncssmistica.ICON_SIZE, i = (0, _css.pxToRem)(n ? _buttoncssmistica.SMALL_SPINNER_SIZE : _buttoncssmistica.SPINNER_SIZE);
202
202
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
203
203
  children: [
204
204
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
@@ -217,11 +217,11 @@ const N = (param)=>{
217
217
  })
218
218
  }),
219
219
  N({
220
- content: i,
220
+ content: r,
221
221
  defaultIconSize: s,
222
- renderText: l
222
+ renderText: c
223
223
  }),
224
- m && !a && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
224
+ m && !o && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
225
225
  style: {
226
226
  display: "flex",
227
227
  alignItems: "center",
@@ -232,7 +232,7 @@ const N = (param)=>{
232
232
  color: "currentColor"
233
233
  })
234
234
  }),
235
- a && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
235
+ o && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
236
236
  style: {
237
237
  display: "flex",
238
238
  alignItems: "center",
@@ -245,14 +245,14 @@ const N = (param)=>{
245
245
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
246
246
  className: _buttoncssmistica.loadingFiller,
247
247
  "aria-hidden": !0,
248
- style: c ? {
249
- paddingLeft: r,
248
+ style: l ? {
249
+ paddingLeft: i,
250
250
  paddingRight: _buttoncssmistica.ICON_MARGIN_PX + 2 * (n ? _buttoncssmistica.X_SMALL_PADDING_PX : _buttoncssmistica.X_PADDING_PX)
251
251
  } : void 0,
252
252
  children: N({
253
- content: c,
253
+ content: l,
254
254
  defaultIconSize: s,
255
- renderText: l
255
+ renderText: c
256
256
  })
257
257
  }),
258
258
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
@@ -263,40 +263,40 @@ const N = (param)=>{
263
263
  },
264
264
  children: [
265
265
  f ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_spinner.default, {
266
- rolePresentation: !!c,
266
+ rolePresentation: !!l,
267
267
  color: "currentcolor",
268
268
  delay: "0s",
269
- size: r
269
+ size: i
270
270
  }) : /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
271
271
  style: {
272
272
  display: "inline-block",
273
- width: r,
274
- height: r
273
+ width: i,
274
+ height: i
275
275
  }
276
276
  }),
277
- c ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
277
+ l ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
278
278
  paddingLeft: 8,
279
279
  children: N({
280
- content: c,
280
+ content: l,
281
281
  defaultIconSize: s,
282
- renderText: l
282
+ renderText: c
283
283
  })
284
284
  }) : null
285
285
  ]
286
286
  })
287
287
  ]
288
288
  });
289
- }, _ = /*#__PURE__*/ _react.forwardRef((e, i)=>{
290
- const { textPresets: n } = (0, _hooks.useTheme)(), { eventFormat: c } = (0, _analytics.useTrackingConfig)(), { formStatus: f , formId: d } = (0, _formcontext.useForm)(), l = (0, _themevariantcontext.useIsInverseVariant)(), { loadingText: g } = e, u = !!e.submit, m = f === "sending", [a, s] = _react.useState(!1), r = e.showSpinner || m && u || a, [v, L] = _react.useState(!!r);
289
+ }, _ = /*#__PURE__*/ _react.forwardRef((e, r)=>{
290
+ const { textPresets: n } = (0, _hooks.useTheme)(), { eventFormat: l } = (0, _analytics.useTrackingConfig)(), { formStatus: f , formId: d } = (0, _formcontext.useForm)(), c = (0, _themevariantcontext.useIsInverseVariant)(), { loadingText: g } = e, u = !!e.submit, m = f === "sending", [o, s] = _react.useState(!1), i = e.showSpinner || m && u || o, [v, L] = _react.useState(!!i);
291
291
  _react.useEffect(()=>{
292
- r && !v && L(!0);
292
+ i && !v && L(!0);
293
293
  }, [
294
- r,
294
+ i,
295
295
  v,
296
296
  f
297
297
  ]);
298
298
  var _e_trackingEvent;
299
- const S = ()=>c === "google-analytics-4" ? {
299
+ const S = ()=>l === "google-analytics-4" ? {
300
300
  name: _analytics.eventNames.userInteraction,
301
301
  component_type: `${e.type}_button`,
302
302
  component_copy: (0, _common.getTextFromChildren)(e.children)
@@ -304,47 +304,49 @@ const N = (param)=>{
304
304
  category: _analytics.eventCategories.userInteraction,
305
305
  action: `${e.type}_button_tapped`,
306
306
  label: (0, _common.getTextFromChildren)(e.children)
307
- }, b = (I)=>e.small ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text, {
307
+ }, I = (y)=>e.small ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text, {
308
308
  size: 14,
309
309
  lineHeight: 20,
310
310
  weight: n.button.weight,
311
311
  truncate: 1,
312
312
  color: "inherit",
313
313
  as: "div",
314
- children: I
314
+ children: y
315
315
  }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
316
316
  weight: n.button.weight,
317
317
  truncate: 1,
318
318
  color: "inherit",
319
319
  as: "div",
320
- children: I
320
+ children: y
321
321
  }), h = {
322
- ref: i,
323
- className: (0, _classnames.default)(l ? _buttoncssmistica.inverseVariants[e.type] : _buttoncssmistica.variants[e.type], e.className, {
322
+ ref: r,
323
+ className: (0, _classnames.default)(c ? _buttoncssmistica.inverseVariants[e.type] : _buttoncssmistica.variants[e.type], e.className, {
324
324
  [_buttoncssmistica.small]: e.small,
325
- [_buttoncssmistica.isLoading]: r
325
+ [_buttoncssmistica.isLoading]: i
326
326
  }),
327
327
  style: _object_spread({
328
328
  cursor: e.fake ? "pointer" : void 0
329
329
  }, e.style),
330
330
  trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ? S() : void 0,
331
331
  dataAttributes: e.dataAttributes,
332
+ "aria-label": e["aria-label"],
332
333
  "aria-controls": e["aria-controls"],
333
334
  "aria-expanded": e["aria-expanded"],
335
+ "aria-haspopup": e["aria-haspopup"],
334
336
  tabIndex: e.tabIndex,
335
337
  children: z({
336
- showSpinner: r,
338
+ showSpinner: i,
337
339
  shouldRenderSpinner: v,
338
340
  setShouldRenderSpinner: L,
339
341
  children: e.children,
340
342
  loadingText: g,
341
343
  small: e.small,
342
- renderText: b,
344
+ renderText: I,
343
345
  textContentStyle: _buttoncssmistica.textContent,
344
346
  StartIcon: e.StartIcon,
345
347
  EndIcon: e.EndIcon
346
348
  }),
347
- disabled: e.disabled || r || m,
349
+ disabled: e.disabled || i || m,
348
350
  role: "button"
349
351
  };
350
352
  if (process.env.NODE_ENV !== "production" && (e.to === "" || e.href === "")) throw Error("to or href props are empty strings");
@@ -360,8 +362,8 @@ const N = (param)=>{
360
362
  onPress: ()=>{}
361
363
  }, h));
362
364
  if (e.onPress) return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({}, h), {
363
- onPress: (I)=>{
364
- const w = e.onPress(I);
365
+ onPress: (y)=>{
366
+ const w = e.onPress(y);
365
367
  w && (s(!0), w.finally(()=>s(!1)));
366
368
  }
367
369
  }));
@@ -376,14 +378,14 @@ const N = (param)=>{
376
378
  }));
377
379
  if (process.env.NODE_ENV !== "production") throw Error("Bad button props");
378
380
  return null;
379
- }), Ne = /*#__PURE__*/ _react.forwardRef((e, i)=>{
381
+ }), Ne = /*#__PURE__*/ _react.forwardRef((e, r)=>{
380
382
  var _e_withChevron;
381
- const { formStatus: n } = (0, _formcontext.useForm)(), c = (0, _themevariantcontext.useIsInverseVariant)(), { analytics: f , textPresets: d } = (0, _hooks.useTheme)(), { loadingText: l } = e, g = n === "sending", [u, m] = _react.useState(!1), a = e.showSpinner || u, s = (_e_withChevron = e.withChevron) !== null && _e_withChevron !== void 0 ? _e_withChevron : !!e.href || !!e.to, [r, v] = _react.useState(!!a);
383
+ const { formStatus: n } = (0, _formcontext.useForm)(), l = (0, _themevariantcontext.useIsInverseVariant)(), { analytics: f , textPresets: d } = (0, _hooks.useTheme)(), { loadingText: c } = e, g = n === "sending", [u, m] = _react.useState(!1), o = e.showSpinner || u, s = (_e_withChevron = e.withChevron) !== null && _e_withChevron !== void 0 ? _e_withChevron : !!e.href || !!e.to, [i, v] = _react.useState(!!o);
382
384
  _react.useEffect(()=>{
383
- a && !r && v(!0);
385
+ o && !i && v(!0);
384
386
  }, [
385
- a,
386
- r,
387
+ o,
388
+ i,
387
389
  n
388
390
  ]);
389
391
  var _e_trackingEvent;
@@ -400,10 +402,10 @@ const N = (param)=>{
400
402
  truncate: 1,
401
403
  color: "inherit",
402
404
  children: h
403
- }), b = {
405
+ }), I = {
404
406
  className: (0, _classnames.default)(_buttoncssmistica.link, {
405
- [_buttoncssmistica.inverseLink]: c,
406
- [_buttoncssmistica.isLoading]: a
407
+ [_buttoncssmistica.inverseLink]: l,
408
+ [_buttoncssmistica.isLoading]: o
407
409
  }),
408
410
  /**
409
411
  * Setting bleed classes with style to override the margin:0 set by the Touchable component.
@@ -420,12 +422,16 @@ const N = (param)=>{
420
422
  dataAttributes: _object_spread({
421
423
  "component-name": "ButtonLink"
422
424
  }, e.dataAttributes),
425
+ "aria-label": e["aria-label"],
426
+ "aria-controls": e["aria-controls"],
427
+ "aria-expanded": e["aria-expanded"],
428
+ "aria-haspopup": e["aria-haspopup"],
423
429
  children: z({
424
- showSpinner: a,
425
- shouldRenderSpinner: r,
430
+ showSpinner: o,
431
+ shouldRenderSpinner: i,
426
432
  setShouldRenderSpinner: v,
427
433
  children: e.children,
428
- loadingText: l,
434
+ loadingText: c,
429
435
  small: !0,
430
436
  renderText: S,
431
437
  textContentStyle: _buttoncssmistica.textContentLink,
@@ -433,64 +439,64 @@ const N = (param)=>{
433
439
  EndIcon: e.EndIcon,
434
440
  withChevron: s
435
441
  }),
436
- disabled: e.disabled || a || g
442
+ disabled: e.disabled || o || g
437
443
  };
438
444
  if (process.env.NODE_ENV !== "production" && (e.to === "" || e.href === "")) throw Error("to or href props are empty strings");
439
445
  if (e.onPress) return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({
440
- ref: i
441
- }, b), {
446
+ ref: r
447
+ }, I), {
442
448
  onPress: (h)=>{
443
- const I = e.onPress(h);
444
- I && (m(!0), I.finally(()=>m(!1)));
449
+ const y = e.onPress(h);
450
+ y && (m(!0), y.finally(()=>m(!1)));
445
451
  }
446
452
  }));
447
453
  if (e.to || e.to === "") return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({
448
- ref: i
449
- }, b), {
454
+ ref: r
455
+ }, I), {
450
456
  to: e.to,
451
457
  fullPageOnWebView: e.fullPageOnWebView
452
458
  }));
453
459
  if (e.href || e.href === "") return /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, _object_spread_props(_object_spread({
454
- ref: i
455
- }, b), {
460
+ ref: r
461
+ }, I), {
456
462
  href: e.href,
457
463
  newTab: e.newTab
458
464
  }));
459
465
  if (process.env.NODE_ENV !== "production") throw Error("Bad button props");
460
466
  return null;
461
467
  }), _e = /*#__PURE__*/ _react.forwardRef((_param, n)=>/* @__PURE__ */ {
462
- var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
468
+ var { dataAttributes: e } = _param, r = _object_without_properties(_param, [
463
469
  "dataAttributes"
464
470
  ]);
465
471
  return (0, _jsxruntime.jsx)(_, _object_spread_props(_object_spread({
466
472
  dataAttributes: _object_spread({
467
473
  "component-name": "ButtonPrimary"
468
474
  }, e)
469
- }, i), {
475
+ }, r), {
470
476
  ref: n,
471
477
  type: "primary"
472
478
  }));
473
479
  }), we = /*#__PURE__*/ _react.forwardRef((_param, n)=>/* @__PURE__ */ {
474
- var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
480
+ var { dataAttributes: e } = _param, r = _object_without_properties(_param, [
475
481
  "dataAttributes"
476
482
  ]);
477
483
  return (0, _jsxruntime.jsx)(_, _object_spread_props(_object_spread({
478
484
  dataAttributes: _object_spread({
479
485
  "component-name": "ButtonSecondary"
480
486
  }, e)
481
- }, i), {
487
+ }, r), {
482
488
  ref: n,
483
489
  type: "secondary"
484
490
  }));
485
- }), Re = /*#__PURE__*/ _react.forwardRef((_param, n)=>/* @__PURE__ */ {
486
- var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
491
+ }), xe = /*#__PURE__*/ _react.forwardRef((_param, n)=>/* @__PURE__ */ {
492
+ var { dataAttributes: e } = _param, r = _object_without_properties(_param, [
487
493
  "dataAttributes"
488
494
  ]);
489
495
  return (0, _jsxruntime.jsx)(_, _object_spread_props(_object_spread({
490
496
  dataAttributes: _object_spread({
491
497
  "component-name": "ButtonDanger"
492
498
  }, e)
493
- }, i), {
499
+ }, r), {
494
500
  ref: n,
495
501
  type: "danger"
496
502
  }));
package/dist/menu.js CHANGED
@@ -144,15 +144,15 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
144
144
  const f = D(r).indexOf(d);
145
145
  return f < 0 ? null : f;
146
146
  }, je = (param)=>{
147
- let { label: r , Icon: d , destructive: f , disabled: m , onPress: E , controlType: o , checked: p } = param;
148
- const { focusedItem: s , setFocusedItem: v , closeMenu: i , isMenuOpen: k } = ke(), c = _react.useRef(null), h = f ? _skincontractcssmistica.vars.colors.textLinkDanger : _skincontractcssmistica.vars.colors.neutralHigh, x = c == null ? void 0 : c.current, M = (x == null ? void 0 : x.closest("[role=menu]")) || null, u = Ne(M, x), l = ()=>o === "checkbox" ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_checkbox.default, {
147
+ let { label: r , Icon: d , destructive: f , disabled: u , onPress: E , controlType: s , checked: p } = param;
148
+ const { focusedItem: n , setFocusedItem: v , closeMenu: i , isMenuOpen: k } = ke(), c = _react.useRef(null), h = f ? _skincontractcssmistica.vars.colors.textLinkDanger : _skincontractcssmistica.vars.colors.neutralHigh, x = c == null ? void 0 : c.current, M = (x == null ? void 0 : x.closest("[role=menu]")) || null, m = Ne(M, x), l = ()=>s === "checkbox" ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_checkbox.default, {
149
149
  ref: c,
150
150
  name: r,
151
151
  checked: p,
152
152
  onChange: ()=>{
153
- k && u !== null && (E(u), i());
153
+ k && m !== null && (E(m), i());
154
154
  },
155
- disabled: m,
155
+ disabled: u,
156
156
  role: "menuitemcheckbox",
157
157
  render: (param)=>/* @__PURE__ */ {
158
158
  let { controlElement: N } = param;
@@ -191,9 +191,9 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
191
191
  }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.default, {
192
192
  ref: c,
193
193
  onPress: ()=>{
194
- k && u !== null && (E(u), i());
194
+ k && m !== null && (E(m), i());
195
195
  },
196
- disabled: m,
196
+ disabled: u,
197
197
  role: "menuitem",
198
198
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
199
199
  paddingX: 8,
@@ -219,11 +219,11 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
219
219
  });
220
220
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
221
221
  className: (0, _classnames.default)(_menucssmistica.menuItem, {
222
- [_menucssmistica.menuItemEnabled]: !m,
223
- [_menucssmistica.menuItemDisabled]: m,
224
- [_menucssmistica.menuItemHovered]: !m && u !== null && s === u
222
+ [_menucssmistica.menuItemEnabled]: !u,
223
+ [_menucssmistica.menuItemDisabled]: u,
224
+ [_menucssmistica.menuItemHovered]: !u && m !== null && n === m
225
225
  }),
226
- onMouseMove: ()=>v(m ? null : u),
226
+ onMouseMove: ()=>v(u ? null : m),
227
227
  onMouseLeave: ()=>v(null),
228
228
  children: l()
229
229
  });
@@ -240,45 +240,45 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
240
240
  ]
241
241
  }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {});
242
242
  }, V = 12, J = 8, qe = (param)=>{
243
- let { renderTarget: r , renderMenu: d , width: f , position: m = "left" , dataAttributes: E } = param;
244
- const [o, p] = _react.useState(!1), [s, v] = _react.useState(null), [i, k] = _react.useState(null), [c, h] = _react.useState(null), [x, M] = _react.useState(!1), u = _react.useRef(null), [l, N] = _react.useState(null), R = (0, _hooks.useWindowSize)();
243
+ let { renderTarget: r , renderMenu: d , width: f , position: u = "left" , dataAttributes: E } = param;
244
+ const [s, p] = _react.useState(!1), [n, v] = _react.useState(null), [i, k] = _react.useState(null), [c, h] = _react.useState(null), [x, M] = _react.useState(!1), m = _react.useRef(null), [l, N] = _react.useState(null), R = (0, _hooks.useWindowSize)();
245
245
  _react.useEffect(()=>{
246
- const a = s == null ? void 0 : s.getBoundingClientRect();
247
- if (!i || !a || !o) return;
248
- const { top: t , right: O , left: g , bottom: F } = a, T = i.scrollHeight, b = m === "left" ? g : void 0, A = m === "right" ? R.width - O : void 0, L = t - J, $ = F + J, H = R.height - $ - V, P = L - V, B = H > T, z = P > T, te = B || !z && H > P;
246
+ const a = n == null ? void 0 : n.getBoundingClientRect();
247
+ if (!i || !a || !s) return;
248
+ const { top: t , right: O , left: g , bottom: A } = a, T = i.scrollHeight, I = u === "left" ? g : void 0, F = u === "right" ? R.width - O : void 0, L = t - J, $ = A + J, H = R.height - $ - V, P = L - V, B = H > T, z = P > T, te = B || !z && H > P;
249
249
  N(te ? {
250
- left: b,
251
- right: A,
250
+ left: I,
251
+ right: F,
252
252
  top: `${$}px`,
253
253
  bottom: "auto",
254
254
  maxHeight: B ? void 0 : H,
255
255
  transformOrigin: "center top"
256
256
  } : {
257
- left: b,
258
- right: A,
257
+ left: I,
258
+ right: F,
259
259
  top: "auto",
260
260
  bottom: `${R.height - L}px`,
261
261
  maxHeight: z ? void 0 : P,
262
262
  transformOrigin: "center bottom"
263
263
  });
264
264
  }, [
265
- m,
266
- o,
267
- i,
265
+ u,
268
266
  s,
267
+ i,
268
+ n,
269
269
  f,
270
270
  R
271
271
  ]);
272
272
  const Z = _react.useMemo(()=>({
273
273
  ref: v,
274
274
  onPress: ()=>{
275
- p(!o);
275
+ p(!s);
276
276
  }
277
277
  }), [
278
278
  v,
279
- o
279
+ s
280
280
  ]), ee = {
281
- ref: (0, _common.combineRefs)(k, u),
281
+ ref: (0, _common.combineRefs)(k, m),
282
282
  className: _menucssmistica.menuContainer,
283
283
  close: ()=>p(!1)
284
284
  }, w = _react.useCallback(()=>{
@@ -291,24 +291,24 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
291
291
  const t = D(i);
292
292
  a && t.reverse();
293
293
  const O = c === null ? -1 : a ? t.length - 1 - c : c;
294
- let g = t.findIndex((b, A)=>!b.getAttribute("aria-disabled") && A > O);
295
- g === -1 && (g = t.findIndex((b)=>!b.getAttribute("aria-disabled")));
296
- const F = a && g !== -1 ? t.length - 1 - g : g;
297
- h(F < 0 ? null : F), (T = t[g]) == null || T.focus();
294
+ let g = t.findIndex((I, F)=>!I.getAttribute("aria-disabled") && F > O);
295
+ g === -1 && (g = t.findIndex((I)=>!I.getAttribute("aria-disabled")));
296
+ const A = a && g !== -1 ? t.length - 1 - g : g;
297
+ h(A < 0 ? null : A), (T = t[g]) == null || T.focus();
298
298
  }, [
299
299
  c,
300
300
  i
301
301
  ]);
302
302
  return _react.useEffect(()=>{
303
- o ? x && i && (w(), M(!1)) : h(null);
303
+ s ? x && i && (w(), M(!1)) : h(null);
304
304
  }, [
305
- o,
305
+ s,
306
306
  w,
307
307
  x,
308
308
  i
309
309
  ]), _react.useEffect(()=>{
310
310
  const a = (t)=>{
311
- if (o) switch(t.keyCode){
311
+ if (s) switch(t.keyCode){
312
312
  case _keycodes.RIGHT:
313
313
  case _keycodes.DOWN:
314
314
  (0, _dom.cancelEvent)(t), _();
@@ -334,7 +334,7 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
334
334
  M(!0);
335
335
  break;
336
336
  case _keycodes.DOWN:
337
- s === document.activeElement && (M(!0), p(!0));
337
+ n === document.activeElement && (M(!0), p(!0));
338
338
  break;
339
339
  }
340
340
  };
@@ -342,24 +342,24 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
342
342
  document.removeEventListener("keydown", a, !1);
343
343
  };
344
344
  }), _react.useEffect(()=>{
345
- s == null || s.setAttribute("aria-expanded", String(o));
345
+ n == null || n.setAttribute("aria-haspopup", "menu"), n == null || n.setAttribute("aria-expanded", String(s));
346
346
  }, [
347
- s,
348
- o
347
+ n,
348
+ s
349
349
  ]), /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(E, "Menu")), {
350
350
  children: [
351
351
  r(_object_spread_props(_object_spread({}, Z), {
352
- isMenuOpen: o
352
+ isMenuOpen: s
353
353
  })),
354
354
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
355
355
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_reacttransitiongroup.CSSTransition, {
356
- in: o,
357
- nodeRef: u,
356
+ in: s,
357
+ nodeRef: m,
358
358
  timeout: Ee,
359
359
  classNames: _menucssmistica.menuTransitionClasses,
360
360
  mountOnEnter: !0,
361
361
  unmountOnExit: !0,
362
- onExit: ()=>s == null ? void 0 : s.focus(),
362
+ onExit: ()=>n == null ? void 0 : n.focus(),
363
363
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_overlay.default, {
364
364
  onPress: (a)=>{
365
365
  (0, _dom.cancelEvent)(a), p(!1);
@@ -382,7 +382,7 @@ const Ee = 120, Q = /*#__PURE__*/ _react.createContext({
382
382
  role: "menu",
383
383
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Q.Provider, {
384
384
  value: {
385
- isMenuOpen: o,
385
+ isMenuOpen: s,
386
386
  focusedItem: c,
387
387
  setFocusedItem: h,
388
388
  closeMenu: ()=>p(!1)
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "PACKAGE_VERSION", {
8
8
  return o;
9
9
  }
10
10
  });
11
- const o = "14.26.1";
11
+ const o = "14.27.0";
@@ -14,6 +14,7 @@ interface CommonProps {
14
14
  'aria-checked'?: 'true' | 'false' | boolean;
15
15
  'aria-controls'?: string;
16
16
  'aria-expanded'?: 'true' | 'false' | boolean;
17
+ 'aria-haspopup'?: 'true' | 'false' | 'menu' | 'dialog' | boolean;
17
18
  'aria-hidden'?: 'true' | 'false' | boolean;
18
19
  'aria-selected'?: 'true' | 'false' | boolean;
19
20
  'aria-labelledby'?: string;
package/dist/touchable.js CHANGED
@@ -126,8 +126,8 @@ const L = function(e) {
126
126
  t ? window.open(e, "_blank") : d ? window.open(e, "_top") : document.location.href = e;
127
127
  }, T = /*#__PURE__*/ _react.forwardRef((e, t)=>{
128
128
  const { texts: d , analytics: v , platformOverrides: N , Link: P , useHrefDecorator: E } = (0, _hooks.useTheme)(), C = E(), f = _react.useRef(!1);
129
- let i = [];
130
- e.trackingEvent && (Array.isArray(e.trackingEvent) ? i = e.trackingEvent : i = [
129
+ let l = [];
130
+ e.trackingEvent && (Array.isArray(e.trackingEvent) ? l = e.trackingEvent : l = [
131
131
  e.trackingEvent
132
132
  ]);
133
133
  var _e_to_pathname;
@@ -140,28 +140,29 @@ const L = function(e) {
140
140
  "aria-disabled": e.disabled ? !0 : void 0,
141
141
  "aria-controls": e["aria-controls"],
142
142
  "aria-expanded": e["aria-expanded"],
143
+ "aria-haspopup": e["aria-haspopup"],
143
144
  "aria-hidden": e["aria-hidden"],
144
145
  "aria-selected": e["aria-selected"],
145
146
  "aria-live": e["aria-live"],
146
147
  tabIndex: e.tabIndex
147
- }, (0, _dom.getPrefixedDataAttributes)(e.dataAttributes, "Touchable")), u = e.type ? e.type : "button", r = !!e.href && !!e.newTab, m = !r && !!e.href && !!e.loadOnTop, b = (a)=>{
148
+ }, (0, _dom.getPrefixedDataAttributes)(e.dataAttributes, "Touchable")), u = e.type ? e.type : "button", r = !!e.href && !!e.newTab, m = !r && !!e.href && !!e.loadOnTop, s = (a)=>{
148
149
  e.stopPropagation && a.stopPropagation();
149
150
  }, h = (a)=>{
150
151
  e.onPress && e.onPress(a);
151
- }, k = ()=>e.href ? C(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (_e_to_pathname = e.to.pathname) !== null && _e_to_pathname !== void 0 ? _e_to_pathname : "" : "", y = ()=>Promise.all(i.map((a)=>v.logEvent(a))), g = (a)=>{
152
+ }, k = ()=>e.href ? C(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (_e_to_pathname = e.to.pathname) !== null && _e_to_pathname !== void 0 ? _e_to_pathname : "" : "", y = ()=>Promise.all(l.map((a)=>v.logEvent(a))), g = (a)=>{
152
153
  f.current || (f.current = !0, y().finally(()=>{
153
154
  f.current = !1, a();
154
155
  }));
155
156
  }, x = (a)=>{
156
- if (b(a), !i.length) {
157
+ if (s(a), !l.length) {
157
158
  h(a);
158
159
  return;
159
160
  }
160
161
  g(()=>h(a));
161
162
  }, R = (a)=>{
162
- b(a), i.length && (a.preventDefault(), g(()=>L(k(), r, m)));
163
+ s(a), l.length && (a.preventDefault(), g(()=>L(k(), r, m)));
163
164
  }, D = (a)=>{
164
- b(a), y();
165
+ s(a), y();
165
166
  }, w = (a)=>{
166
167
  (a.keyCode === _keycodes.ENTER || a.keyCode === _keycodes.SPACE) && (a.preventDefault(), a.currentTarget.click());
167
168
  };