@telefonica/mistica 14.3.0 → 14.4.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/card.css-mistica.js +3 -3
- package/dist/card.d.ts +8 -6
- package/dist/card.js +208 -179
- package/dist/date-time-picker.js +14 -14
- package/dist/empty-state-card.js +24 -20
- package/dist/highlighted-card.js +16 -11
- package/dist/icon-button.js +8 -6
- package/dist/inline.css-mistica.js +7 -6
- package/dist/inline.css.d.ts +1 -0
- package/dist/inline.d.ts +2 -1
- package/dist/inline.js +8 -8
- package/dist/package-version.js +1 -1
- package/dist/popover.js +11 -11
- package/dist/text-link.js +5 -4
- package/dist/touchable.d.ts +1 -0
- package/dist/touchable.js +31 -27
- package/dist-es/card.css-mistica.js +2 -2
- package/dist-es/card.js +268 -239
- package/dist-es/date-time-picker.js +17 -17
- package/dist-es/empty-state-card.js +42 -38
- package/dist-es/highlighted-card.js +33 -28
- package/dist-es/icon-button.js +24 -22
- package/dist-es/inline.css-mistica.js +6 -6
- package/dist-es/inline.js +16 -16
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +34 -34
- package/dist-es/style.css +1 -1
- package/dist-es/text-link.js +15 -14
- package/dist-es/touchable.js +44 -40
- package/package.json +1 -1
|
@@ -83,14 +83,14 @@ import R from "./generated/mistica-icons/icon-calendar-regular.js";
|
|
|
83
83
|
import H from "react-datetime";
|
|
84
84
|
import S from "./overlay.js";
|
|
85
85
|
import { DEFAULT_WIDTH as I } from "./text-field-components.css-mistica.js";
|
|
86
|
-
import
|
|
86
|
+
import h from "./icon-button.js";
|
|
87
87
|
import { cancelEvent as B, createChangeEvent as E } from "./utils/dom.js";
|
|
88
88
|
import { useTheme as F, useElementDimensions as L } from "./hooks.js";
|
|
89
89
|
import T from "./generated/mistica-icons/icon-close-regular.js";
|
|
90
90
|
import { reactDatePicker as V } from "./date-time-picker.css-mistica.js";
|
|
91
91
|
import { jsxs as Y, Fragment as j, jsx as r } from "./_virtual/jsx-runtime.js";
|
|
92
|
-
const
|
|
93
|
-
import(/* webpackChunkName: "moment-locale" */ `moment/locale/${
|
|
92
|
+
const g = navigator.language.toLocaleLowerCase().split("-")[0];
|
|
93
|
+
import(/* webpackChunkName: "moment-locale" */ `moment/locale/${g}`).finally(()=>{});
|
|
94
94
|
const Q = (_param)=>{
|
|
95
95
|
var { withTime: s , mode: l , isValidDate: y , optional: u } = _param, t = _objectWithoutProperties(_param, [
|
|
96
96
|
"withTime",
|
|
@@ -98,15 +98,15 @@ const Q = (_param)=>{
|
|
|
98
98
|
"isValidDate",
|
|
99
99
|
"optional"
|
|
100
100
|
]);
|
|
101
|
-
const [m, x] = d.useState(!1), { texts: b } = F(), n = d.useRef(null), { height: k , ref: v } = L(),
|
|
101
|
+
const [m, x] = d.useState(!1), { texts: b } = F(), n = d.useRef(null), { height: k , ref: v } = L(), i = (e)=>{
|
|
102
102
|
t.disabled || x(e);
|
|
103
103
|
}, w = ()=>{
|
|
104
104
|
var p;
|
|
105
|
-
const { top: e = 0 , bottom: o = 0 , left:
|
|
105
|
+
const { top: e = 0 , bottom: o = 0 , left: a = 0 } = ((p = n.current) == null ? void 0 : p.getBoundingClientRect()) || {}, P = 260 + o < window.innerHeight;
|
|
106
106
|
return {
|
|
107
107
|
width: I,
|
|
108
108
|
top: P ? o : e - k,
|
|
109
|
-
left:
|
|
109
|
+
left: a,
|
|
110
110
|
position: "absolute",
|
|
111
111
|
borderRadius: 8,
|
|
112
112
|
overflow: "hidden",
|
|
@@ -117,21 +117,21 @@ const Q = (_param)=>{
|
|
|
117
117
|
const e = (o = n.current) == null ? void 0 : o.value;
|
|
118
118
|
return e ? new Date(e) : void 0;
|
|
119
119
|
}, C = (e)=>s ? e.format("yyyy-MM-DD HH:mm") : l === "year-month" ? e.format("yyyy-MM") : e.format("yyyy-MM-DD"), f = (e)=>{
|
|
120
|
-
var
|
|
120
|
+
var a;
|
|
121
121
|
const o = typeof e == "string" ? e : C(e);
|
|
122
|
-
n.current && (n.current.focus(), (
|
|
123
|
-
}, D = ()=>c() && u ? /* @__PURE__ */ r(
|
|
122
|
+
n.current && (n.current.focus(), (a = t.onChange) == null || a.call(t, E(n.current, o)));
|
|
123
|
+
}, D = ()=>c() && u ? /* @__PURE__ */ r(h, {
|
|
124
124
|
"aria-label": b.clearButton,
|
|
125
125
|
size: 32,
|
|
126
|
-
onPress: (
|
|
127
|
-
|
|
126
|
+
onPress: ()=>{
|
|
127
|
+
f("");
|
|
128
128
|
},
|
|
129
129
|
children: /* @__PURE__ */ r(T, {})
|
|
130
|
-
}) : /* @__PURE__ */ r(
|
|
130
|
+
}) : /* @__PURE__ */ r(h, {
|
|
131
131
|
disabled: t.disabled,
|
|
132
132
|
"aria-label": "",
|
|
133
133
|
size: 32,
|
|
134
|
-
onPress: ()=>
|
|
134
|
+
onPress: ()=>i(!m),
|
|
135
135
|
children: /* @__PURE__ */ r(R, {})
|
|
136
136
|
});
|
|
137
137
|
return /* @__PURE__ */ Y(j, {
|
|
@@ -150,14 +150,14 @@ const Q = (_param)=>{
|
|
|
150
150
|
(o = t == null ? void 0 : t.inputRef) == null || o.call(t, e), n.current = e;
|
|
151
151
|
},
|
|
152
152
|
readOnly: !0,
|
|
153
|
-
onKeyDown: ()=>
|
|
153
|
+
onKeyDown: ()=>i(!0),
|
|
154
154
|
onClick: ()=>{
|
|
155
|
-
|
|
155
|
+
i(!0);
|
|
156
156
|
}
|
|
157
157
|
})),
|
|
158
158
|
m && /* @__PURE__ */ r(S, {
|
|
159
159
|
onPress: (e)=>{
|
|
160
|
-
B(e),
|
|
160
|
+
B(e), i(!1);
|
|
161
161
|
},
|
|
162
162
|
disableScroll: !0,
|
|
163
163
|
children: /* @__PURE__ */ r("div", {
|
|
@@ -169,7 +169,7 @@ const Q = (_param)=>{
|
|
|
169
169
|
dateFormat: l === "year-month" ? "YYYY-MM" : void 0,
|
|
170
170
|
timeFormat: s ? "HH:mm" : !1,
|
|
171
171
|
initialValue: c(),
|
|
172
|
-
locale:
|
|
172
|
+
locale: g,
|
|
173
173
|
input: !1,
|
|
174
174
|
onChange: f,
|
|
175
175
|
isValidDate: y
|
|
@@ -1,56 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Boxed as
|
|
3
|
-
import { useScreenSize as u } from "./hooks.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { container as
|
|
8
|
-
import { vars as
|
|
9
|
-
import { jsx as
|
|
10
|
-
const
|
|
11
|
-
let { title: n , description:
|
|
12
|
-
var
|
|
13
|
-
const { isTabletOrSmaller:
|
|
14
|
-
let
|
|
15
|
-
return
|
|
1
|
+
import p from "./box.js";
|
|
2
|
+
import { Boxed as g } from "./boxed.js";
|
|
3
|
+
import { useScreenSize as u, useTheme as N } from "./hooks.js";
|
|
4
|
+
import c from "./stack.js";
|
|
5
|
+
import { Text as T, Text2 as y } from "./text.js";
|
|
6
|
+
import B from "./button-group.js";
|
|
7
|
+
import { container as E, iconContainer as k, image as v } from "./empty-state-card.css-mistica.js";
|
|
8
|
+
import { vars as z } from "./skins/skin-contract.css-mistica.js";
|
|
9
|
+
import { jsx as e, jsxs as d } from "./_virtual/jsx-runtime.js";
|
|
10
|
+
const V = (param)=>{
|
|
11
|
+
let { title: n , description: h , button: r , secondaryButton: o , buttonLink: t , icon: a , imageUrl: l , "aria-label": f , dataAttributes: x } = param;
|
|
12
|
+
var m;
|
|
13
|
+
const { isTabletOrSmaller: s } = u(), { textPresets: S } = N();
|
|
14
|
+
let i;
|
|
15
|
+
return l && (i = /* @__PURE__ */ e("img", {
|
|
16
16
|
className: v,
|
|
17
17
|
alt: "",
|
|
18
|
-
src:
|
|
19
|
-
})), process.env.NODE_ENV !== "production" &&
|
|
18
|
+
src: l
|
|
19
|
+
})), process.env.NODE_ENV !== "production" && r && !((m = r == null ? void 0 : r.props) != null && m.small) && console.error("button property in EmptyStateCard must be a a small Button. Set small prop to true"), /* @__PURE__ */ e(g, {
|
|
20
20
|
dataAttributes: x,
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
paddingY:
|
|
23
|
-
paddingX:
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
className:
|
|
26
|
-
"aria-label":
|
|
27
|
-
children: /* @__PURE__ */ d(
|
|
21
|
+
children: /* @__PURE__ */ e(p, {
|
|
22
|
+
paddingY: s ? 24 : 40,
|
|
23
|
+
paddingX: s ? 16 : 40,
|
|
24
|
+
children: /* @__PURE__ */ e("section", {
|
|
25
|
+
className: E,
|
|
26
|
+
"aria-label": f,
|
|
27
|
+
children: /* @__PURE__ */ d(c, {
|
|
28
28
|
space: 16,
|
|
29
29
|
children: [
|
|
30
|
-
|
|
31
|
-
className:
|
|
32
|
-
children:
|
|
30
|
+
i != null ? i : a && /* @__PURE__ */ e("div", {
|
|
31
|
+
className: k,
|
|
32
|
+
children: a
|
|
33
33
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
children: /* @__PURE__ */ d(
|
|
34
|
+
/* @__PURE__ */ e(p, {
|
|
35
|
+
children: /* @__PURE__ */ d(c, {
|
|
36
36
|
space: 8,
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
/* @__PURE__ */ e(T, {
|
|
39
|
+
mobileSize: 18,
|
|
40
|
+
mobileLineHeight: "24px",
|
|
41
|
+
desktopSize: 20,
|
|
42
|
+
desktopLineHeight: "28px",
|
|
43
|
+
weight: S.cardTitle.weight,
|
|
40
44
|
children: n
|
|
41
45
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ e(y, {
|
|
43
47
|
regular: !0,
|
|
44
|
-
color:
|
|
45
|
-
children:
|
|
48
|
+
color: z.colors.textSecondary,
|
|
49
|
+
children: h
|
|
46
50
|
})
|
|
47
51
|
]
|
|
48
52
|
})
|
|
49
53
|
}),
|
|
50
|
-
(
|
|
51
|
-
primaryButton:
|
|
54
|
+
(r || o || t) && /* @__PURE__ */ e(B, {
|
|
55
|
+
primaryButton: r,
|
|
52
56
|
secondaryButton: o,
|
|
53
|
-
link:
|
|
57
|
+
link: t
|
|
54
58
|
})
|
|
55
59
|
]
|
|
56
60
|
})
|
|
@@ -58,4 +62,4 @@ const Y = (param)=>{
|
|
|
58
62
|
})
|
|
59
63
|
});
|
|
60
64
|
};
|
|
61
|
-
export {
|
|
65
|
+
export { V as default };
|
|
@@ -78,48 +78,53 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
80
|
import * as g from "react";
|
|
81
|
-
import { useIsInverseVariant as
|
|
82
|
-
import
|
|
81
|
+
import { useIsInverseVariant as v } from "./theme-variant-context.js";
|
|
82
|
+
import w from "./box.js";
|
|
83
83
|
import { BaseTouchable as c } from "./touchable.js";
|
|
84
|
-
import {
|
|
85
|
-
import { Boxed as
|
|
86
|
-
import
|
|
87
|
-
import { container as
|
|
88
|
-
import { vars as
|
|
89
|
-
import {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
import { Text as x, Text2 as k } from "./text.js";
|
|
85
|
+
import { Boxed as I } from "./boxed.js";
|
|
86
|
+
import C, { useIsDismissable as T } from "./maybe-dismissable.js";
|
|
87
|
+
import { container as P, textContainerVariant as E, imageContent as N, touchableContainer as s } from "./highlighted-card.css-mistica.js";
|
|
88
|
+
import { vars as H } from "./skins/skin-contract.css-mistica.js";
|
|
89
|
+
import { useTheme as y } from "./hooks.js";
|
|
90
|
+
import { jsxs as m, jsx as t, Fragment as R } from "./_virtual/jsx-runtime.js";
|
|
91
|
+
const S = /*#__PURE__*/ g.forwardRef((e, i)=>{
|
|
92
|
+
var h;
|
|
93
|
+
const { title: a , description: r , imageUrl: o , imageFit: l } = e, u = v(), f = (h = e.isInverse) != null ? h : u, d = T(), { textPresets: b } = y(), n = /* @__PURE__ */ m(I, {
|
|
93
94
|
ref: i,
|
|
94
95
|
isInverse: f,
|
|
95
|
-
className:
|
|
96
|
+
className: P,
|
|
96
97
|
dataAttributes: _objectSpread({
|
|
97
98
|
"component-name": "HighlightedCard"
|
|
98
99
|
}, e.dataAttributes),
|
|
99
100
|
width: e.width ? `${e.width}px` : "100%",
|
|
100
101
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
role:
|
|
103
|
-
className:
|
|
104
|
-
"aria-label":
|
|
102
|
+
/* @__PURE__ */ m("div", {
|
|
103
|
+
role: d ? void 0 : "region",
|
|
104
|
+
className: E[o ? "withImage" : "withoutImage"],
|
|
105
|
+
"aria-label": d ? void 0 : e["aria-label"],
|
|
105
106
|
children: [
|
|
106
|
-
/* @__PURE__ */ t(
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
/* @__PURE__ */ t(x, {
|
|
108
|
+
mobileSize: 18,
|
|
109
|
+
mobileLineHeight: "24px",
|
|
110
|
+
desktopSize: 20,
|
|
111
|
+
desktopLineHeight: "28px",
|
|
109
112
|
truncate: e.titleLinesMax,
|
|
113
|
+
weight: b.cardTitle.weight,
|
|
114
|
+
as: "h3",
|
|
110
115
|
children: a
|
|
111
116
|
}),
|
|
112
|
-
/* @__PURE__ */ t(
|
|
117
|
+
/* @__PURE__ */ t(w, {
|
|
113
118
|
paddingTop: 8,
|
|
114
|
-
children: /* @__PURE__ */ t(
|
|
119
|
+
children: /* @__PURE__ */ t(k, {
|
|
115
120
|
regular: !0,
|
|
116
|
-
color:
|
|
121
|
+
color: H.colors.textSecondary,
|
|
117
122
|
truncate: e.descriptionLinesMax,
|
|
118
123
|
as: "p",
|
|
119
124
|
children: r
|
|
120
125
|
})
|
|
121
126
|
}),
|
|
122
|
-
e.button && /* @__PURE__ */
|
|
127
|
+
e.button && /* @__PURE__ */ m(R, {
|
|
123
128
|
children: [
|
|
124
129
|
/* @__PURE__ */ t("div", {
|
|
125
130
|
style: {
|
|
@@ -133,7 +138,7 @@ const R = /*#__PURE__*/ g.forwardRef((e, i)=>{
|
|
|
133
138
|
]
|
|
134
139
|
}),
|
|
135
140
|
o && /* @__PURE__ */ t("div", {
|
|
136
|
-
className:
|
|
141
|
+
className: N,
|
|
137
142
|
style: {
|
|
138
143
|
backgroundImage: `url(${o})`,
|
|
139
144
|
backgroundRepeat: "no-repeat",
|
|
@@ -161,19 +166,19 @@ const R = /*#__PURE__*/ g.forwardRef((e, i)=>{
|
|
|
161
166
|
className: s,
|
|
162
167
|
children: n
|
|
163
168
|
}) : n;
|
|
164
|
-
}),
|
|
169
|
+
}), W = /*#__PURE__*/ g.forwardRef((_param, a)=>{
|
|
165
170
|
var { "aria-label": e } = _param, i = _objectWithoutProperties(_param, [
|
|
166
171
|
"aria-label"
|
|
167
172
|
]);
|
|
168
173
|
const r = e != null ? e : i.title;
|
|
169
|
-
return /* @__PURE__ */ t(
|
|
174
|
+
return /* @__PURE__ */ t(C, {
|
|
170
175
|
onClose: i.onClose,
|
|
171
176
|
"aria-label": r,
|
|
172
177
|
width: i.width,
|
|
173
|
-
children: /* @__PURE__ */ t(
|
|
178
|
+
children: /* @__PURE__ */ t(S, _objectSpreadProps(_objectSpread({}, i), {
|
|
174
179
|
"aria-label": r,
|
|
175
180
|
ref: a
|
|
176
181
|
}))
|
|
177
182
|
});
|
|
178
183
|
});
|
|
179
|
-
export {
|
|
184
|
+
export { W as default };
|
package/dist-es/icon-button.js
CHANGED
|
@@ -50,19 +50,19 @@ function _objectSpreadProps(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import * as
|
|
53
|
+
import * as r from "react";
|
|
54
54
|
import o from "classnames";
|
|
55
|
-
import { BaseTouchable as
|
|
56
|
-
import { base as
|
|
57
|
-
import { jsx as
|
|
58
|
-
const
|
|
55
|
+
import { BaseTouchable as c } from "./touchable.js";
|
|
56
|
+
import { base as s } from "./icon-button.css-mistica.js";
|
|
57
|
+
import { jsx as i } from "./_virtual/jsx-runtime.js";
|
|
58
|
+
const d = 24, b = (e, a, t, n, l)=>{
|
|
59
59
|
const m = n ? `${n}px ${n}px` : "100% 100%";
|
|
60
60
|
return {
|
|
61
61
|
padding: 0,
|
|
62
62
|
backgroundColor: t,
|
|
63
63
|
backgroundImage: e ? `url(${e})` : "initial",
|
|
64
64
|
backgroundSize: m,
|
|
65
|
-
cursor:
|
|
65
|
+
cursor: l ? "default" : "pointer",
|
|
66
66
|
height: a,
|
|
67
67
|
width: a
|
|
68
68
|
};
|
|
@@ -77,35 +77,37 @@ const s = 24, b = (e, a, t, n, c)=>{
|
|
|
77
77
|
"component-name": "IconButton"
|
|
78
78
|
}, e.dataAttributes)
|
|
79
79
|
};
|
|
80
|
-
return e.href ? /* @__PURE__ */
|
|
80
|
+
return e.href ? /* @__PURE__ */ i(c, _objectSpreadProps(_objectSpread({}, n), {
|
|
81
81
|
href: e.href,
|
|
82
82
|
newTab: e.newTab,
|
|
83
83
|
"aria-label": e["aria-label"],
|
|
84
|
-
children: !a &&
|
|
85
|
-
})) : e.to ? /* @__PURE__ */
|
|
84
|
+
children: !a && r.Children.only(t)
|
|
85
|
+
})) : e.to ? /* @__PURE__ */ i(c, _objectSpreadProps(_objectSpread({}, n), {
|
|
86
86
|
to: e.to,
|
|
87
87
|
fullPageOnWebView: e.fullPageOnWebView,
|
|
88
88
|
replace: e.replace,
|
|
89
89
|
"aria-label": e["aria-label"],
|
|
90
|
-
children: !a &&
|
|
91
|
-
})) : e.onPress ? /* @__PURE__ */
|
|
92
|
-
onPress:
|
|
90
|
+
children: !a && r.Children.only(t)
|
|
91
|
+
})) : e.onPress ? /* @__PURE__ */ i(c, _objectSpreadProps(_objectSpread({}, n), {
|
|
92
|
+
onPress: (l)=>{
|
|
93
|
+
l.stopPropagation(), e.onPress(l);
|
|
94
|
+
},
|
|
93
95
|
"aria-label": e["aria-label"],
|
|
94
|
-
children: !a &&
|
|
95
|
-
})) : /* @__PURE__ */
|
|
96
|
+
children: !a && r.Children.only(t)
|
|
97
|
+
})) : /* @__PURE__ */ i(c, _objectSpreadProps(_objectSpread({}, n), {
|
|
96
98
|
maybe: !0,
|
|
97
|
-
children: !a &&
|
|
99
|
+
children: !a && r.Children.only(t)
|
|
98
100
|
}));
|
|
99
101
|
}, I = (e)=>{
|
|
100
|
-
const { icon: a , backgroundColor: t = "transparent" , iconSize: n , size:
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
className: o(
|
|
103
|
-
style: _objectSpread({}, b(a,
|
|
102
|
+
const { icon: a , backgroundColor: t = "transparent" , iconSize: n , size: l = d } = e;
|
|
103
|
+
return /* @__PURE__ */ i(u, _objectSpreadProps(_objectSpread({}, e), {
|
|
104
|
+
className: o(s, e.className),
|
|
105
|
+
style: _objectSpread({}, b(a, l, t, n, e.disabled), e.style)
|
|
104
106
|
}));
|
|
105
107
|
}, w = (e)=>{
|
|
106
|
-
const { size: a =
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
className: o(
|
|
108
|
+
const { size: a = d , disabled: t } = e;
|
|
109
|
+
return /* @__PURE__ */ i(u, _objectSpreadProps(_objectSpread({}, e), {
|
|
110
|
+
className: o(s, e.className),
|
|
109
111
|
style: {
|
|
110
112
|
height: a,
|
|
111
113
|
width: a,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./inline.css.ts.vanilla.js";
|
|
2
2
|
var v = "kkfbnv2 kkfbnv1", n = {
|
|
3
|
-
between: "
|
|
4
|
-
around: "
|
|
5
|
-
evenly: "
|
|
6
|
-
}, a = "
|
|
3
|
+
between: "kkfbnv5",
|
|
4
|
+
around: "kkfbnv6",
|
|
5
|
+
evenly: "kkfbnv7"
|
|
6
|
+
}, a = "kkfbnv4 kkfbnv1", f = {
|
|
7
7
|
space: "var(--kkfbnv0)"
|
|
8
|
-
};
|
|
9
|
-
export { v as fullWidth, n as justifyVariants, a as noFullWidth, f as vars };
|
|
8
|
+
}, r = "kkfbnv3 kkfbnv1";
|
|
9
|
+
export { v as fullWidth, n as justifyVariants, a as noFullWidth, f as vars, r as wrap };
|
package/dist-es/inline.js
CHANGED
|
@@ -51,28 +51,28 @@ function _objectSpreadProps(target, source) {
|
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
53
|
import * as d from "react";
|
|
54
|
-
import
|
|
55
|
-
import { assignInlineVars as
|
|
56
|
-
import { sprinkles as
|
|
57
|
-
import { getPrefixedDataAttributes as
|
|
58
|
-
import { fullWidth as
|
|
54
|
+
import u from "classnames";
|
|
55
|
+
import { assignInlineVars as b } from "@vanilla-extract/dynamic";
|
|
56
|
+
import { sprinkles as y } from "./sprinkles.css-mistica.js";
|
|
57
|
+
import { getPrefixedDataAttributes as h } from "./utils/dom.js";
|
|
58
|
+
import { wrap as v, fullWidth as x, noFullWidth as W, justifyVariants as c, vars as g } from "./inline.css-mistica.js";
|
|
59
59
|
import { jsx as i } from "./_virtual/jsx-runtime.js";
|
|
60
|
-
const
|
|
61
|
-
let { space: r , className: e , children: l , role: o , alignItems:
|
|
62
|
-
const
|
|
60
|
+
const A = (param)=>{
|
|
61
|
+
let { space: r , className: e , children: l , role: o , alignItems: a = "stretch" , "aria-labelledby": s , fullWidth: m , wrap: n , dataAttributes: f } = param;
|
|
62
|
+
const p = m || typeof r == "string";
|
|
63
63
|
return /* @__PURE__ */ i("div", _objectSpreadProps(_objectSpread({
|
|
64
|
-
className:
|
|
65
|
-
alignItems:
|
|
66
|
-
}),
|
|
67
|
-
style: typeof r == "number" ?
|
|
68
|
-
[
|
|
64
|
+
className: u(e, y({
|
|
65
|
+
alignItems: a
|
|
66
|
+
}), n ? v : p ? x : W, typeof r != "number" && c[r]),
|
|
67
|
+
style: typeof r == "number" ? b({
|
|
68
|
+
[g.space]: `${r}px`
|
|
69
69
|
}) : void 0,
|
|
70
70
|
role: o,
|
|
71
|
-
"aria-labelledby":
|
|
72
|
-
},
|
|
71
|
+
"aria-labelledby": s
|
|
72
|
+
}, h(f)), {
|
|
73
73
|
children: d.Children.map(l, (t)=>!!t || t === 0 ? /* @__PURE__ */ i("div", {
|
|
74
74
|
children: t
|
|
75
75
|
}) : null)
|
|
76
76
|
}));
|
|
77
77
|
};
|
|
78
|
-
export {
|
|
78
|
+
export { A as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "14.
|
|
1
|
+
const o = "14.4.0";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|
package/dist-es/popover.js
CHANGED
|
@@ -51,23 +51,23 @@ function _objectSpreadProps(target, source) {
|
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
53
|
import * as c from "react";
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import { useTheme as
|
|
57
|
-
import
|
|
54
|
+
import M from "./generated/mistica-icons/icon-close-regular.js";
|
|
55
|
+
import W from "./icon-button.js";
|
|
56
|
+
import { useTheme as E, useScreenSize as A } from "./hooks.js";
|
|
57
|
+
import P from "./stack.js";
|
|
58
58
|
import u from "./box.js";
|
|
59
|
-
import
|
|
60
|
-
import { Text3 as
|
|
61
|
-
import * as
|
|
62
|
-
import { container as
|
|
59
|
+
import j from "./inline.js";
|
|
60
|
+
import { Text3 as H, Text2 as X } from "./text.js";
|
|
61
|
+
import * as $ from "./popover.css-mistica.js";
|
|
62
|
+
import { container as O, arrowWrapper as _, arrow as q, textAlign as C, textContent as F, closeButtonIcon as G } from "./popover.css-mistica.js";
|
|
63
63
|
import { sprinkles as T } from "./sprinkles.css-mistica.js";
|
|
64
64
|
import { vars as k } from "./skins/skin-contract.css-mistica.js";
|
|
65
|
-
import { getPrefixedDataAttributes as
|
|
65
|
+
import { getPrefixedDataAttributes as J } from "./utils/dom.js";
|
|
66
66
|
import { jsxs as i, jsx as o } from "./_virtual/jsx-runtime.js";
|
|
67
|
-
const { defaultPositionDesktop:
|
|
68
|
-
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
69
|
-
return r && (t === "left" || t === "right") ?
|
|
70
|
-
},
|
|
67
|
+
const { defaultPositionDesktop: K , defaultPositionMobile: Q , distanceToTarget: m , marginLeftRightMobile: d , maxWidthDesktop: U , arrowSize: L } = $, Z = (t)=>t || U, V = function() {
|
|
68
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K, r = arguments.length > 1 ? arguments[1] : void 0;
|
|
69
|
+
return r && (t === "left" || t === "right") ? Q : t;
|
|
70
|
+
}, tt = (t, r, e)=>t ? (r ? window.screen.width : window.innerWidth) - d * 2 : Z(e), et = (t, r, e, s)=>{
|
|
71
71
|
const a = {
|
|
72
72
|
right: {
|
|
73
73
|
left: e.width + m,
|
|
@@ -125,11 +125,11 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
|
|
|
125
125
|
width: t.offsetWidth,
|
|
126
126
|
height: t.offsetHeight,
|
|
127
127
|
parentLeft: t.parentNode.offsetLeft
|
|
128
|
-
} : null,
|
|
128
|
+
} : null, pt = (param)=>{
|
|
129
129
|
let { description: t , title: r , onClose: e , trackingEvent: s , position: n , width: a , target: w , asset: f , isVisible: g = !0 , extra: Y , dataAttributes: B } = param;
|
|
130
|
-
const { texts: R , isIos: z , isDarkMode: D } =
|
|
131
|
-
n =
|
|
132
|
-
const y =
|
|
130
|
+
const { texts: R , isIos: z , isDarkMode: D } = E(), { isTabletOrSmaller: h } = A(), [x, b] = c.useState(null), p = c.useRef(null);
|
|
131
|
+
n = V(n, h);
|
|
132
|
+
const y = tt(h, z, a), S = D ? 1 : 0.2;
|
|
133
133
|
c.useEffect(()=>{
|
|
134
134
|
const l = ()=>{
|
|
135
135
|
b(N(p.current));
|
|
@@ -144,20 +144,20 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
|
|
|
144
144
|
]);
|
|
145
145
|
let v = null;
|
|
146
146
|
if (g && x) {
|
|
147
|
-
const { containerStyles: l , arrowStyles: I } =
|
|
147
|
+
const { containerStyles: l , arrowStyles: I } = et(n, y, x, h);
|
|
148
148
|
v = /* @__PURE__ */ i("div", _objectSpreadProps(_objectSpread({
|
|
149
|
-
className:
|
|
149
|
+
className: O,
|
|
150
150
|
style: _objectSpread({
|
|
151
151
|
width: y,
|
|
152
152
|
boxShadow: `0 2px 4px 0 rgba(0, 0, 0, ${S})`
|
|
153
153
|
}, l)
|
|
154
|
-
},
|
|
154
|
+
}, J(B, "Popover")), {
|
|
155
155
|
children: [
|
|
156
156
|
/* @__PURE__ */ o("div", {
|
|
157
|
-
className:
|
|
157
|
+
className: _,
|
|
158
158
|
style: I,
|
|
159
159
|
children: /* @__PURE__ */ o("div", {
|
|
160
|
-
className:
|
|
160
|
+
className: q,
|
|
161
161
|
style: {
|
|
162
162
|
width: L,
|
|
163
163
|
height: L,
|
|
@@ -174,21 +174,21 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
|
|
|
174
174
|
className: T({
|
|
175
175
|
display: "flex"
|
|
176
176
|
}),
|
|
177
|
-
children: /* @__PURE__ */ i(
|
|
177
|
+
children: /* @__PURE__ */ i(j, {
|
|
178
178
|
space: 16,
|
|
179
179
|
children: [
|
|
180
180
|
f,
|
|
181
181
|
/* @__PURE__ */ o(u, {
|
|
182
|
-
className:
|
|
183
|
-
children: /* @__PURE__ */ i(
|
|
182
|
+
className: C,
|
|
183
|
+
children: /* @__PURE__ */ i(P, {
|
|
184
184
|
space: 4,
|
|
185
|
-
className:
|
|
185
|
+
className: F,
|
|
186
186
|
children: [
|
|
187
|
-
r && /* @__PURE__ */ o(
|
|
187
|
+
r && /* @__PURE__ */ o(H, {
|
|
188
188
|
regular: !0,
|
|
189
189
|
children: r
|
|
190
190
|
}),
|
|
191
|
-
/* @__PURE__ */ o(
|
|
191
|
+
/* @__PURE__ */ o(X, {
|
|
192
192
|
regular: !0,
|
|
193
193
|
color: k.colors.textSecondary,
|
|
194
194
|
children: t
|
|
@@ -199,14 +199,14 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
|
|
|
199
199
|
]
|
|
200
200
|
})
|
|
201
201
|
}),
|
|
202
|
-
/* @__PURE__ */ o(
|
|
203
|
-
className:
|
|
204
|
-
onPress: (
|
|
205
|
-
e == null || e()
|
|
202
|
+
/* @__PURE__ */ o(W, {
|
|
203
|
+
className: G,
|
|
204
|
+
onPress: ()=>{
|
|
205
|
+
e == null || e();
|
|
206
206
|
},
|
|
207
207
|
trackingEvent: s,
|
|
208
208
|
"aria-label": R.modalClose,
|
|
209
|
-
children: /* @__PURE__ */ o(
|
|
209
|
+
children: /* @__PURE__ */ o(M, {
|
|
210
210
|
color: k.colors.neutralHigh
|
|
211
211
|
})
|
|
212
212
|
}),
|
|
@@ -229,4 +229,4 @@ const { defaultPositionDesktop: Q , defaultPositionMobile: U , distanceToTarget:
|
|
|
229
229
|
]
|
|
230
230
|
});
|
|
231
231
|
};
|
|
232
|
-
export {
|
|
232
|
+
export { pt as default };
|