@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.
- package/css/mistica.css +1 -1
- package/dist/callout.js +27 -15
- package/dist/card.css-mistica.js +5 -5
- package/dist/card.d.ts +9 -1
- package/dist/card.js +611 -475
- package/dist/community/advanced-data-card.css-mistica.js +14 -11
- package/dist/community/advanced-data-card.css.d.ts +1 -0
- package/dist/community/advanced-data-card.d.ts +1 -1
- package/dist/community/advanced-data-card.js +172 -85
- package/dist/cover-hero.css-mistica.js +14 -11
- package/dist/cover-hero.css.d.ts +1 -0
- package/dist/cover-hero.d.ts +1 -0
- package/dist/cover-hero.js +101 -59
- package/dist/empty-state.js +24 -15
- package/dist/header.css-mistica.js +6 -3
- package/dist/header.css.d.ts +1 -0
- package/dist/header.d.ts +3 -2
- package/dist/header.js +148 -79
- package/dist/hero.css-mistica.js +11 -8
- package/dist/hero.css.d.ts +1 -0
- package/dist/hero.d.ts +2 -1
- package/dist/hero.js +102 -68
- package/dist/highlighted-card.js +32 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/maybe-dismissable.js +8 -5
- package/dist/meter.d.ts +23 -0
- package/dist/meter.js +400 -0
- package/dist/package-version.js +1 -1
- package/dist/sheet-common.css-mistica.js +16 -10
- package/dist/sheet-common.css.d.ts +3 -1
- package/dist/sheet-common.js +78 -70
- package/dist/sheet-info.css-mistica.js +15 -4
- package/dist/sheet-info.css.d.ts +2 -0
- package/dist/sheet-info.d.ts +3 -0
- package/dist/sheet-info.js +61 -43
- package/dist/sheet-native.js +59 -48
- package/dist/sheet-types.d.ts +6 -1
- package/dist/sheet-web.js +6 -4
- package/dist/text-tokens.d.ts +10 -0
- package/dist/text-tokens.js +54 -38
- package/dist/theme-context-provider.js +60 -50
- package/dist/theme.d.ts +3 -2
- package/dist/utils/headings.d.ts +2 -0
- package/dist/utils/headings.js +11 -0
- package/dist/utils/types.d.ts +1 -0
- package/dist-es/callout.js +55 -43
- package/dist-es/card.css-mistica.js +2 -2
- package/dist-es/card.js +721 -588
- package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
- package/dist-es/community/advanced-data-card.js +217 -130
- package/dist-es/cover-hero.css-mistica.js +3 -3
- package/dist-es/cover-hero.js +132 -90
- package/dist-es/empty-state.js +40 -31
- package/dist-es/header.css-mistica.js +2 -2
- package/dist-es/header.js +174 -104
- package/dist-es/hero.css-mistica.js +2 -2
- package/dist-es/hero.js +150 -115
- package/dist-es/highlighted-card.js +36 -27
- package/dist-es/index.js +1839 -1838
- package/dist-es/maybe-dismissable.js +17 -14
- package/dist-es/meter.js +346 -0
- package/dist-es/package-version.js +1 -1
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/sheet-common.js +124 -116
- package/dist-es/sheet-info.css-mistica.js +2 -2
- package/dist-es/sheet-info.js +74 -56
- package/dist-es/sheet-native.js +59 -48
- package/dist-es/sheet-web.js +10 -8
- package/dist-es/style.css +1 -1
- package/dist-es/text-tokens.js +30 -20
- package/dist-es/theme-context-provider.js +88 -78
- package/dist-es/utils/headings.js +2 -0
- package/package.json +2 -1
package/dist-es/sheet-common.js
CHANGED
|
@@ -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
|
|
82
|
-
import
|
|
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
|
|
85
|
-
import
|
|
86
|
-
import { useTheme as
|
|
87
|
-
import { useSetModalStateEffect as
|
|
88
|
-
import { Portal as
|
|
89
|
-
import { Text5 as
|
|
90
|
-
import { vars as
|
|
91
|
-
import
|
|
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
|
|
94
|
-
import { getPrefixedDataAttributes as
|
|
95
|
-
import
|
|
96
|
-
import { InternalIconButton as
|
|
97
|
-
import
|
|
98
|
-
import { safeAreaInsetBottom as
|
|
99
|
-
import { MOBILE_SIDE_MARGIN as
|
|
100
|
-
import { modalClose as
|
|
101
|
-
|
|
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),
|
|
104
|
-
l.current = !0,
|
|
105
|
-
}, []),
|
|
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 (
|
|
110
|
-
const s = (
|
|
110
|
+
if (u) return;
|
|
111
|
+
const s = (g)=>{
|
|
111
112
|
if (l.current) {
|
|
112
|
-
if (
|
|
113
|
-
|
|
113
|
+
if (d.current < 3) {
|
|
114
|
+
d.current++;
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
a.current = L(g), i(a.current - r.current);
|
|
117
118
|
}
|
|
118
|
-
},
|
|
119
|
+
}, p = ()=>{
|
|
119
120
|
if (!l.current) return;
|
|
120
|
-
const
|
|
121
|
-
l.current = !1, i(0), S > 50 && (
|
|
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",
|
|
124
|
-
document.removeEventListener("touchmove", s), document.removeEventListener("touchend",
|
|
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
|
-
|
|
129
|
-
]),
|
|
130
|
-
onTouchStart:
|
|
131
|
-
onMouseDown:
|
|
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:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
160
|
-
|
|
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" &&
|
|
163
|
+
r === "open" && a("close");
|
|
163
164
|
};
|
|
164
165
|
t.useEffect(()=>{
|
|
165
166
|
if (r === "opening" || r === "closing") {
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
return ()=>clearTimeout(
|
|
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" ?
|
|
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
|
|
180
|
+
const _ue = ue({
|
|
180
181
|
closeModal: s
|
|
181
|
-
}), { onScroll:
|
|
182
|
+
}), { onScroll: p, overlayStyle: g } = _ue, S = _object_without_properties(_ue, [
|
|
182
183
|
"onScroll",
|
|
183
184
|
"overlayStyle"
|
|
184
185
|
]);
|
|
185
|
-
return
|
|
186
|
-
children: /* @__PURE__ */
|
|
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:
|
|
190
|
-
[
|
|
190
|
+
className: R(x, {
|
|
191
|
+
[A]: r === "closing"
|
|
191
192
|
}),
|
|
192
|
-
style:
|
|
193
|
+
style: g,
|
|
193
194
|
onClick: s
|
|
194
195
|
}),
|
|
195
196
|
/* @__PURE__ */ e("div", _object_spread_props(_object_spread({
|
|
196
|
-
className:
|
|
197
|
+
className: R(C, {
|
|
197
198
|
[M]: r === "closing"
|
|
198
199
|
}),
|
|
199
|
-
onTransitionEnd:
|
|
200
|
-
onAnimationEnd:
|
|
201
|
-
}, S,
|
|
200
|
+
onTransitionEnd: h,
|
|
201
|
+
onAnimationEnd: h
|
|
202
|
+
}, S, ee(i, "Sheet")), {
|
|
202
203
|
ref: l,
|
|
203
204
|
children: /* @__PURE__ */ e("div", {
|
|
204
|
-
className:
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
className:
|
|
205
|
+
className: P,
|
|
206
|
+
children: /* @__PURE__ */ v("div", {
|
|
207
|
+
className: Y,
|
|
207
208
|
children: [
|
|
208
209
|
/* @__PURE__ */ e("div", {
|
|
209
|
-
className:
|
|
210
|
-
children: /* @__PURE__ */ e("div", {
|
|
211
|
-
className: _
|
|
212
|
-
})
|
|
210
|
+
className: _
|
|
213
211
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ v("section", {
|
|
215
213
|
role: "dialog",
|
|
216
214
|
"aria-modal": "true",
|
|
217
|
-
"aria-labelledby":
|
|
218
|
-
onScroll:
|
|
215
|
+
"aria-labelledby": c,
|
|
216
|
+
onScroll: p,
|
|
219
217
|
className: O,
|
|
220
218
|
style: {
|
|
221
|
-
paddingBottom:
|
|
219
|
+
paddingBottom: se
|
|
222
220
|
},
|
|
223
|
-
tabIndex: -1,
|
|
224
221
|
children: [
|
|
225
222
|
typeof o == "function" ? o({
|
|
226
223
|
closeModal: s,
|
|
227
|
-
modalTitleId:
|
|
224
|
+
modalTitleId: c
|
|
228
225
|
}) : o,
|
|
229
226
|
/* @__PURE__ */ e("div", {
|
|
230
227
|
className: G,
|
|
231
|
-
children: /* @__PURE__ */ e(
|
|
228
|
+
children: /* @__PURE__ */ e(ne, {
|
|
232
229
|
onPress: s,
|
|
233
|
-
"aria-label":
|
|
234
|
-
Icon:
|
|
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
|
-
}),
|
|
250
|
-
mobile:
|
|
251
|
-
tablet:
|
|
252
|
-
desktop:
|
|
253
|
-
},
|
|
254
|
-
let { title: n, subtitle: o, description: i, modalTitleId: l, button:
|
|
255
|
-
const
|
|
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
|
-
|
|
265
|
+
c.current && (h.current = te(c.current));
|
|
258
266
|
}, []);
|
|
259
|
-
const s = !
|
|
260
|
-
root:
|
|
261
|
-
}),
|
|
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:
|
|
265
|
-
}),
|
|
266
|
-
return /* @__PURE__ */
|
|
272
|
+
root: h.current
|
|
273
|
+
}), g = !!d || !!f || !!r;
|
|
274
|
+
return /* @__PURE__ */ v(k, {
|
|
267
275
|
children: [
|
|
268
276
|
/* @__PURE__ */ e("div", {
|
|
269
|
-
ref:
|
|
277
|
+
ref: u
|
|
270
278
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
className:
|
|
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:
|
|
281
|
-
children: /* @__PURE__ */ e(
|
|
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(
|
|
301
|
+
s && /* @__PURE__ */ e(N, {})
|
|
294
302
|
]
|
|
295
303
|
}),
|
|
296
304
|
/* @__PURE__ */ e("div", {
|
|
297
|
-
className:
|
|
305
|
+
className: $,
|
|
298
306
|
children: /* @__PURE__ */ e(E, {
|
|
299
|
-
paddingBottom:
|
|
307
|
+
paddingBottom: g ? 0 : {
|
|
300
308
|
desktop: 40,
|
|
301
309
|
mobile: 0
|
|
302
310
|
},
|
|
303
|
-
paddingX:
|
|
304
|
-
children: /* @__PURE__ */
|
|
311
|
+
paddingX: T,
|
|
312
|
+
children: /* @__PURE__ */ v(B, {
|
|
305
313
|
space: 8,
|
|
306
314
|
children: [
|
|
307
|
-
o || i ? /* @__PURE__ */
|
|
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(
|
|
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:
|
|
322
|
-
children: i.map((S,
|
|
329
|
+
color: y.colors.textSecondary,
|
|
330
|
+
children: i.map((S, m)=>/* @__PURE__ */ e("p", {
|
|
323
331
|
style: {
|
|
324
332
|
margin: 0,
|
|
325
|
-
marginBottom:
|
|
333
|
+
marginBottom: m < i.length - 1 ? "1em" : void 0
|
|
326
334
|
},
|
|
327
335
|
children: S
|
|
328
|
-
},
|
|
336
|
+
}, m))
|
|
329
337
|
}) : /* @__PURE__ */ e(D, {
|
|
330
338
|
as: "p",
|
|
331
339
|
regular: !0,
|
|
332
|
-
color:
|
|
340
|
+
color: y.colors.textSecondary,
|
|
333
341
|
children: i
|
|
334
342
|
}))
|
|
335
343
|
]
|
|
336
344
|
}) : null,
|
|
337
|
-
|
|
345
|
+
a
|
|
338
346
|
]
|
|
339
347
|
})
|
|
340
348
|
})
|
|
341
349
|
}),
|
|
342
|
-
|
|
343
|
-
className:
|
|
350
|
+
g && /* @__PURE__ */ v("div", {
|
|
351
|
+
className: z,
|
|
344
352
|
children: [
|
|
345
|
-
|
|
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:
|
|
352
|
-
children: /* @__PURE__ */ e(
|
|
359
|
+
paddingX: T,
|
|
360
|
+
children: /* @__PURE__ */ e(oe, {
|
|
353
361
|
align: "full-width",
|
|
354
362
|
link: r,
|
|
355
|
-
primaryButton:
|
|
356
|
-
secondaryButton:
|
|
363
|
+
primaryButton: d,
|
|
364
|
+
secondaryButton: f
|
|
357
365
|
})
|
|
358
366
|
})
|
|
359
367
|
]
|
|
360
368
|
}),
|
|
361
369
|
/* @__PURE__ */ e("div", {
|
|
362
|
-
ref:
|
|
370
|
+
ref: c
|
|
363
371
|
})
|
|
364
372
|
]
|
|
365
373
|
});
|
|
366
|
-
},
|
|
367
|
-
export {
|
|
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
|
|
3
|
-
export {
|
|
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 };
|
package/dist-es/sheet-info.js
CHANGED
|
@@ -27,75 +27,93 @@ function _object_spread(target) {
|
|
|
27
27
|
}
|
|
28
28
|
return target;
|
|
29
29
|
}
|
|
30
|
-
import { jsx as
|
|
31
|
-
import * as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import { useTheme as
|
|
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
|
|
38
|
-
import { Text3 as
|
|
39
|
-
import { vars as
|
|
40
|
-
import {
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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:
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
title:
|
|
55
|
-
subtitle:
|
|
56
|
-
description:
|
|
57
|
-
modalTitleId:
|
|
58
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
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__ */
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
95
|
-
|
|
110
|
+
}),
|
|
111
|
+
i < t.length - 1 && /* @__PURE__ */ o(w, {})
|
|
112
|
+
]
|
|
113
|
+
}, r.id || i))
|
|
96
114
|
})
|
|
97
115
|
});
|
|
98
116
|
}
|
|
99
117
|
});
|
|
100
|
-
}),
|
|
101
|
-
export {
|
|
118
|
+
}), Q = z;
|
|
119
|
+
export { Q as default };
|