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

70 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10607
// Function ID: 10608
2026-07-20 16:05:17 +00:00
// Name: Checkbox
2026-08-25 06:04:03 +00:00
// Dependencies: [17, 21, 4380, 4109, 1236, 4813, 8120, 4376, 2]
2026-07-20 16:05:17 +00:00
// Exports: Checkbox
2026-08-25 06:04:03 +00:00
// Module 10607 (Checkbox)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
({ Pressable: obj1, View: c3 } = get_ActivityIndicator);
({ jsx: c4, jsxs: c5 } = jsxProd);
let closure_6 = createCacheKey.createStyles({ textContainer: { flex: 1 }, labelContainer: { minHeight: 24, justifyContent: "center" } });
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("design/components/Checkbox/native/Checkbox.native.tsx");
2026-07-20 16:05:17 +00:00
export const Checkbox = function Checkbox(onToggle) {
({ label, description, required, checked } = onToggle);
2026-07-23 10:11:24 +00:00
onToggle = onToggle.onToggle;
2026-07-29 08:29:29 +00:00
const tmp = callback();
2026-07-23 10:11:24 +00:00
let obj = checked(onToggle[3]);
2026-07-20 16:05:17 +00:00
const checkboxA11yNative = obj.useCheckboxA11yNative({ checked });
2026-07-29 08:29:29 +00:00
obj = { accessibilityRole: checkboxA11yNative.accessibilityRole, accessibilityLabel: null, accessibilityState: null, onPress: null, children: null };
2026-07-20 16:05:17 +00:00
let str = "";
let str2 = "";
if (required) {
2026-07-29 08:29:29 +00:00
const intl = tmp2(tmp3[4]).intl;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
str2 = " (" + intl.string(tmp2(tmp3[4]).t.EkokLy) + ")";
2026-07-20 16:05:17 +00:00
}
const sum = label + str2;
if (null != description) {
const _HermesInternal2 = HermesInternal;
str = ", " + description;
}
2026-07-29 08:29:29 +00:00
obj[1] = sum + str;
obj[2] = checkboxA11yNative.accessibilityState;
obj[3] = function onPress() {
2026-07-20 16:05:17 +00:00
return onToggle(!checked);
};
2026-07-29 08:29:29 +00:00
const items = [closure_4(checked(onToggle[6]).FormCheckbox, { checked }), ];
obj = { style: tmp.textContainer, children: null };
2026-08-24 06:08:38 +00:00
obj1 = { style: tmp.labelContainer, children: null };
2026-07-20 16:05:17 +00:00
const items1 = [label, ];
if (required) {
2026-07-29 08:29:29 +00:00
const obj2 = { variant: "text-md/bold", color: "text-feedback-critical", "aria-label": null, children: null };
const intl2 = tmp2(tmp3[4]).intl;
obj2[2] = intl2.string(tmp2(tmp3[4]).t.EkokLy);
obj2[3] = [" ", "*"];
required = tmp10(tmp2(tmp3[7]).Text, obj2);
2026-07-20 16:05:17 +00:00
}
items1[1] = required;
2026-07-29 08:29:29 +00:00
obj1[1] = closure_5(checked(onToggle[7]).Text, { variant: "text-md/medium", children: items1 });
const items2 = [closure_4(closure_3, obj1), ];
let tmp5Result = null != description;
if (tmp5Result) {
const obj3 = { variant: "text-sm/normal", color: "text-subtle", children: null };
obj3[2] = description;
tmp5Result = tmp5(tmp2(tmp3[7]).Text, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj4 = { direction: "horizontal", children: null };
items2[1] = tmp5Result;
obj[1] = items2;
items[1] = closure_5(closure_3, obj);
obj4[1] = items;
obj[4] = closure_5(checked(onToggle[5]).Stack, obj4);
return closure_4(closure_2, obj);
2026-07-20 16:05:17 +00:00
};