@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
|
@@ -78,20 +78,44 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
}
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
|
-
import {
|
|
82
|
-
import * as
|
|
83
|
-
import { FieldContainer as
|
|
84
|
-
import {
|
|
85
|
-
import { Text3 as
|
|
86
|
-
import {
|
|
87
|
-
import { useAriaId as
|
|
88
|
-
import
|
|
89
|
-
import { combineRefs as
|
|
90
|
-
import { startIcon as
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
import { jsx as n, jsxs as ae } from "react/jsx-runtime";
|
|
82
|
+
import * as o from "react";
|
|
83
|
+
import { FieldContainer as le, HelperText as oe, Label as se } from "./text-field-components.js";
|
|
84
|
+
import { LABEL_SCALE_MOBILE as de, LABEL_SCALE_DESKTOP as ce } from "./text-field-components.css-mistica.js";
|
|
85
|
+
import { Text3 as N } from "./text.js";
|
|
86
|
+
import { isFirefox as ue, isRunningAcceptanceTest as fe } from "./utils/platform.js";
|
|
87
|
+
import { useAriaId as A, useScreenSize as he, useIsomorphicLayoutEffect as me, useTheme as ge } from "./hooks.js";
|
|
88
|
+
import $ from "classnames";
|
|
89
|
+
import { combineRefs as H } from "./utils/common.js";
|
|
90
|
+
import { startIcon as pe, prefix as Se, inputWithLabel as k, inputWithoutLabel as j, fullWidth as xe, fieldRightPadding as W, fieldLeftPadding as T, textArea as ye, textAreaWithLabel as be, textAreaWithoutLabel as Ce, input as Ee, inputFirefoxStyles as Re, hiddenDatePlaceholder as Le, emptyDateValue as Te, endIconContainer as $e, menuItem as Ae, menuItemSelected as Ie, suggestionsContainer as ve, fieldEndIconContainer as We, iconButtonSize as K, iconSize as M, fieldElementsGap as G } from "./text-field-base.css-mistica.js";
|
|
91
|
+
import { vars as Fe } from "./skins/skin-contract.css-mistica.js";
|
|
92
|
+
import { BaseIconButton as Ne } from "./icon-button.js";
|
|
93
|
+
import { ThemeVariant as Pe } from "./theme-variant-context.js";
|
|
94
|
+
const we = (l, u)=>{
|
|
95
|
+
if (!u) return !0;
|
|
96
|
+
const i = document.createElement("input");
|
|
97
|
+
return i.type = u, i.value = l || "", i.value !== "";
|
|
98
|
+
}, Ue = (param)=>{
|
|
99
|
+
let { Icon: l, className: u, onPress: i, disabled: h, "aria-label": m } = param;
|
|
100
|
+
return(/**
|
|
101
|
+
* If we try to add fieldEndIconContainer styles to the BaseIconButton instead,
|
|
102
|
+
* there may be collisions because that component sets margin internally. We
|
|
103
|
+
* create a wrapper around it so that the margin's value won't be overrided.
|
|
104
|
+
*/ /* @__PURE__ */ n("div", {
|
|
105
|
+
className: We,
|
|
106
|
+
children: /* @__PURE__ */ n(Ne, {
|
|
107
|
+
disabled: h,
|
|
108
|
+
"aria-label": m,
|
|
109
|
+
onPress: i,
|
|
110
|
+
size: K,
|
|
111
|
+
className: u,
|
|
112
|
+
children: /* @__PURE__ */ n(l, {
|
|
113
|
+
size: M
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
}));
|
|
117
|
+
}, F = /*#__PURE__*/ o.forwardRef((_param, Z)=>{
|
|
118
|
+
var { error: l, helperText: u, label: i, inputProps: h, inputRef: m, defaultValue: s, value: r, onFocus: S, onBlur: x, inputComponent: g, prefix: y, startIcon: t, endIcon: f, endIconOverlay: p, shrinkLabel: P, multiline: L = !1, focus: b, fieldRef: J, maxLength: C, id: Q, autoComplete: U, fullWidth: X, dataAttributes: Y } = _param, a = _object_without_properties(_param, [
|
|
95
119
|
"error",
|
|
96
120
|
"helperText",
|
|
97
121
|
"label",
|
|
@@ -113,183 +137,191 @@ const W = /*#__PURE__*/ s.forwardRef((_param, H)=>{
|
|
|
113
137
|
"maxLength",
|
|
114
138
|
"id",
|
|
115
139
|
"autoComplete",
|
|
116
|
-
"fullWidth"
|
|
140
|
+
"fullWidth",
|
|
141
|
+
"dataAttributes"
|
|
117
142
|
]);
|
|
118
143
|
var _ref;
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
f !== "focused" && t != null && t.length && (O(t.length), d("filled")), C && d("focused"), C === !1 && !(t != null && t.length) && d("default"), C === !1 && t != null && t.length && d("filled");
|
|
144
|
+
const w = A(Q), z = A(), [d, c] = o.useState(s != null && s.length || r != null && r.length ? "filled" : "default"), { isTabletOrSmaller: V } = he(), [B, D] = o.useState((_ref = s == null ? void 0 : s.length) !== null && _ref !== void 0 ? _ref : 0), I = !!i || !a.required, E = a.type === "date" || a.type === "datetime-local" || a.type === "month", q = o.useRef(void 0);
|
|
145
|
+
me(()=>{
|
|
146
|
+
const e = E && !we(r, a.type) ? "" : r;
|
|
147
|
+
q.current !== r && E && !(e != null && e.length) && d === "filled" && b === void 0 && c("default"), q.current = r, d !== "focused" && e != null && e.length && (D(e.length), c("filled")), b && c("focused"), b === !1 && !(e != null && e.length) && c("default"), b === !1 && e != null && e.length && c("filled");
|
|
124
148
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
149
|
+
d,
|
|
150
|
+
r,
|
|
151
|
+
b,
|
|
152
|
+
E,
|
|
153
|
+
a.type
|
|
154
|
+
]), o.useEffect(()=>{
|
|
155
|
+
a.autoFocus && c("focused");
|
|
130
156
|
}, [
|
|
131
|
-
|
|
157
|
+
a.autoFocus
|
|
132
158
|
]);
|
|
133
|
-
const
|
|
134
|
-
inputRef:
|
|
159
|
+
const ee = L ? "textarea" : "input", te = g ? {
|
|
160
|
+
inputRef: m
|
|
135
161
|
} : {
|
|
136
|
-
ref:
|
|
137
|
-
},
|
|
138
|
-
maxLength:
|
|
139
|
-
autoComplete:
|
|
140
|
-
}),
|
|
141
|
-
left:
|
|
162
|
+
ref: H(Z, m)
|
|
163
|
+
}, R = _object_spread(_object_spread_props(_object_spread({}, a), {
|
|
164
|
+
maxLength: C,
|
|
165
|
+
autoComplete: U
|
|
166
|
+
}), h), v = `calc(${M} + ${G}px)`, O = `calc(${K} + ${G}px)`, ie = P || d === "focused" || d === "filled" ? V ? de : ce : 1, ne = {
|
|
167
|
+
left: `calc(${T}px + ${t ? v : "0px"})`,
|
|
142
168
|
// shrinking means applying a scale transformation, so width will be proportionally reduced.
|
|
143
169
|
// Let's keep the original width.
|
|
144
|
-
width: `calc((
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
error: c,
|
|
154
|
-
leftText: T,
|
|
155
|
-
rightText: x && p ? `${M}/${p}` : void 0
|
|
170
|
+
width: `calc((100% - ${T}px - ${t ? v : "0px"} - ${f || p ? O : `${W}px`}) / ${ie})`
|
|
171
|
+
}, re = a.type === "password" && B > 0 ? "Lucida Grande, Arial, sans-serif" : "inherit";
|
|
172
|
+
return /* @__PURE__ */ n(le, {
|
|
173
|
+
disabled: a.disabled,
|
|
174
|
+
helperText: /* @__PURE__ */ n(oe, {
|
|
175
|
+
error: l,
|
|
176
|
+
leftText: u,
|
|
177
|
+
id: z,
|
|
178
|
+
rightText: L && C ? `${B}/${C}` : void 0
|
|
156
179
|
}),
|
|
157
|
-
multiline:
|
|
158
|
-
fullWidth:
|
|
159
|
-
fieldRef:
|
|
160
|
-
readOnly:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
180
|
+
multiline: L,
|
|
181
|
+
fullWidth: X,
|
|
182
|
+
fieldRef: J,
|
|
183
|
+
readOnly: a.readOnly,
|
|
184
|
+
dataAttributes: Y,
|
|
185
|
+
children: /* @__PURE__ */ ae(Pe, {
|
|
186
|
+
isInverse: !1,
|
|
187
|
+
children: [
|
|
188
|
+
t && /* @__PURE__ */ n("div", {
|
|
189
|
+
className: pe,
|
|
190
|
+
children: t
|
|
191
|
+
}),
|
|
192
|
+
y && /* @__PURE__ */ n("div", {
|
|
193
|
+
className: $(Se, I ? k : j),
|
|
194
|
+
style: {
|
|
195
|
+
opacity: d === "default" ? 0 : 1
|
|
196
|
+
},
|
|
197
|
+
children: /* @__PURE__ */ n(N, {
|
|
198
|
+
color: Fe.colors.textSecondary,
|
|
199
|
+
regular: !0,
|
|
200
|
+
wordBreak: !1,
|
|
201
|
+
children: y
|
|
202
|
+
})
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ n("div", {
|
|
205
|
+
className: xe,
|
|
206
|
+
children: /* @__PURE__ */ n(N, {
|
|
207
|
+
as: "div",
|
|
208
|
+
regular: !0,
|
|
209
|
+
children: /*#__PURE__*/ o.createElement(g || ee, _object_spread(_object_spread_props(_object_spread({}, te, R), {
|
|
210
|
+
id: w,
|
|
211
|
+
style: _object_spread_props(_object_spread({
|
|
212
|
+
paddingRight: f ? 0 : p ? `calc(${W}px + ${O})` : W,
|
|
213
|
+
paddingLeft: y ? 0 : t ? `calc(${v} + ${T}px)` : T
|
|
214
|
+
}, R.style), {
|
|
215
|
+
fontFamily: re
|
|
216
|
+
}),
|
|
217
|
+
className: L ? $(ye, I ? be : Ce) : $(Ee, I ? k : j, {
|
|
218
|
+
[Re]: ue(),
|
|
219
|
+
// Hide webkit placeholder when label is not shrinked and value is empty
|
|
220
|
+
[Le]: E && d === "default",
|
|
221
|
+
// Force height of input when value is empty to avoid field from having height 0 in iOS
|
|
222
|
+
[Te]: E && d !== "filled"
|
|
223
|
+
}),
|
|
224
|
+
onFocus: (e)=>{
|
|
225
|
+
c("focused"), S == null || S(e);
|
|
226
|
+
},
|
|
227
|
+
onBlur: (e)=>{
|
|
228
|
+
e.target.value.length > 0 ? c("filled") : c("default"), x == null || x(e);
|
|
229
|
+
},
|
|
230
|
+
onChange: (e)=>{
|
|
231
|
+
var _;
|
|
232
|
+
C === void 0 || e.target.value.length <= C ? (D(e.target.value.length), e.target.value.length > 0 && d !== "focused" && c(e.target.value.length > 0 ? "filled" : "default"), (_ = R.onChange) == null || _.call(R, e)) : (e.stopPropagation(), e.preventDefault());
|
|
233
|
+
},
|
|
234
|
+
defaultValue: s,
|
|
235
|
+
value: r
|
|
236
|
+
}), l && {
|
|
237
|
+
"aria-invalid": !0
|
|
238
|
+
}, u && {
|
|
239
|
+
"aria-describedby": z
|
|
240
|
+
}))
|
|
241
|
+
})
|
|
242
|
+
}),
|
|
243
|
+
i && /* @__PURE__ */ n(se, {
|
|
244
|
+
style: ne,
|
|
245
|
+
error: l,
|
|
246
|
+
forId: w,
|
|
247
|
+
inputState: d,
|
|
248
|
+
shrinkLabel: P,
|
|
249
|
+
optional: !a.required,
|
|
250
|
+
children: i
|
|
251
|
+
}),
|
|
252
|
+
f && /* @__PURE__ */ n("div", {
|
|
253
|
+
className: $e,
|
|
254
|
+
children: f
|
|
255
|
+
}),
|
|
256
|
+
p
|
|
257
|
+
]
|
|
258
|
+
})
|
|
227
259
|
});
|
|
228
|
-
}),
|
|
229
|
-
var { getSuggestions:
|
|
260
|
+
}), ze = /*#__PURE__*/ o.lazy(()=>import(/* webpackChunkName: "react-autosuggest" */ "react-autosuggest")), Xe = /*#__PURE__*/ o.forwardRef((_param, h)=>{
|
|
261
|
+
var { getSuggestions: l, id: u } = _param, i = _object_without_properties(_param, [
|
|
230
262
|
"getSuggestions",
|
|
231
263
|
"id"
|
|
232
264
|
]);
|
|
233
|
-
const [
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
236
|
-
fallback: /* @__PURE__ */
|
|
237
|
-
label:
|
|
265
|
+
const [m, s] = o.useState([]), r = o.useRef(null), { platformOverrides: S, texts: x } = ge(), g = A(u), y = A();
|
|
266
|
+
if (l && (i.value === void 0 || i.defaultValue !== void 0)) throw Error("Fields with suggestions must be used in controlled mode");
|
|
267
|
+
return l ? /* @__PURE__ */ n(o.Suspense, {
|
|
268
|
+
fallback: /* @__PURE__ */ n(F, _object_spread_props(_object_spread({}, i), {
|
|
269
|
+
label: fe(S) ? "" : i.label,
|
|
238
270
|
autoComplete: "off",
|
|
239
|
-
ref:
|
|
271
|
+
ref: h,
|
|
240
272
|
id: g
|
|
241
273
|
})),
|
|
242
|
-
children: /* @__PURE__ */
|
|
243
|
-
id:
|
|
244
|
-
inputProps: _object_spread_props(_object_spread({},
|
|
274
|
+
children: /* @__PURE__ */ n(ze, {
|
|
275
|
+
id: y,
|
|
276
|
+
inputProps: _object_spread_props(_object_spread({}, i), {
|
|
245
277
|
id: g,
|
|
246
278
|
autoComplete: "off",
|
|
247
279
|
// @ts-expect-error Autosuggest expects slightly different types
|
|
248
|
-
onChange: (
|
|
249
|
-
let { newValue:
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
value:
|
|
253
|
-
}),
|
|
254
|
-
value:
|
|
255
|
-
}), (
|
|
280
|
+
onChange: (t, param)=>{
|
|
281
|
+
let { newValue: f } = param;
|
|
282
|
+
var p;
|
|
283
|
+
t.target = _object_spread_props(_object_spread({}, t.target), {
|
|
284
|
+
value: f
|
|
285
|
+
}), t.currentTarget = _object_spread_props(_object_spread({}, t.currentTarget), {
|
|
286
|
+
value: f
|
|
287
|
+
}), (p = i.onChange) == null || p.call(i, t);
|
|
256
288
|
}
|
|
257
289
|
}),
|
|
258
|
-
renderInputComponent: (
|
|
259
|
-
inputRef:
|
|
290
|
+
renderInputComponent: (t)=>/* @__PURE__ */ n(F, _object_spread_props(_object_spread({}, t), {
|
|
291
|
+
inputRef: H(r, i.inputRef, h)
|
|
260
292
|
})),
|
|
261
|
-
suggestions:
|
|
293
|
+
suggestions: m,
|
|
262
294
|
onSuggestionsFetchRequested: (param)=>{
|
|
263
|
-
let { value:
|
|
264
|
-
return
|
|
295
|
+
let { value: t } = param;
|
|
296
|
+
return s(l(t));
|
|
265
297
|
},
|
|
266
|
-
onSuggestionsClearRequested: ()=>
|
|
267
|
-
getSuggestionValue: (
|
|
268
|
-
renderSuggestion: (
|
|
269
|
-
let { isHighlighted:
|
|
270
|
-
return /* @__PURE__ */
|
|
298
|
+
onSuggestionsClearRequested: ()=>s([]),
|
|
299
|
+
getSuggestionValue: (t)=>t,
|
|
300
|
+
renderSuggestion: (t, param)=>{
|
|
301
|
+
let { isHighlighted: f } = param;
|
|
302
|
+
return /* @__PURE__ */ n("div", {
|
|
271
303
|
role: "menuitem",
|
|
272
|
-
className:
|
|
273
|
-
[
|
|
304
|
+
className: $(Ae, {
|
|
305
|
+
[Ie]: f
|
|
274
306
|
}),
|
|
275
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ n(N, {
|
|
276
308
|
regular: !0,
|
|
277
|
-
children:
|
|
309
|
+
children: t
|
|
278
310
|
})
|
|
279
311
|
});
|
|
280
312
|
},
|
|
281
|
-
renderSuggestionsContainer: (
|
|
313
|
+
renderSuggestionsContainer: (t)=>/* @__PURE__ */ n("div", _object_spread_props(_object_spread({}, t.containerProps), {
|
|
282
314
|
style: {
|
|
283
|
-
width:
|
|
315
|
+
width: r.current ? r.current.clientWidth + 2 : 0
|
|
284
316
|
},
|
|
285
|
-
className:
|
|
286
|
-
"aria-label": `${
|
|
287
|
-
children:
|
|
317
|
+
className: ve,
|
|
318
|
+
"aria-label": `${i.label} ${x.menuLabelSuffix}`,
|
|
319
|
+
children: t.children
|
|
288
320
|
}))
|
|
289
321
|
})
|
|
290
|
-
}) : /* @__PURE__ */
|
|
322
|
+
}) : /* @__PURE__ */ n(F, _object_spread_props(_object_spread({}, i), {
|
|
291
323
|
id: g,
|
|
292
|
-
ref:
|
|
324
|
+
ref: h
|
|
293
325
|
}));
|
|
294
326
|
});
|
|
295
|
-
export {
|
|
327
|
+
export { Ue as FieldEndIcon, F as TextFieldBase, Xe as TextFieldBaseAutosuggest };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
|
+
import "./text-field-base.css.ts.vanilla.css-mistica.js";
|
|
2
3
|
import "./text-field-components.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var
|
|
4
|
-
export {
|
|
4
|
+
var n = 328, a = 0.78, f = 0.75, e = "_15k6ur97", i = "_1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc", y = "_15k6ur96 _1y2v1nfgi _1y2v1nfgo", t = "_1y2v1nfh5", l = "_1y2v1nf95 _1y2v1nfah _1y2v1nfgi", h = "_15k6ur9d", k = "_15k6ur91 _1y2v1nfgd _1y2v1nfgi _1y2v1nfgn", u = "_15k6ur93 _1y2v1nfjj _1y2v1nfh1", d = "_15k6ur9e", g = "_15k6ur99 _1y2v1nfh5", o = "_15k6ur9f", L = "_15k6ur94";
|
|
5
|
+
export { n as DEFAULT_WIDTH, a as LABEL_SCALE_DESKTOP, f as LABEL_SCALE_MOBILE, e as disabled, i as field, y as fieldContainer, t as fullWidth, l as helperContainer, h as helperText, k as labelContainer, u as labelText, d as leftText, g as normalWidth, o as rightText, L as shrinked };
|
|
@@ -51,100 +51,103 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
import { jsxs as
|
|
55
|
-
import * as
|
|
56
|
-
import
|
|
54
|
+
import { jsxs as m, jsx as o, Fragment as y } from "react/jsx-runtime";
|
|
55
|
+
import * as x from "react";
|
|
56
|
+
import c from "classnames";
|
|
57
57
|
import { useIsInverseVariant as N } from "./theme-variant-context.js";
|
|
58
58
|
import { useTheme as C } from "./hooks.js";
|
|
59
|
-
import { Text1 as
|
|
60
|
-
import { labelContainer as
|
|
59
|
+
import { Text1 as v } from "./text.js";
|
|
60
|
+
import { labelContainer as k, shrinked as S, labelText as I, helperText as b, leftText as F, rightText as E, fieldContainer as L, fullWidth as P, normalWidth as W, disabled as j, field as w, helperContainer as A } from "./text-field-components.css-mistica.js";
|
|
61
61
|
import { sprinkles as T } from "./sprinkles.css-mistica.js";
|
|
62
62
|
import { vars as e } from "./skins/skin-contract.css-mistica.js";
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
import { getPrefixedDataAttributes as D } from "./utils/dom.js";
|
|
64
|
+
const J = (param)=>{
|
|
65
|
+
let { shrinkLabel: t, forId: s, inputState: r, error: l, children: i, style: n, optional: a } = param;
|
|
66
|
+
const f = t || r === "focused" || r === "filled", [u, h] = x.useState("initial"), { texts: d } = C();
|
|
67
|
+
x.useEffect(()=>{
|
|
67
68
|
const g = setTimeout(()=>{
|
|
68
|
-
process.env.NODE_ENV !== "test" &&
|
|
69
|
+
process.env.NODE_ENV !== "test" && h("transform 150ms, width 150ms");
|
|
69
70
|
});
|
|
70
71
|
return ()=>{
|
|
71
72
|
clearTimeout(g);
|
|
72
73
|
};
|
|
73
74
|
}, []);
|
|
74
|
-
let
|
|
75
|
-
return
|
|
76
|
-
className:
|
|
77
|
-
[
|
|
75
|
+
let p = e.colors.textSecondary;
|
|
76
|
+
return l && r !== "default" ? p = e.colors.error : r === "focused" && (p = e.colors.controlActivated), /* @__PURE__ */ m("label", {
|
|
77
|
+
className: c(k, {
|
|
78
|
+
[S]: f
|
|
78
79
|
}, T({
|
|
79
|
-
color:
|
|
80
|
+
color: p
|
|
80
81
|
})),
|
|
81
|
-
htmlFor:
|
|
82
|
+
htmlFor: s,
|
|
82
83
|
style: _object_spread_props(_object_spread({}, n), {
|
|
83
84
|
transition: u
|
|
84
85
|
}),
|
|
85
86
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ o("span", {
|
|
87
88
|
className: I,
|
|
88
89
|
children: i
|
|
89
90
|
}),
|
|
90
|
-
|
|
91
|
+
a ? /* @__PURE__ */ m("span", {
|
|
91
92
|
children: [
|
|
92
93
|
"\xa0(",
|
|
93
|
-
|
|
94
|
+
d.formFieldOptionalLabelSuffix,
|
|
94
95
|
")"
|
|
95
96
|
]
|
|
96
97
|
}) : null
|
|
97
98
|
]
|
|
98
99
|
});
|
|
99
|
-
},
|
|
100
|
-
let { leftText:
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
100
|
+
}, K = (param)=>{
|
|
101
|
+
let { leftText: t, rightText: s, error: r, id: l } = param;
|
|
102
|
+
const i = N(), n = i ? e.colors.textPrimaryInverse : r ? e.colors.error : e.colors.textSecondary, a = i ? e.colors.textPrimaryInverse : e.colors.textSecondary;
|
|
103
|
+
return /* @__PURE__ */ m(y, {
|
|
103
104
|
children: [
|
|
104
|
-
|
|
105
|
-
className:
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
color:
|
|
105
|
+
t && /* @__PURE__ */ o("div", {
|
|
106
|
+
className: c(b, F),
|
|
107
|
+
children: /* @__PURE__ */ o(v, {
|
|
108
|
+
color: n,
|
|
108
109
|
regular: !0,
|
|
109
110
|
as: "p",
|
|
110
|
-
|
|
111
|
+
id: l,
|
|
112
|
+
children: t
|
|
111
113
|
})
|
|
112
114
|
}),
|
|
113
|
-
|
|
114
|
-
className:
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
color:
|
|
115
|
+
s && /* @__PURE__ */ o("div", {
|
|
116
|
+
className: c(b, E),
|
|
117
|
+
children: /* @__PURE__ */ o(v, {
|
|
118
|
+
color: a,
|
|
117
119
|
regular: !0,
|
|
118
120
|
as: "p",
|
|
119
|
-
children:
|
|
121
|
+
children: s
|
|
120
122
|
})
|
|
121
123
|
})
|
|
122
124
|
]
|
|
123
125
|
});
|
|
124
|
-
},
|
|
125
|
-
let { multiline:
|
|
126
|
+
}, M = (param)=>{
|
|
127
|
+
let { multiline: t, disabled: s, children: r, helperText: l, className: i, fieldRef: n, fullWidth: a, readOnly: f, dataAttributes: u } = param;
|
|
126
128
|
return(// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
className:
|
|
129
|
-
[
|
|
129
|
+
/* @__PURE__ */ m("div", _object_spread_props(_object_spread({
|
|
130
|
+
className: c(L, a ? P : W, {
|
|
131
|
+
[j]: s
|
|
130
132
|
}),
|
|
131
|
-
onClick: (
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
}
|
|
133
|
+
onClick: (h)=>{
|
|
134
|
+
var d;
|
|
135
|
+
(d = h.currentTarget.querySelector(t ? "textarea" : "input")) == null || d.focus();
|
|
136
|
+
}
|
|
137
|
+
}, D(u)), {
|
|
135
138
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
className:
|
|
139
|
+
/* @__PURE__ */ o("div", {
|
|
140
|
+
className: c(w, T({
|
|
138
141
|
background: f ? e.colors.neutralLow : e.colors.backgroundContainer
|
|
139
142
|
}), i),
|
|
140
143
|
ref: n,
|
|
141
144
|
children: r
|
|
142
145
|
}),
|
|
143
|
-
|
|
144
|
-
className:
|
|
145
|
-
children:
|
|
146
|
+
l && /* @__PURE__ */ o("div", {
|
|
147
|
+
className: A,
|
|
148
|
+
children: l
|
|
146
149
|
})
|
|
147
150
|
]
|
|
148
|
-
}));
|
|
151
|
+
})));
|
|
149
152
|
};
|
|
150
|
-
export {
|
|
153
|
+
export { M as FieldContainer, K as HelperText, J as Label };
|