@telefonica/mistica 15.16.4 → 15.18.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/css/roboto.css +102 -34
- package/dist/box.d.ts +1 -0
- package/dist/box.js +11 -10
- package/dist/callout.d.ts +1 -0
- package/dist/callout.js +10 -10
- package/dist/card.d.ts +6 -1
- package/dist/card.js +375 -365
- package/dist/chip.d.ts +1 -0
- package/dist/chip.js +25 -26
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +65 -62
- package/dist/feedback.js +58 -52
- package/dist/generated/mistica-icons/icon-box-star-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-filled.js +121 -0
- package/dist/generated/mistica-icons/icon-box-star-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-light.js +117 -0
- package/dist/generated/mistica-icons/icon-box-star-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-regular.js +117 -0
- package/dist/generated/mistica-icons/icon-high-priority-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-filled.js +111 -0
- package/dist/generated/mistica-icons/icon-high-priority-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-light.js +111 -0
- package/dist/generated/mistica-icons/icon-high-priority-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-regular.js +111 -0
- package/dist/generated/mistica-icons/icon-mms-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-filled.js +122 -0
- package/dist/generated/mistica-icons/icon-mms-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-light.js +134 -0
- package/dist/generated/mistica-icons/icon-mms-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-regular.js +134 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.js +111 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-light.js +117 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.js +117 -0
- package/dist/generated/mistica-icons/icons-keywords.js +31 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +48 -0
- package/dist/inline.css-mistica.js +11 -8
- package/dist/inline.css.d.ts +1 -0
- package/dist/inline.js +12 -12
- package/dist/list.d.ts +1 -0
- package/dist/list.js +163 -157
- package/dist/package-version.js +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +9 -7
- package/dist/select.js +103 -95
- package/dist/skins/blau.js +96 -8
- package/dist/skins/defaults.js +98 -10
- package/dist/skins/movistar.js +94 -6
- package/dist/skins/o2-new.js +95 -7
- package/dist/skins/o2.js +94 -6
- package/dist/skins/skin-contract.css-mistica.js +42 -10
- package/dist/skins/skin-contract.css.d.ts +32 -0
- package/dist/skins/telefonica.js +96 -8
- package/dist/skins/tu.js +94 -6
- package/dist/skins/types/index.d.ts +36 -28
- package/dist/skins/vivo-new.js +95 -7
- package/dist/skins/vivo.js +94 -6
- package/dist/snackbar-context.js +23 -22
- package/dist/snackbar.d.ts +1 -0
- package/dist/snackbar.js +63 -57
- package/dist/theme-context-provider.js +91 -63
- package/dist/theme-context.css-mistica.js +452 -0
- package/dist/theme-context.css.d.ts +432 -0
- package/dist/theme-context.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +110 -110
- package/dist-es/box.js +17 -16
- package/dist-es/callout.js +38 -38
- package/dist-es/card.js +492 -482
- package/dist-es/chip.js +49 -50
- package/dist-es/dialog.js +78 -75
- package/dist-es/feedback.js +96 -89
- package/dist-es/generated/mistica-icons/icon-box-star-filled.js +112 -0
- package/dist-es/generated/mistica-icons/icon-box-star-light.js +108 -0
- package/dist-es/generated/mistica-icons/icon-box-star-regular.js +108 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-filled.js +102 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-light.js +102 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-regular.js +102 -0
- package/dist-es/generated/mistica-icons/icon-mms-filled.js +113 -0
- package/dist-es/generated/mistica-icons/icon-mms-light.js +125 -0
- package/dist-es/generated/mistica-icons/icon-mms-regular.js +125 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-filled.js +102 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-light.js +108 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-regular.js +108 -0
- package/dist-es/generated/mistica-icons/icons-keywords.js +31 -0
- package/dist-es/index.js +1563 -1551
- package/dist-es/inline.css-mistica.js +3 -3
- package/dist-es/inline.js +23 -23
- package/dist-es/list.js +225 -219
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +26 -24
- package/dist-es/select.js +146 -138
- package/dist-es/skins/blau.js +96 -8
- package/dist-es/skins/defaults.js +97 -9
- package/dist-es/skins/movistar.js +94 -6
- package/dist-es/skins/o2-new.js +95 -7
- package/dist-es/skins/o2.js +94 -6
- package/dist-es/skins/skin-contract.css-mistica.js +42 -10
- package/dist-es/skins/telefonica.js +98 -10
- package/dist-es/skins/tu.js +94 -6
- package/dist-es/skins/vivo-new.js +95 -7
- package/dist-es/skins/vivo.js +94 -6
- package/dist-es/snackbar-context.js +25 -24
- package/dist-es/snackbar.js +91 -85
- package/dist-es/style.css +1 -1
- package/dist-es/theme-context-provider.js +133 -105
- package/dist-es/theme-context.css-mistica.js +432 -0
- package/dist-es/theme-context.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/tooltip.js +149 -149
- package/package.json +2 -3
package/dist-es/chip.js
CHANGED
|
@@ -51,59 +51,60 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
import { jsxs as
|
|
55
|
-
import
|
|
56
|
-
import { useTheme as
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import { Text2 as
|
|
60
|
-
import
|
|
61
|
-
import { pxToRem as
|
|
62
|
-
import { iconActive as
|
|
63
|
-
import { vars as
|
|
64
|
-
import { getPrefixedDataAttributes as q } from "./utils/dom.js";
|
|
54
|
+
import { jsxs as d, Fragment as C, jsx as t } from "react/jsx-runtime";
|
|
55
|
+
import m from "classnames";
|
|
56
|
+
import { useTheme as P } from "./hooks.js";
|
|
57
|
+
import x from "./badge.js";
|
|
58
|
+
import o from "./box.js";
|
|
59
|
+
import { Text2 as V } from "./text.js";
|
|
60
|
+
import z from "./generated/mistica-icons/icon-close-regular.js";
|
|
61
|
+
import { pxToRem as i } from "./utils/css.js";
|
|
62
|
+
import { iconActive as D, icon as M, chipVariants as h, chipWrapper as u, button as F, wrappedContent as W, chipInteractiveVariants as $ } from "./chip.css-mistica.js";
|
|
63
|
+
import { vars as q } from "./skins/skin-contract.css-mistica.js";
|
|
65
64
|
import { useThemeVariant as E } from "./theme-variant-context.js";
|
|
66
65
|
import G, { BaseTouchable as H } from "./touchable.js";
|
|
67
66
|
const J = (e)=>{
|
|
68
|
-
const { Icon: n, children:
|
|
67
|
+
const { Icon: n, children: A, id: R, dataAttributes: T, active: a, badge: r, onClose: s, closeButtonLabel: k } = e, { texts: B, isDarkMode: I, textPresets: w } = P(), p = E() === "alternative", f = n ? {
|
|
69
68
|
mobile: 16,
|
|
70
69
|
desktop: 8
|
|
71
70
|
} : {
|
|
72
71
|
mobile: 20,
|
|
73
72
|
desktop: 12
|
|
74
|
-
},
|
|
73
|
+
}, y = {
|
|
75
74
|
mobile: 20,
|
|
76
75
|
desktop: 12
|
|
77
76
|
}, g = {
|
|
78
77
|
mobile: 16,
|
|
79
78
|
desktop: 8
|
|
80
|
-
}, b = /* @__PURE__ */
|
|
79
|
+
}, b = /* @__PURE__ */ d(C, {
|
|
81
80
|
children: [
|
|
82
|
-
n && /* @__PURE__ */ t(
|
|
81
|
+
n && /* @__PURE__ */ t(o, {
|
|
83
82
|
paddingRight: 4,
|
|
84
|
-
className: a ?
|
|
83
|
+
className: a ? D : M,
|
|
85
84
|
children: /* @__PURE__ */ t(n, {
|
|
86
85
|
color: "currentColor",
|
|
87
|
-
size:
|
|
86
|
+
size: i(16)
|
|
88
87
|
})
|
|
89
88
|
}),
|
|
90
|
-
/* @__PURE__ */ t(
|
|
89
|
+
/* @__PURE__ */ t(o, {
|
|
91
90
|
paddingRight: r ? 8 : s ? 4 : 0,
|
|
92
|
-
children: /* @__PURE__ */ t(
|
|
93
|
-
id:
|
|
94
|
-
weight:
|
|
91
|
+
children: /* @__PURE__ */ t(V, {
|
|
92
|
+
id: R,
|
|
93
|
+
weight: w.indicator.weight,
|
|
95
94
|
truncate: 1,
|
|
96
95
|
color: "currentColor",
|
|
97
|
-
children:
|
|
96
|
+
children: A
|
|
98
97
|
})
|
|
99
98
|
})
|
|
100
99
|
]
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
}), c = _object_spread({
|
|
101
|
+
"component-name": "Chip"
|
|
102
|
+
}, T);
|
|
103
|
+
if (s) return /* @__PURE__ */ d(o, {
|
|
104
|
+
className: m(p ? h.overAlternative : h.default, u),
|
|
104
105
|
paddingLeft: f,
|
|
105
|
-
paddingRight: g
|
|
106
|
-
|
|
106
|
+
paddingRight: g,
|
|
107
|
+
dataAttributes: c,
|
|
107
108
|
children: [
|
|
108
109
|
b,
|
|
109
110
|
/* @__PURE__ */ t(G, {
|
|
@@ -111,41 +112,39 @@ const J = (e)=>{
|
|
|
111
112
|
display: "flex",
|
|
112
113
|
justifyContent: "center",
|
|
113
114
|
alignItems: "center",
|
|
114
|
-
width:
|
|
115
|
-
height:
|
|
115
|
+
width: i(24),
|
|
116
|
+
height: i(24)
|
|
116
117
|
},
|
|
117
|
-
"aria-label": k.closeButtonLabel,
|
|
118
|
+
"aria-label": k !== null && k !== void 0 ? k : B.closeButtonLabel,
|
|
118
119
|
onPress: ()=>s(),
|
|
119
|
-
children: /* @__PURE__ */ t(
|
|
120
|
-
size:
|
|
121
|
-
color:
|
|
120
|
+
children: /* @__PURE__ */ t(z, {
|
|
121
|
+
size: i(16),
|
|
122
|
+
color: q.colors.neutralMedium
|
|
122
123
|
})
|
|
123
124
|
})
|
|
124
125
|
]
|
|
125
|
-
})
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
}, p), N = ()=>r ? /* @__PURE__ */ t(x, {
|
|
129
|
-
children: r === !0 ? /* @__PURE__ */ t(A, {}) : /* @__PURE__ */ t(A, {
|
|
126
|
+
});
|
|
127
|
+
const l = e.href || e.onPress || e.to, N = a !== void 0 || l, j = ()=>r ? /* @__PURE__ */ t(C, {
|
|
128
|
+
children: r === !0 ? /* @__PURE__ */ t(x, {}) : /* @__PURE__ */ t(x, {
|
|
130
129
|
value: r
|
|
131
130
|
})
|
|
132
|
-
}) : null,
|
|
133
|
-
className:
|
|
134
|
-
|
|
135
|
-
[
|
|
131
|
+
}) : null, v = (L)=>/* @__PURE__ */ d(o, {
|
|
132
|
+
className: m(h[a ? "active" : p ? "overAlternative" : "default"], // If the chip is wrapped inside a BaseTouchable, we set inline-flex to the Touchable instead
|
|
133
|
+
l ? W : u, {
|
|
134
|
+
[$[I ? "dark" : "light"]]: N
|
|
136
135
|
}),
|
|
137
136
|
paddingLeft: f,
|
|
138
|
-
paddingRight: r ? g :
|
|
139
|
-
dataAttributes:
|
|
137
|
+
paddingRight: r ? g : y,
|
|
138
|
+
dataAttributes: L,
|
|
140
139
|
children: [
|
|
141
140
|
b,
|
|
142
|
-
|
|
141
|
+
j()
|
|
143
142
|
]
|
|
144
143
|
});
|
|
145
|
-
return
|
|
146
|
-
className:
|
|
147
|
-
dataAttributes:
|
|
148
|
-
children:
|
|
149
|
-
})) :
|
|
144
|
+
return l ? /* @__PURE__ */ t(H, _object_spread_props(_object_spread({}, e), {
|
|
145
|
+
className: m(u, F),
|
|
146
|
+
dataAttributes: c,
|
|
147
|
+
children: v()
|
|
148
|
+
})) : v(c);
|
|
150
149
|
}, ot = J;
|
|
151
150
|
export { ot as default };
|
package/dist-es/dialog.js
CHANGED
|
@@ -79,7 +79,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
81
|
import { jsx as e, jsxs as w, Fragment as L } from "react/jsx-runtime";
|
|
82
|
-
import * as
|
|
82
|
+
import * as n from "react";
|
|
83
83
|
import E from "classnames";
|
|
84
84
|
import { ButtonDanger as O, ButtonPrimary as S, ButtonSecondary as M } from "./button.js";
|
|
85
85
|
import { Portal as _ } from "./portal.js";
|
|
@@ -95,32 +95,32 @@ import k from "./box.js";
|
|
|
95
95
|
import { isRunningAcceptanceTest as H } from "./utils/platform.js";
|
|
96
96
|
import { useSetModalStateEffect as J } from "./modal-context-provider.js";
|
|
97
97
|
import Q from "./stack.js";
|
|
98
|
-
import { ANIMATION_DURATION_MS as X, wrapper as Z, modalOpacityLayer as $, closedOpactityLayer as ee, modalContent as te, closedModalContent as
|
|
98
|
+
import { ANIMATION_DURATION_MS as X, wrapper as Z, modalOpacityLayer as $, closedOpactityLayer as ee, modalContent as te, closedModalContent as ne, modalCloseButtonContainer as oe, variants as ae, iconContainer as re, dialogContent as ie, dialogActions as se } from "./dialog.css-mistica.js";
|
|
99
99
|
import { vars as le } from "./skins/skin-contract.css-mistica.js";
|
|
100
|
-
const ce = ()=>process.env.NODE_ENV !== "test" && !H(),
|
|
101
|
-
const { texts: i } = D(), { className:
|
|
102
|
-
onPress:
|
|
103
|
-
children:
|
|
100
|
+
const ce = ()=>process.env.NODE_ENV !== "test" && !H(), ue = (t)=>{
|
|
101
|
+
const { texts: i } = D(), { className: u, title: r, message: f, icon: o, extra: c, showCancelButton: s, showAcceptButton: l, cancelText: g = i.dialogCancelButton, acceptText: m = i.dialogAcceptButton, onCancel: h, onAccept: C, destructive: B = !1 } = t, d = t.type === "dialog", p = d && !!t.link || l || s, y = {
|
|
102
|
+
onPress: C || (()=>{}),
|
|
103
|
+
children: m,
|
|
104
104
|
// @deprecated - testid should be removed but many webapp tests depend on this
|
|
105
105
|
dataAttributes: {
|
|
106
106
|
testid: "dialog-accept-button"
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
return /* @__PURE__ */ w("div", {
|
|
110
|
-
className: E(ae[
|
|
110
|
+
className: E(ae[d ? "dialog" : "default"], u),
|
|
111
111
|
children: [
|
|
112
|
-
|
|
112
|
+
o && /* @__PURE__ */ e(k, {
|
|
113
113
|
paddingBottom: 24,
|
|
114
114
|
children: /* @__PURE__ */ e("div", {
|
|
115
115
|
className: re,
|
|
116
|
-
children: /*#__PURE__*/
|
|
116
|
+
children: /*#__PURE__*/ n.cloneElement(o, {
|
|
117
117
|
size: "100%"
|
|
118
118
|
})
|
|
119
119
|
})
|
|
120
120
|
}),
|
|
121
121
|
r && /* @__PURE__ */ e(k, {
|
|
122
122
|
paddingBottom: 16,
|
|
123
|
-
children:
|
|
123
|
+
children: d ? /* @__PURE__ */ e(Y, {
|
|
124
124
|
as: "h2",
|
|
125
125
|
children: r
|
|
126
126
|
}) : /* @__PURE__ */ e(A, {
|
|
@@ -145,134 +145,137 @@ const ce = ()=>process.env.NODE_ENV !== "test" && !H(), de = (t)=>{
|
|
|
145
145
|
/* @__PURE__ */ e(q, {
|
|
146
146
|
color: le.colors.textSecondary,
|
|
147
147
|
regular: !0,
|
|
148
|
-
children:
|
|
148
|
+
children: f
|
|
149
149
|
}),
|
|
150
150
|
c
|
|
151
151
|
]
|
|
152
152
|
})
|
|
153
153
|
}),
|
|
154
|
-
|
|
154
|
+
p && /* @__PURE__ */ e("div", {
|
|
155
155
|
className: se,
|
|
156
156
|
children: /* @__PURE__ */ e(U, {
|
|
157
|
-
link:
|
|
157
|
+
link: d ? t.link : void 0,
|
|
158
158
|
primaryButton: l ? B ? /* @__PURE__ */ e(O, _object_spread({
|
|
159
159
|
tabIndex: 1
|
|
160
|
-
},
|
|
160
|
+
}, y)) : /* @__PURE__ */ e(S, _object_spread({
|
|
161
161
|
tabIndex: 1
|
|
162
|
-
},
|
|
162
|
+
}, y)) : void 0,
|
|
163
163
|
secondaryButton: s ? /* @__PURE__ */ e(M, {
|
|
164
164
|
tabIndex: 2,
|
|
165
|
-
onPress:
|
|
165
|
+
onPress: h || (()=>{}),
|
|
166
166
|
dataAttributes: {
|
|
167
167
|
testid: "dialog-cancel-button"
|
|
168
168
|
},
|
|
169
|
-
children:
|
|
169
|
+
children: g
|
|
170
170
|
}) : void 0
|
|
171
171
|
})
|
|
172
172
|
})
|
|
173
173
|
]
|
|
174
174
|
});
|
|
175
|
-
},
|
|
176
|
-
let { type: t, message: i, title:
|
|
175
|
+
}, de = (param)=>{
|
|
176
|
+
let { type: t, message: i, title: u, acceptText: r, cancelText: f, onAccept: o, onCancel: c, onDestroy: s } = param;
|
|
177
177
|
return t === "confirm" ? z({
|
|
178
178
|
message: i,
|
|
179
|
-
title:
|
|
180
|
-
cancelText:
|
|
179
|
+
title: u,
|
|
180
|
+
cancelText: f,
|
|
181
181
|
acceptText: r
|
|
182
182
|
}).then((l)=>{
|
|
183
|
-
l ?
|
|
183
|
+
l ? o == null || o() : c == null || c(), s();
|
|
184
184
|
}) : K({
|
|
185
185
|
message: i,
|
|
186
|
-
title:
|
|
186
|
+
title: u,
|
|
187
187
|
buttonText: r
|
|
188
188
|
}).then(()=>{
|
|
189
|
-
|
|
189
|
+
o == null || o(), s();
|
|
190
190
|
});
|
|
191
191
|
}, me = (param)=>{
|
|
192
|
-
let { type: t, onAccept: i, onCancel:
|
|
193
|
-
const { texts: l } = D(),
|
|
192
|
+
let { type: t, onAccept: i, onCancel: u, onDestroy: r, acceptText: f, cancelText: o, message: c, title: s } = param;
|
|
193
|
+
const { texts: l } = D(), g = n.useRef({
|
|
194
194
|
type: t,
|
|
195
195
|
onAccept: i,
|
|
196
|
-
onCancel:
|
|
196
|
+
onCancel: u,
|
|
197
197
|
onDestroy: r,
|
|
198
|
-
acceptText:
|
|
199
|
-
cancelText:
|
|
198
|
+
acceptText: f || l.dialogAcceptButton,
|
|
199
|
+
cancelText: o || l.dialogCancelButton,
|
|
200
200
|
message: c,
|
|
201
201
|
title: s
|
|
202
|
-
});
|
|
203
|
-
return
|
|
204
|
-
|
|
202
|
+
}), m = n.useRef(!1);
|
|
203
|
+
return n.useEffect(()=>{
|
|
204
|
+
m.current || (m.current = !0, de(g.current).finally(()=>{
|
|
205
|
+
m.current = !1;
|
|
206
|
+
}));
|
|
205
207
|
}, []), /* @__PURE__ */ e(L, {});
|
|
206
208
|
}, Ie = (t)=>{
|
|
207
209
|
J();
|
|
208
|
-
const i =
|
|
210
|
+
const i = n.useRef(null), { texts: u } = D(), [r, f] = n.useState(!1), o = n.useRef(!1), c = n.useRef(!1), [s, l] = n.useState(!1), g = n.useRef(!1), m = n.useRef(ce() ? X : 0), h = t.type !== "dialog" && W(), C = t.type === "dialog", B = t.type === "alert", { onAccept: d, onCancel: p, onDestroy: y } = t, I = _object_without_properties(t, [
|
|
209
211
|
"onAccept",
|
|
210
212
|
"onCancel",
|
|
211
213
|
"onDestroy"
|
|
212
214
|
]);
|
|
213
|
-
|
|
215
|
+
n.useEffect(()=>{
|
|
214
216
|
const a = setTimeout(()=>{
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
+
o.current || l(!0);
|
|
218
|
+
}, m.current);
|
|
217
219
|
return ()=>{
|
|
218
220
|
clearTimeout(a);
|
|
219
221
|
};
|
|
220
222
|
}, []);
|
|
221
|
-
const x =
|
|
222
|
-
c.current || (c.current = !0,
|
|
223
|
+
const x = n.useCallback(()=>{
|
|
224
|
+
c.current || (c.current = !0, g.current ? d == null || d() : p == null || p(), y());
|
|
223
225
|
}, [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
]), R =
|
|
226
|
+
d,
|
|
227
|
+
p,
|
|
228
|
+
y
|
|
229
|
+
]), R = n.useCallback(()=>{
|
|
228
230
|
let a;
|
|
229
|
-
return !
|
|
231
|
+
return !o.current && s && (o.current = !0, l(!1), f(!0), a = setTimeout(x, m.current)), ()=>{
|
|
230
232
|
a && clearTimeout(a);
|
|
231
233
|
};
|
|
232
234
|
}, [
|
|
233
235
|
x,
|
|
234
236
|
s
|
|
235
|
-
]), N =
|
|
236
|
-
|
|
237
|
+
]), N = n.useCallback(()=>{
|
|
238
|
+
g.current = !0, R();
|
|
237
239
|
}, [
|
|
238
240
|
R
|
|
239
|
-
]),
|
|
240
|
-
|
|
241
|
+
]), b = n.useCallback(()=>{
|
|
242
|
+
g.current = !1, R();
|
|
241
243
|
}, [
|
|
242
244
|
R
|
|
243
|
-
]),
|
|
244
|
-
|
|
245
|
+
]), v = n.useCallback(()=>{
|
|
246
|
+
o.current || (B ? N() : b());
|
|
245
247
|
}, [
|
|
246
248
|
N,
|
|
247
|
-
|
|
249
|
+
b,
|
|
248
250
|
B
|
|
249
|
-
]), T =
|
|
250
|
-
a.key === G && (a.stopPropagation(), a.preventDefault(),
|
|
251
|
+
]), T = n.useCallback((a)=>{
|
|
252
|
+
a.key === G && (a.stopPropagation(), a.preventDefault(), v());
|
|
251
253
|
}, [
|
|
252
|
-
|
|
254
|
+
v
|
|
253
255
|
]);
|
|
254
|
-
|
|
255
|
-
if (!
|
|
256
|
+
n.useEffect(()=>{
|
|
257
|
+
if (!h) return document.addEventListener("keydown", T), ()=>{
|
|
256
258
|
document.removeEventListener("keydown", T);
|
|
257
259
|
};
|
|
258
260
|
}, [
|
|
259
261
|
T,
|
|
260
|
-
|
|
261
|
-
]),
|
|
262
|
-
if (!
|
|
263
|
-
window.removeEventListener("popstate",
|
|
262
|
+
h
|
|
263
|
+
]), n.useEffect(()=>{
|
|
264
|
+
if (!h) return window.addEventListener("popstate", v), ()=>{
|
|
265
|
+
window.removeEventListener("popstate", v);
|
|
264
266
|
};
|
|
265
267
|
}, [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
+
v,
|
|
269
|
+
h
|
|
268
270
|
]);
|
|
269
|
-
const P =
|
|
270
|
-
a.stopPropagation(),
|
|
271
|
+
const P = n.useCallback((a)=>{
|
|
272
|
+
a.stopPropagation(), C && b();
|
|
271
273
|
}, [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
C,
|
|
275
|
+
b
|
|
274
276
|
]);
|
|
275
|
-
|
|
277
|
+
var _t_closeButtonLabel;
|
|
278
|
+
return h ? /* @__PURE__ */ e(me, _object_spread({}, t)) : /* @__PURE__ */ e(_, {
|
|
276
279
|
className: Z,
|
|
277
280
|
children: /* @__PURE__ */ e(j, {
|
|
278
281
|
children: /* @__PURE__ */ e("div", {
|
|
@@ -289,30 +292,30 @@ const ce = ()=>process.env.NODE_ENV !== "test" && !H(), de = (t)=>{
|
|
|
289
292
|
children: /* @__PURE__ */ w("div", {
|
|
290
293
|
ref: i,
|
|
291
294
|
onAnimationEnd: (a)=>{
|
|
292
|
-
a.target === i.current && (
|
|
295
|
+
a.target === i.current && (o.current || l(!0));
|
|
293
296
|
},
|
|
294
297
|
onTransitionEnd: (a)=>{
|
|
295
|
-
a.target === i.current &&
|
|
298
|
+
a.target === i.current && o.current && x();
|
|
296
299
|
},
|
|
297
300
|
className: E(te, {
|
|
298
|
-
[
|
|
301
|
+
[ne]: r
|
|
299
302
|
}),
|
|
300
303
|
children: [
|
|
301
|
-
|
|
302
|
-
className:
|
|
304
|
+
C && /* @__PURE__ */ e("div", {
|
|
305
|
+
className: oe,
|
|
303
306
|
children: /* @__PURE__ */ e(V, {
|
|
304
|
-
onPress:
|
|
305
|
-
"aria-label":
|
|
307
|
+
onPress: v,
|
|
308
|
+
"aria-label": (_t_closeButtonLabel = t.closeButtonLabel) !== null && _t_closeButtonLabel !== void 0 ? _t_closeButtonLabel : u.modalClose || u.closeButtonLabel,
|
|
306
309
|
bleedLeft: !0,
|
|
307
310
|
bleedRight: !0,
|
|
308
311
|
bleedY: !0,
|
|
309
312
|
Icon: F
|
|
310
313
|
})
|
|
311
314
|
}),
|
|
312
|
-
/* @__PURE__ */ e(
|
|
315
|
+
/* @__PURE__ */ e(ue, _object_spread_props(_object_spread({}, I), {
|
|
313
316
|
showAcceptButton: t.type !== "dialog" || !!t.onAccept,
|
|
314
317
|
showCancelButton: t.type === "confirm" || t.type === "dialog" && !!t.onCancel,
|
|
315
|
-
onCancel:
|
|
318
|
+
onCancel: b,
|
|
316
319
|
onAccept: N
|
|
317
320
|
}))
|
|
318
321
|
]
|