@telefonica/mistica 14.21.0 → 14.22.1
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/card.d.ts +2 -1
- package/dist/card.js +74 -74
- package/dist/community/advanced-data-card.css-mistica.js +19 -16
- package/dist/community/advanced-data-card.css.d.ts +2 -1
- package/dist/community/advanced-data-card.js +106 -102
- package/dist/community/blocks.js +14 -14
- package/dist/date-time-field.js +13 -9
- package/dist/form.js +15 -15
- package/dist/generated/mistica-icons/icon-add-more-location-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-add-more-location-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-add-more-query-light.js +1 -1
- package/dist/generated/mistica-icons/icon-adn-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-adn-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-alarm-light-cross-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-alarm-light-cross-light.js +1 -1
- package/dist/generated/mistica-icons/icon-ambulance-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-ambulance-light.js +1 -1
- package/dist/generated/mistica-icons/icon-ambulance-regular.js +5 -5
- package/dist/generated/mistica-icons/icon-api-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-api-light.js +1 -1
- package/dist/generated/mistica-icons/icon-arrow-down-left-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-arrow-down-light.js +1 -1
- package/dist/generated/mistica-icons/icon-arrow-down-right-light.js +1 -1
- package/dist/generated/mistica-icons/icon-bell-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-bicycle-bike-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-blog-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-boat-light.js +1 -1
- package/dist/generated/mistica-icons/icon-book-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-book-light.js +3 -3
- package/dist/generated/mistica-icons/icon-bug-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-calendar-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-data-shield-regular.js +15 -15
- package/dist/generated/mistica-icons/icon-database-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-delivery-van-moving-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-diamond-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-disconnect-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-dollar-symbol-circle-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-dollar-symbol-circle-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-dollar-symbol-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-dollar-symbol-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-download-app-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-download-app-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-drink-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-drink-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-dumbbell-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-dumbbell-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-eco-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-eco-regular.js +1 -1
- package/dist/generated/mistica-icons/icon-edit-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-email-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-emergency-cross-with-circle-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-error-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-esim-filled.js +32 -11
- package/dist/generated/mistica-icons/icon-esim-light.js +31 -10
- package/dist/generated/mistica-icons/icon-esim-regular.js +31 -10
- package/dist/generated/mistica-icons/icon-euro-symbol-circle-filled.js +3 -3
- package/dist/generated/mistica-icons/icon-euro-symbol-filled.js +1 -1
- package/dist/generated/mistica-icons/icon-funnel-filled.js +21 -10
- package/dist/generated/mistica-icons/icon-funnel-light.js +19 -8
- package/dist/generated/mistica-icons/icon-funnel-regular.js +21 -10
- package/dist/generated/mistica-icons/icon-poison-regular.js +3 -3
- package/dist/generated/mistica-icons/icon-price-drop-light.js +4 -4
- package/dist/generated/mistica-icons/icon-search-file-filled.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/logo.css-mistica.js +12 -0
- package/dist/logo.css.d.ts +1 -0
- package/dist/logo.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/logo.d.ts +3 -1
- package/dist/logo.js +94 -84
- package/dist/navigation-bar.css-mistica.js +46 -31
- package/dist/navigation-bar.css.d.ts +8 -5
- package/dist/navigation-bar.d.ts +4 -0
- package/dist/navigation-bar.js +204 -187
- package/dist/overscroll-color-context.js +1 -1
- package/dist/package-version.js +1 -1
- package/dist/sheet-root.js +118 -107
- package/dist/text.d.ts +1 -1
- package/dist/text.js +23 -23
- package/dist/theme.d.ts +1 -0
- package/dist/tooltip.css-mistica.js +10 -7
- package/dist/tooltip.css.d.ts +2 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +113 -77
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.js +56 -40
- package/dist-es/card.js +74 -74
- package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
- package/dist-es/community/advanced-data-card.js +130 -126
- package/dist-es/community/blocks.js +25 -25
- package/dist-es/date-time-field.js +18 -14
- package/dist-es/form.js +15 -15
- package/dist-es/generated/mistica-icons/icon-add-more-location-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-add-more-location-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-add-more-query-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-adn-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-adn-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-alarm-light-cross-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-alarm-light-cross-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-ambulance-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-ambulance-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-ambulance-regular.js +6 -6
- package/dist-es/generated/mistica-icons/icon-api-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-api-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-arrow-down-left-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-arrow-down-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-arrow-down-right-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-bell-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-bicycle-bike-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-blog-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-boat-light.js +1 -1
- package/dist-es/generated/mistica-icons/icon-book-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-book-light.js +3 -3
- package/dist-es/generated/mistica-icons/icon-bug-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-calendar-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-data-shield-regular.js +15 -15
- package/dist-es/generated/mistica-icons/icon-database-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-delivery-van-moving-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-diamond-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-disconnect-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-dollar-symbol-circle-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-dollar-symbol-circle-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-dollar-symbol-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-dollar-symbol-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-download-app-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-download-app-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-drink-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-drink-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-dumbbell-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-dumbbell-regular.js +6 -6
- package/dist-es/generated/mistica-icons/icon-eco-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-eco-regular.js +1 -1
- package/dist-es/generated/mistica-icons/icon-edit-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-email-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-emergency-cross-with-circle-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-error-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-esim-filled.js +38 -17
- package/dist-es/generated/mistica-icons/icon-esim-light.js +38 -17
- package/dist-es/generated/mistica-icons/icon-esim-regular.js +37 -16
- package/dist-es/generated/mistica-icons/icon-euro-symbol-circle-filled.js +3 -3
- package/dist-es/generated/mistica-icons/icon-euro-symbol-filled.js +1 -1
- package/dist-es/generated/mistica-icons/icon-funnel-filled.js +25 -14
- package/dist-es/generated/mistica-icons/icon-funnel-light.js +23 -12
- package/dist-es/generated/mistica-icons/icon-funnel-regular.js +23 -12
- package/dist-es/generated/mistica-icons/icon-poison-regular.js +3 -3
- package/dist-es/generated/mistica-icons/icon-price-drop-light.js +4 -4
- package/dist-es/generated/mistica-icons/icon-search-file-filled.js +1 -1
- package/dist-es/index.js +1677 -1676
- package/dist-es/logo.css-mistica.js +3 -0
- package/dist-es/logo.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/logo.js +94 -84
- package/dist-es/navigation-bar.css-mistica.js +21 -15
- package/dist-es/navigation-bar.js +251 -234
- package/dist-es/overscroll-color-context.js +1 -1
- package/dist-es/package-version.js +1 -1
- package/dist-es/sheet-root.js +121 -110
- package/dist-es/style.css +1 -1
- package/dist-es/text.js +21 -21
- package/dist-es/tooltip.css-mistica.js +3 -3
- package/dist-es/tooltip.js +143 -107
- package/dist-es/utils/dom.js +46 -33
- package/package.json +1 -1
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
|
|
81
|
-
import * as
|
|
82
|
-
import
|
|
83
|
-
import { CSSTransition as
|
|
84
|
-
import { useTheme as
|
|
85
|
-
import { Portal as
|
|
86
|
-
import
|
|
87
|
-
import { Text2 as
|
|
88
|
-
import { TAB as
|
|
89
|
-
import
|
|
90
|
-
import { vars as
|
|
91
|
-
import { assignInlineVars as
|
|
92
|
-
import { getPrefixedDataAttributes as
|
|
93
|
-
import { isClientSide as
|
|
94
|
-
const
|
|
95
|
-
var { children:
|
|
80
|
+
import { jsxs as P, Fragment as tt, jsx as w } from "react/jsx-runtime";
|
|
81
|
+
import * as o from "react";
|
|
82
|
+
import E from "classnames";
|
|
83
|
+
import { CSSTransition as et } from "react-transition-group";
|
|
84
|
+
import { useTheme as rt, useScreenSize as nt, useAriaId as ot } from "./hooks.js";
|
|
85
|
+
import { Portal as it } from "./portal.js";
|
|
86
|
+
import at from "./overlay.js";
|
|
87
|
+
import { Text2 as I } from "./text.js";
|
|
88
|
+
import { TAB as ct } from "./utils/key-codes.js";
|
|
89
|
+
import st from "./stack.js";
|
|
90
|
+
import { vars as s, wrapper as ut, enter as lt, enterActive as dt, enterDone as ft, exit as ht, exitActive as wt, container as mt, textAlign as pt, arrowWrapper as gt, arrow as xt, fadeInTopKeyframes as Tt, fadeInBottomKeyframes as vt, fadeInXKeyframes as bt, arrowTop as At, arrowBottom as Pt, arrowLeft as St, arrowRight as Yt } from "./tooltip.css-mistica.js";
|
|
91
|
+
import { assignInlineVars as Ot } from "@vanilla-extract/dynamic";
|
|
92
|
+
import { getPrefixedDataAttributes as Rt } from "./utils/dom.js";
|
|
93
|
+
import { isClientSide as yt, isServerSide as Ct } from "./utils/environment.js";
|
|
94
|
+
const Dt = "bottom", Wt = "top", $t = 12, m = 4 + $t, Bt = 500, v = 12, Et = 500, M = ()=>{}, It = (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)`, Mt = (r)=>r === "top" ? "translateY(-100%)" : r === "bottom" ? "translateY(0)" : "translateY(-50%)", Nt = (r)=>r === "bottom" ? "translateY(0)" : r === "top" ? "translateY(-100%)" : r === "right" || r === "left" ? "translateX(0px) translateY(-50%)" : "translateY(0px)", kt = (r)=>r === "top" ? Tt : r === "bottom" ? vt : bt, Lt = (r)=>r ? "1" : "0.2", Vt = (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})` : "", jt = (_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 } = _param, C = _object_without_properties(_param, [
|
|
96
96
|
"children",
|
|
97
97
|
"extra",
|
|
98
98
|
"description",
|
|
@@ -100,146 +100,182 @@ const xt = "bottom", Tt = "top", bt = 12, h = 4 + bt, g = 16, vt = 340, At = 500
|
|
|
100
100
|
"title",
|
|
101
101
|
"targetLabel",
|
|
102
102
|
"delay",
|
|
103
|
-
"dataAttributes"
|
|
103
|
+
"dataAttributes",
|
|
104
|
+
"targetStyle",
|
|
105
|
+
"unstable_offsetX"
|
|
104
106
|
]);
|
|
105
|
-
const { isDarkMode:
|
|
107
|
+
const { isDarkMode: z } = rt(), [a, O] = o.useState(!1), { isTabletOrSmaller: F } = nt(), D = ot(), h = o.useRef(!1), c = o.useRef(null), g = o.useRef(null), R = o.useRef(null), x = o.useRef(null), t = o.useRef({
|
|
106
108
|
top: 0,
|
|
107
109
|
right: 0,
|
|
108
110
|
left: 0,
|
|
109
111
|
bottom: 0,
|
|
110
112
|
width: 0,
|
|
111
113
|
height: 0
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
}), [H, X] = o.useState({}), q = (n)=>F ? n || Wt : n || Dt, [e, G] = o.useState(void 0), i = ((n)=>{
|
|
115
|
+
if (!e) return n;
|
|
116
|
+
const u = (d)=>{
|
|
117
|
+
const p = t.current.top > e.height;
|
|
118
|
+
return t.current.left < e.width ? p ? "top" : "bottom" : d;
|
|
119
|
+
}, l = (d)=>t.current.right + e.width > window.innerWidth ? u("left") : d;
|
|
120
|
+
return ({
|
|
121
|
+
top: t.current.top < e.height ? l("bottom") : l(n),
|
|
122
|
+
right: l(n),
|
|
123
|
+
left: t.current.left < e.width ? t.current.right + e.width > window.innerWidth ? t.current.top < e.height ? "bottom" : "top" : "right" : n,
|
|
124
|
+
bottom: t.current.bottom + e.height > window.innerHeight ? l("top") : l(n)
|
|
125
|
+
})[n];
|
|
126
|
+
})(q(C.position)), y = yt() ? window.matchMedia("(pointer: coarse)").matches : !1, W = ()=>{
|
|
127
|
+
a && O(!1);
|
|
117
128
|
};
|
|
118
|
-
|
|
119
|
-
window.removeEventListener("resize",
|
|
129
|
+
o.useEffect(()=>(window.addEventListener("resize", W), ()=>{
|
|
130
|
+
window.removeEventListener("resize", W);
|
|
120
131
|
}));
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
},
|
|
132
|
+
const $ = ()=>{
|
|
133
|
+
O(!1);
|
|
134
|
+
}, T = ()=>{
|
|
135
|
+
R.current && (t.current = R.current.getBoundingClientRect(), O(!a));
|
|
136
|
+
}, J = ()=>{
|
|
137
|
+
a || T();
|
|
138
|
+
}, Q = (n)=>{
|
|
139
|
+
n.keyCode === ct && $();
|
|
140
|
+
}, U = (n)=>{
|
|
141
|
+
if (!e) return {};
|
|
142
|
+
const u = e.width > t.current.width && t.current.left + t.current.width / 2 < e.width / 2 + 16 ? t.current.width / 2 : "50%";
|
|
143
|
+
return n === "bottom" || n === "top" ? {
|
|
144
|
+
left: u
|
|
145
|
+
} : {};
|
|
146
|
+
}, B = o.useCallback((n, u)=>{
|
|
147
|
+
if (Ct() || !e) return {};
|
|
148
|
+
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
|
+
return ({
|
|
130
150
|
right: {
|
|
131
|
-
left: e.current.right +
|
|
132
|
-
top: window.pageYOffset +
|
|
151
|
+
left: t.current.right + e.width > window.innerWidth ? d : t.current.right + m,
|
|
152
|
+
top: t.current.right + e.width > window.innerWidth ? p : f || window.pageYOffset + t.current.top + t.current.height / 2
|
|
133
153
|
},
|
|
134
154
|
left: {
|
|
135
|
-
left:
|
|
136
|
-
top:
|
|
155
|
+
left: d,
|
|
156
|
+
top: p
|
|
137
157
|
},
|
|
138
158
|
top: {
|
|
139
|
-
top: window.pageYOffset +
|
|
140
|
-
left:
|
|
159
|
+
top: t.current.right + e.width > window.innerWidth ? p : window.pageYOffset + t.current.top - m,
|
|
160
|
+
left: t.current.right + e.width > window.innerWidth ? d : A
|
|
141
161
|
},
|
|
142
162
|
bottom: {
|
|
143
|
-
top: window.pageYOffset +
|
|
144
|
-
left:
|
|
163
|
+
top: t.current.right + e.width > window.innerWidth ? p : window.pageYOffset + t.current.bottom + m,
|
|
164
|
+
left: t.current.right + e.width > window.innerWidth ? d : A
|
|
145
165
|
}
|
|
146
|
-
})[
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
[
|
|
157
|
-
[
|
|
158
|
-
[
|
|
159
|
-
[
|
|
166
|
+
})[n];
|
|
167
|
+
}, [
|
|
168
|
+
f,
|
|
169
|
+
e
|
|
170
|
+
]), b = (()=>C.width)(), Z = {
|
|
171
|
+
top: At,
|
|
172
|
+
bottom: Pt,
|
|
173
|
+
left: St,
|
|
174
|
+
right: Yt
|
|
175
|
+
}, _ = i && Ot({
|
|
176
|
+
[s.enterTransform]: It(i),
|
|
177
|
+
[s.exitTransform]: Nt(i),
|
|
178
|
+
[s.enterActiveAnimationName]: kt(i),
|
|
179
|
+
[s.enterDoneTransform]: Mt(i),
|
|
180
|
+
[s.shadowAlpha]: Lt(z),
|
|
181
|
+
[s.arrowBoxShadow]: Vt(i)
|
|
160
182
|
});
|
|
161
|
-
return
|
|
183
|
+
return o.useEffect(()=>{
|
|
184
|
+
i && x.current && a && X(B(i, b || 0));
|
|
185
|
+
}, [
|
|
186
|
+
a,
|
|
187
|
+
B,
|
|
188
|
+
i,
|
|
189
|
+
b
|
|
190
|
+
]), o.useEffect(()=>{
|
|
191
|
+
x.current && (x.current.getBoundingClientRect(), a && G(x.current.getBoundingClientRect()));
|
|
192
|
+
}, [
|
|
193
|
+
a
|
|
194
|
+
]), /* @__PURE__ */ P(tt, {
|
|
162
195
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
ref:
|
|
165
|
-
|
|
196
|
+
/* @__PURE__ */ w("div", {
|
|
197
|
+
ref: R,
|
|
198
|
+
style: K,
|
|
199
|
+
className: ut,
|
|
166
200
|
onPointerOver: ()=>{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
201
|
+
c.current && (clearTimeout(c.current), c.current = null), !h.current && (h.current = !0, V ? g.current = setTimeout(()=>{
|
|
202
|
+
g.current = null, T();
|
|
203
|
+
}, Et) : T());
|
|
170
204
|
},
|
|
171
|
-
onPointerLeave:
|
|
172
|
-
if (
|
|
173
|
-
clearTimeout(
|
|
205
|
+
onPointerLeave: y ? M : ()=>{
|
|
206
|
+
if (g.current) {
|
|
207
|
+
clearTimeout(g.current), g.current = null, h.current = !1;
|
|
174
208
|
return;
|
|
175
209
|
}
|
|
176
|
-
|
|
177
|
-
|
|
210
|
+
c.current = setTimeout(()=>{
|
|
211
|
+
h.current && (c.current = null, h.current = !1, T());
|
|
178
212
|
}, 100);
|
|
179
213
|
},
|
|
180
|
-
onFocus:
|
|
181
|
-
onKeyDown:
|
|
214
|
+
onFocus: J,
|
|
215
|
+
onKeyDown: Q,
|
|
182
216
|
"touch-action": "auto",
|
|
183
217
|
role: "button",
|
|
184
218
|
tabIndex: 0,
|
|
185
|
-
"aria-describedby":
|
|
186
|
-
"aria-expanded":
|
|
187
|
-
"aria-label":
|
|
188
|
-
children:
|
|
219
|
+
"aria-describedby": D,
|
|
220
|
+
"aria-expanded": a,
|
|
221
|
+
"aria-label": L,
|
|
222
|
+
children: k
|
|
189
223
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ P(it, {
|
|
191
225
|
children: [
|
|
192
|
-
|
|
193
|
-
onPress:
|
|
226
|
+
a && y && /* @__PURE__ */ w(at, {
|
|
227
|
+
onPress: $
|
|
194
228
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
in:
|
|
197
|
-
timeout:
|
|
229
|
+
/* @__PURE__ */ w(et, {
|
|
230
|
+
in: a,
|
|
231
|
+
timeout: Bt,
|
|
198
232
|
classNames: {
|
|
199
|
-
enter:
|
|
200
|
-
enterActive:
|
|
201
|
-
enterDone:
|
|
202
|
-
exit:
|
|
203
|
-
exitActive:
|
|
233
|
+
enter: lt,
|
|
234
|
+
enterActive: dt,
|
|
235
|
+
enterDone: ft,
|
|
236
|
+
exit: ht,
|
|
237
|
+
exitActive: wt
|
|
204
238
|
},
|
|
205
239
|
unmountOnExit: !0,
|
|
206
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ P("div", _object_spread_props(_object_spread({
|
|
241
|
+
ref: x
|
|
242
|
+
}, Rt(j, "Tooltip")), {
|
|
207
243
|
role: "tooltip",
|
|
208
|
-
id:
|
|
209
|
-
className:
|
|
244
|
+
id: D,
|
|
245
|
+
className: E(mt, pt),
|
|
210
246
|
style: _object_spread({
|
|
211
|
-
width:
|
|
212
|
-
},
|
|
247
|
+
width: b
|
|
248
|
+
}, H, _),
|
|
213
249
|
onPointerOver: ()=>{
|
|
214
|
-
|
|
250
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
215
251
|
},
|
|
216
|
-
onPointerLeave:
|
|
217
|
-
|
|
218
|
-
|
|
252
|
+
onPointerLeave: y ? M : ()=>{
|
|
253
|
+
c.current = setTimeout(()=>{
|
|
254
|
+
h.current && (c.current = null, h.current = !1, T());
|
|
219
255
|
}, 100);
|
|
220
256
|
},
|
|
221
257
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
children: /* @__PURE__ */
|
|
226
|
-
className:
|
|
258
|
+
/* @__PURE__ */ w("div", {
|
|
259
|
+
style: U(i),
|
|
260
|
+
className: E(gt, Z[i]),
|
|
261
|
+
children: /* @__PURE__ */ w("div", {
|
|
262
|
+
className: xt
|
|
227
263
|
})
|
|
228
264
|
}),
|
|
229
|
-
(
|
|
265
|
+
(Y || S) && /* @__PURE__ */ P(st, {
|
|
230
266
|
space: 4,
|
|
231
267
|
children: [
|
|
232
|
-
|
|
268
|
+
Y && /* @__PURE__ */ w(I, {
|
|
233
269
|
medium: !0,
|
|
234
|
-
children:
|
|
270
|
+
children: Y
|
|
235
271
|
}),
|
|
236
|
-
|
|
272
|
+
S && /* @__PURE__ */ w(I, {
|
|
237
273
|
regular: !0,
|
|
238
|
-
children:
|
|
274
|
+
children: S
|
|
239
275
|
})
|
|
240
276
|
]
|
|
241
277
|
}),
|
|
242
|
-
|
|
278
|
+
N || r
|
|
243
279
|
]
|
|
244
280
|
}))
|
|
245
281
|
})
|
|
@@ -247,5 +283,5 @@ const xt = "bottom", Tt = "top", bt = 12, h = 4 + bt, g = 16, vt = 340, At = 500
|
|
|
247
283
|
})
|
|
248
284
|
]
|
|
249
285
|
});
|
|
250
|
-
},
|
|
251
|
-
export {
|
|
286
|
+
}, oe = jt;
|
|
287
|
+
export { oe as default };
|
package/dist-es/utils/dom.js
CHANGED
|
@@ -50,57 +50,70 @@ function _object_spread_props(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import { isServerSide as
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
return
|
|
58
|
-
},
|
|
53
|
+
import { isServerSide as a } from "./environment.js";
|
|
54
|
+
const d = (e)=>{
|
|
55
|
+
if (a()) return !1;
|
|
56
|
+
const t = document.createElement("input");
|
|
57
|
+
return t.setAttribute("type", e), t.type === e;
|
|
58
|
+
}, f = (e)=>{
|
|
59
59
|
e.stopPropagation(), e.preventDefault();
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
return e.value =
|
|
60
|
+
}, m = (e, t)=>{
|
|
61
|
+
const r = new Event("change");
|
|
62
|
+
return e.value = t, _object_spread_props(_object_spread({}, r), {
|
|
63
63
|
target: e,
|
|
64
64
|
currentTarget: e
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
let
|
|
67
|
+
let c = !1;
|
|
68
68
|
try {
|
|
69
69
|
const e = Object.defineProperty({}, "passive", {
|
|
70
70
|
get () {
|
|
71
|
-
|
|
71
|
+
c = !0;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
window.addEventListener("test", ()=>{}, e);
|
|
75
75
|
} catch (e) {}
|
|
76
|
-
const
|
|
76
|
+
const h = (e, t, r)=>e.addEventListener(t, r, c ? {
|
|
77
77
|
passive: !0
|
|
78
|
-
} : !1),
|
|
79
|
-
const
|
|
80
|
-
"data-component-name":
|
|
78
|
+
} : !1), E = (e, t, r)=>e.removeEventListener(t, r, !1), g = (e, t)=>{
|
|
79
|
+
const r = t ? {
|
|
80
|
+
"data-component-name": t
|
|
81
81
|
} : {};
|
|
82
|
-
return e && Object.keys(e).forEach((
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
},
|
|
86
|
-
const
|
|
82
|
+
return e && Object.keys(e).forEach((n)=>{
|
|
83
|
+
r["data-" + n] = e[n];
|
|
84
|
+
}), r;
|
|
85
|
+
}, u = (e, t)=>{
|
|
86
|
+
const r = `overflow${t}`, n = window.getComputedStyle(e)[r];
|
|
87
87
|
return [
|
|
88
88
|
"auto",
|
|
89
89
|
"scroll",
|
|
90
90
|
"overlay"
|
|
91
|
-
].includes(
|
|
92
|
-
},
|
|
93
|
-
let
|
|
94
|
-
let
|
|
95
|
-
for(;
|
|
96
|
-
return
|
|
97
|
-
},
|
|
98
|
-
const
|
|
99
|
-
let
|
|
100
|
-
return
|
|
101
|
-
!
|
|
91
|
+
].includes(n);
|
|
92
|
+
}, w = function(e) {
|
|
93
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Y";
|
|
94
|
+
let r = e == null ? void 0 : e.parentElement;
|
|
95
|
+
for(; r && !u(r, t);)r = r.parentElement;
|
|
96
|
+
return r || document.documentElement;
|
|
97
|
+
}, b = (e)=>e.scrollHeight - e.scrollTop - e.clientHeight, P = (e)=>e.scrollHeight > e.clientHeight, y = (e, t)=>{
|
|
98
|
+
const r = ()=>a() ? Promise.resolve(null) : window.ResizeObserver ? Promise.resolve(ResizeObserver) : import(/* webpackChunkName: "@juggle/resize-observer" */ "@juggle/resize-observer").then((o)=>o.ResizeObserver);
|
|
99
|
+
let n = !1, s = null;
|
|
100
|
+
return r().then((o)=>{
|
|
101
|
+
!n && o && (s = new o(t), s.observe(e));
|
|
102
102
|
}), ()=>{
|
|
103
|
-
|
|
103
|
+
n = !0, s && s.disconnect();
|
|
104
|
+
};
|
|
105
|
+
}, v = (e)=>{
|
|
106
|
+
const [t, r] = e.replace(/^var\(/, "").replace(/\)$/, "").split(/\s*,\s*(.*)/);
|
|
107
|
+
return {
|
|
108
|
+
varName: t,
|
|
109
|
+
fallback: r
|
|
104
110
|
};
|
|
111
|
+
}, i = (e)=>e.startsWith("var(") || e.startsWith("--"), l = (e, t)=>{
|
|
112
|
+
if (!i(e)) throw new Error(`Invalid css var: ${e}`);
|
|
113
|
+
if (e.startsWith("var(")) {
|
|
114
|
+
const { varName: r , fallback: n } = v(e), s = l(r, t);
|
|
115
|
+
return !s && n ? i(n) ? l(n, t) : n : s;
|
|
116
|
+
}
|
|
117
|
+
return getComputedStyle(t !== null && t !== void 0 ? t : document.documentElement).getPropertyValue(e);
|
|
105
118
|
};
|
|
106
|
-
export {
|
|
119
|
+
export { h as addPassiveEventListener, f as cancelEvent, m as createChangeEvent, l as getCssVarValue, g as getPrefixedDataAttributes, b as getScrollDistanceToBottom, w as getScrollableParentElement, P as hasScroll, d as isInputTypeSupported, y as listenResize, E as removePassiveEventListener };
|