decord/source/design/components/Input/native/Input.native.tsx

75 lines
3.5 KiB
TypeScript
Raw Normal View History

// Module ID: 6708
// Function ID: 6709
2026-07-20 16:05:17 +00:00
// Name: Input
// Dependencies: [19, 17, 21, 4636, 576, 6709, 4340, 4632, 6710, 2]
2026-07-20 16:05:17 +00:00
// Exports: Input
// Module 6708 (Input)
import nativeDefault from "native" /* 576 */;
import native from "native" /* 4340 */;
import getRequiredFieldA11yName from "getRequiredFieldA11yName" /* 6709 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const View = fn(17).View;
const jsxProd = fn(21);
({ jsx: c3, jsxs: closure_4 } = jsxProd);
const createStyles = fn(4636);
const obj2 = { inputRow: { flexDirection: "row", gap: nativeDefault.space.PX_8, marginTop: nativeDefault.space.PX_4, marginBottom: nativeDefault.space.PX_4 }, labelWrapper: null, label: null, description: null, error: null };
let obj3 = { flexDirection: "row", gap: nativeDefault.space.PX_8, marginTop: nativeDefault.space.PX_4, marginBottom: nativeDefault.space.PX_4 };
obj2.labelWrapper = { marginBottom: nativeDefault.space.PX_4, flexDirection: "row", alignItems: "center" };
let obj4 = { marginBottom: nativeDefault.space.PX_4, flexDirection: "row", alignItems: "center" };
obj2.label = { marginBottom: nativeDefault.space.PX_4 };
let obj5 = { marginBottom: nativeDefault.space.PX_4 };
obj2.description = { marginTop: nativeDefault.space.PX_4 };
let obj6 = { marginTop: nativeDefault.space.PX_4 };
obj2.error = { marginTop: nativeDefault.space.PX_4, width: "auto" };
let closure_5 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("design/components/Input/native/Input.native.tsx");
2026-07-20 16:05:17 +00:00
export const Input = function Input(arg0) {
const tmp = closure_5();
2026-07-20 16:05:17 +00:00
({ label, labelTrailing, labelId, description, errorMessage, required } = arg0);
({ children, containerStyle } = arg0);
const obj = getRequiredFieldA11yName;
const requiredFieldA11yName = obj.getRequiredFieldA11yName(native.getNodeText(label), required);
const obj3 = { style: containerStyle, children: null };
2026-07-20 16:05:17 +00:00
if (null == label) {
const items = [null, , , ];
const obj4 = { style: tmp.inputRow, children };
items[1] = React3(tmp6, obj4);
let tmp11Result = null;
2026-07-20 16:05:17 +00:00
if (null != description) {
const obj5 = { variant: "text-xs/medium", color: "text-muted", style: tmp.description, children: description };
tmp11Result = tmp11(tmp2(4632).Text, obj5);
2026-07-20 16:05:17 +00:00
}
items[2] = tmp11Result;
let tmp11Result2 = null;
2026-07-20 16:05:17 +00:00
if (null != errorMessage) {
const obj6 = { style: tmp.error, children: errorMessage };
tmp11Result2 = tmp11(tmp2(6710).ErrorText, obj6);
2026-07-20 16:05:17 +00:00
}
items[3] = tmp11Result2;
obj3.children = items;
return tmp5(tmp6, obj3);
2026-07-20 16:05:17 +00:00
} else if (null != labelTrailing) {
const obj7 = { style: tmp.labelWrapper, children: null };
const obj8 = { variant: "text-sm/semibold", color: "text-subtle", nativeID: labelId, accessibilityLabel: requiredFieldA11yName, children: label };
const items1 = [React3(tmp2(4632).Text, obj8), labelTrailing];
obj7.children = items1;
let tmp5Result = tmp5(tmp6, obj7);
2026-07-20 16:05:17 +00:00
} else {
const obj9 = { variant: "text-sm/semibold", color: "text-subtle", style: tmp.label, nativeID: labelId, accessibilityLabel: requiredFieldA11yName, children: null };
2026-07-20 16:05:17 +00:00
const items2 = [label, ];
let tmp5Result2 = null;
2026-07-20 16:05:17 +00:00
if (required) {
const obj10 = { variant: "text-sm/bold", color: "text-feedback-critical", "aria-hidden": true, children: [" ", "*"] };
tmp5Result2 = tmp5(tmp2(4632).Text, obj10);
2026-07-20 16:05:17 +00:00
}
items2[1] = tmp5Result2;
obj9.children = items2;
tmp5Result = tmp5(tmp2(4632).Text, obj9);
2026-07-20 16:05:17 +00:00
}
};