elseware-ui 2.40.4 → 3.0.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/README.md +289 -289
- package/dist/index.css +484 -310
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +101 -293
- package/dist/index.d.ts +101 -293
- package/dist/index.js +1294 -752
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +986 -449
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +16 -0
- package/dist/index.native.d.ts +16 -0
- package/dist/index.native.js +913 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.native.mjs +904 -0
- package/dist/index.native.mjs.map +1 -0
- package/dist/resolveGlobalConfigs-Cuiq_Zix.d.mts +288 -0
- package/dist/resolveGlobalConfigs-Cuiq_Zix.d.ts +288 -0
- package/package.json +173 -143
- package/tailwind.preset.js +116 -0
|
@@ -0,0 +1,913 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactNative = require('react-native');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var jsxRuntime$1 = require('nativewind/jsx-runtime');
|
|
8
|
+
var formik = require('formik');
|
|
9
|
+
|
|
10
|
+
// src/components/data-entry/button/native/Button.native.tsx
|
|
11
|
+
|
|
12
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
13
|
+
function r(e) {
|
|
14
|
+
var t, f, n = "";
|
|
15
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
16
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
17
|
+
var o = e.length;
|
|
18
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
19
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
function clsx() {
|
|
23
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
var clsx_default = clsx;
|
|
27
|
+
function cn(...inputs) {
|
|
28
|
+
return tailwindMerge.twMerge(clsx_default(inputs));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/utils/styles.ts
|
|
32
|
+
function resolveAppearanceStyles({
|
|
33
|
+
appearance = "solid",
|
|
34
|
+
variant = "default",
|
|
35
|
+
solid,
|
|
36
|
+
lite,
|
|
37
|
+
ghost
|
|
38
|
+
}) {
|
|
39
|
+
switch (appearance) {
|
|
40
|
+
case "ghost":
|
|
41
|
+
return ghost[variant];
|
|
42
|
+
case "lite":
|
|
43
|
+
return lite[variant];
|
|
44
|
+
default:
|
|
45
|
+
return solid[variant];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var EUIContext = react.createContext(null);
|
|
49
|
+
var EUIProvider = ({
|
|
50
|
+
config,
|
|
51
|
+
children
|
|
52
|
+
}) => {
|
|
53
|
+
const [state, setState] = react.useState(config);
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EUIContext.Provider, { value: { config: state, setConfig: setState }, children });
|
|
55
|
+
};
|
|
56
|
+
var useEUIConfig = () => {
|
|
57
|
+
const ctx = react.useContext(EUIContext);
|
|
58
|
+
if (!ctx) {
|
|
59
|
+
throw new Error("useEUIConfig must be used inside EUIProvider");
|
|
60
|
+
}
|
|
61
|
+
return ctx;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// src/components/eui/resolveGlobalConfigs.tsx
|
|
65
|
+
function resolveWithGlobal(config, props, defaults) {
|
|
66
|
+
return {
|
|
67
|
+
...defaults,
|
|
68
|
+
...config?.global ?? {},
|
|
69
|
+
...props
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/components/data-entry/button/base/Button.config.ts
|
|
74
|
+
var buttonModeAppearance = {
|
|
75
|
+
contained: "solid",
|
|
76
|
+
"contained-tonal": "lite",
|
|
77
|
+
outlined: "ghost",
|
|
78
|
+
text: "ghost"
|
|
79
|
+
};
|
|
80
|
+
function useResolvedButtonConfig({
|
|
81
|
+
compact = false,
|
|
82
|
+
mode,
|
|
83
|
+
variant,
|
|
84
|
+
appearance,
|
|
85
|
+
shape,
|
|
86
|
+
size
|
|
87
|
+
}) {
|
|
88
|
+
const eui = useEUIConfig();
|
|
89
|
+
const configuredSize = size ?? eui?.config?.global?.size ?? "md";
|
|
90
|
+
return {
|
|
91
|
+
shape: shape ?? eui?.config?.global?.shape ?? "square",
|
|
92
|
+
size: compact && configuredSize === "md" ? "sm" : configuredSize,
|
|
93
|
+
variant: variant ?? eui?.config?.global?.variant ?? "success",
|
|
94
|
+
appearance: appearance ?? (mode ? buttonModeAppearance[mode] : "solid")
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/data/styles.tsx
|
|
99
|
+
var variantsSolid = {
|
|
100
|
+
["default" /* default */]: "bg-gray-300 text-gray-900 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-100 dark:hover:bg-gray-600",
|
|
101
|
+
["primary" /* primary */]: "bg-eui-primary-500 text-white hover:bg-eui-primary-600",
|
|
102
|
+
["secondary" /* secondary */]: "bg-eui-secondary-500 text-white hover:bg-eui-secondary-600",
|
|
103
|
+
["success" /* success */]: "bg-eui-success-500 text-white hover:bg-eui-success-600",
|
|
104
|
+
["danger" /* danger */]: "bg-eui-danger-500 text-white hover:bg-eui-danger-600",
|
|
105
|
+
["warning" /* warning */]: "bg-eui-warning-500 text-black hover:bg-eui-warning-400",
|
|
106
|
+
["info" /* info */]: "bg-eui-info-500 text-white hover:bg-eui-info-600",
|
|
107
|
+
["light" /* light */]: "bg-eui-light-400 text-gray-900 hover:bg-eui-light-300 dark:bg-gray-200 dark:text-gray-900 dark:hover:bg-gray-100",
|
|
108
|
+
["dark" /* dark */]: "bg-eui-dark-500 text-white hover:bg-eui-dark-400 dark:bg-eui-dark-400 dark:hover:bg-eui-dark-300"
|
|
109
|
+
};
|
|
110
|
+
var variantsLite = {
|
|
111
|
+
["default" /* default */]: "bg-gray-500/10 border border-gray-300 text-gray-700 dark:bg-gray-400/10 dark:border-gray-700 dark:text-gray-200",
|
|
112
|
+
["primary" /* primary */]: "bg-eui-primary-500/10 border border-eui-primary-500/30 text-eui-primary-400 dark:text-eui-primary-300",
|
|
113
|
+
["secondary" /* secondary */]: "bg-eui-secondary-500/10 border border-eui-secondary-500/30 text-eui-secondary-500 dark:text-eui-secondary-400",
|
|
114
|
+
["success" /* success */]: "bg-eui-success-500/10 border border-eui-success-500/30 text-eui-success-500 dark:text-eui-success-400",
|
|
115
|
+
["danger" /* danger */]: "bg-eui-danger-500/10 border border-eui-danger-500/30 text-eui-danger-500 dark:text-eui-danger-400",
|
|
116
|
+
["warning" /* warning */]: "bg-eui-warning-500/10 border border-eui-warning-500/30 text-eui-warning-600 dark:text-eui-warning-400",
|
|
117
|
+
["info" /* info */]: "bg-eui-info-500/10 border border-eui-info-500/30 text-eui-info-500 dark:text-eui-info-400",
|
|
118
|
+
["light" /* light */]: "bg-white/40 border border-white/30 text-gray-800 dark:bg-white/10 dark:border-white/10 dark:text-gray-100",
|
|
119
|
+
["dark" /* dark */]: "bg-eui-dark-500/10 border border-eui-dark-500/30 text-eui-dark-500 dark:text-eui-dark-300"
|
|
120
|
+
};
|
|
121
|
+
var variantsGhost = {
|
|
122
|
+
["default" /* default */]: "bg-transparent border border-gray-300 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:text-gray-200 dark:hover:bg-gray-800",
|
|
123
|
+
["primary" /* primary */]: "bg-transparent border border-eui-primary-500 text-eui-primary-500 hover:bg-eui-primary-500/10 dark:text-eui-primary-300 dark:border-eui-primary-400",
|
|
124
|
+
["secondary" /* secondary */]: "bg-transparent border border-eui-secondary-500 text-eui-secondary-500 hover:bg-eui-secondary-500/10 dark:text-eui-secondary-400 dark:border-eui-secondary-400",
|
|
125
|
+
["success" /* success */]: "bg-transparent border border-eui-success-500 text-eui-success-500 hover:bg-eui-success-500/10 dark:text-eui-success-400 dark:border-eui-success-400",
|
|
126
|
+
["danger" /* danger */]: "bg-transparent border border-eui-danger-500 text-eui-danger-500 hover:bg-eui-danger-500/10 dark:text-eui-danger-400 dark:border-eui-danger-400",
|
|
127
|
+
["warning" /* warning */]: "bg-transparent border border-eui-warning-500 text-eui-warning-600 hover:bg-eui-warning-500/10 dark:text-eui-warning-400 dark:border-eui-warning-400",
|
|
128
|
+
["info" /* info */]: "bg-transparent border border-eui-info-500 text-eui-info-500 hover:bg-eui-info-500/10 dark:text-eui-info-400 dark:border-eui-info-400",
|
|
129
|
+
["light" /* light */]: "bg-transparent border border-gray-300 text-gray-700 hover:bg-white/10 dark:border-gray-500 dark:text-gray-100 dark:hover:bg-white/5",
|
|
130
|
+
["dark" /* dark */]: "bg-transparent border border-eui-dark-500 text-eui-dark-500 hover:bg-eui-dark-500/10 dark:text-eui-dark-300 dark:border-eui-dark-300"
|
|
131
|
+
};
|
|
132
|
+
var textVariants = {
|
|
133
|
+
["default" /* default */]: "eui-text-md",
|
|
134
|
+
["primary" /* primary */]: "text-blue-500",
|
|
135
|
+
["secondary" /* secondary */]: "text-gray-500",
|
|
136
|
+
["success" /* success */]: "text-green-500",
|
|
137
|
+
["danger" /* danger */]: "text-red-500",
|
|
138
|
+
["warning" /* warning */]: "text-yellow-500",
|
|
139
|
+
["info" /* info */]: "text-blue-400",
|
|
140
|
+
["light" /* light */]: "text-gray-300",
|
|
141
|
+
["dark" /* dark */]: "text-gray-900"
|
|
142
|
+
};
|
|
143
|
+
var shapes = {
|
|
144
|
+
["square" /* square */]: "rounded-none",
|
|
145
|
+
["roundedSquare" /* roundedSquare */]: "rounded-md",
|
|
146
|
+
["softRoundedSquare" /* softRoundedSquare */]: "rounded-lg",
|
|
147
|
+
["circle" /* circle */]: "rounded-full"
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/components/data-entry/button/base/Button.styles.ts
|
|
151
|
+
var buttonShapes = shapes;
|
|
152
|
+
var buttonIconSizes = {
|
|
153
|
+
xs: 14,
|
|
154
|
+
sm: 16,
|
|
155
|
+
md: 18,
|
|
156
|
+
lg: 20,
|
|
157
|
+
xl: 22
|
|
158
|
+
};
|
|
159
|
+
function resolveButtonVariantStyles({
|
|
160
|
+
appearance,
|
|
161
|
+
variant
|
|
162
|
+
}) {
|
|
163
|
+
return resolveAppearanceStyles({
|
|
164
|
+
appearance,
|
|
165
|
+
variant,
|
|
166
|
+
solid: variantsSolid,
|
|
167
|
+
lite: variantsLite,
|
|
168
|
+
ghost: variantsGhost
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function getButtonLabelColorClassName(className) {
|
|
172
|
+
return className.split(/\s+/).filter(
|
|
173
|
+
(token) => token.startsWith("text-") || token.startsWith("dark:text-") || token.startsWith("disabled:text-")
|
|
174
|
+
).join(" ");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// src/components/data-entry/button/native/Button.native.styles.ts
|
|
178
|
+
var nativeButtonSizes = {
|
|
179
|
+
xs: {
|
|
180
|
+
rootClassName: "min-h-[30px] px-2.5 py-1",
|
|
181
|
+
labelClassName: "text-xs leading-[14px]",
|
|
182
|
+
slotClassName: "h-[14px] w-[14px]"
|
|
183
|
+
},
|
|
184
|
+
sm: {
|
|
185
|
+
rootClassName: "min-h-9 px-3 py-1.5",
|
|
186
|
+
labelClassName: "text-sm leading-4",
|
|
187
|
+
slotClassName: "h-4 w-4"
|
|
188
|
+
},
|
|
189
|
+
md: {
|
|
190
|
+
rootClassName: "min-h-11 px-4 py-2",
|
|
191
|
+
labelClassName: "text-[15px] leading-[18px]",
|
|
192
|
+
slotClassName: "h-[18px] w-[18px]"
|
|
193
|
+
},
|
|
194
|
+
lg: {
|
|
195
|
+
rootClassName: "min-h-[50px] px-[18px] py-3",
|
|
196
|
+
labelClassName: "text-[17px] leading-5",
|
|
197
|
+
slotClassName: "h-5 w-5"
|
|
198
|
+
},
|
|
199
|
+
xl: {
|
|
200
|
+
rootClassName: "min-h-14 px-[22px] py-4",
|
|
201
|
+
labelClassName: "text-[19px] leading-[22px]",
|
|
202
|
+
slotClassName: "h-[22px] w-[22px]"
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
var nativeLabelBaseStyle = {
|
|
206
|
+
includeFontPadding: false,
|
|
207
|
+
textAlignVertical: "center"
|
|
208
|
+
};
|
|
209
|
+
function Button({
|
|
210
|
+
icon,
|
|
211
|
+
text,
|
|
212
|
+
children,
|
|
213
|
+
loading = false,
|
|
214
|
+
disabled = false,
|
|
215
|
+
block = false,
|
|
216
|
+
compact = false,
|
|
217
|
+
mode,
|
|
218
|
+
contentClassName,
|
|
219
|
+
labelClassName,
|
|
220
|
+
className,
|
|
221
|
+
variant,
|
|
222
|
+
appearance,
|
|
223
|
+
shape,
|
|
224
|
+
size,
|
|
225
|
+
accessibilityRole = "button",
|
|
226
|
+
accessibilityState,
|
|
227
|
+
type: _type,
|
|
228
|
+
onClick: _onClick,
|
|
229
|
+
onMouseMove: _onMouseMove,
|
|
230
|
+
onPress,
|
|
231
|
+
...rest
|
|
232
|
+
}) {
|
|
233
|
+
const {
|
|
234
|
+
shape: resolvedShape,
|
|
235
|
+
size: resolvedSize,
|
|
236
|
+
variant: resolvedVariant,
|
|
237
|
+
appearance: resolvedAppearance
|
|
238
|
+
} = useResolvedButtonConfig({
|
|
239
|
+
compact,
|
|
240
|
+
mode,
|
|
241
|
+
variant,
|
|
242
|
+
appearance,
|
|
243
|
+
shape,
|
|
244
|
+
size
|
|
245
|
+
});
|
|
246
|
+
const metrics = nativeButtonSizes[resolvedSize];
|
|
247
|
+
const iconSize = buttonIconSizes[resolvedSize];
|
|
248
|
+
const variantStyles = resolveButtonVariantStyles({
|
|
249
|
+
appearance: resolvedAppearance,
|
|
250
|
+
variant: resolvedVariant
|
|
251
|
+
});
|
|
252
|
+
const labelColorClassName = getButtonLabelColorClassName(variantStyles);
|
|
253
|
+
const content = text ?? children;
|
|
254
|
+
const resolvedIcon = typeof icon === "function" ? icon({ color: "currentColor", size: iconSize }) : icon;
|
|
255
|
+
return /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
256
|
+
reactNative.Pressable,
|
|
257
|
+
{
|
|
258
|
+
...rest,
|
|
259
|
+
accessibilityRole,
|
|
260
|
+
accessibilityState: {
|
|
261
|
+
disabled: disabled || loading,
|
|
262
|
+
...accessibilityState
|
|
263
|
+
},
|
|
264
|
+
className: cn(
|
|
265
|
+
"relative items-center justify-center overflow-hidden",
|
|
266
|
+
variantStyles,
|
|
267
|
+
buttonShapes[resolvedShape],
|
|
268
|
+
metrics.rootClassName,
|
|
269
|
+
block && "w-full",
|
|
270
|
+
mode === "text" && "border-transparent bg-transparent",
|
|
271
|
+
(disabled || loading) && "opacity-55",
|
|
272
|
+
!disabled && !loading && "active:opacity-80",
|
|
273
|
+
className
|
|
274
|
+
),
|
|
275
|
+
disabled: disabled || loading,
|
|
276
|
+
onPress,
|
|
277
|
+
style: ({ pressed }) => [
|
|
278
|
+
pressed && !disabled && !loading ? { opacity: 0.82 } : null,
|
|
279
|
+
disabled || loading ? { opacity: 0.55 } : null
|
|
280
|
+
],
|
|
281
|
+
children: /* @__PURE__ */ jsxRuntime$1.jsxs(
|
|
282
|
+
reactNative.View,
|
|
283
|
+
{
|
|
284
|
+
className: cn(
|
|
285
|
+
"z-10 flex-row items-center justify-center gap-2",
|
|
286
|
+
contentClassName
|
|
287
|
+
),
|
|
288
|
+
children: [
|
|
289
|
+
loading ? /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
290
|
+
reactNative.View,
|
|
291
|
+
{
|
|
292
|
+
className: cn(
|
|
293
|
+
"shrink-0 items-center justify-center",
|
|
294
|
+
metrics.slotClassName
|
|
295
|
+
),
|
|
296
|
+
children: /* @__PURE__ */ jsxRuntime$1.jsx(reactNative.ActivityIndicator, { className: labelColorClassName, size: "small" })
|
|
297
|
+
}
|
|
298
|
+
) : null,
|
|
299
|
+
!loading && resolvedIcon ? /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
300
|
+
reactNative.View,
|
|
301
|
+
{
|
|
302
|
+
className: cn(
|
|
303
|
+
"shrink-0 items-center justify-center",
|
|
304
|
+
metrics.slotClassName
|
|
305
|
+
),
|
|
306
|
+
children: resolvedIcon
|
|
307
|
+
}
|
|
308
|
+
) : null,
|
|
309
|
+
typeof content === "string" || typeof content === "number" ? /* @__PURE__ */ jsxRuntime$1.jsx(reactNative.View, { className: "items-center justify-center", children: /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
310
|
+
reactNative.Text,
|
|
311
|
+
{
|
|
312
|
+
className: cn(
|
|
313
|
+
"font-bold",
|
|
314
|
+
metrics.labelClassName,
|
|
315
|
+
labelColorClassName,
|
|
316
|
+
labelClassName
|
|
317
|
+
),
|
|
318
|
+
numberOfLines: 1,
|
|
319
|
+
style: nativeLabelBaseStyle,
|
|
320
|
+
children: content
|
|
321
|
+
}
|
|
322
|
+
) }) : content
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
var Button_native_default = Button;
|
|
330
|
+
function isMultiCheckbox(props) {
|
|
331
|
+
return Array.isArray(props.options);
|
|
332
|
+
}
|
|
333
|
+
function useResolvedCheckboxConfig({
|
|
334
|
+
label,
|
|
335
|
+
placeholder,
|
|
336
|
+
variant,
|
|
337
|
+
shape
|
|
338
|
+
}) {
|
|
339
|
+
const eui = useEUIConfig();
|
|
340
|
+
return {
|
|
341
|
+
shape: shape ?? eui?.config?.global?.shape ?? "roundedSquare",
|
|
342
|
+
variant: variant ?? "secondary",
|
|
343
|
+
label: label ?? placeholder
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function useCheckboxFieldState(props) {
|
|
347
|
+
const isMulti = isMultiCheckbox(props);
|
|
348
|
+
const [multiField, multiMeta, multiHelpers] = formik.useField(
|
|
349
|
+
props
|
|
350
|
+
);
|
|
351
|
+
const [singleField, singleMeta, singleHelpers] = formik.useField(
|
|
352
|
+
props
|
|
353
|
+
);
|
|
354
|
+
return {
|
|
355
|
+
isMulti,
|
|
356
|
+
multiField,
|
|
357
|
+
multiMeta,
|
|
358
|
+
multiHelpers,
|
|
359
|
+
singleField,
|
|
360
|
+
singleMeta,
|
|
361
|
+
singleHelpers
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// src/components/data-entry/checkbox/base/Checkbox.styles.ts
|
|
366
|
+
var checkboxShapes = shapes;
|
|
367
|
+
var checkboxGroupClassName = "flex flex-col gap-2";
|
|
368
|
+
var checkboxOptionRowClassName = "flex flex-row items-start gap-3";
|
|
369
|
+
var checkboxLabelClassName = "cursor-pointer select-none text-sm leading-relaxed text-gray-800 dark:text-gray-200";
|
|
370
|
+
var checkboxIndicatorDisabledClassName = "cursor-not-allowed opacity-50";
|
|
371
|
+
|
|
372
|
+
// src/components/data-entry/checkbox/native/Checkbox.native.styles.ts
|
|
373
|
+
var nativeCheckboxVariants = {
|
|
374
|
+
default: {
|
|
375
|
+
checkedClassName: "border-eui-secondary-600 bg-eui-secondary-600 dark:border-eui-secondary-500 dark:bg-eui-secondary-500",
|
|
376
|
+
iconClassName: "text-white"
|
|
377
|
+
},
|
|
378
|
+
primary: {
|
|
379
|
+
checkedClassName: "border-eui-primary-600 bg-eui-primary-600 dark:border-eui-primary-500 dark:bg-eui-primary-500",
|
|
380
|
+
iconClassName: "text-white"
|
|
381
|
+
},
|
|
382
|
+
secondary: {
|
|
383
|
+
checkedClassName: "border-eui-secondary-600 bg-eui-secondary-600 dark:border-eui-secondary-500 dark:bg-eui-secondary-500",
|
|
384
|
+
iconClassName: "text-white"
|
|
385
|
+
},
|
|
386
|
+
success: {
|
|
387
|
+
checkedClassName: "border-eui-success-600 bg-eui-success-600 dark:border-eui-success-500 dark:bg-eui-success-500",
|
|
388
|
+
iconClassName: "text-white"
|
|
389
|
+
},
|
|
390
|
+
danger: {
|
|
391
|
+
checkedClassName: "border-eui-danger-600 bg-eui-danger-600 dark:border-eui-danger-500 dark:bg-eui-danger-500",
|
|
392
|
+
iconClassName: "text-white"
|
|
393
|
+
},
|
|
394
|
+
warning: {
|
|
395
|
+
checkedClassName: "border-eui-warning-500 bg-eui-warning-500 dark:border-eui-warning-400 dark:bg-eui-warning-400",
|
|
396
|
+
iconClassName: "text-black"
|
|
397
|
+
},
|
|
398
|
+
info: {
|
|
399
|
+
checkedClassName: "border-eui-info-600 bg-eui-info-600 dark:border-eui-info-500 dark:bg-eui-info-500",
|
|
400
|
+
iconClassName: "text-white"
|
|
401
|
+
},
|
|
402
|
+
light: {
|
|
403
|
+
checkedClassName: "border-eui-light-400 bg-eui-light-400 dark:border-gray-200 dark:bg-gray-200",
|
|
404
|
+
iconClassName: "text-gray-900"
|
|
405
|
+
},
|
|
406
|
+
dark: {
|
|
407
|
+
checkedClassName: "border-eui-dark-500 bg-eui-dark-500 dark:border-eui-dark-300 dark:bg-eui-dark-300",
|
|
408
|
+
iconClassName: "text-white"
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
function resolveNativeCheckboxVariantStyles(variant) {
|
|
412
|
+
return nativeCheckboxVariants[variant];
|
|
413
|
+
}
|
|
414
|
+
function getIndicatorClassName({
|
|
415
|
+
checked,
|
|
416
|
+
className,
|
|
417
|
+
disabled,
|
|
418
|
+
indicatorClassName,
|
|
419
|
+
checkedIndicatorClassName,
|
|
420
|
+
resolvedShape,
|
|
421
|
+
variantCheckedClassName
|
|
422
|
+
}) {
|
|
423
|
+
return cn(
|
|
424
|
+
"h-5 w-5 shrink-0 items-center justify-center border-2 border-gray-300 bg-white dark:border-neutral-600 dark:bg-neutral-900",
|
|
425
|
+
checkboxShapes[resolvedShape],
|
|
426
|
+
indicatorClassName,
|
|
427
|
+
className,
|
|
428
|
+
checked && variantCheckedClassName,
|
|
429
|
+
checked && checkedIndicatorClassName,
|
|
430
|
+
disabled && checkboxIndicatorDisabledClassName
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
function Tick({
|
|
434
|
+
checkedIconClassName,
|
|
435
|
+
iconClassName
|
|
436
|
+
}) {
|
|
437
|
+
return /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
438
|
+
reactNative.Text,
|
|
439
|
+
{
|
|
440
|
+
className: cn(
|
|
441
|
+
"text-sm font-bold leading-none",
|
|
442
|
+
iconClassName,
|
|
443
|
+
checkedIconClassName
|
|
444
|
+
),
|
|
445
|
+
children: "\u2713"
|
|
446
|
+
}
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
function Checkbox(checkboxProps) {
|
|
450
|
+
const {
|
|
451
|
+
label,
|
|
452
|
+
placeholder,
|
|
453
|
+
variant,
|
|
454
|
+
shape,
|
|
455
|
+
disabled = false,
|
|
456
|
+
className,
|
|
457
|
+
groupClassName,
|
|
458
|
+
optionClassName,
|
|
459
|
+
indicatorClassName,
|
|
460
|
+
checkedIndicatorClassName,
|
|
461
|
+
checkedIconClassName,
|
|
462
|
+
labelClassName
|
|
463
|
+
} = checkboxProps;
|
|
464
|
+
const { shape: resolvedShape, variant: resolvedVariant, label: resolvedLabel } = useResolvedCheckboxConfig({
|
|
465
|
+
label,
|
|
466
|
+
placeholder,
|
|
467
|
+
variant,
|
|
468
|
+
shape
|
|
469
|
+
});
|
|
470
|
+
const {
|
|
471
|
+
isMulti,
|
|
472
|
+
multiField,
|
|
473
|
+
multiMeta,
|
|
474
|
+
multiHelpers,
|
|
475
|
+
singleField,
|
|
476
|
+
singleMeta,
|
|
477
|
+
singleHelpers
|
|
478
|
+
} = useCheckboxFieldState(checkboxProps);
|
|
479
|
+
const variantStyles = resolveNativeCheckboxVariantStyles(resolvedVariant);
|
|
480
|
+
const activeMeta = isMulti ? multiMeta : singleMeta;
|
|
481
|
+
const multiProps = isMultiCheckbox(checkboxProps) ? checkboxProps : null;
|
|
482
|
+
const singleChecked = singleField.value;
|
|
483
|
+
const errorText = activeMeta.touched && typeof activeMeta.error === "string" ? activeMeta.error : null;
|
|
484
|
+
return /* @__PURE__ */ jsxRuntime$1.jsxs(reactNative.View, { className: cn(checkboxGroupClassName, groupClassName), children: [
|
|
485
|
+
!isMulti && /* @__PURE__ */ jsxRuntime$1.jsxs(
|
|
486
|
+
reactNative.Pressable,
|
|
487
|
+
{
|
|
488
|
+
accessibilityRole: "checkbox",
|
|
489
|
+
accessibilityState: {
|
|
490
|
+
checked: singleChecked,
|
|
491
|
+
disabled
|
|
492
|
+
},
|
|
493
|
+
className: cn(checkboxOptionRowClassName, optionClassName),
|
|
494
|
+
disabled,
|
|
495
|
+
onPress: () => singleHelpers.setValue(!singleChecked),
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ jsxRuntime$1.jsx(
|
|
498
|
+
reactNative.View,
|
|
499
|
+
{
|
|
500
|
+
className: getIndicatorClassName({
|
|
501
|
+
checked: singleChecked,
|
|
502
|
+
className,
|
|
503
|
+
disabled,
|
|
504
|
+
indicatorClassName,
|
|
505
|
+
checkedIndicatorClassName,
|
|
506
|
+
resolvedShape,
|
|
507
|
+
variantCheckedClassName: variantStyles.checkedClassName
|
|
508
|
+
}),
|
|
509
|
+
children: singleChecked ? /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
510
|
+
Tick,
|
|
511
|
+
{
|
|
512
|
+
checkedIconClassName,
|
|
513
|
+
iconClassName: variantStyles.iconClassName
|
|
514
|
+
}
|
|
515
|
+
) : null
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
resolvedLabel ? /* @__PURE__ */ jsxRuntime$1.jsx(reactNative.Text, { className: cn(checkboxLabelClassName, labelClassName), children: resolvedLabel }) : null
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
isMulti && multiProps?.options.map((option) => {
|
|
523
|
+
const values = multiField.value ?? [];
|
|
524
|
+
const checked = values.includes(option.value);
|
|
525
|
+
const optionDisabled = disabled || option.disabled === true;
|
|
526
|
+
return /* @__PURE__ */ jsxRuntime$1.jsxs(
|
|
527
|
+
reactNative.Pressable,
|
|
528
|
+
{
|
|
529
|
+
accessibilityRole: "checkbox",
|
|
530
|
+
accessibilityState: {
|
|
531
|
+
checked,
|
|
532
|
+
disabled: optionDisabled
|
|
533
|
+
},
|
|
534
|
+
className: cn(checkboxOptionRowClassName, optionClassName),
|
|
535
|
+
disabled: optionDisabled,
|
|
536
|
+
onPress: () => multiHelpers.setValue(
|
|
537
|
+
checked ? values.filter((value) => value !== option.value) : [...values, option.value]
|
|
538
|
+
),
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ jsxRuntime$1.jsx(
|
|
541
|
+
reactNative.View,
|
|
542
|
+
{
|
|
543
|
+
className: getIndicatorClassName({
|
|
544
|
+
checked,
|
|
545
|
+
className,
|
|
546
|
+
disabled: optionDisabled,
|
|
547
|
+
indicatorClassName,
|
|
548
|
+
checkedIndicatorClassName,
|
|
549
|
+
resolvedShape,
|
|
550
|
+
variantCheckedClassName: variantStyles.checkedClassName
|
|
551
|
+
}),
|
|
552
|
+
children: checked ? /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
553
|
+
Tick,
|
|
554
|
+
{
|
|
555
|
+
checkedIconClassName,
|
|
556
|
+
iconClassName: variantStyles.iconClassName
|
|
557
|
+
}
|
|
558
|
+
) : null
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ jsxRuntime$1.jsx(
|
|
562
|
+
reactNative.Text,
|
|
563
|
+
{
|
|
564
|
+
className: cn(
|
|
565
|
+
checkboxLabelClassName,
|
|
566
|
+
optionDisabled && "opacity-60",
|
|
567
|
+
labelClassName
|
|
568
|
+
),
|
|
569
|
+
children: option.label
|
|
570
|
+
}
|
|
571
|
+
)
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
option.value
|
|
575
|
+
);
|
|
576
|
+
}),
|
|
577
|
+
errorText ? /* @__PURE__ */ jsxRuntime$1.jsx(reactNative.Text, { className: "px-2 py-1 text-sm font-medium text-eui-danger-500", children: errorText }) : null
|
|
578
|
+
] });
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// src/components/data-entry/input/input-label/base/InputLabel.styles.ts
|
|
582
|
+
var inputLabelStaticClassName = "pointer-events-none select-none px-0 text-[13.5px] leading-none text-[#6B7280]";
|
|
583
|
+
var inputLabelBaseClassName = "pointer-events-none absolute left-3 z-10 select-none bg-white/95 px-1 font-medium leading-none dark:bg-eui-dark-800";
|
|
584
|
+
var inputLabelErrorClassName = "text-[#6B7280]";
|
|
585
|
+
var inputLabelDisabledClassName = "opacity-60";
|
|
586
|
+
var nativeInputLabelColors = {
|
|
587
|
+
default: "#6B7280",
|
|
588
|
+
disabled: "#9CA3AF"
|
|
589
|
+
};
|
|
590
|
+
var nativeInputLabelStyle = {
|
|
591
|
+
left: 12,
|
|
592
|
+
position: "absolute",
|
|
593
|
+
zIndex: 10
|
|
594
|
+
};
|
|
595
|
+
var nativeInputLabelMetrics = {
|
|
596
|
+
floatingFontSize: 12,
|
|
597
|
+
floatingTop: 6,
|
|
598
|
+
restingFontSize: 16,
|
|
599
|
+
restingTop: 18
|
|
600
|
+
};
|
|
601
|
+
function getLabelColor({ disabled }) {
|
|
602
|
+
if (disabled) {
|
|
603
|
+
return nativeInputLabelColors.disabled;
|
|
604
|
+
}
|
|
605
|
+
return nativeInputLabelColors.default;
|
|
606
|
+
}
|
|
607
|
+
function InputLabel({
|
|
608
|
+
text,
|
|
609
|
+
children,
|
|
610
|
+
className,
|
|
611
|
+
floating,
|
|
612
|
+
errored = false,
|
|
613
|
+
disabled = false,
|
|
614
|
+
animatedValue
|
|
615
|
+
}) {
|
|
616
|
+
const isFloatingLabel = typeof floating === "boolean";
|
|
617
|
+
const progress = animatedValue;
|
|
618
|
+
const animatedStyle = progress ? {
|
|
619
|
+
fontSize: progress.interpolate({
|
|
620
|
+
inputRange: [0, 1],
|
|
621
|
+
outputRange: [
|
|
622
|
+
nativeInputLabelMetrics.restingFontSize,
|
|
623
|
+
nativeInputLabelMetrics.floatingFontSize
|
|
624
|
+
]
|
|
625
|
+
}),
|
|
626
|
+
lineHeight: progress.interpolate({
|
|
627
|
+
inputRange: [0, 1],
|
|
628
|
+
outputRange: [
|
|
629
|
+
nativeInputLabelMetrics.restingFontSize,
|
|
630
|
+
nativeInputLabelMetrics.floatingFontSize
|
|
631
|
+
]
|
|
632
|
+
}),
|
|
633
|
+
top: progress.interpolate({
|
|
634
|
+
inputRange: [0, 1],
|
|
635
|
+
outputRange: [
|
|
636
|
+
nativeInputLabelMetrics.restingTop,
|
|
637
|
+
nativeInputLabelMetrics.floatingTop
|
|
638
|
+
]
|
|
639
|
+
})
|
|
640
|
+
} : {
|
|
641
|
+
fontSize: floating === true ? nativeInputLabelMetrics.floatingFontSize : nativeInputLabelMetrics.restingFontSize,
|
|
642
|
+
lineHeight: floating === true ? nativeInputLabelMetrics.floatingFontSize : nativeInputLabelMetrics.restingFontSize,
|
|
643
|
+
top: floating === true ? nativeInputLabelMetrics.floatingTop : nativeInputLabelMetrics.restingTop
|
|
644
|
+
};
|
|
645
|
+
return /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
646
|
+
reactNative.Animated.Text,
|
|
647
|
+
{
|
|
648
|
+
className: cn(
|
|
649
|
+
isFloatingLabel ? inputLabelBaseClassName : inputLabelStaticClassName,
|
|
650
|
+
isFloatingLabel && "bg-transparent px-0 dark:bg-transparent",
|
|
651
|
+
errored && inputLabelErrorClassName,
|
|
652
|
+
disabled && inputLabelDisabledClassName,
|
|
653
|
+
className
|
|
654
|
+
),
|
|
655
|
+
style: [
|
|
656
|
+
isFloatingLabel ? nativeInputLabelStyle : null,
|
|
657
|
+
isFloatingLabel ? animatedStyle : null,
|
|
658
|
+
{
|
|
659
|
+
color: getLabelColor({ disabled }),
|
|
660
|
+
includeFontPadding: false
|
|
661
|
+
}
|
|
662
|
+
],
|
|
663
|
+
children: text || children
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// src/components/data-entry/input/input-response/base/InputResponse.styles.ts
|
|
669
|
+
var inputResponseBaseClassName = "px-2 pt-1.5 text-sm font-medium";
|
|
670
|
+
var inputResponseVariants = textVariants;
|
|
671
|
+
function InputResponse({
|
|
672
|
+
name,
|
|
673
|
+
visibility = false,
|
|
674
|
+
variant = "default",
|
|
675
|
+
className,
|
|
676
|
+
message
|
|
677
|
+
}) {
|
|
678
|
+
const [mounted, setMounted] = react.useState(Boolean(visibility));
|
|
679
|
+
const progress = react.useRef(new reactNative.Animated.Value(visibility ? 1 : 0)).current;
|
|
680
|
+
react.useEffect(() => {
|
|
681
|
+
if (visibility) {
|
|
682
|
+
setMounted(true);
|
|
683
|
+
}
|
|
684
|
+
reactNative.Animated.timing(progress, {
|
|
685
|
+
duration: visibility ? 180 : 120,
|
|
686
|
+
easing: visibility ? reactNative.Easing.out(reactNative.Easing.cubic) : reactNative.Easing.in(reactNative.Easing.cubic),
|
|
687
|
+
toValue: visibility ? 1 : 0,
|
|
688
|
+
useNativeDriver: true
|
|
689
|
+
}).start(() => {
|
|
690
|
+
if (!visibility) {
|
|
691
|
+
setMounted(false);
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
}, [progress, visibility]);
|
|
695
|
+
if (!mounted) {
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
const animatedStyle = {
|
|
699
|
+
opacity: progress,
|
|
700
|
+
transform: [
|
|
701
|
+
{
|
|
702
|
+
translateY: progress.interpolate({
|
|
703
|
+
inputRange: [0, 1],
|
|
704
|
+
outputRange: [6, 0]
|
|
705
|
+
})
|
|
706
|
+
}
|
|
707
|
+
]
|
|
708
|
+
};
|
|
709
|
+
const content = message ?? /* @__PURE__ */ jsxRuntime$1.jsx(formik.ErrorMessage, { name, children: (errorMessage) => String(errorMessage) });
|
|
710
|
+
return /* @__PURE__ */ jsxRuntime$1.jsx(reactNative.Animated.View, { className: "w-full", style: animatedStyle, children: /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
711
|
+
reactNative.Text,
|
|
712
|
+
{
|
|
713
|
+
className: cn(
|
|
714
|
+
inputResponseBaseClassName,
|
|
715
|
+
inputResponseVariants[variant],
|
|
716
|
+
className
|
|
717
|
+
),
|
|
718
|
+
style: { includeFontPadding: false },
|
|
719
|
+
children: content
|
|
720
|
+
}
|
|
721
|
+
) });
|
|
722
|
+
}
|
|
723
|
+
function resolveInputType({
|
|
724
|
+
passwordVisible,
|
|
725
|
+
type
|
|
726
|
+
}) {
|
|
727
|
+
return type === "password" && passwordVisible ? "text" : type;
|
|
728
|
+
}
|
|
729
|
+
function useResolvedInputConfig({
|
|
730
|
+
label,
|
|
731
|
+
placeholder,
|
|
732
|
+
shape,
|
|
733
|
+
type = "text"
|
|
734
|
+
}) {
|
|
735
|
+
const eui = useEUIConfig();
|
|
736
|
+
return {
|
|
737
|
+
shape: shape ?? eui?.config?.global?.shape ?? "square",
|
|
738
|
+
type,
|
|
739
|
+
label: label ?? placeholder
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
function useInputFieldState(props) {
|
|
743
|
+
const [field, meta, helpers] = formik.useField(props);
|
|
744
|
+
return {
|
|
745
|
+
field,
|
|
746
|
+
meta,
|
|
747
|
+
helpers
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// src/components/data-entry/input/input/base/Input.styles.ts
|
|
752
|
+
var inputShapes = shapes;
|
|
753
|
+
var inputRootClassName = "relative w-full";
|
|
754
|
+
var inputFrameClassName = "relative h-14 w-full overflow-hidden border bg-white/95 px-3 dark:bg-eui-dark-800";
|
|
755
|
+
var inputFrameIdleClassName = "border-gray-300 hover:border-gray-400 dark:border-eui-dark-300 dark:hover:border-eui-dark-200";
|
|
756
|
+
var inputFrameActiveClassName = "border-eui-secondary-600";
|
|
757
|
+
var inputFrameErrorClassName = "border-eui-danger-500";
|
|
758
|
+
var inputFrameDisabledClassName = "cursor-not-allowed opacity-60";
|
|
759
|
+
var inputControlClassName = "w-full bg-transparent pt-5 pb-2 text-base font-medium text-gray-950 dark:text-gray-50";
|
|
760
|
+
|
|
761
|
+
// src/components/data-entry/input/input/native/Input.native.styles.ts
|
|
762
|
+
var nativeInputControlClassName = "h-full";
|
|
763
|
+
var nativePasswordInputClassName = "pr-16";
|
|
764
|
+
var nativePasswordToggleClassName = "absolute right-3 top-[18px] h-5 items-center justify-center";
|
|
765
|
+
var nativePasswordToggleTextClassName = "text-xs font-semibold text-eui-dark-200";
|
|
766
|
+
var nativeInputControlStyle = {
|
|
767
|
+
backgroundColor: "transparent",
|
|
768
|
+
borderBottomWidth: 0,
|
|
769
|
+
borderColor: "transparent",
|
|
770
|
+
borderWidth: 0,
|
|
771
|
+
includeFontPadding: false,
|
|
772
|
+
outlineColor: "transparent",
|
|
773
|
+
outlineStyle: "none",
|
|
774
|
+
textAlignVertical: "center"
|
|
775
|
+
};
|
|
776
|
+
function Input(inputProps) {
|
|
777
|
+
const {
|
|
778
|
+
type = "text",
|
|
779
|
+
label,
|
|
780
|
+
placeholder,
|
|
781
|
+
inputClassName,
|
|
782
|
+
labelClassName,
|
|
783
|
+
responseClassName,
|
|
784
|
+
step: _step,
|
|
785
|
+
shape,
|
|
786
|
+
disabled = false,
|
|
787
|
+
className,
|
|
788
|
+
onBlur,
|
|
789
|
+
onFocus,
|
|
790
|
+
onChange: _onChange,
|
|
791
|
+
..._props
|
|
792
|
+
} = inputProps;
|
|
793
|
+
const { field, helpers, meta } = useInputFieldState(inputProps);
|
|
794
|
+
const [focused, setFocused] = react.useState(false);
|
|
795
|
+
const [passwordVisible, setPasswordVisible] = react.useState(false);
|
|
796
|
+
const labelProgress = react.useRef(
|
|
797
|
+
new reactNative.Animated.Value(String(field.value ?? "").length > 0 ? 1 : 0)
|
|
798
|
+
).current;
|
|
799
|
+
const {
|
|
800
|
+
shape: resolvedShape,
|
|
801
|
+
type: resolvedType,
|
|
802
|
+
label: resolvedLabel
|
|
803
|
+
} = useResolvedInputConfig({
|
|
804
|
+
label,
|
|
805
|
+
placeholder,
|
|
806
|
+
shape,
|
|
807
|
+
type
|
|
808
|
+
});
|
|
809
|
+
const inputType = resolveInputType({
|
|
810
|
+
passwordVisible,
|
|
811
|
+
type: resolvedType
|
|
812
|
+
});
|
|
813
|
+
const hasError = Boolean(meta.touched && meta.error);
|
|
814
|
+
const errorText = hasError && typeof meta.error === "string" ? meta.error : null;
|
|
815
|
+
const hasValue = String(field.value ?? "").length > 0;
|
|
816
|
+
const floating = focused || hasValue;
|
|
817
|
+
react.useEffect(() => {
|
|
818
|
+
reactNative.Animated.timing(labelProgress, {
|
|
819
|
+
duration: 190,
|
|
820
|
+
easing: reactNative.Easing.out(reactNative.Easing.cubic),
|
|
821
|
+
toValue: floating ? 1 : 0,
|
|
822
|
+
useNativeDriver: false
|
|
823
|
+
}).start();
|
|
824
|
+
}, [floating, labelProgress]);
|
|
825
|
+
const handleBlur = (event) => {
|
|
826
|
+
setFocused(false);
|
|
827
|
+
helpers.setTouched(true);
|
|
828
|
+
onBlur?.(event);
|
|
829
|
+
};
|
|
830
|
+
const handleFocus = (event) => {
|
|
831
|
+
setFocused(true);
|
|
832
|
+
onFocus?.(event);
|
|
833
|
+
};
|
|
834
|
+
return /* @__PURE__ */ jsxRuntime$1.jsxs(reactNative.View, { className: inputRootClassName, children: [
|
|
835
|
+
/* @__PURE__ */ jsxRuntime$1.jsx(
|
|
836
|
+
reactNative.View,
|
|
837
|
+
{
|
|
838
|
+
className: cn(
|
|
839
|
+
inputFrameClassName,
|
|
840
|
+
hasError ? inputFrameErrorClassName : focused ? inputFrameActiveClassName : inputFrameIdleClassName,
|
|
841
|
+
inputShapes[resolvedShape],
|
|
842
|
+
disabled && inputFrameDisabledClassName,
|
|
843
|
+
className
|
|
844
|
+
),
|
|
845
|
+
children: /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
846
|
+
reactNative.TextInput,
|
|
847
|
+
{
|
|
848
|
+
accessibilityLabel: resolvedLabel,
|
|
849
|
+
className: cn(
|
|
850
|
+
inputControlClassName,
|
|
851
|
+
nativeInputControlClassName,
|
|
852
|
+
type === "password" && nativePasswordInputClassName,
|
|
853
|
+
inputClassName
|
|
854
|
+
),
|
|
855
|
+
editable: !disabled,
|
|
856
|
+
keyboardType: inputType === "number" ? "numeric" : "default",
|
|
857
|
+
onBlur: handleBlur,
|
|
858
|
+
onChangeText: (value) => helpers.setValue(value),
|
|
859
|
+
onFocus: handleFocus,
|
|
860
|
+
placeholder: "",
|
|
861
|
+
secureTextEntry: type === "password" && !passwordVisible,
|
|
862
|
+
style: nativeInputControlStyle,
|
|
863
|
+
underlineColorAndroid: "transparent",
|
|
864
|
+
value: field.value ?? ""
|
|
865
|
+
}
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
/* @__PURE__ */ jsxRuntime$1.jsx(
|
|
870
|
+
InputLabel,
|
|
871
|
+
{
|
|
872
|
+
animatedValue: labelProgress,
|
|
873
|
+
disabled,
|
|
874
|
+
errored: hasError,
|
|
875
|
+
floating,
|
|
876
|
+
text: resolvedLabel,
|
|
877
|
+
className: labelClassName
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
type === "password" ? /* @__PURE__ */ jsxRuntime$1.jsx(
|
|
881
|
+
reactNative.Pressable,
|
|
882
|
+
{
|
|
883
|
+
accessibilityRole: "button",
|
|
884
|
+
accessibilityLabel: passwordVisible ? "Hide password" : "Show password",
|
|
885
|
+
className: nativePasswordToggleClassName,
|
|
886
|
+
disabled,
|
|
887
|
+
onPress: () => setPasswordVisible((current) => !current),
|
|
888
|
+
children: /* @__PURE__ */ jsxRuntime$1.jsx(reactNative.Text, { className: nativePasswordToggleTextClassName, children: passwordVisible ? "Hide" : "Show" })
|
|
889
|
+
}
|
|
890
|
+
) : null,
|
|
891
|
+
/* @__PURE__ */ jsxRuntime$1.jsx(
|
|
892
|
+
InputResponse,
|
|
893
|
+
{
|
|
894
|
+
message: errorText,
|
|
895
|
+
name: field.name,
|
|
896
|
+
visibility: Boolean(errorText),
|
|
897
|
+
variant: "danger",
|
|
898
|
+
className: responseClassName
|
|
899
|
+
}
|
|
900
|
+
)
|
|
901
|
+
] });
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
exports.Button = Button_native_default;
|
|
905
|
+
exports.Checkbox = Checkbox;
|
|
906
|
+
exports.EUIProvider = EUIProvider;
|
|
907
|
+
exports.Input = Input;
|
|
908
|
+
exports.InputLabel = InputLabel;
|
|
909
|
+
exports.InputResponse = InputResponse;
|
|
910
|
+
exports.resolveWithGlobal = resolveWithGlobal;
|
|
911
|
+
exports.useEUIConfig = useEUIConfig;
|
|
912
|
+
//# sourceMappingURL=index.native.js.map
|
|
913
|
+
//# sourceMappingURL=index.native.js.map
|