@telefonica/mistica 16.0.0 → 16.1.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/README.md +11 -9
- package/css/mistica.css +1 -1
- package/dist/box.d.ts +1 -0
- package/dist/box.js +12 -12
- package/dist/card.d.ts +14 -2
- package/dist/card.js +210 -206
- package/dist/credit-card-expiration-field.d.ts +1 -1
- package/dist/credit-card-expiration-field.js +53 -52
- package/dist/credit-card-number-field.d.ts +1 -1
- package/dist/credit-card-number-field.js +47 -45
- package/dist/cvv-field.d.ts +1 -1
- package/dist/cvv-field.js +38 -37
- package/dist/date-field.d.ts +1 -1
- package/dist/date-field.js +15 -13
- package/dist/date-time-field.d.ts +1 -1
- package/dist/date-time-field.js +13 -11
- package/dist/decimal-field.d.ts +1 -1
- package/dist/decimal-field.js +39 -38
- package/dist/email-field.d.ts +1 -1
- package/dist/email-field.js +21 -19
- package/dist/form-context.d.ts +7 -2
- package/dist/form-context.js +69 -62
- package/dist/form.d.ts +2 -1
- package/dist/form.js +94 -80
- package/dist/iban-field.d.ts +1 -1
- package/dist/iban-field.js +32 -30
- package/dist/index.d.ts +12 -3
- package/dist/index.js +19 -8
- package/dist/inline.d.ts +2 -1
- package/dist/inline.js +16 -15
- package/dist/integer-field.d.ts +1 -1
- package/dist/integer-field.js +30 -30
- package/dist/month-field.d.ts +1 -1
- package/dist/month-field.js +15 -13
- package/dist/package-version.js +1 -1
- package/dist/password-field.d.ts +1 -1
- package/dist/password-field.js +24 -22
- package/dist/phone-number-field.d.ts +4 -1
- package/dist/phone-number-field.js +84 -52
- package/dist/pin-field.js +21 -20
- package/dist/radio-button.d.ts +1 -0
- package/dist/radio-button.js +42 -41
- package/dist/rating.css-mistica.js +44 -0
- package/dist/rating.css.d.ts +11 -0
- package/dist/rating.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/rating.d.ts +37 -0
- package/dist/rating.js +320 -0
- package/dist/search-field.d.ts +1 -0
- package/dist/search-field.js +18 -16
- package/dist/select.js +36 -33
- package/dist/sheet-action-row.css-mistica.js +13 -0
- package/dist/sheet-action-row.css.d.ts +1 -0
- package/dist/sheet-actions-list.d.ts +26 -0
- package/dist/sheet-actions-list.js +147 -0
- package/dist/sheet-actions.d.ts +23 -0
- package/dist/sheet-actions.js +175 -0
- package/dist/{sheet.css-mistica.js → sheet-common.css-mistica.js} +15 -21
- package/dist/{sheet.css.d.ts → sheet-common.css.d.ts} +0 -2
- package/dist/sheet-common.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/sheet-common.d.ts +24 -0
- package/dist/sheet-common.js +429 -0
- package/dist/sheet-info.css-mistica.js +12 -0
- package/dist/sheet-info.css.d.ts +1 -0
- package/dist/sheet-info.d.ts +28 -0
- package/dist/sheet-info.js +156 -0
- package/dist/sheet-native.d.ts +2 -0
- package/dist/sheet-native.js +173 -0
- package/dist/sheet-radio-list.d.ts +22 -0
- package/dist/sheet-radio-list.js +143 -0
- package/dist/sheet-root.d.ts +4 -85
- package/dist/sheet-root.js +48 -322
- package/dist/sheet-types.d.ts +88 -0
- package/dist/sheet-web.d.ts +8 -0
- package/dist/sheet-web.js +183 -0
- package/dist/slider.js +40 -39
- package/dist/switch-component.js +18 -17
- package/dist/text-field-base.d.ts +3 -1
- package/dist/text-field-base.js +74 -66
- package/dist/text-field-components.css-mistica.js +14 -14
- package/dist/text-field-components.css.d.ts +2 -2
- package/dist/text-field-components.js +49 -39
- package/dist/text-field.d.ts +1 -0
- package/dist/text-field.js +24 -22
- package/dist/text-tokens.d.ts +14 -0
- package/dist/text-tokens.js +145 -89
- package/dist/theme-context-provider.js +6 -5
- package/dist/theme.d.ts +2 -0
- package/dist/utils/credit-card.d.ts +2 -2
- package/dist/utils/credit-card.js +1 -1
- package/dist/vivinho-loading-animation/in-lottie.json.js +544 -612
- package/dist/vivinho-loading-animation/out-lottie.json.js +828 -896
- package/dist/vivinho-loading-animation/pulse-lottie.json.js +798 -866
- package/dist/vivinho-loading-animation/wave-lottie.json.js +4303 -4409
- package/dist-es/box.js +18 -18
- package/dist-es/card.js +305 -301
- package/dist-es/credit-card-expiration-field.js +57 -56
- package/dist-es/credit-card-number-field.js +74 -72
- package/dist-es/cvv-field.js +82 -81
- package/dist-es/date-field.js +29 -27
- package/dist-es/date-time-field.js +29 -27
- package/dist-es/decimal-field.js +46 -45
- package/dist-es/email-field.js +26 -24
- package/dist-es/form-context.js +70 -63
- package/dist-es/form.js +102 -88
- package/dist-es/iban-field.js +35 -33
- package/dist-es/index.js +1822 -1817
- package/dist-es/inline.js +26 -25
- package/dist-es/integer-field.js +31 -31
- package/dist-es/month-field.js +28 -26
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +37 -35
- package/dist-es/phone-number-field.js +92 -60
- package/dist-es/pin-field.js +32 -31
- package/dist-es/radio-button.js +42 -41
- package/dist-es/rating.css-mistica.js +6 -0
- package/dist-es/rating.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/rating.js +257 -0
- package/dist-es/search-field.js +33 -31
- package/dist-es/select.js +49 -46
- package/dist-es/sheet-action-row.css-mistica.js +4 -0
- package/dist-es/sheet-actions-list.js +92 -0
- package/dist-es/sheet-actions.js +125 -0
- package/dist-es/sheet-common.css-mistica.js +4 -0
- package/dist-es/sheet-common.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/sheet-common.js +366 -0
- package/dist-es/sheet-info.css-mistica.js +3 -0
- package/dist-es/sheet-info.js +101 -0
- package/dist-es/sheet-native.js +164 -0
- package/dist-es/sheet-radio-list.js +88 -0
- package/dist-es/sheet-root.js +50 -319
- package/dist-es/sheet-web.js +128 -0
- package/dist-es/slider.js +49 -48
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.js +27 -26
- package/dist-es/text-field-base.js +108 -100
- package/dist-es/text-field-components.css-mistica.js +2 -2
- package/dist-es/text-field-components.js +70 -60
- package/dist-es/text-field.js +33 -31
- package/dist-es/text-tokens.js +80 -45
- package/dist-es/theme-context-provider.js +20 -19
- package/dist-es/utils/credit-card.js +1 -1
- package/dist-es/vivinho-loading-animation/in-lottie.json.js +534 -599
- package/dist-es/vivinho-loading-animation/out-lottie.json.js +821 -886
- package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +790 -855
- package/dist-es/vivinho-loading-animation/wave-lottie.json.js +4297 -4400
- package/package.json +4 -3
- package/dist/sheet.d.ts +0 -107
- package/dist/sheet.js +0 -642
- package/dist-es/sheet.css-mistica.js +0 -4
- package/dist-es/sheet.js +0 -567
- /package/dist/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
- /package/dist-es/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
package/dist-es/search-field.js
CHANGED
|
@@ -80,21 +80,22 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
80
80
|
}
|
|
81
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 { useTheme as
|
|
88
|
-
import { createChangeEvent as
|
|
89
|
-
import { combineRefs as
|
|
90
|
-
import { iconSize as
|
|
91
|
-
import { formSearchClear as
|
|
92
|
-
const
|
|
93
|
-
var { disabled: m, error: u, helperText: d, name: p,
|
|
83
|
+
import { useFieldProps as E } from "./form-context.js";
|
|
84
|
+
import { TextFieldBaseAutosuggest as T, FieldEndIcon as j } from "./text-field-base.js";
|
|
85
|
+
import V from "./generated/mistica-icons/icon-search-regular.js";
|
|
86
|
+
import $ from "./generated/mistica-icons/icon-close-regular.js";
|
|
87
|
+
import { useTheme as q } from "./hooks.js";
|
|
88
|
+
import { createChangeEvent as w } from "./utils/dom.js";
|
|
89
|
+
import { combineRefs as D } from "./utils/common.js";
|
|
90
|
+
import { iconSize as G } from "./icon-button.css-mistica.js";
|
|
91
|
+
import { formSearchClear as H } from "./text-tokens.js";
|
|
92
|
+
const J = /*#__PURE__*/ r.forwardRef((_param, P)=>{
|
|
93
|
+
var { disabled: m, error: u, helperText: d, name: p, label: n, optional: S, validate: I, onChange: e, onChangeValue: t, onBlur: R, value: f, defaultValue: F, dataAttributes: b } = _param, x = _object_without_properties(_param, [
|
|
94
94
|
"disabled",
|
|
95
95
|
"error",
|
|
96
96
|
"helperText",
|
|
97
97
|
"name",
|
|
98
|
+
"label",
|
|
98
99
|
"optional",
|
|
99
100
|
"validate",
|
|
100
101
|
"onChange",
|
|
@@ -104,45 +105,46 @@ const H = /*#__PURE__*/ r.forwardRef((_param, x)=>{
|
|
|
104
105
|
"defaultValue",
|
|
105
106
|
"dataAttributes"
|
|
106
107
|
]);
|
|
107
|
-
const { texts:
|
|
108
|
-
s ||
|
|
108
|
+
const { texts: h, t: v } = q(), o = r.useRef(), [y, k] = r.useState(F || ""), s = typeof f < "u", l = s ? f : y, i = r.useCallback((c, B)=>{
|
|
109
|
+
s || k(c), t == null || t(c, B);
|
|
109
110
|
}, [
|
|
110
111
|
s,
|
|
111
112
|
t
|
|
112
|
-
]),
|
|
113
|
-
i("", ""), o.current && (e == null || e(
|
|
113
|
+
]), z = r.useCallback(()=>{
|
|
114
|
+
i("", ""), o.current && (e == null || e(w(o.current, "")), o.current.focus());
|
|
114
115
|
}, [
|
|
115
116
|
i,
|
|
116
117
|
e
|
|
117
|
-
]),
|
|
118
|
+
]), A = E({
|
|
118
119
|
name: p,
|
|
120
|
+
label: n,
|
|
119
121
|
value: l,
|
|
120
122
|
defaultValue: void 0,
|
|
121
123
|
processValue: (c)=>c,
|
|
122
124
|
helperText: d,
|
|
123
|
-
optional:
|
|
125
|
+
optional: S,
|
|
124
126
|
error: u,
|
|
125
127
|
disabled: m,
|
|
126
|
-
onBlur:
|
|
127
|
-
validate:
|
|
128
|
+
onBlur: R,
|
|
129
|
+
validate: I,
|
|
128
130
|
onChange: e,
|
|
129
131
|
onChangeValue: i
|
|
130
132
|
});
|
|
131
|
-
return /* @__PURE__ */ a(
|
|
132
|
-
ref:
|
|
133
|
-
startIcon: /* @__PURE__ */ a(
|
|
134
|
-
size:
|
|
133
|
+
return /* @__PURE__ */ a(T, _object_spread_props(_object_spread({
|
|
134
|
+
ref: D(o, P),
|
|
135
|
+
startIcon: /* @__PURE__ */ a(V, {
|
|
136
|
+
size: G.default
|
|
135
137
|
}),
|
|
136
|
-
endIcon: l ? /* @__PURE__ */ a(
|
|
137
|
-
Icon:
|
|
138
|
-
"aria-label":
|
|
139
|
-
onPress:
|
|
138
|
+
endIcon: l ? /* @__PURE__ */ a(j, {
|
|
139
|
+
Icon: $,
|
|
140
|
+
"aria-label": h.formSearchClear || v(H),
|
|
141
|
+
onPress: z
|
|
140
142
|
}) : void 0
|
|
141
|
-
},
|
|
143
|
+
}, x, A), {
|
|
142
144
|
type: "search",
|
|
143
145
|
dataAttributes: _object_spread({
|
|
144
146
|
"component-name": "SearchField"
|
|
145
|
-
},
|
|
147
|
+
}, b)
|
|
146
148
|
}));
|
|
147
|
-
}),
|
|
148
|
-
export {
|
|
149
|
+
}), Z = J;
|
|
150
|
+
export { Z as default };
|
package/dist-es/select.js
CHANGED
|
@@ -62,17 +62,17 @@ import oe from "./generated/mistica-icons/icon-chevron-down-regular.js";
|
|
|
62
62
|
import { TextFieldBaseAutosuggest as $e } from "./text-field-base.js";
|
|
63
63
|
import Be from "./overlay.js";
|
|
64
64
|
import { isAndroid as qe, isIos as ze } from "./utils/platform.js";
|
|
65
|
-
import { cancelEvent as
|
|
65
|
+
import { cancelEvent as m } from "./utils/dom.js";
|
|
66
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
|
|
67
|
+
import { selectVariants as Ke, arrowDown as Ue, iconContainer as ie, selectContainerVariants as Xe, selectTextVariants as Je, vars as b, optionsContainer as Qe, optionsAnimationsVariants as ce, menuItem as Ye, menuItemSelected as et } from "./select.css-mistica.js";
|
|
68
68
|
import { inputWithLabel as ae, inputWithoutLabel as le } from "./text-field-base.css-mistica.js";
|
|
69
69
|
import { Portal as tt } from "./portal.js";
|
|
70
70
|
import { pxToRem as nt, applyCssVars as rt } from "./utils/css.js";
|
|
71
71
|
import { ThemeVariant as st } from "./theme-variant-context.js";
|
|
72
72
|
const ot = (param)=>{
|
|
73
|
-
let { id: ue, label:
|
|
73
|
+
let { id: ue, label: u, helperText: de, value: fe, defaultValue: pe, onChangeValue: C, name: i, fullWidth: P, options: d, optional: D, disabled: me, error: he, onBlur: M, autoFocus: z = !1, native: Se } = param;
|
|
74
74
|
var ne;
|
|
75
|
-
const h = n.useRef(null),
|
|
75
|
+
const h = n.useRef(null), f = 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), Ie = n.useId(), L = ue || Ie, { rawValues: Ee, setRawValue: Z, setValue: $, formStatus: we, formErrors: J, setFormError: xe, register: B } = Pe(), { platformOverrides: Q } = De(), Oe = Se || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || qe(Q) || ze(Q), I = me || we === "sending", A = he || !!J[i], Y = J[i] || de, l = fe !== null && fe !== void 0 ? fe : Ee[i], ee = (e)=>{
|
|
76
76
|
C == null || C(e), xe({
|
|
77
77
|
name: i,
|
|
78
78
|
error: ""
|
|
@@ -86,28 +86,28 @@ const ot = (param)=>{
|
|
|
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 _e = window.innerHeight -
|
|
92
|
-
if (
|
|
93
|
-
const ke =
|
|
89
|
+
const o = S.current.getBoundingClientRect(), p = o.top, x = o.width, y = o.left, Ve = o.height, N = p + Ve, V = Math.min(d.length, 8) * 48 + 16;
|
|
90
|
+
if (N + V + 12 > window.innerHeight) {
|
|
91
|
+
const _e = window.innerHeight - N;
|
|
92
|
+
if (p > _e) {
|
|
93
|
+
const ke = p - V;
|
|
94
94
|
F({
|
|
95
95
|
minWidth: x,
|
|
96
96
|
left: y,
|
|
97
97
|
top: Math.max(ke, 12),
|
|
98
|
-
maxHeight: Math.min(
|
|
98
|
+
maxHeight: Math.min(p - 12, V),
|
|
99
99
|
transformOrigin: "center bottom"
|
|
100
100
|
});
|
|
101
101
|
} else F({
|
|
102
102
|
minWidth: x,
|
|
103
|
-
top:
|
|
103
|
+
top: N,
|
|
104
104
|
left: y,
|
|
105
|
-
maxHeight: window.innerHeight -
|
|
105
|
+
maxHeight: window.innerHeight - N - 12,
|
|
106
106
|
transformOrigin: "center top"
|
|
107
107
|
});
|
|
108
108
|
} else F({
|
|
109
109
|
minWidth: x,
|
|
110
|
-
top:
|
|
110
|
+
top: N,
|
|
111
111
|
left: y,
|
|
112
112
|
maxHeight: V,
|
|
113
113
|
transformOrigin: "center top"
|
|
@@ -131,7 +131,7 @@ const ot = (param)=>{
|
|
|
131
131
|
}
|
|
132
132
|
o && o.top + o.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, Ne = f.current, be = h.current;
|
|
135
135
|
n.useEffect(()=>{
|
|
136
136
|
Z({
|
|
137
137
|
name: i,
|
|
@@ -147,46 +147,49 @@ const ot = (param)=>{
|
|
|
147
147
|
l
|
|
148
148
|
]), n.useEffect(()=>(B(i, {
|
|
149
149
|
input: h.current,
|
|
150
|
-
focusableElement:
|
|
150
|
+
focusableElement: f.current,
|
|
151
|
+
label: u
|
|
151
152
|
}), ()=>{
|
|
152
153
|
B(i, {
|
|
153
154
|
input: null,
|
|
154
|
-
focusableElement: null
|
|
155
|
+
focusableElement: null,
|
|
156
|
+
label: ""
|
|
155
157
|
});
|
|
156
158
|
}), [
|
|
157
159
|
i,
|
|
158
160
|
B,
|
|
159
|
-
|
|
161
|
+
f,
|
|
160
162
|
h,
|
|
163
|
+
Ne,
|
|
161
164
|
be,
|
|
162
|
-
|
|
165
|
+
u
|
|
163
166
|
]), n.useEffect(()=>{
|
|
164
167
|
const e = (s)=>{
|
|
165
|
-
var
|
|
168
|
+
var p;
|
|
166
169
|
const o = {
|
|
167
170
|
[Fe]: -1,
|
|
168
171
|
[We]: 1
|
|
169
172
|
}[s.key];
|
|
170
173
|
if (o) {
|
|
171
|
-
|
|
174
|
+
m(s);
|
|
172
175
|
var _ref;
|
|
173
|
-
const x = (_ref = (
|
|
176
|
+
const x = (_ref = (p = d[d.findIndex((param)=>{
|
|
174
177
|
let { value: y } = param;
|
|
175
178
|
return y === T;
|
|
176
|
-
}) + o]) == null ? void 0 :
|
|
179
|
+
}) + o]) == null ? void 0 : p.value) !== null && _ref !== void 0 ? _ref : T;
|
|
177
180
|
W(x), ye(x);
|
|
178
181
|
}
|
|
179
182
|
}, t = (s)=>{
|
|
180
183
|
if (H) switch(s.key){
|
|
181
184
|
case He:
|
|
182
|
-
|
|
185
|
+
m(s);
|
|
183
186
|
break;
|
|
184
187
|
case Me:
|
|
185
188
|
E(!1);
|
|
186
189
|
break;
|
|
187
190
|
case se:
|
|
188
191
|
case re:
|
|
189
|
-
|
|
192
|
+
m(s), d.findIndex((param)=>{
|
|
190
193
|
let { value: c } = param;
|
|
191
194
|
return c === T;
|
|
192
195
|
}) !== -1 && T !== g && q(T), E(!1);
|
|
@@ -198,7 +201,7 @@ const ot = (param)=>{
|
|
|
198
201
|
document.removeEventListener("keydown", t, !1);
|
|
199
202
|
};
|
|
200
203
|
}), n.useEffect(()=>{
|
|
201
|
-
z &&
|
|
204
|
+
z && f.current && f.current.focus();
|
|
202
205
|
}, [
|
|
203
206
|
z
|
|
204
207
|
]), n.useEffect(()=>{
|
|
@@ -206,7 +209,7 @@ const ot = (param)=>{
|
|
|
206
209
|
}, []);
|
|
207
210
|
const Re = (e)=>{
|
|
208
211
|
var t;
|
|
209
|
-
return e ? (t =
|
|
212
|
+
return e ? (t = d.find((param)=>{
|
|
210
213
|
let { value: s } = param;
|
|
211
214
|
return s === e;
|
|
212
215
|
})) == null ? void 0 : t.text : "";
|
|
@@ -218,7 +221,7 @@ const ot = (param)=>{
|
|
|
218
221
|
E(!0), O(!0);
|
|
219
222
|
},
|
|
220
223
|
onKeyDown: (e)=>{
|
|
221
|
-
!H && (e.key === re || e.key === se) && (
|
|
224
|
+
!H && (e.key === re || e.key === se) && (m(e), E(!0));
|
|
222
225
|
}
|
|
223
226
|
}, te = nt(20), w = g !== null && g !== void 0 ? g : l;
|
|
224
227
|
var _a_transformOrigin;
|
|
@@ -233,15 +236,15 @@ const ot = (param)=>{
|
|
|
233
236
|
fieldRef: S,
|
|
234
237
|
fullWidth: P,
|
|
235
238
|
children: [
|
|
236
|
-
|
|
239
|
+
u && /* @__PURE__ */ r(Ze, {
|
|
237
240
|
error: A,
|
|
238
241
|
forId: L,
|
|
239
242
|
inputState: X ? "focused" : (w !== null && w !== void 0 ? w : (ne = h.current) == null ? void 0 : ne.value) ? "filled" : "default",
|
|
240
243
|
optional: D,
|
|
241
|
-
children:
|
|
244
|
+
children: u
|
|
242
245
|
}),
|
|
243
246
|
/* @__PURE__ */ _("select", {
|
|
244
|
-
className: k(Ke[I ? "disabled" : "default"],
|
|
247
|
+
className: k(Ke[I ? "disabled" : "default"], u ? ae : le),
|
|
245
248
|
id: L,
|
|
246
249
|
"aria-invalid": !!A,
|
|
247
250
|
value: w,
|
|
@@ -257,7 +260,7 @@ const ot = (param)=>{
|
|
|
257
260
|
ref: (e)=>{
|
|
258
261
|
[
|
|
259
262
|
h,
|
|
260
|
-
|
|
263
|
+
f
|
|
261
264
|
].forEach((t)=>{
|
|
262
265
|
t.current = e;
|
|
263
266
|
});
|
|
@@ -270,7 +273,7 @@ const ot = (param)=>{
|
|
|
270
273
|
color: w ? void 0 : "transparent"
|
|
271
274
|
},
|
|
272
275
|
children: [
|
|
273
|
-
!w &&
|
|
276
|
+
!w && d.every((param)=>{
|
|
274
277
|
let { value: e } = param;
|
|
275
278
|
return !!e;
|
|
276
279
|
}) && // If no "empty" option exists, insert a dummy empty option. Once an option is selected,
|
|
@@ -285,9 +288,9 @@ const ot = (param)=>{
|
|
|
285
288
|
display: "none"
|
|
286
289
|
},
|
|
287
290
|
"aria-label": "",
|
|
288
|
-
children:
|
|
291
|
+
children: u
|
|
289
292
|
}),
|
|
290
|
-
|
|
293
|
+
d.map((param)=>{
|
|
291
294
|
let { value: e, text: t } = param;
|
|
292
295
|
return(// Set color: 'initial' to avoid wrong text color in some browsers when using dark mode.
|
|
293
296
|
// Similar issue in another lib: https://github.com/chakra-ui/chakra-ui/issues/417#issue-566611352
|
|
@@ -318,7 +321,7 @@ const ot = (param)=>{
|
|
|
318
321
|
className: Xe[P ? "fullWidth" : "default"],
|
|
319
322
|
role: "button",
|
|
320
323
|
"aria-haspopup": "listbox",
|
|
321
|
-
ref:
|
|
324
|
+
ref: f
|
|
322
325
|
}, !I && Ae), {
|
|
323
326
|
children: [
|
|
324
327
|
/* @__PURE__ */ r($e, {
|
|
@@ -333,7 +336,7 @@ const ot = (param)=>{
|
|
|
333
336
|
})
|
|
334
337
|
}),
|
|
335
338
|
focus: X,
|
|
336
|
-
label:
|
|
339
|
+
label: u,
|
|
337
340
|
value: w,
|
|
338
341
|
shrinkLabel: !!(l || g),
|
|
339
342
|
name: i,
|
|
@@ -346,30 +349,30 @@ const ot = (param)=>{
|
|
|
346
349
|
fieldRef: S
|
|
347
350
|
}),
|
|
348
351
|
/* @__PURE__ */ r("div", {
|
|
349
|
-
className: k(Je[I ? "disabled" : "default"],
|
|
352
|
+
className: k(Je[I ? "disabled" : "default"], u ? ae : le),
|
|
350
353
|
children: Re(w)
|
|
351
354
|
})
|
|
352
355
|
]
|
|
353
356
|
})),
|
|
354
357
|
H && /* @__PURE__ */ r(Be, {
|
|
355
358
|
onPress: (e)=>{
|
|
356
|
-
E(!1),
|
|
359
|
+
E(!1), m(e);
|
|
357
360
|
},
|
|
358
361
|
disableScroll: !0,
|
|
359
362
|
children: /* @__PURE__ */ r(tt, {
|
|
360
363
|
children: /* @__PURE__ */ r("ul", {
|
|
361
364
|
style: rt({
|
|
362
|
-
[
|
|
363
|
-
[
|
|
364
|
-
[
|
|
365
|
-
[
|
|
366
|
-
[
|
|
365
|
+
[b.top]: a.top ? `${a.top}px` : "",
|
|
366
|
+
[b.left]: a.left ? `${a.left}px` : "",
|
|
367
|
+
[b.maxHeight]: a.maxHeight ? `${a.maxHeight}px` : "",
|
|
368
|
+
[b.minWidth]: a.minWidth ? `${a.minWidth}px` : "",
|
|
369
|
+
[b.transformOrigin]: (_a_transformOrigin = a.transformOrigin) !== null && _a_transformOrigin !== void 0 ? _a_transformOrigin : ""
|
|
367
370
|
}),
|
|
368
|
-
onPointerDown:
|
|
371
|
+
onPointerDown: m,
|
|
369
372
|
className: k(Qe, K ? ce.show : ce.hide),
|
|
370
373
|
role: "listbox",
|
|
371
374
|
ref: v,
|
|
372
|
-
children:
|
|
375
|
+
children: d.map((param)=>{
|
|
373
376
|
let { value: e, text: t } = param;
|
|
374
377
|
return /* @__PURE__ */ r("li", {
|
|
375
378
|
role: "option",
|
|
@@ -378,7 +381,7 @@ const ot = (param)=>{
|
|
|
378
381
|
className: k(Ye, {
|
|
379
382
|
[et]: e === T || e === (g !== null && g !== void 0 ? g : l)
|
|
380
383
|
}),
|
|
381
|
-
onPointerDown:
|
|
384
|
+
onPointerDown: m,
|
|
382
385
|
onClick: ()=>q(e),
|
|
383
386
|
ref: (s)=>{
|
|
384
387
|
s ? R.current.set(e, s) : R.current.delete(e);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
31
|
+
import * as k from "react";
|
|
32
|
+
import v, { SheetBody as A } from "./sheet-common.js";
|
|
33
|
+
import { useTheme as D } from "./hooks.js";
|
|
34
|
+
import L from "./box.js";
|
|
35
|
+
import { Text3 as R } from "./text.js";
|
|
36
|
+
import { vars as o } from "./skins/skin-contract.css-mistica.js";
|
|
37
|
+
import { sheetActionRow as w } from "./sheet-action-row.css-mistica.js";
|
|
38
|
+
import B from "./image.js";
|
|
39
|
+
import I from "./negative-box.js";
|
|
40
|
+
import T from "./touchable.js";
|
|
41
|
+
const b = /*#__PURE__*/ k.forwardRef((param, d)=>{
|
|
42
|
+
let { title: m, subtitle: a, description: c, items: h, onClose: l, onSelect: e, dataAttributes: n } = param;
|
|
43
|
+
const { isDarkMode: p } = D();
|
|
44
|
+
return /* @__PURE__ */ r(v, {
|
|
45
|
+
onClose: l,
|
|
46
|
+
ref: d,
|
|
47
|
+
dataAttributes: _object_spread({
|
|
48
|
+
"component-name": "ActionsListSheet"
|
|
49
|
+
}, n),
|
|
50
|
+
children: (param)=>{
|
|
51
|
+
let { closeModal: u, modalTitleId: f } = param;
|
|
52
|
+
return /* @__PURE__ */ r(A, {
|
|
53
|
+
title: m,
|
|
54
|
+
subtitle: a,
|
|
55
|
+
description: c,
|
|
56
|
+
modalTitleId: f,
|
|
57
|
+
children: /* @__PURE__ */ r(I, {
|
|
58
|
+
children: h.map((param)=>{
|
|
59
|
+
let { id: i, style: s, title: x, icon: t } = param;
|
|
60
|
+
return /* @__PURE__ */ r(T, {
|
|
61
|
+
onPress: ()=>{
|
|
62
|
+
e == null || e(i), u();
|
|
63
|
+
},
|
|
64
|
+
children: /* @__PURE__ */ g("div", {
|
|
65
|
+
className: w,
|
|
66
|
+
children: [
|
|
67
|
+
t && /* @__PURE__ */ r(L, {
|
|
68
|
+
paddingRight: 16,
|
|
69
|
+
children: t.Icon ? /* @__PURE__ */ r(t.Icon, {
|
|
70
|
+
size: 24,
|
|
71
|
+
color: s === "destructive" ? o.colors.textLinkDanger : o.colors.neutralHigh
|
|
72
|
+
}) : /* @__PURE__ */ r(B, {
|
|
73
|
+
circular: !0,
|
|
74
|
+
src: p && t.urlDark ? t.urlDark : t.url,
|
|
75
|
+
width: 40
|
|
76
|
+
})
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ r(R, {
|
|
79
|
+
regular: !0,
|
|
80
|
+
color: s === "destructive" ? o.colors.textLinkDanger : o.colors.textPrimary,
|
|
81
|
+
children: x
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
}, i);
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}), C = b;
|
|
92
|
+
export { C as default };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
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
|
+
function _object_without_properties(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
57
|
+
var key, i;
|
|
58
|
+
if (Object.getOwnPropertySymbols) {
|
|
59
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
60
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
61
|
+
key = sourceSymbolKeys[i];
|
|
62
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
63
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
64
|
+
target[key] = source[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
function _object_without_properties_loose(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
var target = {};
|
|
72
|
+
var sourceKeys = Object.keys(source);
|
|
73
|
+
var key, i;
|
|
74
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
75
|
+
key = sourceKeys[i];
|
|
76
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
82
|
+
import * as A from "react";
|
|
83
|
+
import R, { SheetBody as u } from "./sheet-common.js";
|
|
84
|
+
import { ButtonPrimary as l, ButtonSecondary as y, ButtonLink as P } from "./button.js";
|
|
85
|
+
const v = /*#__PURE__*/ A.forwardRef((param, S)=>{
|
|
86
|
+
let { title: c, subtitle: s, description: d, button: f, secondaryButton: m, buttonLink: a, onClose: h, dataAttributes: p, onPressButton: o } = param;
|
|
87
|
+
const n = (e, t)=>()=>{
|
|
88
|
+
o == null || o(t), e();
|
|
89
|
+
}, i = (_param)=>{
|
|
90
|
+
var { text: e } = _param, t = _object_without_properties(_param, [
|
|
91
|
+
"text"
|
|
92
|
+
]);
|
|
93
|
+
return _object_spread({
|
|
94
|
+
children: e
|
|
95
|
+
}, t);
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */ r(R, {
|
|
98
|
+
onClose: h,
|
|
99
|
+
ref: S,
|
|
100
|
+
dataAttributes: _object_spread({
|
|
101
|
+
"component-name": "ActionsSheet"
|
|
102
|
+
}, p),
|
|
103
|
+
children: (param)=>{
|
|
104
|
+
let { modalTitleId: e, closeModal: t } = param;
|
|
105
|
+
return /* @__PURE__ */ r(u, {
|
|
106
|
+
title: c,
|
|
107
|
+
subtitle: s,
|
|
108
|
+
description: d,
|
|
109
|
+
modalTitleId: e,
|
|
110
|
+
button: /* @__PURE__ */ r(l, _object_spread_props(_object_spread({}, i(f)), {
|
|
111
|
+
onPress: n(t, "PRIMARY")
|
|
112
|
+
})),
|
|
113
|
+
secondaryButton: m ? /* @__PURE__ */ r(y, _object_spread_props(_object_spread({}, i(m)), {
|
|
114
|
+
onPress: n(t, "SECONDARY")
|
|
115
|
+
})) : void 0,
|
|
116
|
+
link: a ? /* @__PURE__ */ r(P, _object_spread_props(_object_spread({
|
|
117
|
+
small: !0
|
|
118
|
+
}, i(a)), {
|
|
119
|
+
onPress: n(t, "LINK")
|
|
120
|
+
})) : void 0
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}), Y = v;
|
|
125
|
+
export { Y as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
|
+
import "./sheet-common.css.ts.vanilla.css-mistica.js";
|
|
3
|
+
var f = "pidemf6 _1y2v1nf3p", y = "pidemf4 _1y2v1nfhg _1y2v1nfl6 _1y2v1nfll _1y2v1nfm0", _ = "pidemf9 _1y2v1nf81 _1y2v1nfhk _1y2v1nfhq", e = "pidemfo", r = "_1y2v1nfkq _1y2v1nfi6 _1y2v1nfhk _1y2v1nfhq", i = "pidemfl", a = "pidemf7", t = "_1y2v1nf4y _1y2v1nfig _1y2v1nfir _1y2v1nfk4", h = "pidemfc _1y2v1nf7m _1y2v1nf8v _1y2v1nfhf _1y2v1nfkr _1y2v1nfj1 _1y2v1nfi7 _1y2v1nfhk _1y2v1nfht", l = "pidemff _1y2v1nf7y _1y2v1nf97 _1y2v1nfag _1y2v1nfbp _1y2v1nfhf _1y2v1nfkr _1y2v1nfll", o = "pidemfk _1y2v1nfhg _1y2v1nf41 _1y2v1nfkr _1y2v1nfl6 _1y2v1nfll _1y2v1nfm0", m = "_1y2v1nfhi _1y2v1nfm0 _1y2v1nf3p", p = "_1y2v1nfhi _1y2v1nfkr _1y2v1nf3p", d = 400;
|
|
4
|
+
export { f as Sheet, y as SheetContainer, _ as SheetContent, e as bodyContent, r as children, i as closingOverlay, a as closingSheet, t as handle, h as handleContainer, l as modalCloseButton, o as overlay, m as stickyButtons, p as stickyTitle, d as transitionDuration };
|