@telefonica/mistica 16.2.0 → 16.3.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.css-mistica.js +33 -21
- package/dist/card.css.d.ts +4 -0
- package/dist/card.js +235 -263
- package/dist/chip.css-mistica.js +19 -7
- package/dist/chip.css.d.ts +2 -0
- package/dist/chip.js +33 -49
- package/dist/community/advanced-data-card.css-mistica.js +24 -24
- package/dist/community/advanced-data-card.css.d.ts +1 -1
- package/dist/community/advanced-data-card.js +45 -48
- package/dist/empty-state-card.js +12 -11
- package/dist/hero.js +25 -19
- package/dist/highlighted-card.js +15 -14
- package/dist/list.css-mistica.js +21 -15
- package/dist/list.css.d.ts +2 -0
- package/dist/list.js +97 -96
- package/dist/menu.css-mistica.js +9 -9
- package/dist/menu.js +9 -10
- package/dist/package-version.js +1 -1
- package/dist/sheet-common.js +3 -2
- package/dist/table.js +52 -51
- package/dist/tag.css-mistica.js +1 -1
- package/dist/tag.js +9 -10
- package/dist/text-props.d.ts +60 -0
- package/dist/text-props.js +93 -0
- package/dist/text.d.ts +0 -62
- package/dist/text.js +156 -219
- package/dist/title.js +10 -9
- package/dist-es/card.css-mistica.js +4 -4
- package/dist-es/card.js +343 -371
- package/dist-es/chip.css-mistica.js +10 -4
- package/dist-es/chip.js +44 -60
- package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
- package/dist-es/community/advanced-data-card.js +74 -77
- package/dist-es/empty-state-card.js +17 -16
- package/dist-es/hero.js +53 -47
- package/dist-es/highlighted-card.js +19 -18
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/list.js +141 -140
- package/dist-es/menu.css-mistica.js +3 -3
- package/dist-es/menu.js +21 -22
- package/dist-es/package-version.js +1 -1
- package/dist-es/sheet-common.js +12 -11
- package/dist-es/style.css +1 -1
- package/dist-es/table.js +89 -88
- package/dist-es/tag.css-mistica.js +1 -1
- package/dist-es/tag.js +14 -15
- package/dist-es/text-props.js +52 -0
- package/dist-es/text.js +171 -231
- package/dist-es/title.js +14 -13
- package/package.json +3 -3
package/dist-es/menu.js
CHANGED
|
@@ -57,13 +57,13 @@ import ne from "classnames";
|
|
|
57
57
|
import { TAB as oe, ENTER as W, SPACE as G, ESC as se, UP as re, LEFT as ie, DOWN as K, RIGHT as ce } from "./utils/keys.js";
|
|
58
58
|
import { getPrefixedDataAttributes as le, cancelEvent as S } from "./utils/dom.js";
|
|
59
59
|
import ae from "./overlay.js";
|
|
60
|
-
import { menuItem as ue, menuItemEnabled as me, menuItemDisabled as fe, menuItemHovered as de, menuSectionDivider as pe, menuTransitionClasses as he, vars as b, itemContent as
|
|
60
|
+
import { menuItem as ue, menuItemEnabled as me, menuItemDisabled as fe, menuItemHovered as de, menuSectionDivider as pe, menuTransitionClasses as he, vars as b, itemContent as j, iconContainer as X, menuContainer as ge } from "./menu.css-mistica.js";
|
|
61
61
|
import { useWindowSize as xe } from "./hooks.js";
|
|
62
62
|
import { Portal as be } from "./portal.js";
|
|
63
|
-
import
|
|
63
|
+
import P from "./box.js";
|
|
64
64
|
import Ie from "./inline.js";
|
|
65
65
|
import ve from "./touchable.js";
|
|
66
|
-
import { Text3 as
|
|
66
|
+
import { Text3 as Y } from "./text.js";
|
|
67
67
|
import { vars as q } from "./skins/skin-contract.css-mistica.js";
|
|
68
68
|
import Me from "./divider.js";
|
|
69
69
|
import Oe from "./checkbox.js";
|
|
@@ -76,9 +76,9 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
76
76
|
isMenuOpen: !1,
|
|
77
77
|
setFocusedItem: ()=>{},
|
|
78
78
|
closeMenu: ()=>{}
|
|
79
|
-
}), Ne = ()=>o.useContext(Q),
|
|
79
|
+
}), Ne = ()=>o.useContext(Q), y = (r)=>r ? Array.from(r.querySelectorAll("[role=menuitem],[role=menuitemcheckbox]")) : [], Re = (r, f)=>{
|
|
80
80
|
if (!f) return null;
|
|
81
|
-
const d =
|
|
81
|
+
const d = y(r).indexOf(f);
|
|
82
82
|
return d < 0 ? null : d;
|
|
83
83
|
}, qe = (param)=>{
|
|
84
84
|
let { label: r, Icon: f, destructive: d, disabled: u, onPress: C, controlType: s, checked: p } = param;
|
|
@@ -93,7 +93,7 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
93
93
|
role: "menuitemcheckbox",
|
|
94
94
|
render: (param)=>{
|
|
95
95
|
let { controlElement: N } = param;
|
|
96
|
-
return /* @__PURE__ */ e(
|
|
96
|
+
return /* @__PURE__ */ e(P, {
|
|
97
97
|
paddingX: 8,
|
|
98
98
|
paddingY: 12,
|
|
99
99
|
children: /* @__PURE__ */ E(Ie, {
|
|
@@ -101,23 +101,23 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
101
101
|
alignItems: "center",
|
|
102
102
|
children: [
|
|
103
103
|
/* @__PURE__ */ E("div", {
|
|
104
|
-
className:
|
|
104
|
+
className: j,
|
|
105
105
|
children: [
|
|
106
106
|
f && /* @__PURE__ */ e("div", {
|
|
107
|
-
className:
|
|
107
|
+
className: X,
|
|
108
108
|
children: /* @__PURE__ */ e(f, {
|
|
109
109
|
size: 24,
|
|
110
110
|
color: h
|
|
111
111
|
})
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */ e(
|
|
113
|
+
/* @__PURE__ */ e(Y, {
|
|
114
114
|
regular: !0,
|
|
115
115
|
color: h,
|
|
116
116
|
children: r
|
|
117
117
|
})
|
|
118
118
|
]
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(P, {
|
|
121
121
|
paddingLeft: 16,
|
|
122
122
|
children: N
|
|
123
123
|
})
|
|
@@ -132,20 +132,20 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
132
132
|
},
|
|
133
133
|
disabled: u,
|
|
134
134
|
role: "menuitem",
|
|
135
|
-
children: /* @__PURE__ */ e(
|
|
135
|
+
children: /* @__PURE__ */ e(P, {
|
|
136
136
|
paddingX: 8,
|
|
137
137
|
paddingY: 12,
|
|
138
138
|
children: /* @__PURE__ */ E("div", {
|
|
139
|
-
className:
|
|
139
|
+
className: j,
|
|
140
140
|
children: [
|
|
141
141
|
f && /* @__PURE__ */ e("div", {
|
|
142
|
-
className:
|
|
142
|
+
className: X,
|
|
143
143
|
children: /* @__PURE__ */ e(f, {
|
|
144
144
|
size: 24,
|
|
145
145
|
color: h
|
|
146
146
|
})
|
|
147
147
|
}),
|
|
148
|
-
/* @__PURE__ */ e(
|
|
148
|
+
/* @__PURE__ */ e(Y, {
|
|
149
149
|
regular: !0,
|
|
150
150
|
color: h,
|
|
151
151
|
children: r
|
|
@@ -169,8 +169,7 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
169
169
|
return r ? /* @__PURE__ */ E(U, {
|
|
170
170
|
children: [
|
|
171
171
|
r,
|
|
172
|
-
/* @__PURE__ */ e(
|
|
173
|
-
paddingY: 8,
|
|
172
|
+
/* @__PURE__ */ e("div", {
|
|
174
173
|
className: pe,
|
|
175
174
|
children: /* @__PURE__ */ e(Me, {})
|
|
176
175
|
})
|
|
@@ -182,20 +181,20 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
182
181
|
o.useEffect(()=>{
|
|
183
182
|
const a = n == null ? void 0 : n.getBoundingClientRect();
|
|
184
183
|
if (!i || !a || !s) return;
|
|
185
|
-
const { top: t, right: O, left: g, bottom: A } = a, T = i.scrollHeight, I = u === "left" ? g : void 0, F = u === "right" ? R.width - O : void 0, L = t - J, $ = A + J,
|
|
184
|
+
const { top: t, right: O, left: g, bottom: A } = a, T = i.scrollHeight, I = u === "left" ? g : void 0, F = u === "right" ? R.width - O : void 0, L = t - J, $ = A + J, D = R.height - $ - V, H = L - V, B = D > T, z = H > T, te = B || !z && D > H;
|
|
186
185
|
N(te ? {
|
|
187
186
|
left: I,
|
|
188
187
|
right: F,
|
|
189
188
|
top: `${$}px`,
|
|
190
189
|
bottom: "auto",
|
|
191
|
-
maxHeight: B ? void 0 :
|
|
190
|
+
maxHeight: B ? void 0 : D,
|
|
192
191
|
transformOrigin: "center top"
|
|
193
192
|
} : {
|
|
194
193
|
left: I,
|
|
195
194
|
right: F,
|
|
196
195
|
top: "auto",
|
|
197
196
|
bottom: `${R.height - L}px`,
|
|
198
|
-
maxHeight: z ? void 0 :
|
|
197
|
+
maxHeight: z ? void 0 : H,
|
|
199
198
|
transformOrigin: "center bottom"
|
|
200
199
|
});
|
|
201
200
|
}, [
|
|
@@ -219,13 +218,13 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
219
218
|
className: ge,
|
|
220
219
|
close: ()=>p(!1)
|
|
221
220
|
}, w = o.useCallback(()=>{
|
|
222
|
-
const t =
|
|
221
|
+
const t = y(i).findIndex((O)=>!O.getAttribute("aria-disabled"));
|
|
223
222
|
h(t < 0 ? null : t);
|
|
224
223
|
}, [
|
|
225
224
|
i
|
|
226
225
|
]), _ = o.useCallback((a)=>{
|
|
227
226
|
var T;
|
|
228
|
-
const t =
|
|
227
|
+
const t = y(i);
|
|
229
228
|
a && t.reverse();
|
|
230
229
|
const O = c === null ? -1 : a ? t.length - 1 - c : c;
|
|
231
230
|
let g = t.findIndex((I, F)=>!I.getAttribute("aria-disabled") && F > O);
|
|
@@ -259,7 +258,7 @@ const ke = 120, Q = /*#__PURE__*/ o.createContext({
|
|
|
259
258
|
break;
|
|
260
259
|
case G:
|
|
261
260
|
case W:
|
|
262
|
-
S(t), c !== null &&
|
|
261
|
+
S(t), c !== null && y(i)[c].click();
|
|
263
262
|
break;
|
|
264
263
|
case oe:
|
|
265
264
|
S(t);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "16.
|
|
1
|
+
const o = "16.3.1";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|
package/dist-es/sheet-common.js
CHANGED
|
@@ -81,16 +81,16 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
81
81
|
import { jsx as e, jsxs as g, Fragment as L } from "react/jsx-runtime";
|
|
82
82
|
import T from "classnames";
|
|
83
83
|
import * as t from "react";
|
|
84
|
-
import { transitionDuration as k, overlay as
|
|
84
|
+
import { transitionDuration as k, overlay as x, closingOverlay as w, SheetContainer as A, closingSheet as M, Sheet as C, SheetContent as P, handleContainer as Y, handle as _, children as O, modalCloseButton as G, stickyTitle as j, bodyContent as F, stickyButtons as H } from "./sheet-common.css-mistica.js";
|
|
85
85
|
import V from "./focus-trap.js";
|
|
86
86
|
import { useTheme as $, useDisableBodyScroll as z, useIsInViewport as y, useScreenSize as K } from "./hooks.js";
|
|
87
87
|
import { useSetModalStateEffect as X } from "./modal-context-provider.js";
|
|
88
88
|
import { Portal as q } from "./portal.js";
|
|
89
89
|
import { Text5 as J, Text3 as Q, Text2 as D } from "./text.js";
|
|
90
90
|
import { vars as b } from "./skins/skin-contract.css-mistica.js";
|
|
91
|
-
import
|
|
91
|
+
import I from "./stack.js";
|
|
92
92
|
import E from "./box.js";
|
|
93
|
-
import
|
|
93
|
+
import B from "./divider.js";
|
|
94
94
|
import { getPrefixedDataAttributes as U, getScrollableParentElement as W } from "./utils/dom.js";
|
|
95
95
|
import Z from "./generated/mistica-icons/icon-close-regular.js";
|
|
96
96
|
import { InternalIconButton as ee } from "./icon-button.js";
|
|
@@ -186,8 +186,8 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
186
186
|
children: /* @__PURE__ */ g(V, {
|
|
187
187
|
children: [
|
|
188
188
|
/* @__PURE__ */ e("div", {
|
|
189
|
-
className: T(
|
|
190
|
-
[
|
|
189
|
+
className: T(x, {
|
|
190
|
+
[w]: r === "closing"
|
|
191
191
|
}),
|
|
192
192
|
style: p,
|
|
193
193
|
onClick: s
|
|
@@ -220,6 +220,7 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
220
220
|
style: {
|
|
221
221
|
paddingBottom: re
|
|
222
222
|
},
|
|
223
|
+
tabIndex: -1,
|
|
223
224
|
children: [
|
|
224
225
|
typeof o == "function" ? o({
|
|
225
226
|
closeModal: s,
|
|
@@ -249,7 +250,7 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
249
250
|
mobile: ne,
|
|
250
251
|
tablet: oe,
|
|
251
252
|
desktop: se
|
|
252
|
-
},
|
|
253
|
+
}, we = (param)=>{
|
|
253
254
|
let { title: n, subtitle: o, description: i, modalTitleId: l, button: m, secondaryButton: v, link: r, children: c } = param;
|
|
254
255
|
const d = t.useRef(null), a = t.useRef(null), f = t.useRef(null);
|
|
255
256
|
t.useEffect(()=>{
|
|
@@ -289,7 +290,7 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
289
290
|
desktop: 40
|
|
290
291
|
}
|
|
291
292
|
}),
|
|
292
|
-
s && /* @__PURE__ */ e(
|
|
293
|
+
s && /* @__PURE__ */ e(B, {})
|
|
293
294
|
]
|
|
294
295
|
}),
|
|
295
296
|
/* @__PURE__ */ e("div", {
|
|
@@ -300,10 +301,10 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
300
301
|
mobile: 0
|
|
301
302
|
},
|
|
302
303
|
paddingX: R,
|
|
303
|
-
children: /* @__PURE__ */ g(
|
|
304
|
+
children: /* @__PURE__ */ g(I, {
|
|
304
305
|
space: 8,
|
|
305
306
|
children: [
|
|
306
|
-
o || i ? /* @__PURE__ */ g(
|
|
307
|
+
o || i ? /* @__PURE__ */ g(I, {
|
|
307
308
|
space: {
|
|
308
309
|
mobile: 8,
|
|
309
310
|
desktop: 16
|
|
@@ -341,7 +342,7 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
341
342
|
p && /* @__PURE__ */ g("div", {
|
|
342
343
|
className: H,
|
|
343
344
|
children: [
|
|
344
|
-
h && /* @__PURE__ */ e(
|
|
345
|
+
h && /* @__PURE__ */ e(B, {}),
|
|
345
346
|
/* @__PURE__ */ e(E, {
|
|
346
347
|
paddingY: {
|
|
347
348
|
mobile: 16,
|
|
@@ -363,4 +364,4 @@ const ce = process.env.NODE_ENV === "test" ? 0 : k, N = (n)=>"touches" in n ? n.
|
|
|
363
364
|
]
|
|
364
365
|
});
|
|
365
366
|
}, Ae = ue;
|
|
366
|
-
export {
|
|
367
|
+
export { we as SheetBody, Ae as default };
|