@telefonica/mistica 14.24.1 → 14.26.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/accordion.css-mistica.js +41 -0
- package/dist/accordion.css.d.ts +12 -0
- package/dist/accordion.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/accordion.d.ts +47 -0
- package/dist/accordion.js +350 -0
- package/dist/boxed.d.ts +1 -0
- package/dist/boxed.js +17 -16
- package/dist/card.js +345 -345
- package/dist/carousel.js +58 -52
- package/dist/checkbox.css.d.ts +1 -1
- package/dist/checkbox.d.ts +3 -1
- package/dist/checkbox.js +23 -22
- package/dist/community/blocks.js +3 -2
- package/dist/form-context.d.ts +9 -9
- package/dist/generated/mistica-icons/icons-keywords.d.ts +4 -0
- package/dist/icons/icon-chevron.d.ts +1 -0
- package/dist/icons/icon-chevron.js +21 -18
- package/dist/index.d.ts +5 -2
- package/dist/index.js +34 -4
- package/dist/integer-field.d.ts +5 -1
- package/dist/integer-field.js +12 -11
- package/dist/list.d.ts +8 -0
- package/dist/list.js +3 -0
- package/dist/menu.css-mistica.js +30 -6
- package/dist/menu.css.d.ts +14 -2
- package/dist/menu.d.ts +25 -3
- package/dist/menu.js +264 -84
- package/dist/overlay.js +11 -52
- package/dist/overscroll-color-context.js +23 -11
- package/dist/package-version.js +1 -1
- package/dist/pin-field.css-mistica.js +37 -0
- package/dist/pin-field.css.d.ts +7 -0
- package/dist/pin-field.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/pin-field.d.ts +25 -0
- package/dist/pin-field.js +269 -0
- package/dist/progress-bar.css-mistica.js +7 -4
- package/dist/progress-bar.css.d.ts +1 -0
- package/dist/progress-bar.d.ts +12 -3
- package/dist/progress-bar.js +109 -13
- package/dist/skins/telefonica.js +2 -2
- package/dist/skins/vivo-new.js +1 -1
- package/dist/slider.css-mistica.js +42 -0
- package/dist/slider.css.d.ts +9 -0
- package/dist/slider.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/slider.d.ts +14 -0
- package/dist/slider.js +170 -0
- package/dist/stepper.js +34 -27
- package/dist/text-field-base.css.d.ts +2 -0
- package/dist/text-field-base.d.ts +1 -0
- package/dist/text-field-components.js +28 -26
- package/dist/text-field.d.ts +1 -0
- package/dist/theme.d.ts +3 -0
- package/dist/theme.js +24 -12
- package/dist/tooltip.css-mistica.js +10 -7
- package/dist/tooltip.css.d.ts +1 -0
- package/dist/tooltip.d.ts +2 -1
- package/dist/tooltip.js +37 -36
- package/dist/touchable.js +5 -4
- package/dist/utils/locale.d.ts +1 -1
- package/dist/video.js +8 -9
- package/dist-es/accordion.css-mistica.js +9 -0
- package/dist-es/accordion.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/accordion.js +280 -0
- package/dist-es/boxed.js +25 -24
- package/dist-es/card.js +475 -475
- package/dist-es/carousel.js +95 -89
- package/dist-es/checkbox.js +42 -41
- package/dist-es/community/blocks.js +2 -1
- package/dist-es/icons/icon-chevron.js +25 -22
- package/dist-es/index.js +1768 -1765
- package/dist-es/integer-field.js +14 -13
- package/dist-es/list.js +9 -9
- package/dist-es/menu.css-mistica.js +10 -4
- package/dist-es/menu.js +262 -93
- package/dist-es/overlay.js +18 -20
- package/dist-es/overscroll-color-context.js +30 -18
- package/dist-es/package-version.js +1 -1
- package/dist-es/pin-field.css-mistica.js +5 -0
- package/dist-es/pin-field.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/pin-field.js +217 -0
- package/dist-es/progress-bar.css-mistica.js +2 -2
- package/dist-es/progress-bar.js +67 -18
- package/dist-es/skins/telefonica.js +2 -2
- package/dist-es/skins/vivo-new.js +1 -1
- package/dist-es/slider.css-mistica.js +10 -0
- package/dist-es/slider.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/slider.js +117 -0
- package/dist-es/stepper.js +61 -54
- package/dist-es/style.css +1 -1
- package/dist-es/text-field-components.js +38 -36
- package/dist-es/theme.js +24 -12
- package/dist-es/tooltip.css-mistica.js +3 -3
- package/dist-es/tooltip.js +65 -64
- package/dist-es/touchable.js +9 -8
- package/dist-es/video.js +16 -17
- package/package.json +1 -1
|
@@ -50,93 +50,95 @@ function _object_spread_props(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import { jsxs as c, jsx as
|
|
53
|
+
import { jsxs as c, jsx as t, Fragment as g } from "react/jsx-runtime";
|
|
54
54
|
import * as u from "react";
|
|
55
55
|
import a from "classnames";
|
|
56
56
|
import { useIsInverseVariant as y } from "./theme-variant-context.js";
|
|
57
|
-
import { useTheme as
|
|
57
|
+
import { useTheme as C } from "./hooks.js";
|
|
58
58
|
import { Text1 as h } from "./text.js";
|
|
59
|
-
import { labelContainer as
|
|
59
|
+
import { labelContainer as S, shrinked as k, labelText as I, helperText as p, leftText as F, rightText as E, fieldContainer as L, fullWidth as W, normalWidth as j, disabled as w, field as O, fieldMulti as P, fieldSingle as V, helperContainer as A } from "./text-field-components.css-mistica.js";
|
|
60
60
|
import { sprinkles as x } from "./sprinkles.css-mistica.js";
|
|
61
61
|
import { vars as e } from "./skins/skin-contract.css-mistica.js";
|
|
62
|
-
const
|
|
63
|
-
let { shrinkLabel:
|
|
64
|
-
const m =
|
|
62
|
+
const G = (param)=>{
|
|
63
|
+
let { shrinkLabel: l , forId: s , inputState: r , error: o , children: i , style: n , optional: d } = param;
|
|
64
|
+
const m = l || r === "focused" || r === "filled", [v, b] = u.useState("initial"), { texts: N } = C();
|
|
65
65
|
u.useEffect(()=>{
|
|
66
|
-
const
|
|
67
|
-
process.env.NODE_ENV !== "test" &&
|
|
66
|
+
const T = setTimeout(()=>{
|
|
67
|
+
process.env.NODE_ENV !== "test" && b("transform 150ms, width 150ms");
|
|
68
68
|
});
|
|
69
69
|
return ()=>{
|
|
70
|
-
clearTimeout(
|
|
70
|
+
clearTimeout(T);
|
|
71
71
|
};
|
|
72
72
|
}, []);
|
|
73
73
|
let f = e.colors.textSecondary;
|
|
74
|
-
return
|
|
75
|
-
className: a(
|
|
76
|
-
[
|
|
74
|
+
return o && r !== "default" ? f = e.colors.error : r === "focused" && (f = e.colors.controlActivated), /* @__PURE__ */ c("label", {
|
|
75
|
+
className: a(S, {
|
|
76
|
+
[k]: m
|
|
77
77
|
}, x({
|
|
78
78
|
color: f
|
|
79
79
|
})),
|
|
80
|
-
htmlFor:
|
|
80
|
+
htmlFor: s,
|
|
81
81
|
style: _object_spread_props(_object_spread({}, n), {
|
|
82
82
|
transition: v
|
|
83
83
|
}),
|
|
84
84
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
className:
|
|
85
|
+
/* @__PURE__ */ t("span", {
|
|
86
|
+
className: I,
|
|
87
87
|
children: i
|
|
88
88
|
}),
|
|
89
89
|
d ? /* @__PURE__ */ c("span", {
|
|
90
90
|
children: [
|
|
91
91
|
"\xa0(",
|
|
92
|
-
|
|
92
|
+
N.formFieldOptionalLabelSuffix,
|
|
93
93
|
")"
|
|
94
94
|
]
|
|
95
95
|
}) : null
|
|
96
96
|
]
|
|
97
97
|
});
|
|
98
|
-
},
|
|
99
|
-
let { leftText:
|
|
100
|
-
const
|
|
101
|
-
return /* @__PURE__ */ c(
|
|
102
|
-
className: I,
|
|
98
|
+
}, J = (param)=>{
|
|
99
|
+
let { leftText: l , rightText: s , error: r } = param;
|
|
100
|
+
const o = y(), i = o ? e.colors.textPrimaryInverse : r ? e.colors.error : e.colors.textSecondary, n = o ? e.colors.textPrimaryInverse : e.colors.textSecondary;
|
|
101
|
+
return /* @__PURE__ */ c(g, {
|
|
103
102
|
children: [
|
|
104
|
-
|
|
105
|
-
className: a(p,
|
|
106
|
-
children: /* @__PURE__ */
|
|
103
|
+
l && /* @__PURE__ */ t("div", {
|
|
104
|
+
className: a(p, F),
|
|
105
|
+
children: /* @__PURE__ */ t(h, {
|
|
107
106
|
color: i,
|
|
108
107
|
regular: !0,
|
|
109
108
|
as: "p",
|
|
110
|
-
children:
|
|
109
|
+
children: l
|
|
111
110
|
})
|
|
112
111
|
}),
|
|
113
|
-
|
|
114
|
-
className: a(p,
|
|
115
|
-
children: /* @__PURE__ */
|
|
112
|
+
s && /* @__PURE__ */ t("div", {
|
|
113
|
+
className: a(p, E),
|
|
114
|
+
children: /* @__PURE__ */ t(h, {
|
|
116
115
|
color: n,
|
|
117
116
|
regular: !0,
|
|
118
117
|
as: "p",
|
|
119
|
-
children:
|
|
118
|
+
children: s
|
|
120
119
|
})
|
|
121
120
|
})
|
|
122
121
|
]
|
|
123
122
|
});
|
|
124
|
-
},
|
|
125
|
-
let { multiline:
|
|
123
|
+
}, K = (param)=>/* @__PURE__ */ {
|
|
124
|
+
let { multiline: l , disabled: s , children: r , helperText: o , className: i , fieldRef: n , fullWidth: d , readOnly: m } = param;
|
|
126
125
|
return c("div", {
|
|
127
126
|
className: a(L, d ? W : j, {
|
|
128
|
-
[w]:
|
|
127
|
+
[w]: s
|
|
129
128
|
}),
|
|
130
129
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
className: a(O,
|
|
130
|
+
/* @__PURE__ */ t("div", {
|
|
131
|
+
className: a(O, l ? P : V, x({
|
|
133
132
|
background: m ? e.colors.neutralLow : e.colors.backgroundContainer
|
|
134
133
|
}), i),
|
|
135
134
|
ref: n,
|
|
136
135
|
children: r
|
|
137
136
|
}),
|
|
138
|
-
|
|
137
|
+
o && /* @__PURE__ */ t("div", {
|
|
138
|
+
className: A,
|
|
139
|
+
children: o
|
|
140
|
+
})
|
|
139
141
|
]
|
|
140
142
|
});
|
|
141
143
|
};
|
|
142
|
-
export {
|
|
144
|
+
export { K as FieldContainer, J as HelperText, G as Label };
|
package/dist-es/theme.js
CHANGED
|
@@ -111,7 +111,10 @@ const l = {
|
|
|
111
111
|
carouselPrevButton: "anterior",
|
|
112
112
|
playIconButtonLabel: "Reproducir",
|
|
113
113
|
pauseIconButtonLabel: "Pausar",
|
|
114
|
-
sheetConfirmButton: "Continuar"
|
|
114
|
+
sheetConfirmButton: "Continuar",
|
|
115
|
+
progressBarCompletedLabel: "completo",
|
|
116
|
+
progressBarStepLabel: "Paso 1$s de 2$s",
|
|
117
|
+
pinFieldInputLabel: "D\xedgito 1$s de 2$s"
|
|
115
118
|
}, i = {
|
|
116
119
|
expirationDatePlaceholder: "MM/YY",
|
|
117
120
|
togglePasswordVisibilityLabel: "Toggle password visibility",
|
|
@@ -145,8 +148,11 @@ const l = {
|
|
|
145
148
|
carouselPrevButton: "previous",
|
|
146
149
|
playIconButtonLabel: "Play",
|
|
147
150
|
pauseIconButtonLabel: "Pause",
|
|
148
|
-
sheetConfirmButton: "Continue"
|
|
149
|
-
|
|
151
|
+
sheetConfirmButton: "Continue",
|
|
152
|
+
progressBarCompletedLabel: "completed",
|
|
153
|
+
progressBarStepLabel: "Step 1$s of 2$s",
|
|
154
|
+
pinFieldInputLabel: "Digit 1$s of 2$s"
|
|
155
|
+
}, s = {
|
|
150
156
|
expirationDatePlaceholder: "MM/JJ",
|
|
151
157
|
togglePasswordVisibilityLabel: "Passwort un-/sichtbar machen",
|
|
152
158
|
loading: "Wird gespeichert",
|
|
@@ -179,8 +185,11 @@ const l = {
|
|
|
179
185
|
carouselPrevButton: "vorherige",
|
|
180
186
|
playIconButtonLabel: "Abspielen",
|
|
181
187
|
pauseIconButtonLabel: "Pausieren",
|
|
182
|
-
sheetConfirmButton: "Fortfahren"
|
|
183
|
-
|
|
188
|
+
sheetConfirmButton: "Fortfahren",
|
|
189
|
+
progressBarCompletedLabel: "vollendet",
|
|
190
|
+
progressBarStepLabel: "Schritt 1$s von 2$s",
|
|
191
|
+
pinFieldInputLabel: "Ziffer 1$s von 2$s"
|
|
192
|
+
}, d = {
|
|
184
193
|
expirationDatePlaceholder: "MM/AA",
|
|
185
194
|
togglePasswordVisibilityLabel: "Mostrar ou ocultar senha",
|
|
186
195
|
loading: "Carregando",
|
|
@@ -213,15 +222,18 @@ const l = {
|
|
|
213
222
|
carouselPrevButton: "anterior",
|
|
214
223
|
playIconButtonLabel: "Reproduzir",
|
|
215
224
|
pauseIconButtonLabel: "Pausar",
|
|
216
|
-
sheetConfirmButton: "Continuar"
|
|
217
|
-
|
|
225
|
+
sheetConfirmButton: "Continuar",
|
|
226
|
+
progressBarCompletedLabel: "conclu\xeddo",
|
|
227
|
+
progressBarStepLabel: "Etapa 1$s de 2$s",
|
|
228
|
+
pinFieldInputLabel: "D\xedgito 1$s de 2$s"
|
|
229
|
+
}, v = (e)=>{
|
|
218
230
|
switch(e.toLocaleLowerCase().split(/[-_]/)[0]){
|
|
219
231
|
case "es":
|
|
220
232
|
return l;
|
|
221
233
|
case "pt":
|
|
222
|
-
return s;
|
|
223
|
-
case "de":
|
|
224
234
|
return d;
|
|
235
|
+
case "de":
|
|
236
|
+
return s;
|
|
225
237
|
case "en":
|
|
226
238
|
return i;
|
|
227
239
|
default:
|
|
@@ -262,7 +274,7 @@ const l = {
|
|
|
262
274
|
children: t
|
|
263
275
|
}))
|
|
264
276
|
});
|
|
265
|
-
},
|
|
277
|
+
}, g = (e)=>(_param)=>/* @__PURE__ */ {
|
|
266
278
|
var { to: r , innerRef: o , children: t } = _param, n = _object_without_properties(_param, [
|
|
267
279
|
"to",
|
|
268
280
|
"innerRef",
|
|
@@ -285,10 +297,10 @@ const l = {
|
|
|
285
297
|
case "Next12":
|
|
286
298
|
return p(e.Component);
|
|
287
299
|
case "Next13":
|
|
288
|
-
return
|
|
300
|
+
return g(e.Component);
|
|
289
301
|
default:
|
|
290
302
|
const r = e.type;
|
|
291
303
|
throw new Error(`Invalid Link type: ${r}`);
|
|
292
304
|
}
|
|
293
305
|
};
|
|
294
|
-
export { u as NAVBAR_HEIGHT_DESKTOP, c as NAVBAR_HEIGHT_MOBILE, E as dimensions, h as getMisticaLinkComponent,
|
|
306
|
+
export { u as NAVBAR_HEIGHT_DESKTOP, c as NAVBAR_HEIGHT_MOBILE, E as dimensions, h as getMisticaLinkComponent, v as getTexts };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./tooltip.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var v = "_1xhatbpb _1y2v1nfb1 _1y2v1nfec _1y2v1nfbz _1y2v1nfcf _1y2v1nfdq _1y2v1nf31 _1y2v1nfdn", t = "_1xhatbpe", n = "_1xhatbpf", _ = "_1xhatbpd", e = "_1xhatbpc", f = "_1y2v1nfb1 _1y2v1nfc2 _1y2v1nfcf _1y2v1nfe6 _1y2v1nf2", p = "_1xhatbpj _1y2v1nf68 _1y2v1nf7h _1y2v1nf8q _1y2v1nf9z _1y2v1nfb1 _1y2v1nfew _1y2v1nfbu _1y2v1nfdz _1y2v1nfdn", b = "
|
|
3
|
+
var v = "_1xhatbpb _1y2v1nfb1 _1y2v1nfec _1y2v1nfbz _1y2v1nfcf _1y2v1nfdq _1y2v1nf31 _1y2v1nfdn", t = "_1xhatbpe", n = "_1xhatbpf", _ = "_1xhatbpd", e = "_1xhatbpc", f = "_1y2v1nfb1 _1y2v1nfc2 _1y2v1nfcf _1y2v1nfe6 _1y2v1nf2", p = "_1xhatbpj _1y2v1nf68 _1y2v1nf7h _1y2v1nf8q _1y2v1nf9z _1y2v1nfb1 _1y2v1nfew _1y2v1nfbu _1y2v1nfdz _1y2v1nfdn", b = "_1xhatbpm", x = "_1xhatbpn", h = "_1xhatbpo", o = "_1xhatbpp", y = "_1xhatbpq", i = "_1xhatbp6", m = "_1xhatbp7", w = "_1xhatbp8", d = "_1xhatbpk", c = "_1xhatbpl", s = {
|
|
4
4
|
shadowAlpha: "var(--_1xhatbp0)",
|
|
5
5
|
enterTransform: "var(--_1xhatbp1)",
|
|
6
6
|
enterDoneTransform: "var(--_1xhatbp2)",
|
|
7
7
|
exitTransform: "var(--_1xhatbp3)",
|
|
8
8
|
enterActiveAnimationName: "var(--_1xhatbp4)",
|
|
9
9
|
arrowBoxShadow: "var(--_1xhatbp5)"
|
|
10
|
-
},
|
|
11
|
-
export { v as arrow, t as arrowBottom, n as arrowLeft, _ as arrowRight, e as arrowTop, f as arrowWrapper, p as container, b as enter,
|
|
10
|
+
}, A = "_1y2v1nfb7";
|
|
11
|
+
export { v as arrow, t as arrowBottom, n as arrowLeft, _ as arrowRight, e as arrowTop, f as arrowWrapper, p as container, b as enter, x as enterActive, h as enterDone, o as exit, y as exitActive, i as fadeInBottomKeyframes, m as fadeInTopKeyframes, w as fadeInXKeyframes, d as textAlign, c as textCenter, s as vars, A as wrapper };
|
package/dist-es/tooltip.js
CHANGED
|
@@ -77,22 +77,22 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
77
77
|
}
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
import { jsxs as P, Fragment as
|
|
80
|
+
import { jsxs as P, Fragment as et, jsx as w } from "react/jsx-runtime";
|
|
81
81
|
import * as o from "react";
|
|
82
82
|
import E from "classnames";
|
|
83
|
-
import { CSSTransition as
|
|
84
|
-
import { useTheme as
|
|
85
|
-
import { Portal as
|
|
86
|
-
import
|
|
83
|
+
import { CSSTransition as rt } from "react-transition-group";
|
|
84
|
+
import { useTheme as nt, useScreenSize as ot, useAriaId as it } from "./hooks.js";
|
|
85
|
+
import { Portal as at } from "./portal.js";
|
|
86
|
+
import ct from "./overlay.js";
|
|
87
87
|
import { Text2 as I } from "./text.js";
|
|
88
|
-
import { TAB as
|
|
89
|
-
import
|
|
90
|
-
import { vars as s, wrapper as
|
|
91
|
-
import { assignInlineVars as
|
|
92
|
-
import { getPrefixedDataAttributes as
|
|
93
|
-
import { isClientSide as
|
|
94
|
-
const
|
|
95
|
-
var { children: r , extra: N , description: S , target: k , title: Y , targetLabel: L , delay: V = !0 , dataAttributes: j , targetStyle: K , unstable_offsetX: f } = _param,
|
|
88
|
+
import { TAB as st } from "./utils/key-codes.js";
|
|
89
|
+
import ut from "./stack.js";
|
|
90
|
+
import { vars as s, wrapper as lt, enter as dt, enterActive as ft, enterDone as ht, exit as wt, exitActive as mt, container as pt, textAlign as gt, textCenter as xt, arrowWrapper as Tt, arrow as vt, fadeInTopKeyframes as bt, fadeInBottomKeyframes as At, fadeInXKeyframes as Pt, arrowTop as St, arrowBottom as Yt, arrowLeft as Ct, arrowRight as Ot } from "./tooltip.css-mistica.js";
|
|
91
|
+
import { assignInlineVars as Rt } from "@vanilla-extract/dynamic";
|
|
92
|
+
import { getPrefixedDataAttributes as yt } from "./utils/dom.js";
|
|
93
|
+
import { isClientSide as Dt, isServerSide as Wt } from "./utils/environment.js";
|
|
94
|
+
const $t = "bottom", Bt = "top", Et = 12, m = 4 + Et, It = 500, v = 12, Mt = 500, M = ()=>{}, Nt = (r)=>r === "bottom" ? `translateY(${v}px)` : r === "top" ? `translateY(calc(-100% - ${v}px))` : r === "right" ? `translateX(${v}px) translateY(-50%)` : r === "left" ? `translateX(-${v}px) translateY(-50%)` : `translateY(-${v}px)`, kt = (r)=>r === "top" ? "translateY(-100%)" : r === "bottom" ? "translateY(0)" : "translateY(-50%)", Lt = (r)=>r === "bottom" ? "translateY(0)" : r === "top" ? "translateY(-100%)" : r === "right" || r === "left" ? "translateX(0px) translateY(-50%)" : "translateY(0px)", Vt = (r)=>r === "top" ? bt : r === "bottom" ? At : Pt, jt = (r)=>r ? "1" : "0.2", Kt = (r)=>r === "top" ? `2px 2px 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : r === "right" ? `0 0 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : r === "left" ? `0 0 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : r === "bottom" ? `-1px -1px 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : "", zt = (_param)=>{
|
|
95
|
+
var { children: r , extra: N , description: S , target: k , title: Y , targetLabel: L , delay: V = !0 , dataAttributes: j , targetStyle: K , unstable_offsetX: f , textCenter: z } = _param, y = _object_without_properties(_param, [
|
|
96
96
|
"children",
|
|
97
97
|
"extra",
|
|
98
98
|
"description",
|
|
@@ -102,16 +102,17 @@ const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500
|
|
|
102
102
|
"delay",
|
|
103
103
|
"dataAttributes",
|
|
104
104
|
"targetStyle",
|
|
105
|
-
"unstable_offsetX"
|
|
105
|
+
"unstable_offsetX",
|
|
106
|
+
"textCenter"
|
|
106
107
|
]);
|
|
107
|
-
const { isDarkMode:
|
|
108
|
+
const { isDarkMode: F } = nt(), [a, C] = o.useState(!1), { isTabletOrSmaller: H } = ot(), D = it(), h = o.useRef(!1), c = o.useRef(null), g = o.useRef(null), O = o.useRef(null), x = o.useRef(null), t = o.useRef({
|
|
108
109
|
top: 0,
|
|
109
110
|
right: 0,
|
|
110
111
|
left: 0,
|
|
111
112
|
bottom: 0,
|
|
112
113
|
width: 0,
|
|
113
114
|
height: 0
|
|
114
|
-
}), [
|
|
115
|
+
}), [X, q] = o.useState({}), G = (n)=>H ? n || Bt : n || $t, [e, J] = o.useState(void 0), i = ((n)=>{
|
|
115
116
|
if (!e) return n;
|
|
116
117
|
const u = (d)=>{
|
|
117
118
|
const p = t.current.top > e.height;
|
|
@@ -123,28 +124,28 @@ const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500
|
|
|
123
124
|
left: t.current.left < e.width ? t.current.right + e.width > window.innerWidth ? t.current.top < e.height ? "bottom" : "top" : "right" : n,
|
|
124
125
|
bottom: t.current.bottom + e.height > window.innerHeight ? l("top") : l(n)
|
|
125
126
|
})[n];
|
|
126
|
-
})(
|
|
127
|
-
a &&
|
|
127
|
+
})(G(y.position)), R = Dt() ? window.matchMedia("(pointer: coarse)").matches : !1, W = ()=>{
|
|
128
|
+
a && C(!1);
|
|
128
129
|
};
|
|
129
130
|
o.useEffect(()=>(window.addEventListener("resize", W), ()=>{
|
|
130
131
|
window.removeEventListener("resize", W);
|
|
131
132
|
}));
|
|
132
133
|
const $ = ()=>{
|
|
133
|
-
|
|
134
|
+
C(!1);
|
|
134
135
|
}, T = ()=>{
|
|
135
|
-
|
|
136
|
-
},
|
|
136
|
+
O.current && (t.current = O.current.getBoundingClientRect(), C(!a));
|
|
137
|
+
}, Q = ()=>{
|
|
137
138
|
a || T();
|
|
138
|
-
}, Q = (n)=>{
|
|
139
|
-
n.keyCode === ct && $();
|
|
140
139
|
}, U = (n)=>{
|
|
140
|
+
n.keyCode === st && $();
|
|
141
|
+
}, Z = (n)=>{
|
|
141
142
|
if (!e) return {};
|
|
142
143
|
const u = e.width > t.current.width && t.current.left + t.current.width / 2 < e.width / 2 + 16 ? t.current.width / 2 : "50%";
|
|
143
144
|
return n === "bottom" || n === "top" ? {
|
|
144
145
|
left: u
|
|
145
146
|
} : {};
|
|
146
147
|
}, B = o.useCallback((n, u)=>{
|
|
147
|
-
if (
|
|
148
|
+
if (Wt() || !e) return {};
|
|
148
149
|
const l = e.width > t.current.width && t.current.left + t.current.width / 2 < e.width / 2 + 16 ? Math.round(e.width / 2 - t.current.width / 2) : 0, A = f || (u ? window.pageXOffset + t.current.left + t.current.width / 2 - u / 2 : window.pageXOffset + t.current.left + l + t.current.width / 2 - e.width / 2), d = t.current.left < e.width ? A : u ? t.current.left - u - m : t.current.left - e.width - m, p = t.current.left < e.width ? t.current.top < e.height ? window.pageYOffset + t.current.bottom + m : window.pageYOffset + t.current.top - m : f || window.pageYOffset + t.current.top + t.current.height / 2;
|
|
149
150
|
return ({
|
|
150
151
|
right: {
|
|
@@ -167,42 +168,42 @@ const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500
|
|
|
167
168
|
}, [
|
|
168
169
|
f,
|
|
169
170
|
e
|
|
170
|
-
]), b = (()=>
|
|
171
|
-
top:
|
|
172
|
-
bottom:
|
|
173
|
-
left:
|
|
174
|
-
right:
|
|
175
|
-
},
|
|
176
|
-
[s.enterTransform]:
|
|
177
|
-
[s.exitTransform]:
|
|
178
|
-
[s.enterActiveAnimationName]:
|
|
179
|
-
[s.enterDoneTransform]:
|
|
180
|
-
[s.shadowAlpha]:
|
|
181
|
-
[s.arrowBoxShadow]:
|
|
171
|
+
]), b = (()=>y.width)(), _ = {
|
|
172
|
+
top: St,
|
|
173
|
+
bottom: Yt,
|
|
174
|
+
left: Ct,
|
|
175
|
+
right: Ot
|
|
176
|
+
}, tt = i && Rt({
|
|
177
|
+
[s.enterTransform]: Nt(i),
|
|
178
|
+
[s.exitTransform]: Lt(i),
|
|
179
|
+
[s.enterActiveAnimationName]: Vt(i),
|
|
180
|
+
[s.enterDoneTransform]: kt(i),
|
|
181
|
+
[s.shadowAlpha]: jt(F),
|
|
182
|
+
[s.arrowBoxShadow]: Kt(i)
|
|
182
183
|
});
|
|
183
184
|
return o.useEffect(()=>{
|
|
184
|
-
i && x.current && a &&
|
|
185
|
+
i && x.current && a && q(B(i, b || 0));
|
|
185
186
|
}, [
|
|
186
187
|
a,
|
|
187
188
|
B,
|
|
188
189
|
i,
|
|
189
190
|
b
|
|
190
191
|
]), o.useEffect(()=>{
|
|
191
|
-
x.current && (x.current.getBoundingClientRect(), a &&
|
|
192
|
+
x.current && (x.current.getBoundingClientRect(), a && J(x.current.getBoundingClientRect()));
|
|
192
193
|
}, [
|
|
193
194
|
a
|
|
194
|
-
]), /* @__PURE__ */ P(
|
|
195
|
+
]), /* @__PURE__ */ P(et, {
|
|
195
196
|
children: [
|
|
196
197
|
/* @__PURE__ */ w("div", {
|
|
197
|
-
ref:
|
|
198
|
+
ref: O,
|
|
198
199
|
style: K,
|
|
199
|
-
className:
|
|
200
|
+
className: lt,
|
|
200
201
|
onPointerOver: ()=>{
|
|
201
202
|
c.current && (clearTimeout(c.current), c.current = null), !h.current && (h.current = !0, V ? g.current = setTimeout(()=>{
|
|
202
203
|
g.current = null, T();
|
|
203
|
-
},
|
|
204
|
+
}, Mt) : T());
|
|
204
205
|
},
|
|
205
|
-
onPointerLeave:
|
|
206
|
+
onPointerLeave: R ? M : ()=>{
|
|
206
207
|
if (g.current) {
|
|
207
208
|
clearTimeout(g.current), g.current = null, h.current = !1;
|
|
208
209
|
return;
|
|
@@ -211,8 +212,8 @@ const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500
|
|
|
211
212
|
h.current && (c.current = null, h.current = !1, T());
|
|
212
213
|
}, 100);
|
|
213
214
|
},
|
|
214
|
-
onFocus:
|
|
215
|
-
onKeyDown:
|
|
215
|
+
onFocus: Q,
|
|
216
|
+
onKeyDown: U,
|
|
216
217
|
"touch-action": "auto",
|
|
217
218
|
role: "button",
|
|
218
219
|
tabIndex: 0,
|
|
@@ -221,48 +222,48 @@ const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500
|
|
|
221
222
|
"aria-label": L,
|
|
222
223
|
children: k
|
|
223
224
|
}),
|
|
224
|
-
/* @__PURE__ */ P(
|
|
225
|
+
/* @__PURE__ */ P(at, {
|
|
225
226
|
children: [
|
|
226
|
-
a &&
|
|
227
|
+
a && R && /* @__PURE__ */ w(ct, {
|
|
227
228
|
onPress: $
|
|
228
229
|
}),
|
|
229
|
-
/* @__PURE__ */ w(
|
|
230
|
+
/* @__PURE__ */ w(rt, {
|
|
230
231
|
in: a,
|
|
231
|
-
timeout:
|
|
232
|
+
timeout: It,
|
|
232
233
|
classNames: {
|
|
233
|
-
enter:
|
|
234
|
-
enterActive:
|
|
235
|
-
enterDone:
|
|
236
|
-
exit:
|
|
237
|
-
exitActive:
|
|
234
|
+
enter: dt,
|
|
235
|
+
enterActive: ft,
|
|
236
|
+
enterDone: ht,
|
|
237
|
+
exit: wt,
|
|
238
|
+
exitActive: mt
|
|
238
239
|
},
|
|
239
240
|
unmountOnExit: !0,
|
|
240
241
|
children: /* @__PURE__ */ P("div", _object_spread_props(_object_spread({
|
|
241
242
|
ref: x
|
|
242
|
-
},
|
|
243
|
+
}, yt(j, "Tooltip")), {
|
|
243
244
|
role: "tooltip",
|
|
244
245
|
id: D,
|
|
245
|
-
className: E(
|
|
246
|
+
className: E(pt, gt, z ? xt : ""),
|
|
246
247
|
style: _object_spread({
|
|
247
248
|
width: b
|
|
248
|
-
},
|
|
249
|
+
}, X, tt),
|
|
249
250
|
onPointerOver: ()=>{
|
|
250
251
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
251
252
|
},
|
|
252
|
-
onPointerLeave:
|
|
253
|
+
onPointerLeave: R ? M : ()=>{
|
|
253
254
|
c.current = setTimeout(()=>{
|
|
254
255
|
h.current && (c.current = null, h.current = !1, T());
|
|
255
256
|
}, 100);
|
|
256
257
|
},
|
|
257
258
|
children: [
|
|
258
259
|
/* @__PURE__ */ w("div", {
|
|
259
|
-
style:
|
|
260
|
-
className: E(
|
|
260
|
+
style: Z(i),
|
|
261
|
+
className: E(Tt, _[i]),
|
|
261
262
|
children: /* @__PURE__ */ w("div", {
|
|
262
|
-
className:
|
|
263
|
+
className: vt
|
|
263
264
|
})
|
|
264
265
|
}),
|
|
265
|
-
(Y || S) && /* @__PURE__ */ P(
|
|
266
|
+
(Y || S) && /* @__PURE__ */ P(ut, {
|
|
266
267
|
space: 4,
|
|
267
268
|
children: [
|
|
268
269
|
Y && /* @__PURE__ */ w(I, {
|
|
@@ -283,5 +284,5 @@ const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500
|
|
|
283
284
|
})
|
|
284
285
|
]
|
|
285
286
|
});
|
|
286
|
-
},
|
|
287
|
-
export {
|
|
287
|
+
}, ae = zt;
|
|
288
|
+
export { ae as default };
|
package/dist-es/touchable.js
CHANGED
|
@@ -52,7 +52,7 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import { jsxs as I, jsx as l } from "react/jsx-runtime";
|
|
54
54
|
import * as c from "react";
|
|
55
|
-
import
|
|
55
|
+
import s from "classnames";
|
|
56
56
|
import A from "./screen-reader-only.js";
|
|
57
57
|
import { notTouchable as _, touchable as H, base as K } from "./touchable.css-mistica.js";
|
|
58
58
|
import { useTheme as j } from "./hooks.js";
|
|
@@ -75,13 +75,14 @@ const L = function(e) {
|
|
|
75
75
|
style: e.style,
|
|
76
76
|
role: e.role,
|
|
77
77
|
"aria-checked": e["aria-checked"],
|
|
78
|
+
"aria-disabled": e.disabled ? !0 : void 0,
|
|
78
79
|
"aria-controls": e["aria-controls"],
|
|
79
80
|
"aria-expanded": e["aria-expanded"],
|
|
80
81
|
"aria-hidden": e["aria-hidden"],
|
|
81
82
|
"aria-selected": e["aria-selected"],
|
|
82
83
|
"aria-live": e["aria-live"],
|
|
83
84
|
tabIndex: e.tabIndex
|
|
84
|
-
}, W(e.dataAttributes, "Touchable")), u = e.type ? e.type : "button", r = !!e.href && !!e.newTab, m = !r && !!e.href && !!e.loadOnTop,
|
|
85
|
+
}, W(e.dataAttributes, "Touchable")), u = e.type ? e.type : "button", r = !!e.href && !!e.newTab, m = !r && !!e.href && !!e.loadOnTop, b = (a)=>{
|
|
85
86
|
e.stopPropagation && a.stopPropagation();
|
|
86
87
|
}, h = (a)=>{
|
|
87
88
|
e.onPress && e.onPress(a);
|
|
@@ -90,15 +91,15 @@ const L = function(e) {
|
|
|
90
91
|
f.current = !1, a();
|
|
91
92
|
}));
|
|
92
93
|
}, x = (a)=>{
|
|
93
|
-
if (
|
|
94
|
+
if (b(a), !i.length) {
|
|
94
95
|
h(a);
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
98
|
g(()=>h(a));
|
|
98
99
|
}, R = (a)=>{
|
|
99
|
-
|
|
100
|
+
b(a), i.length && (a.preventDefault(), g(()=>L(k(), r, m)));
|
|
100
101
|
}, D = (a)=>{
|
|
101
|
-
|
|
102
|
+
b(a), y();
|
|
102
103
|
}, w = (a)=>{
|
|
103
104
|
(a.keyCode === S || a.keyCode === V) && (a.preventDefault(), a.currentTarget.click());
|
|
104
105
|
};
|
|
@@ -153,14 +154,14 @@ const L = function(e) {
|
|
|
153
154
|
}
|
|
154
155
|
return /* @__PURE__ */ l("div", _object_spread_props(_object_spread({}, n), {
|
|
155
156
|
ref: t,
|
|
156
|
-
className:
|
|
157
|
+
className: s(n.className, _),
|
|
157
158
|
children: o
|
|
158
159
|
}));
|
|
159
160
|
}), $ = /*#__PURE__*/ c.forwardRef((e, t)=>/* @__PURE__ */ l(T, _object_spread_props(_object_spread({}, e), {
|
|
160
|
-
className:
|
|
161
|
+
className: s(H, e.className),
|
|
161
162
|
ref: t
|
|
162
163
|
}))), X = /*#__PURE__*/ c.forwardRef((e, t)=>/* @__PURE__ */ l(T, _object_spread_props(_object_spread({}, e), {
|
|
163
|
-
className:
|
|
164
|
+
className: s(K, e.className),
|
|
164
165
|
ref: t
|
|
165
166
|
}))), Y = $;
|
|
166
167
|
export { X as BaseTouchable, Y as default };
|