elseware-ui 3.0.12 → 3.0.14
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 +0 -28
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +361 -346
- package/dist/index.d.ts +361 -346
- package/dist/index.js +192 -134
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +180 -125
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +15 -15
- package/dist/index.native.d.ts +15 -15
- package/dist/index.native.js +251 -213
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +236 -198
- package/dist/index.native.mjs.map +1 -1
- package/dist/{resolveGlobalConfigs-BdBJw5_w.d.mts → resolveGlobalConfigs-ClQlBbvH.d.mts} +19 -5
- package/dist/{resolveGlobalConfigs-BdBJw5_w.d.ts → resolveGlobalConfigs-ClQlBbvH.d.ts} +19 -5
- package/package.json +1 -1
- package/tailwind.preset.js +116 -116
package/dist/index.native.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createContext, forwardRef, useContext, useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { View, ActivityIndicator, Text, Pressable, Animated, Easing, TextInput, Modal, ScrollView } from 'react-native';
|
|
2
3
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import {
|
|
4
|
-
import { jsx } from '
|
|
5
|
-
import { jsx as jsx$1, jsxs } from 'nativewind/jsx-runtime';
|
|
4
|
+
import { jsx as jsx$1 } from 'react/jsx-runtime';
|
|
5
|
+
import { jsx, jsxs } from 'nativewind/jsx-runtime';
|
|
6
6
|
import { Formik, ErrorMessage, useField } from 'formik';
|
|
7
7
|
|
|
8
8
|
// src/components/data-entry/button/native/Button.native.tsx
|
|
@@ -27,6 +27,11 @@ function cn(...inputs) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/utils/styles.ts
|
|
30
|
+
function extractTextColorClasses(className) {
|
|
31
|
+
return className.split(/\s+/).filter(
|
|
32
|
+
(token) => token.startsWith("text-") || token.startsWith("dark:text-") || token.startsWith("disabled:text-")
|
|
33
|
+
).join(" ");
|
|
34
|
+
}
|
|
30
35
|
function resolveAppearanceStyles({
|
|
31
36
|
appearance = "solid",
|
|
32
37
|
variant = "default",
|
|
@@ -49,7 +54,7 @@ var EUIProvider = ({
|
|
|
49
54
|
children
|
|
50
55
|
}) => {
|
|
51
56
|
const [state, setState] = useState(config);
|
|
52
|
-
return /* @__PURE__ */ jsx(EUIContext.Provider, { value: { config: state, setConfig: setState }, children });
|
|
57
|
+
return /* @__PURE__ */ jsx$1(EUIContext.Provider, { value: { config: state, setConfig: setState }, children });
|
|
53
58
|
};
|
|
54
59
|
var useEUIConfig = () => {
|
|
55
60
|
const ctx = useContext(EUIContext);
|
|
@@ -146,14 +151,6 @@ var shapes = {
|
|
|
146
151
|
};
|
|
147
152
|
|
|
148
153
|
// src/components/data-entry/button/base/Button.styles.ts
|
|
149
|
-
var buttonShapes = shapes;
|
|
150
|
-
var buttonIconSizes = {
|
|
151
|
-
xs: 14,
|
|
152
|
-
sm: 16,
|
|
153
|
-
md: 18,
|
|
154
|
-
lg: 20,
|
|
155
|
-
xl: 22
|
|
156
|
-
};
|
|
157
154
|
function resolveButtonVariantStyles({
|
|
158
155
|
appearance,
|
|
159
156
|
variant
|
|
@@ -166,164 +163,205 @@ function resolveButtonVariantStyles({
|
|
|
166
163
|
ghost: variantsGhost
|
|
167
164
|
});
|
|
168
165
|
}
|
|
169
|
-
function getButtonLabelColorClassName(className) {
|
|
170
|
-
return className.split(/\s+/).filter(
|
|
171
|
-
(token) => token.startsWith("text-") || token.startsWith("dark:text-") || token.startsWith("disabled:text-")
|
|
172
|
-
).join(" ");
|
|
173
|
-
}
|
|
174
166
|
|
|
175
|
-
// src/components/data-entry/button/
|
|
176
|
-
var
|
|
167
|
+
// src/components/data-entry/button/base/Button.tokens.ts
|
|
168
|
+
var buttonSizeTokens = {
|
|
177
169
|
xs: {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
padding: "px-2 py-1",
|
|
171
|
+
text: "text-xs",
|
|
172
|
+
icon: 14,
|
|
173
|
+
minHeight: "min-h-[30px]",
|
|
174
|
+
leading: "leading-[14px]",
|
|
175
|
+
slot: "h-[14px] w-[14px]"
|
|
181
176
|
},
|
|
182
177
|
sm: {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
padding: "px-3 py-1.5",
|
|
179
|
+
text: "text-sm",
|
|
180
|
+
icon: 16,
|
|
181
|
+
minHeight: "min-h-9",
|
|
182
|
+
leading: "leading-4",
|
|
183
|
+
slot: "h-4 w-4"
|
|
186
184
|
},
|
|
187
185
|
md: {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
padding: "px-4 py-2",
|
|
187
|
+
text: "text-base",
|
|
188
|
+
icon: 18,
|
|
189
|
+
minHeight: "min-h-11",
|
|
190
|
+
leading: "leading-[18px]",
|
|
191
|
+
slot: "h-[18px] w-[18px]"
|
|
191
192
|
},
|
|
192
193
|
lg: {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
padding: "px-5 py-3",
|
|
195
|
+
text: "text-lg",
|
|
196
|
+
icon: 20,
|
|
197
|
+
minHeight: "min-h-[50px]",
|
|
198
|
+
leading: "leading-5",
|
|
199
|
+
slot: "h-5 w-5"
|
|
196
200
|
},
|
|
197
201
|
xl: {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
202
|
+
padding: "px-6 py-4",
|
|
203
|
+
text: "text-xl",
|
|
204
|
+
icon: 22,
|
|
205
|
+
minHeight: "min-h-14",
|
|
206
|
+
leading: "leading-[22px]",
|
|
207
|
+
slot: "h-[22px] w-[22px]"
|
|
201
208
|
}
|
|
202
209
|
};
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
function
|
|
208
|
-
icon,
|
|
209
|
-
text,
|
|
210
|
-
children,
|
|
211
|
-
loading = false,
|
|
212
|
-
disabled = false,
|
|
213
|
-
block = false,
|
|
214
|
-
compact = false,
|
|
215
|
-
mode,
|
|
216
|
-
contentClassName,
|
|
217
|
-
labelClassName,
|
|
218
|
-
className,
|
|
219
|
-
variant,
|
|
220
|
-
appearance,
|
|
221
|
-
shape,
|
|
222
|
-
size,
|
|
223
|
-
accessibilityRole = "button",
|
|
224
|
-
accessibilityState,
|
|
225
|
-
type: _type,
|
|
226
|
-
onClick: _onClick,
|
|
227
|
-
onMouseMove: _onMouseMove,
|
|
228
|
-
onPress,
|
|
229
|
-
...rest
|
|
230
|
-
}) {
|
|
210
|
+
var buttonShapes = shapes;
|
|
211
|
+
var buttonTextModeClassName = "border-transparent bg-transparent";
|
|
212
|
+
|
|
213
|
+
// src/components/data-entry/button/base/useButton.ts
|
|
214
|
+
function useButton(props) {
|
|
231
215
|
const {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
216
|
+
// Consumed by the shared model
|
|
217
|
+
icon,
|
|
218
|
+
iconPosition = "leading",
|
|
219
|
+
text,
|
|
220
|
+
children,
|
|
221
|
+
loading = false,
|
|
222
|
+
disabled = false,
|
|
223
|
+
block = false,
|
|
224
|
+
compact = false,
|
|
238
225
|
mode,
|
|
239
226
|
variant,
|
|
240
227
|
appearance,
|
|
241
228
|
shape,
|
|
242
|
-
size
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
229
|
+
size,
|
|
230
|
+
accessibilityState,
|
|
231
|
+
onPress,
|
|
232
|
+
// Owned by the platform views — pulled out here only so `rootRest` is a
|
|
233
|
+
// clean pass-through (no library props leak onto the DOM / native root).
|
|
234
|
+
type: _type,
|
|
235
|
+
glow: _glow,
|
|
236
|
+
className: _className,
|
|
237
|
+
contentClassName: _contentClassName,
|
|
238
|
+
labelClassName: _labelClassName,
|
|
239
|
+
accessibilityLabel: _accessibilityLabel,
|
|
240
|
+
accessibilityRole: _accessibilityRole,
|
|
241
|
+
testID: _testID,
|
|
242
|
+
onClick: _onClick,
|
|
243
|
+
onMouseMove: _onMouseMove,
|
|
244
|
+
...rootRest
|
|
245
|
+
} = props;
|
|
246
|
+
const { shape: resolvedShape, size: resolvedSize, variant: resolvedVariant, appearance: resolvedAppearance } = useResolvedButtonConfig({ compact, mode, variant, appearance, shape, size });
|
|
247
|
+
const tokens = buttonSizeTokens[resolvedSize];
|
|
248
|
+
const variantClassName = resolveButtonVariantStyles({
|
|
247
249
|
appearance: resolvedAppearance,
|
|
248
250
|
variant: resolvedVariant
|
|
249
251
|
});
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
onPress,
|
|
275
|
-
style: ({ pressed }) => [
|
|
276
|
-
pressed && !disabled && !loading ? { opacity: 0.82 } : null,
|
|
277
|
-
disabled || loading ? { opacity: 0.55 } : null
|
|
278
|
-
],
|
|
279
|
-
children: /* @__PURE__ */ jsxs(
|
|
280
|
-
View,
|
|
281
|
-
{
|
|
282
|
-
className: cn(
|
|
283
|
-
"z-10 flex-row items-center justify-center gap-2",
|
|
284
|
-
contentClassName
|
|
285
|
-
),
|
|
286
|
-
children: [
|
|
287
|
-
loading ? /* @__PURE__ */ jsx$1(
|
|
288
|
-
View,
|
|
289
|
-
{
|
|
290
|
-
className: cn(
|
|
291
|
-
"shrink-0 items-center justify-center",
|
|
292
|
-
metrics.slotClassName
|
|
293
|
-
),
|
|
294
|
-
children: /* @__PURE__ */ jsx$1(ActivityIndicator, { className: labelColorClassName, size: "small" })
|
|
295
|
-
}
|
|
296
|
-
) : null,
|
|
297
|
-
!loading && resolvedIcon ? /* @__PURE__ */ jsx$1(
|
|
298
|
-
View,
|
|
299
|
-
{
|
|
300
|
-
className: cn(
|
|
301
|
-
"shrink-0 items-center justify-center",
|
|
302
|
-
metrics.slotClassName
|
|
303
|
-
),
|
|
304
|
-
children: resolvedIcon
|
|
305
|
-
}
|
|
306
|
-
) : null,
|
|
307
|
-
typeof content === "string" || typeof content === "number" ? /* @__PURE__ */ jsx$1(View, { className: "items-center justify-center", children: /* @__PURE__ */ jsx$1(
|
|
308
|
-
Text,
|
|
309
|
-
{
|
|
310
|
-
className: cn(
|
|
311
|
-
"font-bold",
|
|
312
|
-
metrics.labelClassName,
|
|
313
|
-
labelColorClassName,
|
|
314
|
-
labelClassName
|
|
315
|
-
),
|
|
316
|
-
numberOfLines: 1,
|
|
317
|
-
style: nativeLabelBaseStyle,
|
|
318
|
-
children: content
|
|
319
|
-
}
|
|
320
|
-
) }) : content
|
|
321
|
-
]
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
}
|
|
325
|
-
);
|
|
252
|
+
const label = text ?? children;
|
|
253
|
+
const resolvedIcon = typeof icon === "function" ? icon({ color: "currentColor", size: tokens.icon }) : icon;
|
|
254
|
+
const isBusy = disabled || loading;
|
|
255
|
+
return {
|
|
256
|
+
size: resolvedSize,
|
|
257
|
+
shape: resolvedShape,
|
|
258
|
+
tokens,
|
|
259
|
+
isBusy,
|
|
260
|
+
isInteractive: !isBusy,
|
|
261
|
+
isTextMode: mode === "text",
|
|
262
|
+
block,
|
|
263
|
+
loading,
|
|
264
|
+
iconSize: tokens.icon,
|
|
265
|
+
icon: resolvedIcon,
|
|
266
|
+
iconPosition,
|
|
267
|
+
label,
|
|
268
|
+
hasTextLabel: typeof label === "string" || typeof label === "number",
|
|
269
|
+
variantClassName,
|
|
270
|
+
shapeClassName: buttonShapes[resolvedShape],
|
|
271
|
+
labelColorClassName: extractTextColorClasses(variantClassName),
|
|
272
|
+
selected: accessibilityState?.selected,
|
|
273
|
+
onPress,
|
|
274
|
+
rootRest
|
|
275
|
+
};
|
|
326
276
|
}
|
|
277
|
+
var NATIVE_ROOT = "relative items-center justify-center overflow-hidden";
|
|
278
|
+
var nativeLabelBaseStyle = {
|
|
279
|
+
includeFontPadding: false,
|
|
280
|
+
textAlignVertical: "center"
|
|
281
|
+
};
|
|
282
|
+
var Button = forwardRef(
|
|
283
|
+
function Button2(props, ref) {
|
|
284
|
+
const {
|
|
285
|
+
className,
|
|
286
|
+
contentClassName,
|
|
287
|
+
labelClassName,
|
|
288
|
+
accessibilityLabel,
|
|
289
|
+
accessibilityRole = "button",
|
|
290
|
+
testID
|
|
291
|
+
} = props;
|
|
292
|
+
const model = useButton(props);
|
|
293
|
+
const trailing = model.iconPosition === "trailing";
|
|
294
|
+
const iconSlot = model.loading || model.icon ? /* @__PURE__ */ jsx(
|
|
295
|
+
View,
|
|
296
|
+
{
|
|
297
|
+
className: cn(
|
|
298
|
+
"shrink-0 items-center justify-center",
|
|
299
|
+
model.tokens.slot
|
|
300
|
+
),
|
|
301
|
+
children: model.loading ? /* @__PURE__ */ jsx(
|
|
302
|
+
ActivityIndicator,
|
|
303
|
+
{
|
|
304
|
+
className: model.labelColorClassName,
|
|
305
|
+
size: "small"
|
|
306
|
+
}
|
|
307
|
+
) : model.icon
|
|
308
|
+
}
|
|
309
|
+
) : null;
|
|
310
|
+
const labelNode = model.hasTextLabel ? /* @__PURE__ */ jsx(
|
|
311
|
+
Text,
|
|
312
|
+
{
|
|
313
|
+
className: cn(
|
|
314
|
+
"font-bold",
|
|
315
|
+
model.tokens.text,
|
|
316
|
+
model.tokens.leading,
|
|
317
|
+
model.labelColorClassName,
|
|
318
|
+
labelClassName
|
|
319
|
+
),
|
|
320
|
+
numberOfLines: 1,
|
|
321
|
+
style: nativeLabelBaseStyle,
|
|
322
|
+
children: model.label
|
|
323
|
+
}
|
|
324
|
+
) : model.label;
|
|
325
|
+
return /* @__PURE__ */ jsx(
|
|
326
|
+
Pressable,
|
|
327
|
+
{
|
|
328
|
+
...model.rootRest,
|
|
329
|
+
ref,
|
|
330
|
+
accessibilityLabel,
|
|
331
|
+
accessibilityRole,
|
|
332
|
+
accessibilityState: { disabled: model.isBusy, selected: model.selected },
|
|
333
|
+
testID,
|
|
334
|
+
disabled: model.isBusy,
|
|
335
|
+
onPress: model.onPress,
|
|
336
|
+
className: cn(
|
|
337
|
+
NATIVE_ROOT,
|
|
338
|
+
model.variantClassName,
|
|
339
|
+
model.shapeClassName,
|
|
340
|
+
model.tokens.padding,
|
|
341
|
+
model.tokens.minHeight,
|
|
342
|
+
model.block && "w-full",
|
|
343
|
+
model.isTextMode && buttonTextModeClassName,
|
|
344
|
+
model.isBusy ? "opacity-55" : "active:opacity-80",
|
|
345
|
+
className
|
|
346
|
+
),
|
|
347
|
+
style: ({ pressed }) => pressed && model.isInteractive ? { opacity: 0.82 } : null,
|
|
348
|
+
children: /* @__PURE__ */ jsxs(
|
|
349
|
+
View,
|
|
350
|
+
{
|
|
351
|
+
className: cn(
|
|
352
|
+
"z-10 flex-row items-center justify-center gap-2",
|
|
353
|
+
contentClassName
|
|
354
|
+
),
|
|
355
|
+
children: [
|
|
356
|
+
trailing ? labelNode : iconSlot,
|
|
357
|
+
trailing ? iconSlot : labelNode
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
);
|
|
327
365
|
var Button_native_default = Button;
|
|
328
366
|
function isMultiCheckbox(props) {
|
|
329
367
|
return Array.isArray(props.options);
|
|
@@ -443,7 +481,7 @@ function Tick({
|
|
|
443
481
|
checkedIconClassName,
|
|
444
482
|
iconClassName
|
|
445
483
|
}) {
|
|
446
|
-
return /* @__PURE__ */ jsx
|
|
484
|
+
return /* @__PURE__ */ jsx(
|
|
447
485
|
Text,
|
|
448
486
|
{
|
|
449
487
|
className: cn(
|
|
@@ -508,7 +546,7 @@ function Checkbox(checkboxProps) {
|
|
|
508
546
|
disabled,
|
|
509
547
|
onPress: () => singleHelpers.setValue(!singleChecked),
|
|
510
548
|
children: [
|
|
511
|
-
/* @__PURE__ */ jsx
|
|
549
|
+
/* @__PURE__ */ jsx(
|
|
512
550
|
View,
|
|
513
551
|
{
|
|
514
552
|
className: getIndicatorClassName({
|
|
@@ -520,7 +558,7 @@ function Checkbox(checkboxProps) {
|
|
|
520
558
|
resolvedShape,
|
|
521
559
|
variantCheckedClassName: variantStyles.checkedClassName
|
|
522
560
|
}),
|
|
523
|
-
children: singleChecked ? /* @__PURE__ */ jsx
|
|
561
|
+
children: singleChecked ? /* @__PURE__ */ jsx(
|
|
524
562
|
Tick,
|
|
525
563
|
{
|
|
526
564
|
checkedIconClassName,
|
|
@@ -529,11 +567,11 @@ function Checkbox(checkboxProps) {
|
|
|
529
567
|
) : null
|
|
530
568
|
}
|
|
531
569
|
),
|
|
532
|
-
resolvedLabel ? /* @__PURE__ */ jsx
|
|
570
|
+
resolvedLabel ? /* @__PURE__ */ jsx(Text, { className: cn(checkboxLabelClassName, labelClassName), children: resolvedLabel }) : null
|
|
533
571
|
]
|
|
534
572
|
}
|
|
535
573
|
),
|
|
536
|
-
isMulti && multiProps ? /* @__PURE__ */ jsx
|
|
574
|
+
isMulti && multiProps ? /* @__PURE__ */ jsx(View, { className: "w-full flex-row gap-6", children: optionColumns.map((columnOptions, columnIndex) => /* @__PURE__ */ jsx(
|
|
537
575
|
View,
|
|
538
576
|
{
|
|
539
577
|
className: "min-w-0 flex-1 flex-col gap-2",
|
|
@@ -555,7 +593,7 @@ function Checkbox(checkboxProps) {
|
|
|
555
593
|
checked ? values.filter((value) => value !== option.value) : [...values, option.value]
|
|
556
594
|
),
|
|
557
595
|
children: [
|
|
558
|
-
/* @__PURE__ */ jsx
|
|
596
|
+
/* @__PURE__ */ jsx(
|
|
559
597
|
View,
|
|
560
598
|
{
|
|
561
599
|
className: getIndicatorClassName({
|
|
@@ -567,7 +605,7 @@ function Checkbox(checkboxProps) {
|
|
|
567
605
|
resolvedShape,
|
|
568
606
|
variantCheckedClassName: variantStyles.checkedClassName
|
|
569
607
|
}),
|
|
570
|
-
children: checked ? /* @__PURE__ */ jsx
|
|
608
|
+
children: checked ? /* @__PURE__ */ jsx(
|
|
571
609
|
Tick,
|
|
572
610
|
{
|
|
573
611
|
checkedIconClassName,
|
|
@@ -576,7 +614,7 @@ function Checkbox(checkboxProps) {
|
|
|
576
614
|
) : null
|
|
577
615
|
}
|
|
578
616
|
),
|
|
579
|
-
/* @__PURE__ */ jsx
|
|
617
|
+
/* @__PURE__ */ jsx(
|
|
580
618
|
Text,
|
|
581
619
|
{
|
|
582
620
|
className: cn(
|
|
@@ -595,7 +633,7 @@ function Checkbox(checkboxProps) {
|
|
|
595
633
|
},
|
|
596
634
|
`${multiField.name}-column-${columnIndex}`
|
|
597
635
|
)) }) : null,
|
|
598
|
-
errorText ? /* @__PURE__ */ jsx
|
|
636
|
+
errorText ? /* @__PURE__ */ jsx(Text, { className: "px-2 py-1 text-sm font-medium text-eui-danger-500", children: errorText }) : null
|
|
599
637
|
] });
|
|
600
638
|
}
|
|
601
639
|
|
|
@@ -676,7 +714,7 @@ function InputLabel({
|
|
|
676
714
|
lineHeight: floating === true ? nativeInputLabelMetrics.floatingFontSize : nativeInputLabelMetrics.restingFontSize,
|
|
677
715
|
top: floating === true ? nativeInputLabelMetrics.floatingTop : nativeInputLabelMetrics.restingTop
|
|
678
716
|
};
|
|
679
|
-
return /* @__PURE__ */ jsx
|
|
717
|
+
return /* @__PURE__ */ jsx(
|
|
680
718
|
Animated.Text,
|
|
681
719
|
{
|
|
682
720
|
className: cn(
|
|
@@ -740,8 +778,8 @@ function InputResponse({
|
|
|
740
778
|
}
|
|
741
779
|
]
|
|
742
780
|
};
|
|
743
|
-
const content = message ?? /* @__PURE__ */ jsx
|
|
744
|
-
return /* @__PURE__ */ jsx
|
|
781
|
+
const content = message ?? /* @__PURE__ */ jsx(ErrorMessage, { name, children: (errorMessage) => String(errorMessage) });
|
|
782
|
+
return /* @__PURE__ */ jsx(Animated.View, { className: "w-full", style: animatedStyle, children: /* @__PURE__ */ jsx(
|
|
745
783
|
Text,
|
|
746
784
|
{
|
|
747
785
|
className: cn(
|
|
@@ -825,7 +863,7 @@ function DateSelector(dateSelectorProps) {
|
|
|
825
863
|
);
|
|
826
864
|
};
|
|
827
865
|
return /* @__PURE__ */ jsxs(View, { className: inputRootClassName, children: [
|
|
828
|
-
/* @__PURE__ */ jsx
|
|
866
|
+
/* @__PURE__ */ jsx(
|
|
829
867
|
View,
|
|
830
868
|
{
|
|
831
869
|
className: cn(
|
|
@@ -836,7 +874,7 @@ function DateSelector(dateSelectorProps) {
|
|
|
836
874
|
className,
|
|
837
875
|
styles
|
|
838
876
|
),
|
|
839
|
-
children: /* @__PURE__ */ jsx
|
|
877
|
+
children: /* @__PURE__ */ jsx(
|
|
840
878
|
TextInput,
|
|
841
879
|
{
|
|
842
880
|
accessibilityLabel: resolvedLabel,
|
|
@@ -858,7 +896,7 @@ function DateSelector(dateSelectorProps) {
|
|
|
858
896
|
)
|
|
859
897
|
}
|
|
860
898
|
),
|
|
861
|
-
/* @__PURE__ */ jsx
|
|
899
|
+
/* @__PURE__ */ jsx(
|
|
862
900
|
InputLabel,
|
|
863
901
|
{
|
|
864
902
|
animatedValue: labelProgress,
|
|
@@ -869,7 +907,7 @@ function DateSelector(dateSelectorProps) {
|
|
|
869
907
|
className: labelClassName
|
|
870
908
|
}
|
|
871
909
|
),
|
|
872
|
-
/* @__PURE__ */ jsx
|
|
910
|
+
/* @__PURE__ */ jsx(
|
|
873
911
|
InputResponse,
|
|
874
912
|
{
|
|
875
913
|
message: errorText,
|
|
@@ -921,7 +959,7 @@ function Form({
|
|
|
921
959
|
onChange,
|
|
922
960
|
onDirtyChange
|
|
923
961
|
}) {
|
|
924
|
-
return /* @__PURE__ */ jsx
|
|
962
|
+
return /* @__PURE__ */ jsx(
|
|
925
963
|
Formik,
|
|
926
964
|
{
|
|
927
965
|
initialValues,
|
|
@@ -931,7 +969,7 @@ function Form({
|
|
|
931
969
|
await onSubmit(values, helpers);
|
|
932
970
|
},
|
|
933
971
|
children: (formik) => /* @__PURE__ */ jsxs(View, { className: cn(className), children: [
|
|
934
|
-
/* @__PURE__ */ jsx
|
|
972
|
+
/* @__PURE__ */ jsx(
|
|
935
973
|
FormObservers,
|
|
936
974
|
{
|
|
937
975
|
formik,
|
|
@@ -939,7 +977,7 @@ function Form({
|
|
|
939
977
|
onDirtyChange
|
|
940
978
|
}
|
|
941
979
|
),
|
|
942
|
-
/* @__PURE__ */ jsx
|
|
980
|
+
/* @__PURE__ */ jsx(View, { className: cn(contentClassName), children: renderFormChildren(children, formik) })
|
|
943
981
|
] })
|
|
944
982
|
}
|
|
945
983
|
);
|
|
@@ -1012,7 +1050,7 @@ function FormResponse({
|
|
|
1012
1050
|
return null;
|
|
1013
1051
|
}
|
|
1014
1052
|
const styles = resolveFormResponseStyles({ shape, size, variant });
|
|
1015
|
-
return /* @__PURE__ */ jsx
|
|
1053
|
+
return /* @__PURE__ */ jsx(View, { className: cn(styles.rootClassName, className), children: /* @__PURE__ */ jsx(Text, { className: cn(styles.textClassName, textClassName), children: text }) });
|
|
1016
1054
|
}
|
|
1017
1055
|
function resolveInputType({
|
|
1018
1056
|
passwordVisible,
|
|
@@ -1100,7 +1138,7 @@ function Input(inputProps) {
|
|
|
1100
1138
|
onFocus?.(event);
|
|
1101
1139
|
};
|
|
1102
1140
|
return /* @__PURE__ */ jsxs(View, { className: inputRootClassName, children: [
|
|
1103
|
-
/* @__PURE__ */ jsx
|
|
1141
|
+
/* @__PURE__ */ jsx(
|
|
1104
1142
|
View,
|
|
1105
1143
|
{
|
|
1106
1144
|
className: cn(
|
|
@@ -1110,7 +1148,7 @@ function Input(inputProps) {
|
|
|
1110
1148
|
disabled && inputFrameDisabledClassName,
|
|
1111
1149
|
className
|
|
1112
1150
|
),
|
|
1113
|
-
children: /* @__PURE__ */ jsx
|
|
1151
|
+
children: /* @__PURE__ */ jsx(
|
|
1114
1152
|
TextInput,
|
|
1115
1153
|
{
|
|
1116
1154
|
accessibilityLabel: resolvedLabel,
|
|
@@ -1134,7 +1172,7 @@ function Input(inputProps) {
|
|
|
1134
1172
|
)
|
|
1135
1173
|
}
|
|
1136
1174
|
),
|
|
1137
|
-
/* @__PURE__ */ jsx
|
|
1175
|
+
/* @__PURE__ */ jsx(
|
|
1138
1176
|
InputLabel,
|
|
1139
1177
|
{
|
|
1140
1178
|
animatedValue: labelProgress,
|
|
@@ -1145,7 +1183,7 @@ function Input(inputProps) {
|
|
|
1145
1183
|
className: labelClassName
|
|
1146
1184
|
}
|
|
1147
1185
|
),
|
|
1148
|
-
type === "password" ? /* @__PURE__ */ jsx
|
|
1186
|
+
type === "password" ? /* @__PURE__ */ jsx(
|
|
1149
1187
|
Pressable,
|
|
1150
1188
|
{
|
|
1151
1189
|
accessibilityRole: "button",
|
|
@@ -1153,10 +1191,10 @@ function Input(inputProps) {
|
|
|
1153
1191
|
className: nativePasswordToggleClassName,
|
|
1154
1192
|
disabled,
|
|
1155
1193
|
onPress: () => setPasswordVisible((current) => !current),
|
|
1156
|
-
children: /* @__PURE__ */ jsx
|
|
1194
|
+
children: /* @__PURE__ */ jsx(Text, { className: nativePasswordToggleTextClassName, children: passwordVisible ? "Hide" : "Show" })
|
|
1157
1195
|
}
|
|
1158
1196
|
) : null,
|
|
1159
|
-
/* @__PURE__ */ jsx
|
|
1197
|
+
/* @__PURE__ */ jsx(
|
|
1160
1198
|
InputResponse,
|
|
1161
1199
|
{
|
|
1162
1200
|
message: errorText,
|
|
@@ -1240,7 +1278,7 @@ function InputFile(inputFileProps) {
|
|
|
1240
1278
|
}
|
|
1241
1279
|
};
|
|
1242
1280
|
return /* @__PURE__ */ jsxs(View, { className: inputRootClassName, children: [
|
|
1243
|
-
/* @__PURE__ */ jsx
|
|
1281
|
+
/* @__PURE__ */ jsx(
|
|
1244
1282
|
Pressable,
|
|
1245
1283
|
{
|
|
1246
1284
|
accessibilityLabel: resolvedLabel,
|
|
@@ -1257,7 +1295,7 @@ function InputFile(inputFileProps) {
|
|
|
1257
1295
|
disabled && inputFrameDisabledClassName,
|
|
1258
1296
|
className
|
|
1259
1297
|
),
|
|
1260
|
-
children: /* @__PURE__ */ jsx
|
|
1298
|
+
children: /* @__PURE__ */ jsx(
|
|
1261
1299
|
Text,
|
|
1262
1300
|
{
|
|
1263
1301
|
numberOfLines: 1,
|
|
@@ -1273,7 +1311,7 @@ function InputFile(inputFileProps) {
|
|
|
1273
1311
|
)
|
|
1274
1312
|
}
|
|
1275
1313
|
),
|
|
1276
|
-
/* @__PURE__ */ jsx
|
|
1314
|
+
/* @__PURE__ */ jsx(
|
|
1277
1315
|
InputLabel,
|
|
1278
1316
|
{
|
|
1279
1317
|
disabled,
|
|
@@ -1283,7 +1321,7 @@ function InputFile(inputFileProps) {
|
|
|
1283
1321
|
className: labelClassName
|
|
1284
1322
|
}
|
|
1285
1323
|
),
|
|
1286
|
-
/* @__PURE__ */ jsx
|
|
1324
|
+
/* @__PURE__ */ jsx(
|
|
1287
1325
|
InputResponse,
|
|
1288
1326
|
{
|
|
1289
1327
|
message: errorText,
|
|
@@ -1379,7 +1417,7 @@ function Select(selectProps) {
|
|
|
1379
1417
|
onFocus?.(event);
|
|
1380
1418
|
};
|
|
1381
1419
|
return /* @__PURE__ */ jsxs(View, { className: inputRootClassName, children: [
|
|
1382
|
-
/* @__PURE__ */ jsx
|
|
1420
|
+
/* @__PURE__ */ jsx(
|
|
1383
1421
|
Pressable,
|
|
1384
1422
|
{
|
|
1385
1423
|
accessibilityLabel: resolvedLabel,
|
|
@@ -1398,7 +1436,7 @@ function Select(selectProps) {
|
|
|
1398
1436
|
className,
|
|
1399
1437
|
styles
|
|
1400
1438
|
),
|
|
1401
|
-
children: /* @__PURE__ */ jsx
|
|
1439
|
+
children: /* @__PURE__ */ jsx(
|
|
1402
1440
|
Text,
|
|
1403
1441
|
{
|
|
1404
1442
|
numberOfLines: 1,
|
|
@@ -1414,7 +1452,7 @@ function Select(selectProps) {
|
|
|
1414
1452
|
)
|
|
1415
1453
|
}
|
|
1416
1454
|
),
|
|
1417
|
-
/* @__PURE__ */ jsx
|
|
1455
|
+
/* @__PURE__ */ jsx(
|
|
1418
1456
|
InputLabel,
|
|
1419
1457
|
{
|
|
1420
1458
|
disabled,
|
|
@@ -1424,7 +1462,7 @@ function Select(selectProps) {
|
|
|
1424
1462
|
className: labelClassName
|
|
1425
1463
|
}
|
|
1426
1464
|
),
|
|
1427
|
-
/* @__PURE__ */ jsx
|
|
1465
|
+
/* @__PURE__ */ jsx(
|
|
1428
1466
|
InputResponse,
|
|
1429
1467
|
{
|
|
1430
1468
|
message: errorText,
|
|
@@ -1434,7 +1472,7 @@ function Select(selectProps) {
|
|
|
1434
1472
|
className: responseClassName
|
|
1435
1473
|
}
|
|
1436
1474
|
),
|
|
1437
|
-
/* @__PURE__ */ jsx
|
|
1475
|
+
/* @__PURE__ */ jsx(
|
|
1438
1476
|
Modal,
|
|
1439
1477
|
{
|
|
1440
1478
|
animationType: "fade",
|
|
@@ -1442,7 +1480,7 @@ function Select(selectProps) {
|
|
|
1442
1480
|
transparent: true,
|
|
1443
1481
|
visible: open,
|
|
1444
1482
|
children: /* @__PURE__ */ jsxs(View, { className: "flex-1 justify-end bg-black/40 px-4 py-6", children: [
|
|
1445
|
-
/* @__PURE__ */ jsx
|
|
1483
|
+
/* @__PURE__ */ jsx(
|
|
1446
1484
|
Pressable,
|
|
1447
1485
|
{
|
|
1448
1486
|
accessibilityLabel: "Close select options",
|
|
@@ -1451,9 +1489,9 @@ function Select(selectProps) {
|
|
|
1451
1489
|
onPress: closeOptions
|
|
1452
1490
|
}
|
|
1453
1491
|
),
|
|
1454
|
-
/* @__PURE__ */ jsx
|
|
1492
|
+
/* @__PURE__ */ jsx(View, { className: "max-h-[70%] overflow-hidden rounded-lg bg-white shadow-xl dark:bg-eui-dark-500", children: /* @__PURE__ */ jsx(ScrollView, { children: options.map((option) => {
|
|
1455
1493
|
const selected = option.value === field.value;
|
|
1456
|
-
return /* @__PURE__ */ jsx
|
|
1494
|
+
return /* @__PURE__ */ jsx(
|
|
1457
1495
|
Pressable,
|
|
1458
1496
|
{
|
|
1459
1497
|
accessibilityRole: "button",
|
|
@@ -1468,7 +1506,7 @@ function Select(selectProps) {
|
|
|
1468
1506
|
selected && "bg-eui-secondary-500/10",
|
|
1469
1507
|
option.disabled && "opacity-50"
|
|
1470
1508
|
),
|
|
1471
|
-
children: /* @__PURE__ */ jsx
|
|
1509
|
+
children: /* @__PURE__ */ jsx(Text, { className: "text-base font-medium text-gray-950 dark:text-gray-50", children: String(option.label) })
|
|
1472
1510
|
},
|
|
1473
1511
|
option.value
|
|
1474
1512
|
);
|
|
@@ -1621,7 +1659,7 @@ function Tags(tagsProps) {
|
|
|
1621
1659
|
tagClassName
|
|
1622
1660
|
),
|
|
1623
1661
|
children: [
|
|
1624
|
-
/* @__PURE__ */ jsx
|
|
1662
|
+
/* @__PURE__ */ jsx(
|
|
1625
1663
|
Text,
|
|
1626
1664
|
{
|
|
1627
1665
|
className: "shrink text-sm font-medium text-eui-dark-700 dark:text-eui-light-300",
|
|
@@ -1630,7 +1668,7 @@ function Tags(tagsProps) {
|
|
|
1630
1668
|
children: tag
|
|
1631
1669
|
}
|
|
1632
1670
|
),
|
|
1633
|
-
/* @__PURE__ */ jsx
|
|
1671
|
+
/* @__PURE__ */ jsx(
|
|
1634
1672
|
Pressable,
|
|
1635
1673
|
{
|
|
1636
1674
|
accessibilityLabel: `Remove ${tag}`,
|
|
@@ -1642,7 +1680,7 @@ function Tags(tagsProps) {
|
|
|
1642
1680
|
),
|
|
1643
1681
|
disabled,
|
|
1644
1682
|
onPress: () => handleRemoveTag(index),
|
|
1645
|
-
children: /* @__PURE__ */ jsx
|
|
1683
|
+
children: /* @__PURE__ */ jsx(
|
|
1646
1684
|
Text,
|
|
1647
1685
|
{
|
|
1648
1686
|
className: "text-xs font-bold text-eui-danger-500",
|
|
@@ -1656,7 +1694,7 @@ function Tags(tagsProps) {
|
|
|
1656
1694
|
},
|
|
1657
1695
|
`${tag}-${index}`
|
|
1658
1696
|
)),
|
|
1659
|
-
tags.length < resolvedLimit ? /* @__PURE__ */ jsx
|
|
1697
|
+
tags.length < resolvedLimit ? /* @__PURE__ */ jsx(
|
|
1660
1698
|
TextInput,
|
|
1661
1699
|
{
|
|
1662
1700
|
accessibilityLabel: resolvedLabel,
|
|
@@ -1696,7 +1734,7 @@ function Tags(tagsProps) {
|
|
|
1696
1734
|
]
|
|
1697
1735
|
}
|
|
1698
1736
|
),
|
|
1699
|
-
/* @__PURE__ */ jsx
|
|
1737
|
+
/* @__PURE__ */ jsx(
|
|
1700
1738
|
InputLabel,
|
|
1701
1739
|
{
|
|
1702
1740
|
disabled,
|
|
@@ -1706,7 +1744,7 @@ function Tags(tagsProps) {
|
|
|
1706
1744
|
className: labelClassName
|
|
1707
1745
|
}
|
|
1708
1746
|
),
|
|
1709
|
-
/* @__PURE__ */ jsx
|
|
1747
|
+
/* @__PURE__ */ jsx(
|
|
1710
1748
|
InputResponse,
|
|
1711
1749
|
{
|
|
1712
1750
|
message: errorText,
|
|
@@ -1802,7 +1840,7 @@ function TextArea(textAreaProps) {
|
|
|
1802
1840
|
styles
|
|
1803
1841
|
),
|
|
1804
1842
|
children: [
|
|
1805
|
-
/* @__PURE__ */ jsx
|
|
1843
|
+
/* @__PURE__ */ jsx(
|
|
1806
1844
|
TextInput,
|
|
1807
1845
|
{
|
|
1808
1846
|
accessibilityLabel: resolvedLabel,
|
|
@@ -1827,7 +1865,7 @@ function TextArea(textAreaProps) {
|
|
|
1827
1865
|
]
|
|
1828
1866
|
}
|
|
1829
1867
|
),
|
|
1830
|
-
/* @__PURE__ */ jsx
|
|
1868
|
+
/* @__PURE__ */ jsx(
|
|
1831
1869
|
InputLabel,
|
|
1832
1870
|
{
|
|
1833
1871
|
disabled,
|
|
@@ -1837,7 +1875,7 @@ function TextArea(textAreaProps) {
|
|
|
1837
1875
|
className: labelClassName
|
|
1838
1876
|
}
|
|
1839
1877
|
),
|
|
1840
|
-
/* @__PURE__ */ jsx
|
|
1878
|
+
/* @__PURE__ */ jsx(
|
|
1841
1879
|
InputResponse,
|
|
1842
1880
|
{
|
|
1843
1881
|
message: errorText,
|