@telefonica/mistica 14.41.0 → 14.42.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/boxed.css-mistica.js +14 -5
- package/dist/boxed.css.d.ts +1 -0
- package/dist/boxed.d.ts +1 -0
- package/dist/boxed.js +11 -9
- package/dist/button-fixed-footer-layout.d.ts +1 -0
- package/dist/button-fixed-footer-layout.js +19 -14
- package/dist/button-layout.css-mistica.js +16 -13
- package/dist/button-layout.css.d.ts +1 -0
- package/dist/button-layout.js +15 -15
- package/dist/button.js +43 -35
- package/dist/carousel.d.ts +13 -0
- package/dist/carousel.js +325 -223
- package/dist/credit-card-expiration-field.js +30 -26
- package/dist/credit-card-number-field.css-mistica.js +7 -7
- package/dist/credit-card-number-field.js +59 -45
- package/dist/cvv-field.js +46 -41
- package/dist/date-field.css-mistica.js +14 -0
- package/dist/date-field.css.d.ts +1 -0
- package/dist/date-field.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/date-field.js +41 -35
- package/dist/date-time-field.js +40 -34
- package/dist/date-time-picker.js +43 -45
- package/dist/decimal-field.js +26 -22
- package/dist/dialog-context.d.ts +24 -0
- package/dist/dialog-context.js +192 -0
- package/dist/dialog.css-mistica.js +15 -12
- package/dist/dialog.css.d.ts +1 -0
- package/dist/dialog.d.ts +14 -44
- package/dist/dialog.js +163 -246
- package/dist/double-field.css-mistica.js +3 -2
- package/dist/email-field.js +15 -11
- package/dist/feedback.css-mistica.js +23 -14
- package/dist/feedback.css.d.ts +7 -4
- package/dist/feedback.js +157 -143
- package/dist/fixed-footer-layout.css-mistica.js +1 -1
- package/dist/fixed-footer-layout.js +9 -8
- package/dist/iban-field.js +31 -27
- package/dist/icons/icon-amex.d.ts +1 -1
- package/dist/icons/icon-cvv-amex.d.ts +1 -1
- package/dist/icons/icon-cvv-visa-mc.d.ts +1 -1
- package/dist/icons/icon-mastercard.d.ts +1 -1
- package/dist/icons/icon-visa.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -4
- package/dist/inline.css-mistica.js +9 -6
- package/dist/inline.css.d.ts +1 -1
- package/dist/inline.js +9 -9
- package/dist/integer-field.js +17 -13
- package/dist/loading-bar.css-mistica.js +4 -7
- package/dist/loading-bar.css.d.ts +0 -2
- package/dist/loading-bar.js +3 -6
- package/dist/month-field.js +39 -33
- package/dist/package-version.js +1 -1
- package/dist/password-field.js +46 -44
- package/dist/phone-number-field.js +50 -46
- package/dist/pin-field.css-mistica.js +12 -6
- package/dist/pin-field.css.d.ts +2 -0
- package/dist/pin-field.d.ts +3 -1
- package/dist/pin-field.js +129 -95
- package/dist/responsive-layout.css-mistica.js +10 -7
- package/dist/responsive-layout.css.d.ts +2 -1
- package/dist/responsive-layout.d.ts +1 -1
- package/dist/responsive-layout.js +20 -17
- package/dist/search-field.js +36 -35
- package/dist/select.css-mistica.js +16 -15
- package/dist/select.css.d.ts +1 -0
- package/dist/select.js +138 -143
- package/dist/text-field-base.css-mistica.js +45 -21
- package/dist/text-field-base.css.d.ts +30 -7
- package/dist/text-field-base.d.ts +11 -0
- package/dist/text-field-base.js +175 -140
- package/dist/text-field-components.css-mistica.js +13 -21
- package/dist/text-field-components.css.d.ts +0 -3
- package/dist/text-field-components.d.ts +3 -0
- package/dist/text-field-components.js +38 -35
- package/dist/text-field.js +26 -22
- package/dist/text.css-mistica.js +7 -7
- package/dist/text.css.d.ts +0 -1
- package/dist/text.js +24 -24
- package/dist/theme-context-provider.js +2 -2
- package/dist/utils/platform.js +8 -11
- package/dist-es/boxed.css-mistica.js +3 -2
- package/dist-es/boxed.js +17 -15
- package/dist-es/button-fixed-footer-layout.js +29 -24
- package/dist-es/button-layout.css-mistica.js +7 -7
- package/dist-es/button-layout.js +23 -23
- package/dist-es/button.js +65 -57
- package/dist-es/carousel.js +373 -280
- package/dist-es/credit-card-expiration-field.js +34 -30
- package/dist-es/credit-card-number-field.css-mistica.js +4 -4
- package/dist-es/credit-card-number-field.js +84 -70
- package/dist-es/cvv-field.js +68 -63
- package/dist-es/date-field.css-mistica.js +5 -0
- package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/date-field.js +46 -40
- package/dist-es/date-time-field.js +47 -41
- package/dist-es/date-time-picker.js +55 -57
- package/dist-es/decimal-field.js +31 -27
- package/dist-es/dialog-context.js +125 -0
- package/dist-es/dialog.css-mistica.js +3 -3
- package/dist-es/dialog.js +193 -262
- package/dist-es/double-field.css-mistica.js +3 -2
- package/dist-es/email-field.js +16 -12
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/feedback.js +196 -182
- package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
- package/dist-es/fixed-footer-layout.js +21 -20
- package/dist-es/iban-field.js +42 -38
- package/dist-es/index.js +1778 -1778
- package/dist-es/inline.css-mistica.js +3 -3
- package/dist-es/inline.js +18 -18
- package/dist-es/integer-field.js +21 -17
- package/dist-es/loading-bar.css-mistica.js +2 -2
- package/dist-es/loading-bar.js +10 -13
- package/dist-es/month-field.js +47 -41
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +54 -52
- package/dist-es/phone-number-field.js +53 -49
- package/dist-es/pin-field.css-mistica.js +2 -2
- package/dist-es/pin-field.js +145 -111
- package/dist-es/responsive-layout.css-mistica.js +3 -3
- package/dist-es/responsive-layout.js +27 -24
- package/dist-es/search-field.js +45 -44
- package/dist-es/select.css-mistica.js +8 -7
- package/dist-es/select.js +167 -172
- package/dist-es/style.css +1 -1
- package/dist-es/text-field-base.css-mistica.js +2 -2
- package/dist-es/text-field-base.js +189 -157
- package/dist-es/text-field-components.css-mistica.js +3 -2
- package/dist-es/text-field-components.js +52 -49
- package/dist-es/text-field.js +31 -27
- package/dist-es/text.css-mistica.js +3 -3
- package/dist-es/text.js +32 -32
- package/dist-es/theme-context-provider.js +1 -1
- package/dist-es/utils/platform.js +6 -6
- package/package.json +1 -1
- package/dist/password-field.css-mistica.js +0 -13
- package/dist/password-field.css.d.ts +0 -1
- package/dist-es/password-field.css-mistica.js +0 -4
- /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
- /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
package/dist-es/pin-field.js
CHANGED
|
@@ -27,45 +27,69 @@ function _object_spread(target) {
|
|
|
27
27
|
}
|
|
28
28
|
return target;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
function ownKeys(object, enumerableOnly) {
|
|
31
|
+
var keys = Object.keys(object);
|
|
32
|
+
if (Object.getOwnPropertySymbols) {
|
|
33
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
if (enumerableOnly) {
|
|
35
|
+
symbols = symbols.filter(function(sym) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
keys.push.apply(keys, symbols);
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread_props(target, source) {
|
|
44
|
+
source = source != null ? source : {};
|
|
45
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
+
} else {
|
|
48
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
import { jsxs as $, jsx as n } from "react/jsx-runtime";
|
|
31
55
|
import D from "classnames";
|
|
32
56
|
import * as m from "react";
|
|
33
|
-
import
|
|
34
|
-
import { input as
|
|
35
|
-
import { disabled as
|
|
57
|
+
import N from "./inline.js";
|
|
58
|
+
import { input as B } from "./text-field-base.css-mistica.js";
|
|
59
|
+
import { fieldContainer as E, disabled as L, readOnlyField as j, focusedField as O, field as W, input as q, passwordInput as z, pinInputLineHeight as h, passwordDot as K } from "./pin-field.css-mistica.js";
|
|
36
60
|
import { useAriaId as M, useTheme as _ } from "./hooks.js";
|
|
37
|
-
import
|
|
38
|
-
import { IntegerInput as
|
|
39
|
-
import { useFieldProps as
|
|
40
|
-
import { createChangeEvent as
|
|
41
|
-
import { HelperText as
|
|
42
|
-
import { flushSync as
|
|
43
|
-
let
|
|
44
|
-
const
|
|
45
|
-
let { length:
|
|
61
|
+
import G from "./screen-reader-only.js";
|
|
62
|
+
import { IntegerInput as J } from "./integer-field.js";
|
|
63
|
+
import { useFieldProps as Q } from "./form-context.js";
|
|
64
|
+
import { getPrefixedDataAttributes as U, createChangeEvent as X } from "./utils/dom.js";
|
|
65
|
+
import { HelperText as Y } from "./text-field-components.js";
|
|
66
|
+
import { flushSync as Z } from "react-dom";
|
|
67
|
+
let T = !1;
|
|
68
|
+
const x = (param)=>{
|
|
69
|
+
let { length: l = 6, hideCode: f = !1, readSms: d, disabled: g, readOnly: y, value: F, defaultValue: b, onChange: u, inputRef: A } = param;
|
|
46
70
|
var _ref;
|
|
47
|
-
const { texts:
|
|
48
|
-
length:
|
|
49
|
-
}, ()=>null)).current,
|
|
50
|
-
if (s ===
|
|
51
|
-
|
|
52
|
-
const e =
|
|
53
|
-
e && (
|
|
71
|
+
const { texts: C } = _(), [R, S] = m.useState((_ref = b == null ? void 0 : b.slice(0, l)) !== null && _ref !== void 0 ? _ref : ""), [w, I] = m.useState(void 0), a = m.useRef(Array.from({
|
|
72
|
+
length: l
|
|
73
|
+
}, ()=>null)).current, i = typeof F < "u", t = i ? F : R, c = m.useCallback((s)=>{
|
|
74
|
+
if (s === t) return;
|
|
75
|
+
i || S(s);
|
|
76
|
+
const e = a[0];
|
|
77
|
+
e && (u == null || u(X(_object_spread({}, e), s)));
|
|
54
78
|
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
79
|
+
t,
|
|
80
|
+
a,
|
|
81
|
+
i,
|
|
82
|
+
u
|
|
59
83
|
]);
|
|
60
84
|
m.useEffect(()=>{
|
|
61
|
-
|
|
85
|
+
c(t.slice(0, l));
|
|
62
86
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
87
|
+
l,
|
|
88
|
+
t,
|
|
89
|
+
c
|
|
66
90
|
]), m.useEffect(()=>{
|
|
67
|
-
if (d && "OTPCredential" in window && !
|
|
68
|
-
|
|
91
|
+
if (d && "OTPCredential" in window && !T) {
|
|
92
|
+
T = !0;
|
|
69
93
|
const s = new AbortController();
|
|
70
94
|
return navigator.credentials.get({
|
|
71
95
|
// @ts-expect-error: otp is not in the types yet
|
|
@@ -77,94 +101,101 @@ const Y = (param)=>{
|
|
|
77
101
|
signal: s.signal
|
|
78
102
|
}).then((e)=>{
|
|
79
103
|
if (e) {
|
|
80
|
-
const
|
|
81
|
-
|
|
104
|
+
const r = e.code.slice(0, l);
|
|
105
|
+
c(r);
|
|
82
106
|
}
|
|
83
107
|
}).catch(()=>{}).finally(()=>{
|
|
84
|
-
|
|
108
|
+
T = !1;
|
|
85
109
|
}), ()=>{
|
|
86
|
-
|
|
110
|
+
T = !1, s.abort();
|
|
87
111
|
};
|
|
88
112
|
}
|
|
89
113
|
}, [
|
|
90
|
-
|
|
91
|
-
|
|
114
|
+
c,
|
|
115
|
+
l,
|
|
92
116
|
d
|
|
93
117
|
]);
|
|
94
|
-
const
|
|
95
|
-
var
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
const o =
|
|
99
|
-
let p =
|
|
100
|
-
!o || o ===
|
|
101
|
-
let
|
|
118
|
+
const H = (s)=>(e)=>{
|
|
119
|
+
var k;
|
|
120
|
+
const r = e.target.value;
|
|
121
|
+
if (r === "") return;
|
|
122
|
+
const o = t[s];
|
|
123
|
+
let p = r;
|
|
124
|
+
!o || o === r ? p = r : o === r[0] ? p = r.slice(1) : o === r[r.length - 1] && (p = r.slice(0, -1));
|
|
125
|
+
let v = s, P = t;
|
|
102
126
|
if (p.length >= 2) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
} else
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}),
|
|
127
|
+
const V = p.slice(0, l - s);
|
|
128
|
+
P = t.slice(0, s) + V, v = Math.min(s + V.length, l - 1);
|
|
129
|
+
} else P = t.slice(0, s) + p + t.slice(s + 1), v = s + 1;
|
|
130
|
+
P !== t && (Z(()=>{
|
|
131
|
+
c(P);
|
|
132
|
+
}), v !== s && v <= l - 1 && ((k = a[v]) == null || k.focus()));
|
|
109
133
|
};
|
|
110
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ n(N, {
|
|
111
135
|
space: 8,
|
|
112
136
|
children: Array.from({
|
|
113
|
-
length:
|
|
137
|
+
length: l
|
|
114
138
|
}).map((s, e)=>/* @__PURE__ */ {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
117
|
-
className: y ? j : e ===
|
|
139
|
+
var _t_e;
|
|
140
|
+
return $("div", {
|
|
141
|
+
className: y ? j : e === w ? O : W,
|
|
118
142
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
"aria-label":
|
|
121
|
-
type:
|
|
122
|
-
tabIndex: e >
|
|
143
|
+
/* @__PURE__ */ n(J, {
|
|
144
|
+
"aria-label": C.pinFieldInputLabel.replace("1$s", String(e + 1)).replace("2$s", String(l)),
|
|
145
|
+
type: f ? "password" : "text",
|
|
146
|
+
tabIndex: e > t.length ? -1 : void 0,
|
|
123
147
|
required: !0,
|
|
124
148
|
onFocus: ()=>{
|
|
125
149
|
var o;
|
|
126
|
-
const
|
|
127
|
-
|
|
150
|
+
const r = t.length === l ? -1 : t.length;
|
|
151
|
+
r >= 0 && r < e ? (o = a[r]) == null || o.focus() : I(e);
|
|
128
152
|
},
|
|
129
153
|
onBlur: ()=>{
|
|
130
|
-
|
|
154
|
+
I(void 0);
|
|
131
155
|
},
|
|
132
|
-
inputRef: (
|
|
133
|
-
|
|
156
|
+
inputRef: (r)=>{
|
|
157
|
+
a[e] = r, e === 0 && A(r);
|
|
134
158
|
},
|
|
135
|
-
className: D(
|
|
136
|
-
[
|
|
159
|
+
className: D(B, q, {
|
|
160
|
+
[z]: f
|
|
137
161
|
}),
|
|
138
|
-
|
|
162
|
+
style: {
|
|
163
|
+
marginTop: `calc(${h} - 1px)`,
|
|
164
|
+
marginBottom: `calc(${h} - 1px)`,
|
|
165
|
+
lineHeight: h,
|
|
166
|
+
fontSize: h,
|
|
167
|
+
height: h
|
|
168
|
+
},
|
|
169
|
+
disabled: g,
|
|
139
170
|
readOnly: y,
|
|
140
171
|
autoComplete: d ? "one-time-code" : void 0,
|
|
141
|
-
value: (
|
|
142
|
-
onChange:
|
|
143
|
-
onKeyDown: (
|
|
144
|
-
switch(
|
|
172
|
+
value: (_t_e = t[e]) !== null && _t_e !== void 0 ? _t_e : "",
|
|
173
|
+
onChange: H(e),
|
|
174
|
+
onKeyDown: (r)=>{
|
|
175
|
+
switch(r.key){
|
|
145
176
|
case "Backspace":
|
|
146
177
|
case "Delete":
|
|
147
|
-
if (
|
|
148
|
-
const o =
|
|
178
|
+
if (r.currentTarget.value && c(t.slice(0, e) + t.slice(e + 1)), e > 0 && e >= t.length - 1) {
|
|
179
|
+
const o = a[e - 1];
|
|
149
180
|
o == null || o.focus();
|
|
150
181
|
}
|
|
151
182
|
break;
|
|
152
183
|
case "ArrowLeft":
|
|
153
184
|
if (e > 0) {
|
|
154
|
-
const o =
|
|
185
|
+
const o = a[e - 1];
|
|
155
186
|
o && o.focus();
|
|
156
187
|
}
|
|
157
188
|
break;
|
|
158
189
|
case "ArrowRight":
|
|
159
|
-
if (e <
|
|
160
|
-
const o =
|
|
190
|
+
if (e < l - 1) {
|
|
191
|
+
const o = a[e + 1];
|
|
161
192
|
o && o.focus();
|
|
162
193
|
}
|
|
163
194
|
break;
|
|
164
195
|
}
|
|
165
196
|
}
|
|
166
197
|
}),
|
|
167
|
-
|
|
198
|
+
f && t[e] && /* @__PURE__ */ n("div", {
|
|
168
199
|
"aria-hidden": !0,
|
|
169
200
|
className: K,
|
|
170
201
|
children: "•"
|
|
@@ -173,48 +204,51 @@ const Y = (param)=>{
|
|
|
173
204
|
}, e);
|
|
174
205
|
})
|
|
175
206
|
});
|
|
176
|
-
},
|
|
177
|
-
let { length:
|
|
178
|
-
disabled:
|
|
179
|
-
const
|
|
180
|
-
name:
|
|
207
|
+
}, ee = (param)=>{
|
|
208
|
+
let { length: l = 6, hideCode: f = !1, readSms: d = !f, // by default, don't read sms if the code is hidden (password input type)
|
|
209
|
+
disabled: g, readOnly: y, name: F, value: b, defaultValue: u, helperText: A, error: C, onChangeValue: R, onChange: S, "aria-label": w, "aria-labelledby": I, dataAttributes: a } = param;
|
|
210
|
+
const i = Q({
|
|
211
|
+
name: F,
|
|
181
212
|
value: b,
|
|
182
|
-
defaultValue:
|
|
183
|
-
processValue: (
|
|
184
|
-
helperText:
|
|
213
|
+
defaultValue: u,
|
|
214
|
+
processValue: (c)=>c,
|
|
215
|
+
helperText: A,
|
|
185
216
|
optional: !1,
|
|
186
|
-
error:
|
|
187
|
-
disabled:
|
|
188
|
-
onChangeValue:
|
|
189
|
-
onChange:
|
|
190
|
-
}),
|
|
191
|
-
return /* @__PURE__ */
|
|
217
|
+
error: C,
|
|
218
|
+
disabled: g,
|
|
219
|
+
onChangeValue: R,
|
|
220
|
+
onChange: S
|
|
221
|
+
}), t = M();
|
|
222
|
+
return /* @__PURE__ */ $("div", _object_spread_props(_object_spread({
|
|
192
223
|
role: "group",
|
|
193
|
-
"aria-labelledby":
|
|
194
|
-
className:
|
|
224
|
+
"aria-labelledby": I !== null && I !== void 0 ? I : t,
|
|
225
|
+
className: D(E, {
|
|
226
|
+
[L]: g
|
|
227
|
+
})
|
|
228
|
+
}, U(a, "PinField")), {
|
|
195
229
|
children: [
|
|
196
|
-
|
|
197
|
-
children: /* @__PURE__ */
|
|
198
|
-
id:
|
|
199
|
-
children:
|
|
230
|
+
w && !I && /* @__PURE__ */ n(G, {
|
|
231
|
+
children: /* @__PURE__ */ n("div", {
|
|
232
|
+
id: t,
|
|
233
|
+
children: w
|
|
200
234
|
})
|
|
201
235
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
inputRef:
|
|
204
|
-
length:
|
|
205
|
-
hideCode:
|
|
236
|
+
/* @__PURE__ */ n(x, {
|
|
237
|
+
inputRef: i.inputRef,
|
|
238
|
+
length: l,
|
|
239
|
+
hideCode: f,
|
|
206
240
|
readSms: d,
|
|
207
|
-
value:
|
|
208
|
-
defaultValue:
|
|
209
|
-
disabled:
|
|
210
|
-
onChange:
|
|
241
|
+
value: i.value,
|
|
242
|
+
defaultValue: i.defaultValue,
|
|
243
|
+
disabled: i.disabled,
|
|
244
|
+
onChange: i.onChange,
|
|
211
245
|
readOnly: y
|
|
212
246
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
error:
|
|
215
|
-
leftText:
|
|
247
|
+
/* @__PURE__ */ n(Y, {
|
|
248
|
+
error: i.error,
|
|
249
|
+
leftText: i.helperText
|
|
216
250
|
})
|
|
217
251
|
]
|
|
218
|
-
});
|
|
219
|
-
},
|
|
220
|
-
export {
|
|
252
|
+
}));
|
|
253
|
+
}, de = ee;
|
|
254
|
+
export { de as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./responsive-layout.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var
|
|
3
|
+
var e = {
|
|
4
4
|
inverse: "_1y2v1nf3f",
|
|
5
5
|
alternative: "_1y2v1nf3k"
|
|
6
|
-
}, r = "_17lofg73",
|
|
7
|
-
export {
|
|
6
|
+
}, n = "_17lofg74", r = "_17lofg73", t = "_17lofg7a _1y2v1nfh5", v = "_17lofg75", i = "_17lofg78", f = "_17lofg72 _1y2v1nfh5";
|
|
7
|
+
export { e as backgroundVariant, n as expandedResponsiveLayoutContainerDesktop, r as expandedResponsiveLayoutContainerMobile, t as fullWidth, v as fullwidthContainer, i as responsiveLayout, f as responsiveLayoutContainer };
|
|
@@ -78,35 +78,38 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
}
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
|
-
import { jsx as
|
|
82
|
-
import
|
|
83
|
-
import { getPrefixedDataAttributes as
|
|
84
|
-
import { fullwidthContainer as
|
|
85
|
-
import { useThemeVariant as
|
|
86
|
-
const
|
|
87
|
-
let { children:
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
variant:
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
className:
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
82
|
+
import m from "classnames";
|
|
83
|
+
import { getPrefixedDataAttributes as v } from "./utils/dom.js";
|
|
84
|
+
import { fullwidthContainer as l, responsiveLayoutContainer as c, backgroundVariant as f, expandedResponsiveLayoutContainerMobile as y, expandedResponsiveLayoutContainerDesktop as L, fullWidth as x, responsiveLayout as R } from "./responsive-layout.css-mistica.js";
|
|
85
|
+
import { useThemeVariant as V, ThemeVariant as h } from "./theme-variant-context.js";
|
|
86
|
+
const b = (param)=>{
|
|
87
|
+
let { children: n, isInverse: o = !1, variant: r, backgroundColor: s, className: p, fullWidth: e, dataAttributes: u, shouldExpandWhenNested: i = !1 } = param;
|
|
88
|
+
const d = V(), t = r || o && "inverse" || void 0;
|
|
89
|
+
return /* @__PURE__ */ a(h, {
|
|
90
|
+
variant: t !== null && t !== void 0 ? t : d,
|
|
91
|
+
children: /* @__PURE__ */ a("div", _object_spread_props(_object_spread({
|
|
92
|
+
className: m(e ? l : c, p, t && t !== "default" && f[t], {
|
|
93
|
+
[y]: i === !0 && !e,
|
|
94
|
+
[L]: i && !e
|
|
95
|
+
}),
|
|
96
|
+
style: s ? {
|
|
97
|
+
background: s
|
|
95
98
|
} : void 0
|
|
96
|
-
},
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
className:
|
|
99
|
-
children:
|
|
99
|
+
}, v(u)), {
|
|
100
|
+
children: /* @__PURE__ */ a("div", {
|
|
101
|
+
className: e ? x : R,
|
|
102
|
+
children: n
|
|
100
103
|
})
|
|
101
104
|
}))
|
|
102
105
|
});
|
|
103
|
-
},
|
|
104
|
-
var { children:
|
|
106
|
+
}, C = (_param)=>{
|
|
107
|
+
var { children: n } = _param, o = _object_without_properties(_param, [
|
|
105
108
|
"children"
|
|
106
109
|
]);
|
|
107
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ a(b, _object_spread_props(_object_spread({}, o), {
|
|
108
111
|
shouldExpandWhenNested: !0,
|
|
109
|
-
children:
|
|
112
|
+
children: n
|
|
110
113
|
}));
|
|
111
|
-
},
|
|
112
|
-
export {
|
|
114
|
+
}, j = C;
|
|
115
|
+
export { b as InternalResponsiveLayout, j as default };
|
package/dist-es/search-field.js
CHANGED
|
@@ -78,18 +78,18 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
}
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
|
-
import { jsx as
|
|
81
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
82
82
|
import * as r from "react";
|
|
83
|
-
import { useFieldProps as
|
|
84
|
-
import { TextFieldBaseAutosuggest as
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
const q = /*#__PURE__*/ r.forwardRef((_param,
|
|
92
|
-
var { disabled:
|
|
83
|
+
import { useFieldProps as A } from "./form-context.js";
|
|
84
|
+
import { TextFieldBaseAutosuggest as B, FieldEndIcon as E } from "./text-field-base.js";
|
|
85
|
+
import T from "./generated/mistica-icons/icon-search-regular.js";
|
|
86
|
+
import j from "./generated/mistica-icons/icon-close-regular.js";
|
|
87
|
+
import { useTheme as w } from "./hooks.js";
|
|
88
|
+
import { createChangeEvent as N } from "./utils/dom.js";
|
|
89
|
+
import { combineRefs as V } from "./utils/common.js";
|
|
90
|
+
import { iconSize as W, endIconWithShadow as $ } from "./text-field-base.css-mistica.js";
|
|
91
|
+
const q = /*#__PURE__*/ r.forwardRef((_param, h)=>{
|
|
92
|
+
var { disabled: f, error: d, helperText: u, name: n, optional: p, validate: S, onChange: e, onChangeValue: t, onBlur: I, value: l, defaultValue: R, dataAttributes: F } = _param, b = _object_without_properties(_param, [
|
|
93
93
|
"disabled",
|
|
94
94
|
"error",
|
|
95
95
|
"helperText",
|
|
@@ -100,48 +100,49 @@ const q = /*#__PURE__*/ r.forwardRef((_param, y)=>{
|
|
|
100
100
|
"onChangeValue",
|
|
101
101
|
"onBlur",
|
|
102
102
|
"value",
|
|
103
|
-
"defaultValue"
|
|
103
|
+
"defaultValue",
|
|
104
|
+
"dataAttributes"
|
|
104
105
|
]);
|
|
105
|
-
const
|
|
106
|
-
|
|
106
|
+
const x = w(), o = r.useRef(), [P, v] = r.useState(R || ""), c = typeof l < "u", m = c ? l : P, i = r.useCallback((s, z)=>{
|
|
107
|
+
c || v(s), t == null || t(s, z);
|
|
107
108
|
}, [
|
|
108
|
-
|
|
109
|
+
c,
|
|
109
110
|
t
|
|
110
|
-
]),
|
|
111
|
-
|
|
111
|
+
]), y = r.useCallback(()=>{
|
|
112
|
+
i("", ""), o.current && (e == null || e(N(o.current, "")), o.current.focus());
|
|
112
113
|
}, [
|
|
113
|
-
|
|
114
|
+
i,
|
|
114
115
|
e
|
|
115
|
-
]),
|
|
116
|
-
name:
|
|
117
|
-
value:
|
|
116
|
+
]), k = A({
|
|
117
|
+
name: n,
|
|
118
|
+
value: m,
|
|
118
119
|
defaultValue: void 0,
|
|
119
120
|
processValue: (s)=>s,
|
|
120
|
-
helperText:
|
|
121
|
-
optional:
|
|
122
|
-
error:
|
|
123
|
-
disabled:
|
|
121
|
+
helperText: u,
|
|
122
|
+
optional: p,
|
|
123
|
+
error: d,
|
|
124
|
+
disabled: f,
|
|
124
125
|
onBlur: I,
|
|
125
|
-
validate:
|
|
126
|
+
validate: S,
|
|
126
127
|
onChange: e,
|
|
127
|
-
onChangeValue:
|
|
128
|
+
onChangeValue: i
|
|
128
129
|
});
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
ref:
|
|
131
|
-
startIcon: /* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"aria-label": b.texts.formSearchClear,
|
|
140
|
-
onPress: h,
|
|
141
|
-
children: /* @__PURE__ */ c(z, {})
|
|
130
|
+
return /* @__PURE__ */ a(B, _object_spread_props(_object_spread({
|
|
131
|
+
ref: V(o, h),
|
|
132
|
+
startIcon: /* @__PURE__ */ a(T, {
|
|
133
|
+
size: W
|
|
134
|
+
}),
|
|
135
|
+
endIcon: m ? /* @__PURE__ */ a(E, {
|
|
136
|
+
Icon: j,
|
|
137
|
+
className: $,
|
|
138
|
+
"aria-label": x.texts.formSearchClear,
|
|
139
|
+
onPress: y
|
|
142
140
|
}) : void 0
|
|
143
|
-
},
|
|
144
|
-
type: "search"
|
|
141
|
+
}, b, k), {
|
|
142
|
+
type: "search",
|
|
143
|
+
dataAttributes: _object_spread({
|
|
144
|
+
"component-name": "SearchField"
|
|
145
|
+
}, F)
|
|
145
146
|
}));
|
|
146
|
-
}),
|
|
147
|
-
export {
|
|
147
|
+
}), U = q;
|
|
148
|
+
export { U as default };
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
|
+
import "./text-field-base.css.ts.vanilla.css-mistica.js";
|
|
2
3
|
import "./select.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var
|
|
4
|
+
var i = "_1sqpivvo _1y2v1nfgd", f = "_1sqpivvq _1y2v1nf98 _1y2v1nfah _1y2v1nf6k _1y2v1nf7t _1y2v1nf22 _1y2v1nfgi _1y2v1nfgx _1y2v1nfji", y = "_1y2v1nf3k", a = {
|
|
4
5
|
show: "_1sqpivv7",
|
|
5
6
|
hide: "_1sqpivv8"
|
|
6
|
-
},
|
|
7
|
+
}, s = "_1sqpivv6 _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nfge _1y2v1nfj8 _1y2v1nf37", t = {
|
|
7
8
|
default: "_1sqpivvd _1sqpivvc _1y2v1nfgc _1y2v1nfji",
|
|
8
9
|
fullWidth: "_1sqpivve _1sqpivvc _1y2v1nfgc _1y2v1nfji"
|
|
9
|
-
},
|
|
10
|
+
}, r = {
|
|
10
11
|
default: "_1sqpivvl _1sqpivvk _1y2v1nfgd _1y2v1nfjj _1y2v1nfix _1y2v1nf22",
|
|
11
12
|
disabled: "_1sqpivvm _1sqpivvk _1y2v1nfgd _1y2v1nfjj _1y2v1nfix _1y2v1nf22"
|
|
12
|
-
}, r = {
|
|
13
|
-
default: "_1sqpivvh _1sqpivvg _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5 _1y2v1nfhm",
|
|
14
|
-
disabled: "_1sqpivvi _1sqpivvg _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5 _1y2v1nfhm"
|
|
15
13
|
}, p = {
|
|
14
|
+
default: "_1sqpivvh _1sqpivvg _1y2v1nf6b _1y2v1nf7k _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5",
|
|
15
|
+
disabled: "_1sqpivvi _1sqpivvg _1y2v1nf6b _1y2v1nf7k _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5"
|
|
16
|
+
}, e = {
|
|
16
17
|
top: "var(--_1sqpivv0)",
|
|
17
18
|
left: "var(--_1sqpivv1)",
|
|
18
19
|
transformOrigin: "var(--_1sqpivv2)",
|
|
19
20
|
minWidth: "var(--_1sqpivv3)",
|
|
20
21
|
maxHeight: "var(--_1sqpivv4)"
|
|
21
22
|
};
|
|
22
|
-
export {
|
|
23
|
+
export { i as arrowDown, f as menuItem, y as menuItemSelected, a as optionsAnimationsVariants, s as optionsContainer, t as selectContainerVariants, r as selectTextVariants, p as selectVariants, e as vars };
|