@telefonica/mistica 15.16.4 → 15.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/mistica.css +1 -1
- package/css/roboto.css +102 -34
- package/dist/box.d.ts +1 -0
- package/dist/box.js +11 -10
- package/dist/callout.d.ts +1 -0
- package/dist/callout.js +10 -10
- package/dist/card.d.ts +6 -1
- package/dist/card.js +375 -365
- package/dist/chip.d.ts +1 -0
- package/dist/chip.js +25 -26
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +65 -62
- package/dist/feedback.js +58 -52
- package/dist/generated/mistica-icons/icon-box-star-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-filled.js +121 -0
- package/dist/generated/mistica-icons/icon-box-star-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-light.js +117 -0
- package/dist/generated/mistica-icons/icon-box-star-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-regular.js +117 -0
- package/dist/generated/mistica-icons/icon-high-priority-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-filled.js +111 -0
- package/dist/generated/mistica-icons/icon-high-priority-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-light.js +111 -0
- package/dist/generated/mistica-icons/icon-high-priority-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-regular.js +111 -0
- package/dist/generated/mistica-icons/icon-mms-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-filled.js +122 -0
- package/dist/generated/mistica-icons/icon-mms-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-light.js +134 -0
- package/dist/generated/mistica-icons/icon-mms-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-regular.js +134 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.js +111 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-light.js +117 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.js +117 -0
- package/dist/generated/mistica-icons/icons-keywords.js +31 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +48 -0
- package/dist/inline.css-mistica.js +11 -8
- package/dist/inline.css.d.ts +1 -0
- package/dist/inline.js +12 -12
- package/dist/list.d.ts +1 -0
- package/dist/list.js +163 -157
- package/dist/package-version.js +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +9 -7
- package/dist/select.js +103 -95
- package/dist/skins/blau.js +96 -8
- package/dist/skins/defaults.js +98 -10
- package/dist/skins/movistar.js +94 -6
- package/dist/skins/o2-new.js +95 -7
- package/dist/skins/o2.js +94 -6
- package/dist/skins/skin-contract.css-mistica.js +42 -10
- package/dist/skins/skin-contract.css.d.ts +32 -0
- package/dist/skins/telefonica.js +96 -8
- package/dist/skins/tu.js +94 -6
- package/dist/skins/types/index.d.ts +36 -28
- package/dist/skins/vivo-new.js +95 -7
- package/dist/skins/vivo.js +94 -6
- package/dist/snackbar-context.js +23 -22
- package/dist/snackbar.d.ts +1 -0
- package/dist/snackbar.js +63 -57
- package/dist/theme-context-provider.js +91 -63
- package/dist/theme-context.css-mistica.js +452 -0
- package/dist/theme-context.css.d.ts +432 -0
- package/dist/theme-context.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +110 -110
- package/dist-es/box.js +17 -16
- package/dist-es/callout.js +38 -38
- package/dist-es/card.js +492 -482
- package/dist-es/chip.js +49 -50
- package/dist-es/dialog.js +78 -75
- package/dist-es/feedback.js +96 -89
- package/dist-es/generated/mistica-icons/icon-box-star-filled.js +112 -0
- package/dist-es/generated/mistica-icons/icon-box-star-light.js +108 -0
- package/dist-es/generated/mistica-icons/icon-box-star-regular.js +108 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-filled.js +102 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-light.js +102 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-regular.js +102 -0
- package/dist-es/generated/mistica-icons/icon-mms-filled.js +113 -0
- package/dist-es/generated/mistica-icons/icon-mms-light.js +125 -0
- package/dist-es/generated/mistica-icons/icon-mms-regular.js +125 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-filled.js +102 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-light.js +108 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-regular.js +108 -0
- package/dist-es/generated/mistica-icons/icons-keywords.js +31 -0
- package/dist-es/index.js +1563 -1551
- package/dist-es/inline.css-mistica.js +3 -3
- package/dist-es/inline.js +23 -23
- package/dist-es/list.js +225 -219
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +26 -24
- package/dist-es/select.js +146 -138
- package/dist-es/skins/blau.js +96 -8
- package/dist-es/skins/defaults.js +97 -9
- package/dist-es/skins/movistar.js +94 -6
- package/dist-es/skins/o2-new.js +95 -7
- package/dist-es/skins/o2.js +94 -6
- package/dist-es/skins/skin-contract.css-mistica.js +42 -10
- package/dist-es/skins/telefonica.js +98 -10
- package/dist-es/skins/tu.js +94 -6
- package/dist-es/skins/vivo-new.js +95 -7
- package/dist-es/skins/vivo.js +94 -6
- package/dist-es/snackbar-context.js +25 -24
- package/dist-es/snackbar.js +91 -85
- package/dist-es/style.css +1 -1
- package/dist-es/theme-context-provider.js +133 -105
- package/dist-es/theme-context.css-mistica.js +432 -0
- package/dist-es/theme-context.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/tooltip.js +149 -149
- package/package.json +2 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "15.
|
|
1
|
+
const o = "15.18.0";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|
package/dist-es/popover.js
CHANGED
|
@@ -55,48 +55,49 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
55
55
|
return target;
|
|
56
56
|
}
|
|
57
57
|
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
58
|
-
import { BaseTooltip as
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import { Text3 as
|
|
62
|
-
import
|
|
63
|
-
import { content as
|
|
64
|
-
import { vars as
|
|
65
|
-
import { iconContainerSize as
|
|
66
|
-
const
|
|
67
|
-
var { open: a, extra: m, children: c, onClose: i = ()=>{},
|
|
58
|
+
import { BaseTooltip as d } from "./tooltip.js";
|
|
59
|
+
import h from "./inline.js";
|
|
60
|
+
import u from "./stack.js";
|
|
61
|
+
import { Text3 as x, Text2 as v } from "./text.js";
|
|
62
|
+
import g from "./box.js";
|
|
63
|
+
import { content as y } from "./popover.css-mistica.js";
|
|
64
|
+
import { vars as P } from "./skins/skin-contract.css-mistica.js";
|
|
65
|
+
import { iconContainerSize as S } from "./icon-button.css-mistica.js";
|
|
66
|
+
const T = (_param)=>{
|
|
67
|
+
var { open: a, extra: m, children: c, onClose: i = ()=>{}, closeButtonLabel: l, dataAttributes: p, trackingEvent: s, title: o, description: e, asset: n } = _param, f = _object_without_properties(_param, [
|
|
68
68
|
"open",
|
|
69
69
|
"extra",
|
|
70
70
|
"children",
|
|
71
71
|
"onClose",
|
|
72
|
+
"closeButtonLabel",
|
|
72
73
|
"dataAttributes",
|
|
73
74
|
"trackingEvent",
|
|
74
75
|
"title",
|
|
75
76
|
"description",
|
|
76
77
|
"asset"
|
|
77
78
|
]);
|
|
78
|
-
return /* @__PURE__ */ r(
|
|
79
|
-
content: /* @__PURE__ */ t(
|
|
80
|
-
className:
|
|
79
|
+
return /* @__PURE__ */ r(d, _object_spread({
|
|
80
|
+
content: /* @__PURE__ */ t(g, {
|
|
81
|
+
className: y,
|
|
81
82
|
children: [
|
|
82
83
|
(o || e || n) && /* @__PURE__ */ r("div", {
|
|
83
84
|
style: {
|
|
84
|
-
paddingRight: `calc((${
|
|
85
|
+
paddingRight: `calc((${S.small} - 8px)`
|
|
85
86
|
},
|
|
86
|
-
children: /* @__PURE__ */ t(
|
|
87
|
+
children: /* @__PURE__ */ t(h, {
|
|
87
88
|
space: 16,
|
|
88
89
|
children: [
|
|
89
90
|
n,
|
|
90
|
-
/* @__PURE__ */ t(
|
|
91
|
+
/* @__PURE__ */ t(u, {
|
|
91
92
|
space: 4,
|
|
92
93
|
children: [
|
|
93
|
-
o && /* @__PURE__ */ r(
|
|
94
|
+
o && /* @__PURE__ */ r(x, {
|
|
94
95
|
regular: !0,
|
|
95
96
|
children: o
|
|
96
97
|
}),
|
|
97
|
-
e && /* @__PURE__ */ r(
|
|
98
|
+
e && /* @__PURE__ */ r(v, {
|
|
98
99
|
regular: !0,
|
|
99
|
-
color:
|
|
100
|
+
color: P.colors.textSecondary,
|
|
100
101
|
children: e
|
|
101
102
|
})
|
|
102
103
|
]
|
|
@@ -112,10 +113,11 @@ const S = (_param)=>{
|
|
|
112
113
|
hasPointerInteractionOnly: !0,
|
|
113
114
|
delay: !1,
|
|
114
115
|
onClose: i,
|
|
115
|
-
|
|
116
|
+
closeButtonLabel: l,
|
|
117
|
+
trackingEvent: s,
|
|
116
118
|
dataAttributes: _object_spread({
|
|
117
119
|
"component-name": "Popover"
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
export {
|
|
120
|
+
}, p)
|
|
121
|
+
}, f));
|
|
122
|
+
}, N = T;
|
|
123
|
+
export { N as default };
|
package/dist-es/select.js
CHANGED
|
@@ -51,29 +51,29 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
import { jsx as r, jsxs as
|
|
54
|
+
import { jsx as r, jsxs as _, Fragment as ke } from "react/jsx-runtime";
|
|
55
55
|
import * as n from "react";
|
|
56
|
-
import
|
|
56
|
+
import k from "classnames";
|
|
57
57
|
import { useForm as Ce } from "./form-context.js";
|
|
58
|
-
import { useAriaId as
|
|
59
|
-
import { SPACE as
|
|
60
|
-
import { FieldContainer as
|
|
61
|
-
import
|
|
62
|
-
import { TextFieldBaseAutosuggest as
|
|
63
|
-
import
|
|
64
|
-
import { isAndroid as
|
|
65
|
-
import { cancelEvent as
|
|
66
|
-
import { Text3 as
|
|
67
|
-
import { selectVariants as
|
|
68
|
-
import { inputWithLabel as
|
|
69
|
-
import { Portal as
|
|
70
|
-
import { pxToRem as
|
|
71
|
-
import { ThemeVariant as
|
|
72
|
-
const
|
|
73
|
-
let { id:
|
|
74
|
-
var
|
|
75
|
-
const h = n.useRef(null), d = n.useRef(null), S = n.useRef(null), v = n.useRef(null),
|
|
76
|
-
|
|
58
|
+
import { useAriaId as Pe, useTheme as De } from "./hooks.js";
|
|
59
|
+
import { SPACE as re, ENTER as se, ESC as Me, TAB as He, UP as Fe, DOWN as We } from "./utils/keys.js";
|
|
60
|
+
import { FieldContainer as Ge, HelperText as Le, Label as Ze } from "./text-field-components.js";
|
|
61
|
+
import oe from "./generated/mistica-icons/icon-chevron-down-regular.js";
|
|
62
|
+
import { TextFieldBaseAutosuggest as $e } from "./text-field-base.js";
|
|
63
|
+
import Be from "./overlay.js";
|
|
64
|
+
import { isAndroid as qe, isIos as ze } from "./utils/platform.js";
|
|
65
|
+
import { cancelEvent as p } from "./utils/dom.js";
|
|
66
|
+
import { Text3 as je } from "./text.js";
|
|
67
|
+
import { selectVariants as Ke, arrowDown as Ue, iconContainer as ie, selectContainerVariants as Xe, selectTextVariants as Je, vars as N, optionsContainer as Qe, optionsAnimationsVariants as ce, menuItem as Ye, menuItemSelected as et } from "./select.css-mistica.js";
|
|
68
|
+
import { inputWithLabel as ae, inputWithoutLabel as le } from "./text-field-base.css-mistica.js";
|
|
69
|
+
import { Portal as tt } from "./portal.js";
|
|
70
|
+
import { pxToRem as nt, applyCssVars as rt } from "./utils/css.js";
|
|
71
|
+
import { ThemeVariant as st } from "./theme-variant-context.js";
|
|
72
|
+
const ot = (param)=>{
|
|
73
|
+
let { id: ue, label: m, helperText: de, value: fe, defaultValue: pe, onChangeValue: C, name: i, fullWidth: P, options: u, optional: D, disabled: me, error: he, onBlur: M, autoFocus: z = !1, native: Se } = param;
|
|
74
|
+
var ne;
|
|
75
|
+
const h = n.useRef(null), d = n.useRef(null), S = n.useRef(null), v = n.useRef(null), R = n.useRef(/* @__PURE__ */ new Map()), [ve, ge] = n.useState(!0), [g, Te] = n.useState(pe), [H, j] = n.useState(!1), [K, U] = n.useState(!1), [X, O] = n.useState(!1), [a, F] = n.useState({}), [T, W] = n.useState(), G = n.useRef(null), L = Pe(ue), { rawValues: Ie, setRawValue: Z, setValue: $, formStatus: Ee, formErrors: J, setFormError: we, register: B } = Ce(), { platformOverrides: Q } = De(), xe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || qe(Q) || ze(Q), I = me || Ee === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ie[i], ee = (e)=>{
|
|
76
|
+
C == null || C(e), we({
|
|
77
77
|
name: i,
|
|
78
78
|
error: ""
|
|
79
79
|
}), Z({
|
|
@@ -83,68 +83,68 @@ const st = (param)=>{
|
|
|
83
83
|
name: i,
|
|
84
84
|
value: e
|
|
85
85
|
});
|
|
86
|
-
},
|
|
86
|
+
}, E = (e)=>{
|
|
87
87
|
if (e) {
|
|
88
88
|
if (S != null && S.current) {
|
|
89
|
-
const o = S.current.getBoundingClientRect(),
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const _e =
|
|
89
|
+
const o = S.current.getBoundingClientRect(), f = o.top, x = o.width, y = o.left, Ae = o.height, b = f + Ae, V = Math.min(u.length, 8) * 48 + 16;
|
|
90
|
+
if (b + V + 12 > window.innerHeight) {
|
|
91
|
+
const Ve = window.innerHeight - b;
|
|
92
|
+
if (f > Ve) {
|
|
93
|
+
const _e = f - V;
|
|
94
94
|
F({
|
|
95
|
-
minWidth:
|
|
96
|
-
left:
|
|
95
|
+
minWidth: x,
|
|
96
|
+
left: y,
|
|
97
97
|
top: Math.max(_e, 12),
|
|
98
|
-
maxHeight: Math.min(
|
|
98
|
+
maxHeight: Math.min(f - 12, V),
|
|
99
99
|
transformOrigin: "center bottom"
|
|
100
100
|
});
|
|
101
101
|
} else F({
|
|
102
|
-
minWidth:
|
|
103
|
-
top:
|
|
104
|
-
left:
|
|
105
|
-
maxHeight: window.innerHeight -
|
|
102
|
+
minWidth: x,
|
|
103
|
+
top: b,
|
|
104
|
+
left: y,
|
|
105
|
+
maxHeight: window.innerHeight - b - 12,
|
|
106
106
|
transformOrigin: "center top"
|
|
107
107
|
});
|
|
108
108
|
} else F({
|
|
109
|
-
minWidth:
|
|
110
|
-
top:
|
|
111
|
-
left:
|
|
112
|
-
maxHeight:
|
|
109
|
+
minWidth: x,
|
|
110
|
+
top: b,
|
|
111
|
+
left: y,
|
|
112
|
+
maxHeight: V,
|
|
113
113
|
transformOrigin: "center top"
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
j(!0), requestAnimationFrame(()=>{
|
|
117
117
|
G.current && v.current && "scrollTop" in v.current && (v.current.scrollTop = G.current), U(!0);
|
|
118
|
-
}), W(
|
|
118
|
+
}), W(g !== null && g !== void 0 ? g : l);
|
|
119
119
|
} else U(!1), j(!1), W(void 0);
|
|
120
120
|
}, q = (e)=>{
|
|
121
121
|
var t;
|
|
122
|
-
G.current = (t = v.current) == null ? void 0 : t.scrollTop,
|
|
123
|
-
},
|
|
122
|
+
G.current = (t = v.current) == null ? void 0 : t.scrollTop, E(!1), ee && typeof e == "string" && ee(e), typeof l > "u" && Te(e);
|
|
123
|
+
}, Oe = (e)=>{
|
|
124
124
|
var s;
|
|
125
125
|
const t = (s = v.current) == null ? void 0 : s.getBoundingClientRect();
|
|
126
|
-
if (t && e &&
|
|
127
|
-
const c =
|
|
126
|
+
if (t && e && R.current.has(e)) {
|
|
127
|
+
const c = R.current.get(e), o = c == null ? void 0 : c.getBoundingClientRect();
|
|
128
128
|
if (o && o.top + o.height / 2 >= t.top + t.height) {
|
|
129
129
|
c == null || c.scrollIntoView();
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
o && o.top + o.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, ye = d.current, be = h.current;
|
|
135
135
|
n.useEffect(()=>{
|
|
136
136
|
Z({
|
|
137
137
|
name: i,
|
|
138
|
-
value:
|
|
138
|
+
value: l
|
|
139
139
|
}), $({
|
|
140
140
|
name: i,
|
|
141
|
-
value:
|
|
141
|
+
value: l
|
|
142
142
|
});
|
|
143
143
|
}, [
|
|
144
144
|
i,
|
|
145
145
|
Z,
|
|
146
146
|
$,
|
|
147
|
-
|
|
147
|
+
l
|
|
148
148
|
]), n.useEffect(()=>(B(i, {
|
|
149
149
|
input: h.current,
|
|
150
150
|
focusableElement: d.current
|
|
@@ -158,38 +158,38 @@ const st = (param)=>{
|
|
|
158
158
|
B,
|
|
159
159
|
d,
|
|
160
160
|
h,
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
ye,
|
|
162
|
+
be
|
|
163
163
|
]), n.useEffect(()=>{
|
|
164
164
|
const e = (s)=>{
|
|
165
|
-
var
|
|
165
|
+
var f;
|
|
166
166
|
const o = {
|
|
167
|
-
[
|
|
168
|
-
[
|
|
167
|
+
[Fe]: -1,
|
|
168
|
+
[We]: 1
|
|
169
169
|
}[s.key];
|
|
170
170
|
if (o) {
|
|
171
|
-
|
|
171
|
+
p(s);
|
|
172
172
|
var _ref;
|
|
173
|
-
const
|
|
174
|
-
let { value:
|
|
175
|
-
return
|
|
176
|
-
}) + o]) == null ? void 0 :
|
|
177
|
-
W(
|
|
173
|
+
const x = (_ref = (f = u[u.findIndex((param)=>{
|
|
174
|
+
let { value: y } = param;
|
|
175
|
+
return y === T;
|
|
176
|
+
}) + o]) == null ? void 0 : f.value) !== null && _ref !== void 0 ? _ref : T;
|
|
177
|
+
W(x), Oe(x);
|
|
178
178
|
}
|
|
179
179
|
}, t = (s)=>{
|
|
180
180
|
if (H) switch(s.key){
|
|
181
|
-
case
|
|
182
|
-
|
|
181
|
+
case He:
|
|
182
|
+
p(s);
|
|
183
183
|
break;
|
|
184
|
-
case
|
|
185
|
-
|
|
184
|
+
case Me:
|
|
185
|
+
E(!1);
|
|
186
186
|
break;
|
|
187
|
+
case se:
|
|
187
188
|
case re:
|
|
188
|
-
|
|
189
|
-
m(s), f.findIndex((param)=>{
|
|
189
|
+
p(s), u.findIndex((param)=>{
|
|
190
190
|
let { value: c } = param;
|
|
191
|
-
return c ===
|
|
192
|
-
}) !== -1 &&
|
|
191
|
+
return c === T;
|
|
192
|
+
}) !== -1 && T !== g && q(T), E(!1);
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
K && e(s);
|
|
@@ -202,57 +202,57 @@ const st = (param)=>{
|
|
|
202
202
|
}, [
|
|
203
203
|
z
|
|
204
204
|
]), n.useEffect(()=>{
|
|
205
|
-
|
|
205
|
+
ge(!1);
|
|
206
206
|
}, []);
|
|
207
|
-
const
|
|
207
|
+
const Ne = (e)=>{
|
|
208
208
|
var t;
|
|
209
|
-
return e ? (t =
|
|
209
|
+
return e ? (t = u.find((param)=>{
|
|
210
210
|
let { value: s } = param;
|
|
211
211
|
return s === e;
|
|
212
212
|
})) == null ? void 0 : t.text : "";
|
|
213
|
-
},
|
|
213
|
+
}, Re = {
|
|
214
214
|
tabIndex: 0,
|
|
215
|
-
onFocus: ()=>
|
|
216
|
-
onBlur: ()=>
|
|
215
|
+
onFocus: ()=>O(!0),
|
|
216
|
+
onBlur: ()=>O(!1),
|
|
217
217
|
onClick: ()=>{
|
|
218
|
-
|
|
218
|
+
E(!0), O(!0);
|
|
219
219
|
},
|
|
220
220
|
onKeyDown: (e)=>{
|
|
221
|
-
!H && (e.key ===
|
|
221
|
+
!H && (e.key === re || e.key === se) && (p(e), E(!0));
|
|
222
222
|
}
|
|
223
|
-
},
|
|
224
|
-
var
|
|
225
|
-
return /* @__PURE__ */ r(
|
|
223
|
+
}, te = nt(20), w = g !== null && g !== void 0 ? g : l;
|
|
224
|
+
var _a_transformOrigin;
|
|
225
|
+
return /* @__PURE__ */ r(st, {
|
|
226
226
|
isInverse: !1,
|
|
227
|
-
children:
|
|
228
|
-
disabled:
|
|
229
|
-
helperText: /* @__PURE__ */ r(
|
|
230
|
-
error:
|
|
227
|
+
children: xe || ve ? /* @__PURE__ */ _(Ge, {
|
|
228
|
+
disabled: I,
|
|
229
|
+
helperText: /* @__PURE__ */ r(Le, {
|
|
230
|
+
error: A,
|
|
231
231
|
leftText: Y
|
|
232
232
|
}),
|
|
233
233
|
fieldRef: S,
|
|
234
234
|
fullWidth: P,
|
|
235
235
|
children: [
|
|
236
|
-
|
|
237
|
-
error:
|
|
236
|
+
m && /* @__PURE__ */ r(Ze, {
|
|
237
|
+
error: A,
|
|
238
238
|
forId: L,
|
|
239
|
-
inputState: X ? "focused" : (
|
|
239
|
+
inputState: X ? "focused" : (w !== null && w !== void 0 ? w : (ne = h.current) == null ? void 0 : ne.value) ? "filled" : "default",
|
|
240
240
|
optional: D,
|
|
241
|
-
children:
|
|
241
|
+
children: m
|
|
242
242
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
className:
|
|
243
|
+
/* @__PURE__ */ _("select", {
|
|
244
|
+
className: k(Ke[I ? "disabled" : "default"], m ? ae : le),
|
|
245
245
|
id: L,
|
|
246
|
-
"aria-invalid": !!
|
|
247
|
-
value:
|
|
246
|
+
"aria-invalid": !!A,
|
|
247
|
+
value: w,
|
|
248
248
|
required: !D,
|
|
249
|
-
disabled:
|
|
249
|
+
disabled: I,
|
|
250
250
|
onChange: (e)=>{
|
|
251
|
-
q(e.target.value)
|
|
251
|
+
q(e.target.value);
|
|
252
252
|
},
|
|
253
|
-
onFocus: ()=>
|
|
253
|
+
onFocus: ()=>O(!0),
|
|
254
254
|
onBlur: (e)=>{
|
|
255
|
-
|
|
255
|
+
O(!1), M == null || M(e);
|
|
256
256
|
},
|
|
257
257
|
ref: (e)=>{
|
|
258
258
|
[
|
|
@@ -265,21 +265,29 @@ const st = (param)=>{
|
|
|
265
265
|
style: {
|
|
266
266
|
// Override default browser opacity when disabled. This opacity also affects the label.
|
|
267
267
|
// Without this fix, the label is invisible when disabled
|
|
268
|
-
opacity: 1
|
|
268
|
+
opacity: 1,
|
|
269
|
+
// Use transparent color for the empty option (show below) to avoid showing it when the menu is closed
|
|
270
|
+
color: w ? void 0 : "transparent"
|
|
269
271
|
},
|
|
270
272
|
children: [
|
|
271
|
-
|
|
273
|
+
!w && u.every((param)=>{
|
|
272
274
|
let { value: e } = param;
|
|
273
275
|
return !!e;
|
|
274
|
-
}) && //
|
|
275
|
-
// this is needed to allow a native select
|
|
276
|
+
}) && // If no "empty" option exists, insert a dummy empty option. Once an option is selected,
|
|
277
|
+
// this empty option is removed. This is needed to allow a native select without a selected
|
|
278
|
+
// default option.
|
|
279
|
+
// Chrome doesn't show this option when the select menu is open (because of display: none),
|
|
280
|
+
// but Safari does. So we use the select's label for this option, otherwise it would be shown
|
|
281
|
+
// as an empty option, which is weirder.
|
|
276
282
|
/* @__PURE__ */ r("option", {
|
|
277
283
|
value: "",
|
|
278
284
|
style: {
|
|
279
285
|
display: "none"
|
|
280
|
-
}
|
|
286
|
+
},
|
|
287
|
+
"aria-label": "",
|
|
288
|
+
children: m
|
|
281
289
|
}),
|
|
282
|
-
|
|
290
|
+
u.map((param)=>{
|
|
283
291
|
let { value: e, text: t } = param;
|
|
284
292
|
return(// Set color: 'initial' to avoid wrong text color in some browsers when using dark mode.
|
|
285
293
|
// Similar issue in another lib: https://github.com/chakra-ui/chakra-ui/issues/417#issue-566611352
|
|
@@ -294,88 +302,88 @@ const st = (param)=>{
|
|
|
294
302
|
]
|
|
295
303
|
}),
|
|
296
304
|
/* @__PURE__ */ r("div", {
|
|
297
|
-
className:
|
|
305
|
+
className: Ue,
|
|
298
306
|
"aria-hidden": !0,
|
|
299
307
|
children: /* @__PURE__ */ r("div", {
|
|
300
|
-
className:
|
|
301
|
-
children: /* @__PURE__ */ r(
|
|
302
|
-
size:
|
|
308
|
+
className: ie,
|
|
309
|
+
children: /* @__PURE__ */ r(oe, {
|
|
310
|
+
size: te
|
|
303
311
|
})
|
|
304
312
|
})
|
|
305
313
|
})
|
|
306
314
|
]
|
|
307
|
-
}) : /* @__PURE__ */
|
|
315
|
+
}) : /* @__PURE__ */ _(ke, {
|
|
308
316
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
className:
|
|
317
|
+
/* @__PURE__ */ _("div", _object_spread_props(_object_spread({
|
|
318
|
+
className: Xe[P ? "fullWidth" : "default"],
|
|
311
319
|
role: "button",
|
|
312
320
|
"aria-haspopup": "listbox",
|
|
313
321
|
ref: d
|
|
314
|
-
}, !
|
|
322
|
+
}, !I && Re), {
|
|
315
323
|
children: [
|
|
316
|
-
/* @__PURE__ */ r(
|
|
324
|
+
/* @__PURE__ */ r($e, {
|
|
317
325
|
style: {
|
|
318
326
|
visibility: "hidden"
|
|
319
327
|
},
|
|
320
328
|
fullWidth: P,
|
|
321
329
|
endIcon: /* @__PURE__ */ r("div", {
|
|
322
|
-
className:
|
|
323
|
-
children: /* @__PURE__ */ r(
|
|
324
|
-
size:
|
|
330
|
+
className: ie,
|
|
331
|
+
children: /* @__PURE__ */ r(oe, {
|
|
332
|
+
size: te
|
|
325
333
|
})
|
|
326
334
|
}),
|
|
327
335
|
focus: X,
|
|
328
|
-
label:
|
|
329
|
-
value:
|
|
330
|
-
shrinkLabel: !!(
|
|
336
|
+
label: m,
|
|
337
|
+
value: w,
|
|
338
|
+
shrinkLabel: !!(l || g),
|
|
331
339
|
name: i,
|
|
332
340
|
helperText: Y,
|
|
333
341
|
required: !D,
|
|
334
|
-
disabled:
|
|
342
|
+
disabled: I,
|
|
335
343
|
id: L,
|
|
336
|
-
error:
|
|
344
|
+
error: A,
|
|
337
345
|
inputRef: h,
|
|
338
346
|
fieldRef: S
|
|
339
347
|
}),
|
|
340
348
|
/* @__PURE__ */ r("div", {
|
|
341
|
-
className:
|
|
342
|
-
children:
|
|
349
|
+
className: k(Je[I ? "disabled" : "default"], m ? ae : le),
|
|
350
|
+
children: Ne(w)
|
|
343
351
|
})
|
|
344
352
|
]
|
|
345
353
|
})),
|
|
346
|
-
H && /* @__PURE__ */ r(
|
|
354
|
+
H && /* @__PURE__ */ r(Be, {
|
|
347
355
|
onPress: (e)=>{
|
|
348
|
-
|
|
356
|
+
E(!1), p(e);
|
|
349
357
|
},
|
|
350
358
|
disableScroll: !0,
|
|
351
|
-
children: /* @__PURE__ */ r(
|
|
359
|
+
children: /* @__PURE__ */ r(tt, {
|
|
352
360
|
children: /* @__PURE__ */ r("ul", {
|
|
353
|
-
style:
|
|
354
|
-
[
|
|
355
|
-
[
|
|
356
|
-
[
|
|
357
|
-
[
|
|
358
|
-
[
|
|
361
|
+
style: rt({
|
|
362
|
+
[N.top]: a.top ? `${a.top}px` : "",
|
|
363
|
+
[N.left]: a.left ? `${a.left}px` : "",
|
|
364
|
+
[N.maxHeight]: a.maxHeight ? `${a.maxHeight}px` : "",
|
|
365
|
+
[N.minWidth]: a.minWidth ? `${a.minWidth}px` : "",
|
|
366
|
+
[N.transformOrigin]: (_a_transformOrigin = a.transformOrigin) !== null && _a_transformOrigin !== void 0 ? _a_transformOrigin : ""
|
|
359
367
|
}),
|
|
360
|
-
onPointerDown:
|
|
361
|
-
className:
|
|
368
|
+
onPointerDown: p,
|
|
369
|
+
className: k(Qe, K ? ce.show : ce.hide),
|
|
362
370
|
role: "listbox",
|
|
363
371
|
ref: v,
|
|
364
|
-
children:
|
|
372
|
+
children: u.map((param)=>{
|
|
365
373
|
let { value: e, text: t } = param;
|
|
366
374
|
return /* @__PURE__ */ r("li", {
|
|
367
375
|
role: "option",
|
|
368
|
-
"aria-selected": e === (
|
|
376
|
+
"aria-selected": e === (g !== null && g !== void 0 ? g : l),
|
|
369
377
|
"data-value": e,
|
|
370
|
-
className:
|
|
371
|
-
[
|
|
378
|
+
className: k(Ye, {
|
|
379
|
+
[et]: e === T || e === (g !== null && g !== void 0 ? g : l)
|
|
372
380
|
}),
|
|
373
|
-
onPointerDown:
|
|
381
|
+
onPointerDown: p,
|
|
374
382
|
onClick: ()=>q(e),
|
|
375
383
|
ref: (s)=>{
|
|
376
|
-
s ?
|
|
384
|
+
s ? R.current.set(e, s) : R.current.delete(e);
|
|
377
385
|
},
|
|
378
|
-
children: /* @__PURE__ */ r(
|
|
386
|
+
children: /* @__PURE__ */ r(je, {
|
|
379
387
|
regular: !0,
|
|
380
388
|
children: t
|
|
381
389
|
})
|
|
@@ -387,5 +395,5 @@ const st = (param)=>{
|
|
|
387
395
|
]
|
|
388
396
|
})
|
|
389
397
|
});
|
|
390
|
-
},
|
|
391
|
-
export {
|
|
398
|
+
}, Ot = ot;
|
|
399
|
+
export { Ot as default };
|