@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.
Files changed (74) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/callout.js +27 -15
  3. package/dist/card.css-mistica.js +5 -5
  4. package/dist/card.d.ts +9 -1
  5. package/dist/card.js +611 -475
  6. package/dist/community/advanced-data-card.css-mistica.js +14 -11
  7. package/dist/community/advanced-data-card.css.d.ts +1 -0
  8. package/dist/community/advanced-data-card.d.ts +1 -1
  9. package/dist/community/advanced-data-card.js +172 -85
  10. package/dist/cover-hero.css-mistica.js +14 -11
  11. package/dist/cover-hero.css.d.ts +1 -0
  12. package/dist/cover-hero.d.ts +1 -0
  13. package/dist/cover-hero.js +101 -59
  14. package/dist/empty-state.js +24 -15
  15. package/dist/header.css-mistica.js +6 -3
  16. package/dist/header.css.d.ts +1 -0
  17. package/dist/header.d.ts +3 -2
  18. package/dist/header.js +148 -79
  19. package/dist/hero.css-mistica.js +11 -8
  20. package/dist/hero.css.d.ts +1 -0
  21. package/dist/hero.d.ts +2 -1
  22. package/dist/hero.js +102 -68
  23. package/dist/highlighted-card.js +32 -23
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +4 -0
  26. package/dist/maybe-dismissable.js +8 -5
  27. package/dist/meter.d.ts +23 -0
  28. package/dist/meter.js +400 -0
  29. package/dist/package-version.js +1 -1
  30. package/dist/sheet-common.css-mistica.js +16 -10
  31. package/dist/sheet-common.css.d.ts +3 -1
  32. package/dist/sheet-common.js +78 -70
  33. package/dist/sheet-info.css-mistica.js +15 -4
  34. package/dist/sheet-info.css.d.ts +2 -0
  35. package/dist/sheet-info.d.ts +3 -0
  36. package/dist/sheet-info.js +61 -43
  37. package/dist/sheet-native.js +59 -48
  38. package/dist/sheet-types.d.ts +6 -1
  39. package/dist/sheet-web.js +6 -4
  40. package/dist/text-tokens.d.ts +10 -0
  41. package/dist/text-tokens.js +54 -38
  42. package/dist/theme-context-provider.js +60 -50
  43. package/dist/theme.d.ts +3 -2
  44. package/dist/utils/headings.d.ts +2 -0
  45. package/dist/utils/headings.js +11 -0
  46. package/dist/utils/types.d.ts +1 -0
  47. package/dist-es/callout.js +55 -43
  48. package/dist-es/card.css-mistica.js +2 -2
  49. package/dist-es/card.js +721 -588
  50. package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
  51. package/dist-es/community/advanced-data-card.js +217 -130
  52. package/dist-es/cover-hero.css-mistica.js +3 -3
  53. package/dist-es/cover-hero.js +132 -90
  54. package/dist-es/empty-state.js +40 -31
  55. package/dist-es/header.css-mistica.js +2 -2
  56. package/dist-es/header.js +174 -104
  57. package/dist-es/hero.css-mistica.js +2 -2
  58. package/dist-es/hero.js +150 -115
  59. package/dist-es/highlighted-card.js +36 -27
  60. package/dist-es/index.js +1839 -1838
  61. package/dist-es/maybe-dismissable.js +17 -14
  62. package/dist-es/meter.js +346 -0
  63. package/dist-es/package-version.js +1 -1
  64. package/dist-es/sheet-common.css-mistica.js +2 -2
  65. package/dist-es/sheet-common.js +124 -116
  66. package/dist-es/sheet-info.css-mistica.js +2 -2
  67. package/dist-es/sheet-info.js +74 -56
  68. package/dist-es/sheet-native.js +59 -48
  69. package/dist-es/sheet-web.js +10 -8
  70. package/dist-es/style.css +1 -1
  71. package/dist-es/text-tokens.js +30 -20
  72. package/dist-es/theme-context-provider.js +88 -78
  73. package/dist-es/utils/headings.js +2 -0
  74. package/package.json +2 -1
@@ -78,69 +78,70 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as e, jsxs as g, Fragment as L } from "react/jsx-runtime";
82
- import T from "classnames";
81
+ import { jsx as e, jsxs as v, Fragment as k } from "react/jsx-runtime";
82
+ import R from "classnames";
83
83
  import * as t from "react";
84
- import { transitionDuration as k, overlay as x, closingOverlay as w, SheetContainer as A, closingSheet as M, Sheet as C, SheetContent as P, handleContainer as Y, handle as _, children as O, modalCloseButton as G, stickyTitle as j, bodyContent as F, stickyButtons as H } from "./sheet-common.css-mistica.js";
85
- import V from "./focus-trap.js";
86
- import { useTheme as $, useDisableBodyScroll as z, useIsInViewport as y, useScreenSize as K } from "./hooks.js";
87
- import { useSetModalStateEffect as X } from "./modal-context-provider.js";
88
- import { Portal as q } from "./portal.js";
89
- import { Text5 as J, Text3 as Q, Text2 as D } from "./text.js";
90
- import { vars as b } from "./skins/skin-contract.css-mistica.js";
91
- import I from "./stack.js";
84
+ import { transitionDuration as w, overlay as x, closingOverlay as A, SheetContainer as C, closingSheet as M, Sheet as P, SheetContent as Y, sheetTopDraggingArea as _, children as O, modalCloseButton as G, handleContainer as j, handleTouchable as F, handleBar as H, stickyTitle as V, bodyContent as $, stickyButtons as z } from "./sheet-common.css-mistica.js";
85
+ import K from "./focus-trap.js";
86
+ import { useTheme as X, useDisableBodyScroll as q, useIsInViewport as b, useScreenSize as J } from "./hooks.js";
87
+ import { useSetModalStateEffect as Q } from "./modal-context-provider.js";
88
+ import { Portal as U } from "./portal.js";
89
+ import { Text5 as W, Text3 as Z, Text2 as D } from "./text.js";
90
+ import { vars as y } from "./skins/skin-contract.css-mistica.js";
91
+ import B from "./stack.js";
92
92
  import E from "./box.js";
93
- import B from "./divider.js";
94
- import { getPrefixedDataAttributes as U, getScrollableParentElement as W } from "./utils/dom.js";
95
- import Z from "./generated/mistica-icons/icon-close-regular.js";
96
- import { InternalIconButton as ee } from "./icon-button.js";
97
- import te from "./button-layout.js";
98
- import { safeAreaInsetBottom as re } from "./utils/css.js";
99
- import { MOBILE_SIDE_MARGIN as ne, TABLET_SIDE_MARGIN as oe, SMALL_DESKTOP_SIDE_MARGIN as se } from "./responsive-layout.css-mistica.js";
100
- import { modalClose as ie } from "./text-tokens.js";
101
- const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.touches[0].clientY : n.clientY, ae = (param)=>{
93
+ import N from "./divider.js";
94
+ import { getPrefixedDataAttributes as ee, getScrollableParentElement as te } from "./utils/dom.js";
95
+ import re from "./generated/mistica-icons/icon-close-regular.js";
96
+ import { InternalIconButton as ne } from "./icon-button.js";
97
+ import oe from "./button-layout.js";
98
+ import { safeAreaInsetBottom as se } from "./utils/css.js";
99
+ import { MOBILE_SIDE_MARGIN as ie, TABLET_SIDE_MARGIN as ae, SMALL_DESKTOP_SIDE_MARGIN as ce } from "./responsive-layout.css-mistica.js";
100
+ import { modalClose as I } from "./text-tokens.js";
101
+ import le from "./touchable.js";
102
+ const de = process.env.NODE_ENV === "test" ? 0 : w, L = (n)=>"touches" in n ? n.touches[0].clientY : n.clientY, ue = (param)=>{
102
103
  let { closeModal: n } = param;
103
- const [o, i] = t.useState(0), l = t.useRef(!1), m = t.useRef(0), v = t.useRef(0), r = t.useRef(0), c = t.useRef(0), { isDesktopOrBigger: d } = K(), a = t.useCallback((s)=>{
104
- l.current = !0, m.current = 0, v.current = Date.now(), r.current = N(s);
105
- }, []), f = t.useCallback(()=>{
104
+ const [o, i] = t.useState(0), l = t.useRef(!1), d = t.useRef(0), f = t.useRef(0), r = t.useRef(0), a = t.useRef(0), { isDesktopOrBigger: u } = J(), c = t.useCallback((s)=>{
105
+ l.current = !0, d.current = 0, f.current = Date.now(), r.current = L(s);
106
+ }, []), h = t.useCallback(()=>{
106
107
  l.current = !1, i(0);
107
108
  }, []);
108
109
  return t.useEffect(()=>{
109
- if (d) return;
110
- const s = (p)=>{
110
+ if (u) return;
111
+ const s = (g)=>{
111
112
  if (l.current) {
112
- if (m.current < 3) {
113
- m.current++;
113
+ if (d.current < 3) {
114
+ d.current++;
114
115
  return;
115
116
  }
116
- c.current = N(p), i(c.current - r.current);
117
+ a.current = L(g), i(a.current - r.current);
117
118
  }
118
- }, h = ()=>{
119
+ }, p = ()=>{
119
120
  if (!l.current) return;
120
- const p = Date.now() - v.current, S = c.current - r.current, u = S / p;
121
- l.current = !1, i(0), S > 50 && (c.current > window.innerHeight * 0.75 || u > 0.5) && n();
121
+ const g = Date.now() - f.current, S = a.current - r.current, m = S / g;
122
+ l.current = !1, i(0), S > 50 && (a.current > window.innerHeight * 0.75 || m > 0.5) && n();
122
123
  };
123
- return document.addEventListener("touchmove", s), document.addEventListener("touchend", h), document.addEventListener("mousemove", s), document.addEventListener("mouseup", h), ()=>{
124
- document.removeEventListener("touchmove", s), document.removeEventListener("touchend", h), document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", h);
124
+ return document.addEventListener("touchmove", s), document.addEventListener("touchend", p), document.addEventListener("mousemove", s), document.addEventListener("mouseup", p), ()=>{
125
+ document.removeEventListener("touchmove", s), document.removeEventListener("touchend", p), document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", p);
125
126
  };
126
127
  }, [
127
128
  n,
128
- d
129
- ]), d ? {} : {
130
- onTouchStart: a,
131
- onMouseDown: a,
129
+ u
130
+ ]), u ? {} : {
131
+ onTouchStart: c,
132
+ onMouseDown: c,
132
133
  style: o ? {
133
134
  transform: `translateY(${o}px)`,
134
135
  transition: "none"
135
136
  } : void 0,
136
- onScroll: f,
137
+ onScroll: h,
137
138
  overlayStyle: o ? {
138
139
  // decrease opacity when dragging down the sheet
139
140
  opacity: 0.25 + 1 - o / (window.innerHeight - r.current),
140
141
  transition: "none"
141
142
  } : void 0
142
143
  };
143
- }, le = {
144
+ }, me = {
144
145
  closed: {
145
146
  open: "opening"
146
147
  },
@@ -154,88 +155,95 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
154
155
  closing: {
155
156
  transitionEnd: "closed"
156
157
  }
157
- }, de = (n, o)=>le[n][o] || n, ue = /*#__PURE__*/ t.forwardRef((param, l)=>{
158
+ }, fe = (n, o)=>me[n][o] || n, he = /*#__PURE__*/ t.forwardRef((param, l)=>{
158
159
  let { onClose: n, children: o, dataAttributes: i } = param;
159
- const { texts: m, t: v } = $(), [r, c] = t.useReducer(de, "closed"), d = t.useRef(!1), a = t.useId(), f = t.useCallback((u)=>{
160
- u.target === u.currentTarget && c("transitionEnd");
160
+ const { texts: d, t: f } = X(), [r, a] = t.useReducer(fe, "closed"), u = t.useRef(!1), c = t.useId(), h = t.useCallback((m)=>{
161
+ m.target === m.currentTarget && a("transitionEnd");
161
162
  }, []), s = ()=>{
162
- r === "open" && c("close");
163
+ r === "open" && a("close");
163
164
  };
164
165
  t.useEffect(()=>{
165
166
  if (r === "opening" || r === "closing") {
166
- const u = setTimeout(()=>{
167
- c("transitionEnd");
168
- }, ce);
169
- return ()=>clearTimeout(u);
167
+ const m = setTimeout(()=>{
168
+ a("transitionEnd");
169
+ }, de);
170
+ return ()=>clearTimeout(m);
170
171
  }
171
172
  }, [
172
173
  r
173
174
  ]), t.useEffect(()=>{
174
- r === "closed" ? d.current ? n == null || n() : c("open") : d.current = !0;
175
+ r === "closed" ? u.current ? n == null || n() : a("open") : u.current = !0;
175
176
  }, [
176
177
  r,
177
178
  n
178
179
  ]);
179
- const _ae = ae({
180
+ const _ue = ue({
180
181
  closeModal: s
181
- }), { onScroll: h, overlayStyle: p } = _ae, S = _object_without_properties(_ae, [
182
+ }), { onScroll: p, overlayStyle: g } = _ue, S = _object_without_properties(_ue, [
182
183
  "onScroll",
183
184
  "overlayStyle"
184
185
  ]);
185
- return X(), z(r !== "closed"), r === "closed" ? null : /* @__PURE__ */ e(q, {
186
- children: /* @__PURE__ */ g(V, {
186
+ return Q(), q(r !== "closed"), r === "closed" ? null : /* @__PURE__ */ e(U, {
187
+ children: /* @__PURE__ */ v(K, {
187
188
  children: [
188
189
  /* @__PURE__ */ e("div", {
189
- className: T(x, {
190
- [w]: r === "closing"
190
+ className: R(x, {
191
+ [A]: r === "closing"
191
192
  }),
192
- style: p,
193
+ style: g,
193
194
  onClick: s
194
195
  }),
195
196
  /* @__PURE__ */ e("div", _object_spread_props(_object_spread({
196
- className: T(A, {
197
+ className: R(C, {
197
198
  [M]: r === "closing"
198
199
  }),
199
- onTransitionEnd: f,
200
- onAnimationEnd: f
201
- }, S, U(i, "Sheet")), {
200
+ onTransitionEnd: h,
201
+ onAnimationEnd: h
202
+ }, S, ee(i, "Sheet")), {
202
203
  ref: l,
203
204
  children: /* @__PURE__ */ e("div", {
204
- className: C,
205
- children: /* @__PURE__ */ g("div", {
206
- className: P,
205
+ className: P,
206
+ children: /* @__PURE__ */ v("div", {
207
+ className: Y,
207
208
  children: [
208
209
  /* @__PURE__ */ e("div", {
209
- className: Y,
210
- children: /* @__PURE__ */ e("div", {
211
- className: _
212
- })
210
+ className: _
213
211
  }),
214
- /* @__PURE__ */ g("section", {
212
+ /* @__PURE__ */ v("section", {
215
213
  role: "dialog",
216
214
  "aria-modal": "true",
217
- "aria-labelledby": a,
218
- onScroll: h,
215
+ "aria-labelledby": c,
216
+ onScroll: p,
219
217
  className: O,
220
218
  style: {
221
- paddingBottom: re
219
+ paddingBottom: se
222
220
  },
223
- tabIndex: -1,
224
221
  children: [
225
222
  typeof o == "function" ? o({
226
223
  closeModal: s,
227
- modalTitleId: a
224
+ modalTitleId: c
228
225
  }) : o,
229
226
  /* @__PURE__ */ e("div", {
230
227
  className: G,
231
- children: /* @__PURE__ */ e(ee, {
228
+ children: /* @__PURE__ */ e(ne, {
232
229
  onPress: s,
233
- "aria-label": m.modalClose || v(ie),
234
- Icon: Z,
230
+ "aria-label": d.modalClose || f(I),
231
+ Icon: re,
235
232
  bleedLeft: !0,
236
233
  bleedRight: !0,
237
234
  bleedY: !0
238
235
  })
236
+ }),
237
+ /* @__PURE__ */ e("div", {
238
+ className: j,
239
+ children: /* @__PURE__ */ e(le, {
240
+ onPress: s,
241
+ className: F,
242
+ "aria-label": d.modalClose || f(I),
243
+ children: /* @__PURE__ */ e("div", {
244
+ className: H
245
+ })
246
+ })
239
247
  })
240
248
  ]
241
249
  })
@@ -246,30 +254,30 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
246
254
  ]
247
255
  })
248
256
  });
249
- }), R = {
250
- mobile: ne,
251
- tablet: oe,
252
- desktop: se
253
- }, we = (param)=>{
254
- let { title: n, subtitle: o, description: i, modalTitleId: l, button: m, secondaryButton: v, link: r, children: c } = param;
255
- const d = t.useRef(null), a = t.useRef(null), f = t.useRef(null);
257
+ }), T = {
258
+ mobile: ie,
259
+ tablet: ae,
260
+ desktop: ce
261
+ }, Pe = (param)=>{
262
+ let { title: n, subtitle: o, description: i, modalTitleId: l, button: d, secondaryButton: f, link: r, children: a } = param;
263
+ const u = t.useRef(null), c = t.useRef(null), h = t.useRef(null);
256
264
  t.useEffect(()=>{
257
- a.current && (f.current = W(a.current));
265
+ c.current && (h.current = te(c.current));
258
266
  }, []);
259
- const s = !y(d, !0, {
260
- root: f.current
261
- }), h = !y(a, !0, {
267
+ const s = !b(u, !0, {
268
+ root: h.current
269
+ }), p = !b(c, !0, {
262
270
  rootMargin: "1px",
263
271
  // bottomScrollSignal div has 0px height so we need a 1px margin to trigger the intersection observer
264
- root: f.current
265
- }), p = !!m || !!v || !!r;
266
- return /* @__PURE__ */ g(L, {
272
+ root: h.current
273
+ }), g = !!d || !!f || !!r;
274
+ return /* @__PURE__ */ v(k, {
267
275
  children: [
268
276
  /* @__PURE__ */ e("div", {
269
- ref: d
277
+ ref: u
270
278
  }),
271
- /* @__PURE__ */ g("div", {
272
- className: j,
279
+ /* @__PURE__ */ v("div", {
280
+ className: V,
273
281
  children: [
274
282
  n ? /* @__PURE__ */ e(E, {
275
283
  paddingBottom: 8,
@@ -277,8 +285,8 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
277
285
  mobile: 0,
278
286
  desktop: 40
279
287
  },
280
- paddingX: R,
281
- children: /* @__PURE__ */ e(J, {
288
+ paddingX: T,
289
+ children: /* @__PURE__ */ e(W, {
282
290
  as: "h2",
283
291
  id: l,
284
292
  truncate: !0,
@@ -290,27 +298,27 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
290
298
  desktop: 40
291
299
  }
292
300
  }),
293
- s && /* @__PURE__ */ e(B, {})
301
+ s && /* @__PURE__ */ e(N, {})
294
302
  ]
295
303
  }),
296
304
  /* @__PURE__ */ e("div", {
297
- className: F,
305
+ className: $,
298
306
  children: /* @__PURE__ */ e(E, {
299
- paddingBottom: p ? 0 : {
307
+ paddingBottom: g ? 0 : {
300
308
  desktop: 40,
301
309
  mobile: 0
302
310
  },
303
- paddingX: R,
304
- children: /* @__PURE__ */ g(I, {
311
+ paddingX: T,
312
+ children: /* @__PURE__ */ v(B, {
305
313
  space: 8,
306
314
  children: [
307
- o || i ? /* @__PURE__ */ g(I, {
315
+ o || i ? /* @__PURE__ */ v(B, {
308
316
  space: {
309
317
  mobile: 8,
310
318
  desktop: 16
311
319
  },
312
320
  children: [
313
- o && /* @__PURE__ */ e(Q, {
321
+ o && /* @__PURE__ */ e(Z, {
314
322
  as: "p",
315
323
  regular: !0,
316
324
  children: o
@@ -318,50 +326,50 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
318
326
  i && (Array.isArray(i) ? /* @__PURE__ */ e(D, {
319
327
  as: "div",
320
328
  regular: !0,
321
- color: b.colors.textSecondary,
322
- children: i.map((S, u)=>/* @__PURE__ */ e("p", {
329
+ color: y.colors.textSecondary,
330
+ children: i.map((S, m)=>/* @__PURE__ */ e("p", {
323
331
  style: {
324
332
  margin: 0,
325
- marginBottom: u < i.length - 1 ? "1em" : void 0
333
+ marginBottom: m < i.length - 1 ? "1em" : void 0
326
334
  },
327
335
  children: S
328
- }, u))
336
+ }, m))
329
337
  }) : /* @__PURE__ */ e(D, {
330
338
  as: "p",
331
339
  regular: !0,
332
- color: b.colors.textSecondary,
340
+ color: y.colors.textSecondary,
333
341
  children: i
334
342
  }))
335
343
  ]
336
344
  }) : null,
337
- c
345
+ a
338
346
  ]
339
347
  })
340
348
  })
341
349
  }),
342
- p && /* @__PURE__ */ g("div", {
343
- className: H,
350
+ g && /* @__PURE__ */ v("div", {
351
+ className: z,
344
352
  children: [
345
- h && /* @__PURE__ */ e(B, {}),
353
+ p && /* @__PURE__ */ e(N, {}),
346
354
  /* @__PURE__ */ e(E, {
347
355
  paddingY: {
348
356
  mobile: 16,
349
357
  desktop: 40
350
358
  },
351
- paddingX: R,
352
- children: /* @__PURE__ */ e(te, {
359
+ paddingX: T,
360
+ children: /* @__PURE__ */ e(oe, {
353
361
  align: "full-width",
354
362
  link: r,
355
- primaryButton: m,
356
- secondaryButton: v
363
+ primaryButton: d,
364
+ secondaryButton: f
357
365
  })
358
366
  })
359
367
  ]
360
368
  }),
361
369
  /* @__PURE__ */ e("div", {
362
- ref: a
370
+ ref: c
363
371
  })
364
372
  ]
365
373
  });
366
- }, Ae = ue;
367
- export { we as SheetBody, Ae as default };
374
+ }, Ye = he;
375
+ export { Pe as SheetBody, Ye as default };
@@ -1,3 +1,3 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
- var o = "_1y2v1nfho _1y2v1nfi3 _1y2v1nfj0";
3
- export { o as infoItemIcon };
2
+ var v = "_1y2v1nfho _1y2v1nfi3 _1y2v1nfj0", f = "_1y2v1nfis _1y2v1nfho", o = "_1y2v1nf7w _1y2v1nf95 _1y2v1nfho _1y2v1nfi3 _1y2v1nfk1";
3
+ export { v as infoItemIcon, f as infoItemIconContainer, o as itemContainer };
@@ -27,75 +27,93 @@ function _object_spread(target) {
27
27
  }
28
28
  return target;
29
29
  }
30
- import { jsx as r, jsxs as e } from "react/jsx-runtime";
31
- import * as u from "react";
32
- import I from "./inline.js";
33
- import x from "./circle.js";
34
- import y, { SheetBody as S } from "./sheet-common.js";
35
- import { useTheme as g } from "./hooks.js";
30
+ import { jsx as o, jsxs as e } from "react/jsx-runtime";
31
+ import * as c from "react";
32
+ import y from "./inline.js";
33
+ import g from "./circle.js";
34
+ import x, { SheetBody as v } from "./sheet-common.js";
35
+ import { useTheme as S } from "./hooks.js";
36
36
  import k from "./box.js";
37
- import t from "./stack.js";
38
- import { Text3 as b, Text2 as B } from "./text.js";
39
- import { vars as c } from "./skins/skin-contract.css-mistica.js";
40
- import { infoItemIcon as D } from "./sheet-info.css-mistica.js";
37
+ import b from "./stack.js";
38
+ import { Text3 as B, Text2 as C } from "./text.js";
39
+ import { vars as l } from "./skins/skin-contract.css-mistica.js";
40
+ import { itemContainer as D, infoItemIconContainer as N, infoItemIcon as P } from "./sheet-info.css-mistica.js";
41
41
  import T from "./image.js";
42
- const j = /*#__PURE__*/ u.forwardRef((param, m)=>{
43
- let { title: n, subtitle: i, description: l, items: a, onClose: s, dataAttributes: p } = param;
44
- const { isDarkMode: d } = g();
45
- return /* @__PURE__ */ r(y, {
46
- onClose: s,
47
- ref: m,
42
+ import { ButtonPrimary as j } from "./button.js";
43
+ import w from "./divider.js";
44
+ const z = /*#__PURE__*/ c.forwardRef((param, f)=>{
45
+ let { title: a, subtitle: s, description: m, items: t, onClose: d, button: n, dataAttributes: p } = param;
46
+ const { isDarkMode: h } = S();
47
+ return /* @__PURE__ */ o(x, {
48
+ onClose: d,
49
+ ref: f,
48
50
  dataAttributes: _object_spread({
49
51
  "component-name": "InfoSheet"
50
52
  }, p),
51
53
  children: (param)=>{
52
- let { modalTitleId: f } = param;
53
- return /* @__PURE__ */ r(S, {
54
- title: n,
55
- subtitle: i,
56
- description: l,
57
- modalTitleId: f,
58
- children: /* @__PURE__ */ r(k, {
54
+ let { closeModal: u, modalTitleId: I } = param;
55
+ return /* @__PURE__ */ o(v, {
56
+ title: a,
57
+ subtitle: s,
58
+ description: m,
59
+ modalTitleId: I,
60
+ button: n ? /* @__PURE__ */ o(j, {
61
+ onPress: u,
62
+ children: n.text
63
+ }) : void 0,
64
+ children: /* @__PURE__ */ o(k, {
59
65
  paddingBottom: 16,
60
- children: /* @__PURE__ */ r(t, {
61
- space: 16,
62
- role: "list",
63
- children: a.map((o, h)=>/* @__PURE__ */ e(I, {
64
- space: 8,
65
- children: [
66
- /* @__PURE__ */ r("div", {
67
- className: D,
68
- children: o.icon.type === "bullet" ? /* @__PURE__ */ r(x, {
69
- size: 8,
70
- backgroundColor: c.colors.textPrimary
71
- }) : o.icon.Icon ? /* @__PURE__ */ r(o.icon.Icon, {
72
- size: o.icon.type === "small" ? 16 : 24
73
- }) : /* @__PURE__ */ r(T, {
74
- src: d && o.icon.urlDark ? o.icon.urlDark : o.icon.url,
75
- width: o.icon.type === "small" ? 16 : 24,
76
- height: o.icon.type === "small" ? 16 : 24
77
- })
78
- }),
79
- /* @__PURE__ */ e(t, {
80
- space: 2,
66
+ role: "list",
67
+ children: t.map((r, i)=>/* @__PURE__ */ e(c.Fragment, {
68
+ children: [
69
+ /* @__PURE__ */ o("div", {
70
+ className: D,
71
+ role: "listitem",
72
+ children: /* @__PURE__ */ e(y, {
73
+ space: 8,
81
74
  children: [
82
- /* @__PURE__ */ r(b, {
83
- regular: !0,
84
- children: o.title
75
+ /* @__PURE__ */ o("div", {
76
+ className: N,
77
+ style: {
78
+ alignItems: r.icon.type !== "bullet" && !r.description ? "center" : void 0
79
+ },
80
+ children: /* @__PURE__ */ o("div", {
81
+ className: P,
82
+ children: r.icon.type === "bullet" ? /* @__PURE__ */ o(g, {
83
+ size: 8,
84
+ backgroundColor: l.colors.textPrimary
85
+ }) : r.icon.Icon ? /* @__PURE__ */ o(r.icon.Icon, {
86
+ size: r.icon.type === "small" ? 16 : 24
87
+ }) : /* @__PURE__ */ o(T, {
88
+ src: h && r.icon.urlDark ? r.icon.urlDark : r.icon.url,
89
+ width: r.icon.type === "small" ? 16 : 24,
90
+ height: r.icon.type === "small" ? 16 : 24
91
+ })
92
+ })
85
93
  }),
86
- o.description && /* @__PURE__ */ r(B, {
87
- regular: !0,
88
- color: c.colors.textSecondary,
89
- children: o.description
94
+ /* @__PURE__ */ e(b, {
95
+ space: 2,
96
+ children: [
97
+ /* @__PURE__ */ o(B, {
98
+ regular: !0,
99
+ children: r.title
100
+ }),
101
+ r.description && /* @__PURE__ */ o(C, {
102
+ regular: !0,
103
+ color: l.colors.textSecondary,
104
+ children: r.description
105
+ })
106
+ ]
90
107
  })
91
108
  ]
92
109
  })
93
- ]
94
- }, o.id || h))
95
- })
110
+ }),
111
+ i < t.length - 1 && /* @__PURE__ */ o(w, {})
112
+ ]
113
+ }, r.id || i))
96
114
  })
97
115
  });
98
116
  }
99
117
  });
100
- }), E = j;
101
- export { E as default };
118
+ }), Q = z;
119
+ export { Q as default };