@telefonica/mistica 14.28.1 → 14.29.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 (55) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.d.ts +3 -0
  3. package/dist/accordion.js +71 -70
  4. package/dist/button-layout.css-mistica.js +11 -19
  5. package/dist/button-layout.css.d.ts +1 -5
  6. package/dist/button-layout.js +19 -90
  7. package/dist/button.css-mistica.js +18 -21
  8. package/dist/counter.css-mistica.js +48 -0
  9. package/dist/counter.css.d.ts +11 -0
  10. package/dist/counter.css.ts.vanilla.css-mistica.js +11 -0
  11. package/dist/counter.d.ts +19 -0
  12. package/dist/counter.js +240 -0
  13. package/dist/generated/mistica-icons/icon-add-more-filled.js +1 -1
  14. package/dist/generated/mistica-icons/icon-add-more-light.js +1 -1
  15. package/dist/generated/mistica-icons/icon-add-more-regular.js +2 -2
  16. package/dist/generated/mistica-icons/icon-subtract-filled.d.ts +4 -0
  17. package/dist/generated/mistica-icons/icon-subtract-light.js +21 -10
  18. package/dist/generated/mistica-icons/icon-subtract-regular.js +29 -8
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +4 -0
  21. package/dist/list.d.ts +3 -0
  22. package/dist/list.js +92 -92
  23. package/dist/loading-bar.js +5 -4
  24. package/dist/menu.js +11 -10
  25. package/dist/navigation-bar.js +27 -26
  26. package/dist/package-version.js +1 -1
  27. package/dist/snackbar.css-mistica.js +16 -13
  28. package/dist/snackbar.css.d.ts +3 -2
  29. package/dist/snackbar.d.ts +5 -1
  30. package/dist/snackbar.js +119 -64
  31. package/dist/theme.d.ts +6 -0
  32. package/dist/theme.js +52 -28
  33. package/dist-es/accordion.js +79 -78
  34. package/dist-es/button-layout.css-mistica.js +4 -6
  35. package/dist-es/button-layout.js +27 -98
  36. package/dist-es/button.css-mistica.js +3 -3
  37. package/dist-es/counter.css-mistica.js +4 -0
  38. package/dist-es/counter.css.ts.vanilla.css-mistica.js +2 -0
  39. package/dist-es/counter.js +187 -0
  40. package/dist-es/generated/mistica-icons/icon-add-more-filled.js +1 -1
  41. package/dist-es/generated/mistica-icons/icon-add-more-light.js +1 -1
  42. package/dist-es/generated/mistica-icons/icon-add-more-regular.js +2 -2
  43. package/dist-es/generated/mistica-icons/icon-subtract-light.js +24 -13
  44. package/dist-es/generated/mistica-icons/icon-subtract-regular.js +33 -12
  45. package/dist-es/index.js +1765 -1764
  46. package/dist-es/list.js +125 -125
  47. package/dist-es/loading-bar.js +12 -11
  48. package/dist-es/menu.js +9 -8
  49. package/dist-es/navigation-bar.js +26 -25
  50. package/dist-es/package-version.js +1 -1
  51. package/dist-es/snackbar.css-mistica.js +5 -2
  52. package/dist-es/snackbar.js +140 -85
  53. package/dist-es/style.css +1 -1
  54. package/dist-es/theme.js +56 -32
  55. package/package.json +1 -1
package/dist-es/list.js CHANGED
@@ -79,22 +79,22 @@ function _object_without_properties_loose(source, excluded) {
79
79
  }
80
80
  import { jsx as t, jsxs as k } from "react/jsx-runtime";
81
81
  import * as P from "react";
82
- import a from "classnames";
83
- import { BaseTouchable as S } from "./touchable.js";
82
+ import i from "classnames";
83
+ import { BaseTouchable as T } from "./touchable.js";
84
84
  import { Text1 as ne, Text3 as re, Text2 as O } from "./text.js";
85
- import m from "./box.js";
85
+ import u from "./box.js";
86
86
  import L from "./stack.js";
87
87
  import J from "./badge.js";
88
- import { useAriaId as ie } from "./hooks.js";
88
+ import { useAriaId as ae } from "./hooks.js";
89
89
  import { useIsInverseVariant as p } from "./theme-variant-context.js";
90
- import ae from "./icons/icon-chevron.js";
90
+ import ie from "./icons/icon-chevron.js";
91
91
  import oe from "./switch-component.js";
92
92
  import K, { useRadioContext as ce } from "./radio-button.js";
93
93
  import se from "./checkbox.js";
94
94
  import { Boxed as de } from "./boxed.js";
95
95
  import le from "./divider.js";
96
96
  import { getPrefixedDataAttributes as he } from "./utils/dom.js";
97
- import { rowContent as B, touchableBackground as R, touchableBackgroundInverse as C, pointer as V, dualActionContainer as Q, dualActionLeft as U, dualActionDivider as Z, content as ue, center as W, disabled as I, asset as me, rowBody as fe, right as ge, rightRestrictedWidth as ve, detail as be, detailRight as _, dualActionRight as xe, badge as we } from "./list.css-mistica.js";
97
+ import { rowContent as B, touchableBackground as R, touchableBackgroundInverse as C, pointer as S, dualActionContainer as Q, dualActionLeft as U, dualActionDivider as Z, content as ue, center as M, disabled as I, asset as me, rowBody as fe, right as ge, rightRestrictedWidth as ve, detail as be, detailRight as _, dualActionRight as xe, badge as we } from "./list.css-mistica.js";
98
98
  import { vars as N } from "./skins/skin-contract.css-mistica.js";
99
99
  const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
100
100
  centerY: n
@@ -106,45 +106,45 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
106
106
  },
107
107
  children: e
108
108
  }) : e, ye = (param)=>{
109
- let { withChevron: e , headline: n , title: r , titleLinesMax: o , subtitle: d , subtitleLinesMax: x , description: l , descriptionLinesMax: A , detail: c , asset: E , type: g = "basic" , badge: T , right: X , extra: D , labelId: h , disabled: v } = param;
110
- const u = p(), i = [
109
+ let { withChevron: e , headline: n , title: r , titleLinesMax: o , subtitle: s , subtitleLinesMax: x , description: d , descriptionLinesMax: W , detail: m , asset: V , type: g = "basic" , badge: A , right: E , extra: X , labelId: l , disabled: v } = param;
110
+ const h = p(), a = [
111
111
  n,
112
112
  r,
113
+ s,
113
114
  d,
114
- l,
115
- D
116
- ].filter(Boolean).length === 1, f = ()=>T ? /* @__PURE__ */ t(m, {
115
+ X
116
+ ].filter(Boolean).length === 1, f = ()=>A ? /* @__PURE__ */ t(u, {
117
117
  paddingLeft: 16,
118
118
  children: /* @__PURE__ */ t("div", {
119
- className: a(W, we, {
119
+ className: i(M, we, {
120
120
  [I]: v
121
121
  }),
122
- children: T === !0 ? /* @__PURE__ */ t(J, {}) : /* @__PURE__ */ t(J, {
123
- value: T
122
+ children: A === !0 ? /* @__PURE__ */ t(J, {}) : /* @__PURE__ */ t(J, {
123
+ value: A
124
124
  })
125
125
  })
126
126
  }) : null;
127
- return /* @__PURE__ */ k(m, {
127
+ return /* @__PURE__ */ k(u, {
128
128
  paddingY: 16,
129
129
  className: ue,
130
130
  children: [
131
- E && /* @__PURE__ */ t(m, {
131
+ V && /* @__PURE__ */ t(u, {
132
132
  paddingRight: 16,
133
- className: a({
134
- [W]: i,
133
+ className: i({
134
+ [M]: a,
135
135
  [I]: v
136
136
  }),
137
137
  children: /* @__PURE__ */ t("div", {
138
138
  className: me,
139
- children: E
139
+ children: V
140
140
  })
141
141
  }),
142
142
  /* @__PURE__ */ t("div", {
143
- className: a(fe, {
143
+ className: i(fe, {
144
144
  [I]: v
145
145
  }),
146
146
  style: {
147
- justifyContent: i ? "center" : "flex-start"
147
+ justifyContent: a ? "center" : "flex-start"
148
148
  },
149
149
  children: /* @__PURE__ */ k(L, {
150
150
  space: 4,
@@ -162,25 +162,25 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
162
162
  regular: !0,
163
163
  color: N.colors.textPrimary,
164
164
  truncate: o,
165
- id: h,
165
+ id: l,
166
166
  hyphens: "auto",
167
167
  children: r
168
168
  }),
169
- d && /* @__PURE__ */ t(O, {
169
+ s && /* @__PURE__ */ t(O, {
170
170
  regular: !0,
171
171
  color: N.colors.textSecondary,
172
172
  truncate: x,
173
173
  hyphens: "auto",
174
- children: d
174
+ children: s
175
175
  }),
176
- l && /* @__PURE__ */ t(O, {
176
+ d && /* @__PURE__ */ t(O, {
177
177
  regular: !0,
178
178
  color: N.colors.textSecondary,
179
- truncate: A,
179
+ truncate: W,
180
180
  hyphens: "auto",
181
- children: l
181
+ children: d
182
182
  }),
183
- D
183
+ X
184
184
  ]
185
185
  })
186
186
  ]
@@ -188,42 +188,42 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
188
188
  }),
189
189
  f(),
190
190
  /* @__PURE__ */ k("div", {
191
- className: a({
192
- [ge]: !!c || g !== "basic",
193
- [ve]: !!c
191
+ className: i({
192
+ [ge]: !!m || g !== "basic",
193
+ [ve]: !!m
194
194
  }),
195
195
  children: [
196
- c && /* @__PURE__ */ t("div", {
197
- className: a(W, be, {
196
+ m && /* @__PURE__ */ t("div", {
197
+ className: i(M, be, {
198
198
  [I]: v
199
199
  }),
200
200
  children: /* @__PURE__ */ t(O, {
201
201
  regular: !0,
202
202
  color: N.colors.textSecondary,
203
203
  hyphens: "auto",
204
- children: c
204
+ children: m
205
205
  })
206
206
  }),
207
207
  g === "control" && /* @__PURE__ */ t("div", {
208
- className: a({
209
- [_]: !!c
208
+ className: i({
209
+ [_]: !!m
210
210
  }),
211
- children: $(X, i)
211
+ children: $(E, a)
212
212
  }),
213
213
  g === "custom" && /* @__PURE__ */ t("div", {
214
- className: a({
215
- [_]: !!c,
214
+ className: i({
215
+ [_]: !!m,
216
216
  [I]: v
217
217
  }),
218
- children: $(X, i)
218
+ children: $(E, a)
219
219
  }),
220
- (g === "chevron" || g === "custom" && e) && /* @__PURE__ */ t(m, {
221
- paddingLeft: c || g === "custom" ? 4 : 0,
222
- className: a(W, {
220
+ (g === "chevron" || g === "custom" && e) && /* @__PURE__ */ t(u, {
221
+ paddingLeft: m || g === "custom" ? 4 : 0,
222
+ className: i(M, {
223
223
  [I]: v
224
224
  }),
225
- children: /* @__PURE__ */ t(ae, {
226
- color: u ? N.colors.inverse : N.colors.neutralMedium,
225
+ children: /* @__PURE__ */ t(ie, {
226
+ color: h ? N.colors.inverse : N.colors.neutralMedium,
227
227
  direction: "right"
228
228
  })
229
229
  })
@@ -233,103 +233,103 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
233
233
  });
234
234
  }, Re = (param)=>{
235
235
  let { value: e , defaultValue: n , onChange: r } = param;
236
- const o = e !== void 0, [d, x] = P.useState(!!n), l = ()=>{
237
- o || x(!d), r && r(o ? !e : !d);
236
+ const o = e !== void 0, [s, x] = P.useState(!!n), d = ()=>{
237
+ o || x(!s), r && r(o ? !e : !s);
238
238
  };
239
239
  return o ? [
240
240
  !!e,
241
- l
241
+ d
242
242
  ] : [
243
- d,
244
- l
243
+ s,
244
+ d
245
245
  ];
246
246
  }, Ce = (e)=>e.switch !== void 0, Ne = (e)=>e.checkbox !== void 0, ke = (e)=>e.radioValue !== void 0, ee = /*#__PURE__*/ P.forwardRef((e, n)=>{
247
- const r = ie(), o = p(), { asset: d , headline: x , title: l , titleLinesMax: A , subtitle: c , subtitleLinesMax: E , description: g , descriptionLinesMax: T , detail: X , badge: D , role: h , extra: v , dataAttributes: u } = e, F = ce(), i = e.disabled || e.radioValue !== void 0 && F.disabled, f = !i && !o, w = !i && o, [Y, q] = Re(e.switch || e.checkbox || {}), y = (param)=>/* @__PURE__ */ {
248
- let { type: s , right: b , labelId: M } = param;
247
+ const r = ae(), o = p(), { asset: s , headline: x , title: d , titleLinesMax: W , subtitle: m , subtitleLinesMax: V , description: g , descriptionLinesMax: A , detail: E , badge: X , role: l , extra: v , dataAttributes: h } = e, F = ce(), a = e.disabled || e.radioValue !== void 0 && F.disabled, f = !a && !o, w = !a && o, [Y, q] = Re(e.switch || e.checkbox || {}), y = (param)=>/* @__PURE__ */ {
248
+ let { type: c , right: b , labelId: D } = param;
249
249
  return t(ye, {
250
- asset: d,
250
+ asset: s,
251
251
  headline: x,
252
- title: l,
253
- subtitle: c,
252
+ title: d,
253
+ subtitle: m,
254
254
  description: g,
255
- badge: D,
256
- titleLinesMax: A,
257
- subtitleLinesMax: E,
258
- descriptionLinesMax: T,
259
- detail: X,
260
- type: s,
255
+ badge: X,
256
+ titleLinesMax: W,
257
+ subtitleLinesMax: V,
258
+ descriptionLinesMax: A,
259
+ detail: E,
260
+ type: c,
261
261
  right: b,
262
262
  extra: v,
263
- labelId: M,
264
- disabled: i,
263
+ labelId: D,
264
+ disabled: a,
265
265
  withChevron: !!e.onPress || !!e.href || !!e.to
266
266
  });
267
- }, j = (s)=>{
267
+ }, j = (c)=>{
268
268
  let b = "chevron";
269
- return s.right === null && (b = "basic"), s.right && (b = "custom"), /* @__PURE__ */ t(m, {
269
+ return c.right === null && (b = "basic"), c.right && (b = "custom"), /* @__PURE__ */ t(u, {
270
270
  paddingX: 16,
271
271
  ref: n,
272
272
  children: y({
273
273
  type: b,
274
- right: s.right
274
+ right: c.right
275
275
  })
276
276
  });
277
277
  };
278
- if (e.onPress && !Ce(e) && !Ne(e) && !ke(e)) return /* @__PURE__ */ t(S, {
278
+ if (e.onPress && !Ce(e) && !Ne(e) && !ke(e)) return /* @__PURE__ */ t(T, {
279
279
  ref: n,
280
- className: a(B, {
280
+ className: i(B, {
281
281
  [R]: f,
282
282
  [C]: w,
283
- [V]: !i
283
+ [S]: !a
284
284
  }),
285
285
  trackingEvent: e.trackingEvent,
286
286
  onPress: e.onPress,
287
- role: h,
288
- dataAttributes: u,
289
- disabled: i,
287
+ role: l,
288
+ dataAttributes: h,
289
+ disabled: a,
290
290
  children: j(e)
291
291
  });
292
- if (e.to) return /* @__PURE__ */ t(S, {
293
- className: a(B, {
292
+ if (e.to) return /* @__PURE__ */ t(T, {
293
+ className: i(B, {
294
294
  [R]: f,
295
295
  [C]: w,
296
- [V]: !i
296
+ [S]: !a
297
297
  }),
298
298
  trackingEvent: e.trackingEvent,
299
299
  to: e.to,
300
300
  fullPageOnWebView: e.fullPageOnWebView,
301
- role: h,
302
- dataAttributes: u,
303
- disabled: i,
301
+ role: l,
302
+ dataAttributes: h,
303
+ disabled: a,
304
304
  children: j(e)
305
305
  });
306
- if (e.href) return /* @__PURE__ */ t(S, {
307
- className: a(B, {
306
+ if (e.href) return /* @__PURE__ */ t(T, {
307
+ className: i(B, {
308
308
  [R]: f,
309
309
  [C]: w,
310
- [V]: !i
310
+ [S]: !a
311
311
  }),
312
312
  trackingEvent: e.trackingEvent,
313
313
  href: e.href,
314
314
  newTab: e.newTab,
315
- role: h,
316
- dataAttributes: u,
317
- disabled: i,
315
+ role: l,
316
+ dataAttributes: h,
317
+ disabled: a,
318
318
  children: j(e)
319
319
  });
320
- const z = (s)=>{
321
- var M, G;
320
+ const z = (c)=>{
321
+ var D, G;
322
322
  var _ref, _ref1;
323
- const b = (_ref1 = (_ref = (M = e.switch) == null ? void 0 : M.name) !== null && _ref !== void 0 ? _ref : (G = e.checkbox) == null ? void 0 : G.name) !== null && _ref1 !== void 0 ? _ref1 : r;
323
+ const b = (_ref1 = (_ref = (D = e.switch) == null ? void 0 : D.name) !== null && _ref !== void 0 ? _ref : (G = e.checkbox) == null ? void 0 : G.name) !== null && _ref1 !== void 0 ? _ref1 : r;
324
324
  return e.onPress ? /* @__PURE__ */ k("div", {
325
325
  className: Q,
326
326
  children: [
327
- /* @__PURE__ */ t(S, {
328
- dataAttributes: u,
329
- disabled: i,
327
+ /* @__PURE__ */ t(T, {
328
+ dataAttributes: h,
329
+ disabled: a,
330
330
  onPress: e.onPress,
331
- role: h,
332
- className: a(U, {
331
+ role: l,
332
+ className: i(U, {
333
333
  [R]: f,
334
334
  [C]: w
335
335
  }),
@@ -341,8 +341,8 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
341
341
  /* @__PURE__ */ t("div", {
342
342
  className: Z
343
343
  }),
344
- /* @__PURE__ */ t(s, {
345
- disabled: i,
344
+ /* @__PURE__ */ t(c, {
345
+ disabled: a,
346
346
  name: b,
347
347
  checked: Y,
348
348
  "aria-labelledby": r,
@@ -357,22 +357,22 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
357
357
  })
358
358
  ]
359
359
  }) : /* @__PURE__ */ t("div", {
360
- className: a(B, {
360
+ className: i(B, {
361
361
  [R]: f,
362
362
  [C]: w,
363
- [V]: !i
363
+ [S]: !a
364
364
  }),
365
- children: /* @__PURE__ */ t(s, {
366
- disabled: i,
367
- dataAttributes: u,
365
+ children: /* @__PURE__ */ t(c, {
366
+ disabled: a,
367
+ dataAttributes: h,
368
368
  name: b,
369
369
  checked: Y,
370
370
  onChange: q,
371
371
  render: (param)=>/* @__PURE__ */ {
372
372
  let { controlElement: H , labelId: te } = param;
373
- return t(m, {
373
+ return t(u, {
374
374
  paddingX: 16,
375
- role: h,
375
+ role: l,
376
376
  children: y({
377
377
  labelId: te,
378
378
  type: "control",
@@ -389,11 +389,11 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
389
389
  return e.switch ? z(oe) : e.checkbox ? z(se) : e.radioValue ? e.onPress ? /* @__PURE__ */ k("div", {
390
390
  className: Q,
391
391
  children: [
392
- /* @__PURE__ */ t(S, {
393
- disabled: i,
392
+ /* @__PURE__ */ t(T, {
393
+ disabled: a,
394
394
  onPress: e.onPress,
395
- role: h,
396
- className: a(U, {
395
+ role: l,
396
+ className: i(U, {
397
397
  [R]: f,
398
398
  [C]: w
399
399
  }),
@@ -406,53 +406,53 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
406
406
  className: Z
407
407
  }),
408
408
  /* @__PURE__ */ t(K, {
409
- dataAttributes: u,
409
+ dataAttributes: h,
410
410
  value: e.radioValue,
411
411
  "aria-labelledby": r,
412
412
  render: (param)=>/* @__PURE__ */ {
413
- let { controlElement: s } = param;
413
+ let { controlElement: c } = param;
414
414
  return t(L, {
415
415
  space: "around",
416
- children: /* @__PURE__ */ t(m, {
416
+ children: /* @__PURE__ */ t(u, {
417
417
  paddingX: 16,
418
- children: s
418
+ children: c
419
419
  })
420
420
  });
421
421
  }
422
422
  })
423
423
  ]
424
424
  }) : /* @__PURE__ */ t("div", {
425
- className: a(B, {
425
+ className: i(B, {
426
426
  [R]: f,
427
427
  [C]: w,
428
- [V]: !i
428
+ [S]: !a
429
429
  }),
430
- role: h,
430
+ role: l,
431
431
  ref: n,
432
432
  children: /* @__PURE__ */ t(K, {
433
- dataAttributes: u,
433
+ dataAttributes: h,
434
434
  value: e.radioValue,
435
435
  "aria-labelledby": r,
436
436
  render: (param)=>/* @__PURE__ */ {
437
- let { controlElement: s } = param;
438
- return t(m, {
437
+ let { controlElement: c } = param;
438
+ return t(u, {
439
439
  paddingX: 16,
440
440
  children: y({
441
441
  labelId: r,
442
442
  type: "control",
443
443
  right: ()=>/* @__PURE__ */ t(L, {
444
444
  space: "around",
445
- children: s
445
+ children: c
446
446
  })
447
447
  })
448
448
  });
449
449
  }
450
450
  })
451
- }) : /* @__PURE__ */ t(m, {
451
+ }) : /* @__PURE__ */ t(u, {
452
452
  paddingX: 16,
453
453
  className: B,
454
- role: h,
455
- dataAttributes: u,
454
+ role: l,
455
+ dataAttributes: h,
456
456
  children: e.right ? y({
457
457
  type: "custom",
458
458
  right: e.right
@@ -471,21 +471,21 @@ const $ = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
471
471
  }, e)
472
472
  }));
473
473
  }), ze = (param)=>{
474
- let { children: e , ariaLabelledby: n , role: r , dataAttributes: o , noLastDivider: d } = param;
475
- const x = P.Children.count(e) - 1, l = !d;
474
+ let { children: e , ariaLabelledby: n , role: r , dataAttributes: o } = param;
475
+ const s = P.Children.count(e) - 1;
476
476
  return /* @__PURE__ */ t("div", _object_spread_props(_object_spread({
477
477
  role: r,
478
478
  "aria-labelledby": n
479
479
  }, he(o, "RowList")), {
480
- children: P.Children.toArray(e).filter(Boolean).map((A, c)=>/* @__PURE__ */ k(P.Fragment, {
480
+ children: P.Children.toArray(e).filter(Boolean).map((x, d)=>/* @__PURE__ */ k(P.Fragment, {
481
481
  children: [
482
- A,
483
- (c < x || l) && /* @__PURE__ */ t(m, {
482
+ x,
483
+ d < s && /* @__PURE__ */ t(u, {
484
484
  paddingX: 16,
485
485
  children: /* @__PURE__ */ t(le, {})
486
486
  })
487
487
  ]
488
- }, c))
488
+ }, d))
489
489
  }));
490
490
  }, Ge = /*#__PURE__*/ P.forwardRef((_param, r)=>/* @__PURE__ */ {
491
491
  var { dataAttributes: e } = _param, n = _object_without_properties(_param, [
@@ -52,34 +52,35 @@ function _object_spread_props(target, source) {
52
52
  }
53
53
  import { jsx as e } from "react/jsx-runtime";
54
54
  import { CSSTransition as i } from "react-transition-group";
55
- import { Portal as o } from "./portal.js";
56
- import { TRANSITION_DURATION_MS as a, enter as n, enterActive as s, exit as m, exitActive as c, portal as d, progressContainer as l, progress as p, innerProgress as x } from "./loading-bar.css-mistica.js";
57
- import { getPrefixedDataAttributes as N } from "./utils/dom.js";
58
- const f = (param)=>/* @__PURE__ */ {
55
+ import { Portal as n } from "./portal.js";
56
+ import { TRANSITION_DURATION_MS as o, enter as a, enterActive as s, exit as m, exitActive as c, portal as d, progressContainer as l, progress as p, innerProgress as f } from "./loading-bar.css-mistica.js";
57
+ import { getPrefixedDataAttributes as g } from "./utils/dom.js";
58
+ import { isRunningAcceptanceTest as u } from "./utils/platform.js";
59
+ const x = (param)=>/* @__PURE__ */ {
59
60
  let { visible: r , dataAttributes: t } = param;
60
61
  return e(i, {
61
62
  in: r,
62
- timeout: a,
63
+ timeout: u() ? 0 : o,
63
64
  classNames: {
64
- enter: n,
65
+ enter: a,
65
66
  enterActive: s,
66
67
  exit: m,
67
68
  exitActive: c
68
69
  },
69
70
  unmountOnExit: !0,
70
- children: /* @__PURE__ */ e(o, {
71
+ children: /* @__PURE__ */ e(n, {
71
72
  className: d,
72
73
  children: /* @__PURE__ */ e("div", _object_spread_props(_object_spread({
73
74
  className: l
74
- }, N(t, "LoadingBar")), {
75
+ }, g(t, "LoadingBar")), {
75
76
  children: /* @__PURE__ */ e("div", {
76
77
  className: p,
77
78
  children: /* @__PURE__ */ e("div", {
78
- className: x
79
+ className: f
79
80
  })
80
81
  })
81
82
  }))
82
83
  })
83
84
  });
84
- }, S = f;
85
- export { S as default };
85
+ }, B = x;
86
+ export { B as default };
package/dist-es/menu.js CHANGED
@@ -69,18 +69,19 @@ import Oe from "./divider.js";
69
69
  import Te from "./checkbox.js";
70
70
  import { CSSTransition as Se } from "react-transition-group";
71
71
  import { combineRefs as Ce } from "./utils/common.js";
72
- const Ee = 120, Q = /*#__PURE__*/ o.createContext({
72
+ import { isRunningAcceptanceTest as Ee } from "./utils/platform.js";
73
+ const ke = 120, Q = /*#__PURE__*/ o.createContext({
73
74
  focusedItem: null,
74
75
  isMenuOpen: !1,
75
76
  setFocusedItem: ()=>{},
76
77
  closeMenu: ()=>{}
77
- }), ke = ()=>o.useContext(Q), D = (r)=>r ? Array.from(r.querySelectorAll("[role=menuitem],[role=menuitemcheckbox]")) : [], Ne = (r, d)=>{
78
+ }), Ne = ()=>o.useContext(Q), D = (r)=>r ? Array.from(r.querySelectorAll("[role=menuitem],[role=menuitemcheckbox]")) : [], Re = (r, d)=>{
78
79
  if (!d) return null;
79
80
  const f = D(r).indexOf(d);
80
81
  return f < 0 ? null : f;
81
- }, je = (param)=>{
82
+ }, qe = (param)=>{
82
83
  let { label: r , Icon: d , destructive: f , disabled: u , onPress: E , controlType: s , checked: p } = param;
83
- const { focusedItem: n , setFocusedItem: v , closeMenu: i , isMenuOpen: k } = ke(), c = o.useRef(null), h = f ? q.colors.textLinkDanger : q.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__ */ e(Te, {
84
+ const { focusedItem: n , setFocusedItem: v , closeMenu: i , isMenuOpen: k } = Ne(), c = o.useRef(null), h = f ? q.colors.textLinkDanger : q.colors.neutralHigh, x = c == null ? void 0 : c.current, M = (x == null ? void 0 : x.closest("[role=menu]")) || null, m = Re(M, x), l = ()=>s === "checkbox" ? /* @__PURE__ */ e(Te, {
84
85
  ref: c,
85
86
  name: r,
86
87
  checked: p,
@@ -162,7 +163,7 @@ const Ee = 120, Q = /*#__PURE__*/ o.createContext({
162
163
  onMouseLeave: ()=>v(null),
163
164
  children: l()
164
165
  });
165
- }, Xe = (param)=>{
166
+ }, Ve = (param)=>{
166
167
  let { children: r } = param;
167
168
  return r ? /* @__PURE__ */ C(U, {
168
169
  children: [
@@ -174,7 +175,7 @@ const Ee = 120, Q = /*#__PURE__*/ o.createContext({
174
175
  })
175
176
  ]
176
177
  }) : /* @__PURE__ */ e(U, {});
177
- }, V = 12, J = 8, qe = (param)=>{
178
+ }, V = 12, J = 8, Je = (param)=>{
178
179
  let { renderTarget: r , renderMenu: d , width: f , position: u = "left" , dataAttributes: E } = param;
179
180
  const [s, p] = o.useState(!1), [n, v] = o.useState(null), [i, k] = o.useState(null), [c, h] = o.useState(null), [x, M] = o.useState(!1), m = o.useRef(null), [l, N] = o.useState(null), R = xe();
180
181
  o.useEffect(()=>{
@@ -290,7 +291,7 @@ const Ee = 120, Q = /*#__PURE__*/ o.createContext({
290
291
  children: /* @__PURE__ */ e(Se, {
291
292
  in: s,
292
293
  nodeRef: m,
293
- timeout: Ee,
294
+ timeout: Ee() ? 0 : ke,
294
295
  classNames: he,
295
296
  mountOnEnter: !0,
296
297
  unmountOnExit: !0,
@@ -331,4 +332,4 @@ const Ee = 120, Q = /*#__PURE__*/ o.createContext({
331
332
  ]
332
333
  }));
333
334
  };
334
- export { qe as Menu, je as MenuItem, Xe as MenuSection };
335
+ export { Je as Menu, qe as MenuItem, Ve as MenuSection };