@telefonica/mistica 16.0.0 → 16.1.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 (152) hide show
  1. package/README.md +11 -9
  2. package/css/mistica.css +1 -1
  3. package/dist/box.d.ts +1 -0
  4. package/dist/box.js +12 -12
  5. package/dist/card.d.ts +14 -2
  6. package/dist/card.js +210 -206
  7. package/dist/credit-card-expiration-field.d.ts +1 -1
  8. package/dist/credit-card-expiration-field.js +53 -52
  9. package/dist/credit-card-number-field.d.ts +1 -1
  10. package/dist/credit-card-number-field.js +47 -45
  11. package/dist/cvv-field.d.ts +1 -1
  12. package/dist/cvv-field.js +38 -37
  13. package/dist/date-field.d.ts +1 -1
  14. package/dist/date-field.js +15 -13
  15. package/dist/date-time-field.d.ts +1 -1
  16. package/dist/date-time-field.js +13 -11
  17. package/dist/decimal-field.d.ts +1 -1
  18. package/dist/decimal-field.js +39 -38
  19. package/dist/email-field.d.ts +1 -1
  20. package/dist/email-field.js +21 -19
  21. package/dist/form-context.d.ts +7 -2
  22. package/dist/form-context.js +69 -62
  23. package/dist/form.d.ts +2 -1
  24. package/dist/form.js +94 -80
  25. package/dist/iban-field.d.ts +1 -1
  26. package/dist/iban-field.js +32 -30
  27. package/dist/index.d.ts +12 -3
  28. package/dist/index.js +19 -8
  29. package/dist/inline.d.ts +2 -1
  30. package/dist/inline.js +16 -15
  31. package/dist/integer-field.d.ts +1 -1
  32. package/dist/integer-field.js +30 -30
  33. package/dist/month-field.d.ts +1 -1
  34. package/dist/month-field.js +15 -13
  35. package/dist/package-version.js +1 -1
  36. package/dist/password-field.d.ts +1 -1
  37. package/dist/password-field.js +24 -22
  38. package/dist/phone-number-field.d.ts +4 -1
  39. package/dist/phone-number-field.js +84 -52
  40. package/dist/pin-field.js +21 -20
  41. package/dist/radio-button.d.ts +1 -0
  42. package/dist/radio-button.js +42 -41
  43. package/dist/rating.css-mistica.js +44 -0
  44. package/dist/rating.css.d.ts +11 -0
  45. package/dist/rating.css.ts.vanilla.css-mistica.js +11 -0
  46. package/dist/rating.d.ts +37 -0
  47. package/dist/rating.js +320 -0
  48. package/dist/search-field.d.ts +1 -0
  49. package/dist/search-field.js +18 -16
  50. package/dist/select.js +36 -33
  51. package/dist/sheet-action-row.css-mistica.js +13 -0
  52. package/dist/sheet-action-row.css.d.ts +1 -0
  53. package/dist/sheet-actions-list.d.ts +26 -0
  54. package/dist/sheet-actions-list.js +147 -0
  55. package/dist/sheet-actions.d.ts +23 -0
  56. package/dist/sheet-actions.js +175 -0
  57. package/dist/{sheet.css-mistica.js → sheet-common.css-mistica.js} +15 -21
  58. package/dist/{sheet.css.d.ts → sheet-common.css.d.ts} +0 -2
  59. package/dist/sheet-common.css.ts.vanilla.css-mistica.js +11 -0
  60. package/dist/sheet-common.d.ts +24 -0
  61. package/dist/sheet-common.js +429 -0
  62. package/dist/sheet-info.css-mistica.js +12 -0
  63. package/dist/sheet-info.css.d.ts +1 -0
  64. package/dist/sheet-info.d.ts +28 -0
  65. package/dist/sheet-info.js +156 -0
  66. package/dist/sheet-native.d.ts +2 -0
  67. package/dist/sheet-native.js +173 -0
  68. package/dist/sheet-radio-list.d.ts +22 -0
  69. package/dist/sheet-radio-list.js +143 -0
  70. package/dist/sheet-root.d.ts +4 -85
  71. package/dist/sheet-root.js +48 -322
  72. package/dist/sheet-types.d.ts +88 -0
  73. package/dist/sheet-web.d.ts +8 -0
  74. package/dist/sheet-web.js +183 -0
  75. package/dist/slider.js +40 -39
  76. package/dist/switch-component.js +18 -17
  77. package/dist/text-field-base.d.ts +3 -1
  78. package/dist/text-field-base.js +74 -66
  79. package/dist/text-field-components.css-mistica.js +14 -14
  80. package/dist/text-field-components.css.d.ts +2 -2
  81. package/dist/text-field-components.js +49 -39
  82. package/dist/text-field.d.ts +1 -0
  83. package/dist/text-field.js +24 -22
  84. package/dist/text-tokens.d.ts +14 -0
  85. package/dist/text-tokens.js +145 -89
  86. package/dist/theme-context-provider.js +6 -5
  87. package/dist/theme.d.ts +2 -0
  88. package/dist/utils/credit-card.d.ts +2 -2
  89. package/dist/utils/credit-card.js +1 -1
  90. package/dist/vivinho-loading-animation/in-lottie.json.js +544 -612
  91. package/dist/vivinho-loading-animation/out-lottie.json.js +828 -896
  92. package/dist/vivinho-loading-animation/pulse-lottie.json.js +798 -866
  93. package/dist/vivinho-loading-animation/wave-lottie.json.js +4303 -4409
  94. package/dist-es/box.js +18 -18
  95. package/dist-es/card.js +305 -301
  96. package/dist-es/credit-card-expiration-field.js +57 -56
  97. package/dist-es/credit-card-number-field.js +74 -72
  98. package/dist-es/cvv-field.js +82 -81
  99. package/dist-es/date-field.js +29 -27
  100. package/dist-es/date-time-field.js +29 -27
  101. package/dist-es/decimal-field.js +46 -45
  102. package/dist-es/email-field.js +26 -24
  103. package/dist-es/form-context.js +70 -63
  104. package/dist-es/form.js +102 -88
  105. package/dist-es/iban-field.js +35 -33
  106. package/dist-es/index.js +1822 -1817
  107. package/dist-es/inline.js +26 -25
  108. package/dist-es/integer-field.js +31 -31
  109. package/dist-es/month-field.js +28 -26
  110. package/dist-es/package-version.js +1 -1
  111. package/dist-es/password-field.js +37 -35
  112. package/dist-es/phone-number-field.js +92 -60
  113. package/dist-es/pin-field.js +32 -31
  114. package/dist-es/radio-button.js +42 -41
  115. package/dist-es/rating.css-mistica.js +6 -0
  116. package/dist-es/rating.css.ts.vanilla.css-mistica.js +2 -0
  117. package/dist-es/rating.js +257 -0
  118. package/dist-es/search-field.js +33 -31
  119. package/dist-es/select.js +49 -46
  120. package/dist-es/sheet-action-row.css-mistica.js +4 -0
  121. package/dist-es/sheet-actions-list.js +92 -0
  122. package/dist-es/sheet-actions.js +125 -0
  123. package/dist-es/sheet-common.css-mistica.js +4 -0
  124. package/dist-es/sheet-common.css.ts.vanilla.css-mistica.js +2 -0
  125. package/dist-es/sheet-common.js +366 -0
  126. package/dist-es/sheet-info.css-mistica.js +3 -0
  127. package/dist-es/sheet-info.js +101 -0
  128. package/dist-es/sheet-native.js +164 -0
  129. package/dist-es/sheet-radio-list.js +88 -0
  130. package/dist-es/sheet-root.js +50 -319
  131. package/dist-es/sheet-web.js +128 -0
  132. package/dist-es/slider.js +49 -48
  133. package/dist-es/style.css +1 -1
  134. package/dist-es/switch-component.js +27 -26
  135. package/dist-es/text-field-base.js +108 -100
  136. package/dist-es/text-field-components.css-mistica.js +2 -2
  137. package/dist-es/text-field-components.js +70 -60
  138. package/dist-es/text-field.js +33 -31
  139. package/dist-es/text-tokens.js +80 -45
  140. package/dist-es/theme-context-provider.js +20 -19
  141. package/dist-es/utils/credit-card.js +1 -1
  142. package/dist-es/vivinho-loading-animation/in-lottie.json.js +534 -599
  143. package/dist-es/vivinho-loading-animation/out-lottie.json.js +821 -886
  144. package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +790 -855
  145. package/dist-es/vivinho-loading-animation/wave-lottie.json.js +4297 -4400
  146. package/package.json +4 -3
  147. package/dist/sheet.d.ts +0 -107
  148. package/dist/sheet.js +0 -642
  149. package/dist-es/sheet.css-mistica.js +0 -4
  150. package/dist-es/sheet.js +0 -567
  151. /package/dist/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
  152. /package/dist-es/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
@@ -0,0 +1,429 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
13
+ SheetBody: function() {
14
+ return xe;
15
+ },
16
+ default: function() {
17
+ return Ae;
18
+ }
19
+ });
20
+ const _jsxruntime = require("react/jsx-runtime");
21
+ const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
22
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
23
+ const _sheetcommoncssmistica = require("./sheet-common.css-mistica.js");
24
+ const _focustrap = /*#__PURE__*/ _interop_require_default(require("./focus-trap.js"));
25
+ const _hooks = require("./hooks.js");
26
+ const _modalcontextprovider = require("./modal-context-provider.js");
27
+ const _portal = require("./portal.js");
28
+ const _text = require("./text.js");
29
+ const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
30
+ const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
31
+ const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
32
+ const _divider = /*#__PURE__*/ _interop_require_default(require("./divider.js"));
33
+ const _dom = require("./utils/dom.js");
34
+ const _iconcloseregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-close-regular.js"));
35
+ const _iconbutton = require("./icon-button.js");
36
+ const _buttonlayout = /*#__PURE__*/ _interop_require_default(require("./button-layout.js"));
37
+ const _css = require("./utils/css.js");
38
+ const _responsivelayoutcssmistica = require("./responsive-layout.css-mistica.js");
39
+ const _texttokens = require("./text-tokens.js");
40
+ function _interop_require_default(obj) {
41
+ return obj && obj.__esModule ? obj : {
42
+ default: obj
43
+ };
44
+ }
45
+ function _getRequireWildcardCache(nodeInterop) {
46
+ if (typeof WeakMap !== "function") return null;
47
+ var cacheBabelInterop = new WeakMap();
48
+ var cacheNodeInterop = new WeakMap();
49
+ return (_getRequireWildcardCache = function(nodeInterop) {
50
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
51
+ })(nodeInterop);
52
+ }
53
+ function _interop_require_wildcard(obj, nodeInterop) {
54
+ if (!nodeInterop && obj && obj.__esModule) {
55
+ return obj;
56
+ }
57
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
58
+ return {
59
+ default: obj
60
+ };
61
+ }
62
+ var cache = _getRequireWildcardCache(nodeInterop);
63
+ if (cache && cache.has(obj)) {
64
+ return cache.get(obj);
65
+ }
66
+ var newObj = {
67
+ __proto__: null
68
+ };
69
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
70
+ for(var key in obj){
71
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
72
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
73
+ if (desc && (desc.get || desc.set)) {
74
+ Object.defineProperty(newObj, key, desc);
75
+ } else {
76
+ newObj[key] = obj[key];
77
+ }
78
+ }
79
+ }
80
+ newObj.default = obj;
81
+ if (cache) {
82
+ cache.set(obj, newObj);
83
+ }
84
+ return newObj;
85
+ }
86
+ function _define_property(obj, key, value) {
87
+ if (key in obj) {
88
+ Object.defineProperty(obj, key, {
89
+ value: value,
90
+ enumerable: true,
91
+ configurable: true,
92
+ writable: true
93
+ });
94
+ } else {
95
+ obj[key] = value;
96
+ }
97
+ return obj;
98
+ }
99
+ function _object_spread(target) {
100
+ for(var i = 1; i < arguments.length; i++){
101
+ var source = arguments[i] != null ? arguments[i] : {};
102
+ var ownKeys = Object.keys(source);
103
+ if (typeof Object.getOwnPropertySymbols === "function") {
104
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
105
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
106
+ }));
107
+ }
108
+ ownKeys.forEach(function(key) {
109
+ _define_property(target, key, source[key]);
110
+ });
111
+ }
112
+ return target;
113
+ }
114
+ function ownKeys(object, enumerableOnly) {
115
+ var keys = Object.keys(object);
116
+ if (Object.getOwnPropertySymbols) {
117
+ var symbols = Object.getOwnPropertySymbols(object);
118
+ if (enumerableOnly) {
119
+ symbols = symbols.filter(function(sym) {
120
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
121
+ });
122
+ }
123
+ keys.push.apply(keys, symbols);
124
+ }
125
+ return keys;
126
+ }
127
+ function _object_spread_props(target, source) {
128
+ source = source != null ? source : {};
129
+ if (Object.getOwnPropertyDescriptors) {
130
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
131
+ } else {
132
+ ownKeys(Object(source)).forEach(function(key) {
133
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
134
+ });
135
+ }
136
+ return target;
137
+ }
138
+ function _object_without_properties(source, excluded) {
139
+ if (source == null) return {};
140
+ var target = _object_without_properties_loose(source, excluded);
141
+ var key, i;
142
+ if (Object.getOwnPropertySymbols) {
143
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
144
+ for(i = 0; i < sourceSymbolKeys.length; i++){
145
+ key = sourceSymbolKeys[i];
146
+ if (excluded.indexOf(key) >= 0) continue;
147
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
148
+ target[key] = source[key];
149
+ }
150
+ }
151
+ return target;
152
+ }
153
+ function _object_without_properties_loose(source, excluded) {
154
+ if (source == null) return {};
155
+ var target = {};
156
+ var sourceKeys = Object.keys(source);
157
+ var key, i;
158
+ for(i = 0; i < sourceKeys.length; i++){
159
+ key = sourceKeys[i];
160
+ if (excluded.indexOf(key) >= 0) continue;
161
+ target[key] = source[key];
162
+ }
163
+ return target;
164
+ }
165
+ const ce = process.env.NODE_ENV === "test" ? 0 : _sheetcommoncssmistica.transitionDuration, N = (n)=>"touches" in n ? n.touches[0].clientY : n.clientY, ae = (param)=>{
166
+ let { closeModal: n } = param;
167
+ const [o, i] = _react.useState(0), l = _react.useRef(!1), m = _react.useRef(0), v = _react.useRef(0), r = _react.useRef(0), c = _react.useRef(0), { isDesktopOrBigger: d } = (0, _hooks.useScreenSize)(), a = _react.useCallback((s)=>{
168
+ l.current = !0, m.current = 0, v.current = Date.now(), r.current = N(s);
169
+ }, []), f = _react.useCallback(()=>{
170
+ l.current = !1, i(0);
171
+ }, []);
172
+ return _react.useEffect(()=>{
173
+ if (d) return;
174
+ const s = (p)=>{
175
+ if (l.current) {
176
+ if (m.current < 3) {
177
+ m.current++;
178
+ return;
179
+ }
180
+ c.current = N(p), i(c.current - r.current);
181
+ }
182
+ }, h = ()=>{
183
+ if (!l.current) return;
184
+ const p = Date.now() - v.current, S = c.current - r.current, u = S / p;
185
+ l.current = !1, i(0), S > 50 && (c.current > window.innerHeight * 0.75 || u > 0.5) && n();
186
+ };
187
+ return document.addEventListener("touchmove", s), document.addEventListener("touchend", h), document.addEventListener("mousemove", s), document.addEventListener("mouseup", h), ()=>{
188
+ document.removeEventListener("touchmove", s), document.removeEventListener("touchend", h), document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", h);
189
+ };
190
+ }, [
191
+ n,
192
+ d
193
+ ]), d ? {} : {
194
+ onTouchStart: a,
195
+ onMouseDown: a,
196
+ style: o ? {
197
+ transform: `translateY(${o}px)`,
198
+ transition: "none"
199
+ } : void 0,
200
+ onScroll: f,
201
+ overlayStyle: o ? {
202
+ // decrease opacity when dragging down the sheet
203
+ opacity: 0.25 + 1 - o / (window.innerHeight - r.current),
204
+ transition: "none"
205
+ } : void 0
206
+ };
207
+ }, le = {
208
+ closed: {
209
+ open: "opening"
210
+ },
211
+ opening: {
212
+ close: "closed",
213
+ transitionEnd: "open"
214
+ },
215
+ open: {
216
+ close: "closing"
217
+ },
218
+ closing: {
219
+ transitionEnd: "closed"
220
+ }
221
+ }, de = (n, o)=>le[n][o] || n, ue = /*#__PURE__*/ _react.forwardRef((param, l)=>{
222
+ let { onClose: n, children: o, dataAttributes: i } = param;
223
+ const { texts: m, t: v } = (0, _hooks.useTheme)(), [r, c] = _react.useReducer(de, "closed"), d = _react.useRef(!1), a = _react.useId(), f = _react.useCallback((u)=>{
224
+ u.target === u.currentTarget && c("transitionEnd");
225
+ }, []), s = ()=>{
226
+ r === "open" && c("close");
227
+ };
228
+ _react.useEffect(()=>{
229
+ if (r === "opening" || r === "closing") {
230
+ const u = setTimeout(()=>{
231
+ c("transitionEnd");
232
+ }, ce);
233
+ return ()=>clearTimeout(u);
234
+ }
235
+ }, [
236
+ r
237
+ ]), _react.useEffect(()=>{
238
+ r === "closed" ? d.current ? n == null || n() : c("open") : d.current = !0;
239
+ }, [
240
+ r,
241
+ n
242
+ ]);
243
+ const _ae = ae({
244
+ closeModal: s
245
+ }), { onScroll: h, overlayStyle: p } = _ae, S = _object_without_properties(_ae, [
246
+ "onScroll",
247
+ "overlayStyle"
248
+ ]);
249
+ return (0, _modalcontextprovider.useSetModalStateEffect)(), (0, _hooks.useDisableBodyScroll)(r !== "closed"), r === "closed" ? null : /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
250
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_focustrap.default, {
251
+ children: [
252
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
253
+ className: (0, _classnames.default)(_sheetcommoncssmistica.overlay, {
254
+ [_sheetcommoncssmistica.closingOverlay]: r === "closing"
255
+ }),
256
+ style: p,
257
+ onClick: s
258
+ }),
259
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
260
+ className: (0, _classnames.default)(_sheetcommoncssmistica.SheetContainer, {
261
+ [_sheetcommoncssmistica.closingSheet]: r === "closing"
262
+ }),
263
+ onTransitionEnd: f,
264
+ onAnimationEnd: f
265
+ }, S, (0, _dom.getPrefixedDataAttributes)(i, "Sheet")), {
266
+ ref: l,
267
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
268
+ className: _sheetcommoncssmistica.Sheet,
269
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
270
+ className: _sheetcommoncssmistica.SheetContent,
271
+ children: [
272
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
273
+ className: _sheetcommoncssmistica.handleContainer,
274
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
275
+ className: _sheetcommoncssmistica.handle
276
+ })
277
+ }),
278
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)("section", {
279
+ role: "dialog",
280
+ "aria-modal": "true",
281
+ "aria-labelledby": a,
282
+ onScroll: h,
283
+ className: _sheetcommoncssmistica.children,
284
+ style: {
285
+ paddingBottom: _css.safeAreaInsetBottom
286
+ },
287
+ children: [
288
+ typeof o == "function" ? o({
289
+ closeModal: s,
290
+ modalTitleId: a
291
+ }) : o,
292
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
293
+ className: _sheetcommoncssmistica.modalCloseButton,
294
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.InternalIconButton, {
295
+ onPress: s,
296
+ "aria-label": m.modalClose || v(_texttokens.modalClose),
297
+ Icon: _iconcloseregular.default,
298
+ bleedLeft: !0,
299
+ bleedRight: !0,
300
+ bleedY: !0
301
+ })
302
+ })
303
+ ]
304
+ })
305
+ ]
306
+ })
307
+ })
308
+ }))
309
+ ]
310
+ })
311
+ });
312
+ }), R = {
313
+ mobile: _responsivelayoutcssmistica.MOBILE_SIDE_MARGIN,
314
+ tablet: _responsivelayoutcssmistica.TABLET_SIDE_MARGIN,
315
+ desktop: _responsivelayoutcssmistica.SMALL_DESKTOP_SIDE_MARGIN
316
+ }, xe = (param)=>{
317
+ let { title: n, subtitle: o, description: i, modalTitleId: l, button: m, secondaryButton: v, link: r, children: c } = param;
318
+ const d = _react.useRef(null), a = _react.useRef(null), f = _react.useRef(null);
319
+ _react.useEffect(()=>{
320
+ a.current && (f.current = (0, _dom.getScrollableParentElement)(a.current));
321
+ }, []);
322
+ const s = !(0, _hooks.useIsInViewport)(d, !0, {
323
+ root: f.current
324
+ }), h = !(0, _hooks.useIsInViewport)(a, !0, {
325
+ rootMargin: "1px",
326
+ // bottomScrollSignal div has 0px height so we need a 1px margin to trigger the intersection observer
327
+ root: f.current
328
+ }), p = !!m || !!v || !!r;
329
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
330
+ children: [
331
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
332
+ ref: d
333
+ }),
334
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
335
+ className: _sheetcommoncssmistica.stickyTitle,
336
+ children: [
337
+ n ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
338
+ paddingBottom: 8,
339
+ paddingTop: {
340
+ mobile: 0,
341
+ desktop: 40
342
+ },
343
+ paddingX: R,
344
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text5, {
345
+ as: "h2",
346
+ id: l,
347
+ truncate: !0,
348
+ children: n
349
+ })
350
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
351
+ paddingTop: {
352
+ mobile: 0,
353
+ desktop: 40
354
+ }
355
+ }),
356
+ s && /* @__PURE__ */ (0, _jsxruntime.jsx)(_divider.default, {})
357
+ ]
358
+ }),
359
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
360
+ className: _sheetcommoncssmistica.bodyContent,
361
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
362
+ paddingBottom: p ? 0 : {
363
+ desktop: 40,
364
+ mobile: 0
365
+ },
366
+ paddingX: R,
367
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
368
+ space: 8,
369
+ children: [
370
+ o || i ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
371
+ space: {
372
+ mobile: 8,
373
+ desktop: 16
374
+ },
375
+ children: [
376
+ o && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
377
+ as: "p",
378
+ regular: !0,
379
+ children: o
380
+ }),
381
+ i && (Array.isArray(i) ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
382
+ as: "div",
383
+ regular: !0,
384
+ color: _skincontractcssmistica.vars.colors.textSecondary,
385
+ children: i.map((S, u)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("p", {
386
+ style: {
387
+ margin: 0,
388
+ marginBottom: u < i.length - 1 ? "1em" : void 0
389
+ },
390
+ children: S
391
+ }, u))
392
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
393
+ as: "p",
394
+ regular: !0,
395
+ color: _skincontractcssmistica.vars.colors.textSecondary,
396
+ children: i
397
+ }))
398
+ ]
399
+ }) : null,
400
+ c
401
+ ]
402
+ })
403
+ })
404
+ }),
405
+ p && /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
406
+ className: _sheetcommoncssmistica.stickyButtons,
407
+ children: [
408
+ h && /* @__PURE__ */ (0, _jsxruntime.jsx)(_divider.default, {}),
409
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
410
+ paddingY: {
411
+ mobile: 16,
412
+ desktop: 40
413
+ },
414
+ paddingX: R,
415
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_buttonlayout.default, {
416
+ align: "full-width",
417
+ link: r,
418
+ primaryButton: m,
419
+ secondaryButton: v
420
+ })
421
+ })
422
+ ]
423
+ }),
424
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
425
+ ref: a
426
+ })
427
+ ]
428
+ });
429
+ }, Ae = ue;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "infoItemIcon", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return f;
9
+ }
10
+ });
11
+ require("./sprinkles.css.ts.vanilla.css-mistica.js");
12
+ var f = "_1y2v1nfhk _1y2v1nfhz _1y2v1nfiw";
@@ -0,0 +1 @@
1
+ export declare const infoItemIcon: string;
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import type { ExclusifyUnion } from './utils/utility-types';
3
+ import type { DataAttributes, IconProps } from './utils/types';
4
+ type InfoSheetProps = {
5
+ title?: string;
6
+ subtitle?: string;
7
+ description?: string | ReadonlyArray<string>;
8
+ items: ReadonlyArray<{
9
+ id?: string;
10
+ title: string;
11
+ description?: string;
12
+ icon: ExclusifyUnion<{
13
+ type: 'regular' | 'small';
14
+ /** @deprecated use url instead */
15
+ Icon: React.ComponentType<IconProps>;
16
+ } | {
17
+ type: 'regular' | 'small';
18
+ url: string;
19
+ urlDark?: string;
20
+ } | {
21
+ type: 'bullet';
22
+ }>;
23
+ }>;
24
+ onClose?: () => void;
25
+ dataAttributes?: DataAttributes;
26
+ };
27
+ declare const InfoSheet: React.ForwardRefExoticComponent<InfoSheetProps & React.RefAttributes<HTMLDivElement>>;
28
+ export default InfoSheet;
@@ -0,0 +1,156 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function() {
9
+ return E;
10
+ }
11
+ });
12
+ const _jsxruntime = require("react/jsx-runtime");
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
14
+ const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
15
+ const _circle = /*#__PURE__*/ _interop_require_default(require("./circle.js"));
16
+ const _sheetcommon = /*#__PURE__*/ _interop_require_wildcard(require("./sheet-common.js"));
17
+ const _hooks = require("./hooks.js");
18
+ const _box = /*#__PURE__*/ _interop_require_default(require("./box.js"));
19
+ const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
20
+ const _text = require("./text.js");
21
+ const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
22
+ const _sheetinfocssmistica = require("./sheet-info.css-mistica.js");
23
+ const _image = /*#__PURE__*/ _interop_require_default(require("./image.js"));
24
+ function _interop_require_default(obj) {
25
+ return obj && obj.__esModule ? obj : {
26
+ default: obj
27
+ };
28
+ }
29
+ function _getRequireWildcardCache(nodeInterop) {
30
+ if (typeof WeakMap !== "function") return null;
31
+ var cacheBabelInterop = new WeakMap();
32
+ var cacheNodeInterop = new WeakMap();
33
+ return (_getRequireWildcardCache = function(nodeInterop) {
34
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
35
+ })(nodeInterop);
36
+ }
37
+ function _interop_require_wildcard(obj, nodeInterop) {
38
+ if (!nodeInterop && obj && obj.__esModule) {
39
+ return obj;
40
+ }
41
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
42
+ return {
43
+ default: obj
44
+ };
45
+ }
46
+ var cache = _getRequireWildcardCache(nodeInterop);
47
+ if (cache && cache.has(obj)) {
48
+ return cache.get(obj);
49
+ }
50
+ var newObj = {
51
+ __proto__: null
52
+ };
53
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
54
+ for(var key in obj){
55
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
56
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
57
+ if (desc && (desc.get || desc.set)) {
58
+ Object.defineProperty(newObj, key, desc);
59
+ } else {
60
+ newObj[key] = obj[key];
61
+ }
62
+ }
63
+ }
64
+ newObj.default = obj;
65
+ if (cache) {
66
+ cache.set(obj, newObj);
67
+ }
68
+ return newObj;
69
+ }
70
+ function _define_property(obj, key, value) {
71
+ if (key in obj) {
72
+ Object.defineProperty(obj, key, {
73
+ value: value,
74
+ enumerable: true,
75
+ configurable: true,
76
+ writable: true
77
+ });
78
+ } else {
79
+ obj[key] = value;
80
+ }
81
+ return obj;
82
+ }
83
+ function _object_spread(target) {
84
+ for(var i = 1; i < arguments.length; i++){
85
+ var source = arguments[i] != null ? arguments[i] : {};
86
+ var ownKeys = Object.keys(source);
87
+ if (typeof Object.getOwnPropertySymbols === "function") {
88
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
89
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
90
+ }));
91
+ }
92
+ ownKeys.forEach(function(key) {
93
+ _define_property(target, key, source[key]);
94
+ });
95
+ }
96
+ return target;
97
+ }
98
+ const j = /*#__PURE__*/ _react.forwardRef((param, m)=>{
99
+ let { title: n, subtitle: i, description: l, items: a, onClose: s, dataAttributes: p } = param;
100
+ const { isDarkMode: d } = (0, _hooks.useTheme)();
101
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_sheetcommon.default, {
102
+ onClose: s,
103
+ ref: m,
104
+ dataAttributes: _object_spread({
105
+ "component-name": "InfoSheet"
106
+ }, p),
107
+ children: (param)=>{
108
+ let { modalTitleId: f } = param;
109
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_sheetcommon.SheetBody, {
110
+ title: n,
111
+ subtitle: i,
112
+ description: l,
113
+ modalTitleId: f,
114
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
115
+ paddingBottom: 16,
116
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_stack.default, {
117
+ space: 16,
118
+ role: "list",
119
+ children: a.map((o, h)=>/* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
120
+ space: 8,
121
+ children: [
122
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
123
+ className: _sheetinfocssmistica.infoItemIcon,
124
+ children: o.icon.type === "bullet" ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_circle.default, {
125
+ size: 8,
126
+ backgroundColor: _skincontractcssmistica.vars.colors.textPrimary
127
+ }) : o.icon.Icon ? /* @__PURE__ */ (0, _jsxruntime.jsx)(o.icon.Icon, {
128
+ size: o.icon.type === "small" ? 16 : 24
129
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_image.default, {
130
+ src: d && o.icon.urlDark ? o.icon.urlDark : o.icon.url,
131
+ width: o.icon.type === "small" ? 16 : 24,
132
+ height: o.icon.type === "small" ? 16 : 24
133
+ })
134
+ }),
135
+ /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
136
+ space: 2,
137
+ children: [
138
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
139
+ regular: !0,
140
+ children: o.title
141
+ }),
142
+ o.description && /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
143
+ regular: !0,
144
+ color: _skincontractcssmistica.vars.colors.textSecondary,
145
+ children: o.description
146
+ })
147
+ ]
148
+ })
149
+ ]
150
+ }, o.id || h))
151
+ })
152
+ })
153
+ });
154
+ }
155
+ });
156
+ }), E = j;
@@ -0,0 +1,2 @@
1
+ import type { NativeSheetImplementation, SheetPropsByType, SheetResultByType, SheetTypeWithProps } from './sheet-types';
2
+ export declare const showNativeSheet: <T extends keyof SheetPropsByType>(nativeSheetImplementation: NativeSheetImplementation, sheetProps: SheetTypeWithProps<T>) => Promise<SheetResultByType[T]>;