decord/source/design/components/Checkbox/native/Checkbox.native.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

71 lines
2.9 KiB
TypeScript

// Module ID: 9499
// Function ID: 9500
// Name: Checkbox
// Dependencies: [17, 21, 4605, 4323, 1114, 5023, 5667, 4601, 2]
// Exports: Checkbox
// Module 9499 (Checkbox)
import useA11yRolesNative from "useA11yRolesNative" /* 4323 */;
import Text_Text from "Text/Text" /* 4601 */;
import Stack_Stack from "Stack/Stack" /* 5023 */;
import FormCheckbox from "FormCheckbox" /* 5667 */;
import get_ActivityIndicator from "module_17" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
import createStyles from "createStyles" /* 4605 */;
import size from "module_2" /* 2 */;
({ Pressable: c2, View: c3 } = get_ActivityIndicator);
({ jsx: closure_4, jsxs: hasOwnProperty } = jsxProd);
let closure_6 = createStyles.createStyles({ textContainer: { flex: 1 }, labelContainer: { minHeight: 24, justifyContent: "center" } });
const result = size.fileFinishedImporting("design/components/Checkbox/native/Checkbox.native.tsx");
export const Checkbox = function Checkbox(onToggle) {
({ label, description, required, checked } = onToggle);
onToggle = onToggle.onToggle;
const tmp = closure_6();
const checkboxA11yNative = useA11yRolesNative.useCheckboxA11yNative({ checked });
const obj2 = { accessibilityRole: checkboxA11yNative.accessibilityRole, accessibilityLabel: null, accessibilityState: null, onPress: null, children: null };
let str = "";
let str2 = "";
if (required) {
const intl = tmp2(1114).intl;
const _HermesInternal = HermesInternal;
str2 = " (" + intl.string(tmp2(1114).t.EkokLy) + ")";
}
const sum = label + str2;
if (null != description) {
const _HermesInternal2 = HermesInternal;
str = ", " + description;
}
obj2.accessibilityLabel = sum + str;
obj2.accessibilityState = checkboxA11yNative.accessibilityState;
obj2.onPress = function onPress() {
return onToggle(!checked);
};
const items = [React4(FormCheckbox.FormCheckbox, { checked }), ];
const obj3 = { style: tmp.textContainer, children: null };
const obj4 = { style: tmp.labelContainer, children: null };
const items1 = [label, ];
if (required) {
const obj5 = { variant: "text-md/bold", color: "text-feedback-critical", "aria-label": null, children: null };
const intl2 = tmp2(1114).intl;
obj5["aria-label"] = intl2.string(tmp2(1114).t.EkokLy);
obj5.children = [" ", "*"];
required = tmp10(tmp2(4601).Text, obj5);
}
items1[1] = required;
obj4.children = hasOwnProperty(Text_Text.Text, { variant: "text-md/medium", children: items1 });
const items2 = [React4(React3, obj4), ];
let tmp5Result = null != description;
if (tmp5Result) {
const obj6 = { variant: "text-sm/normal", color: "text-subtle", children: description };
tmp5Result = tmp5(tmp2(4601).Text, obj6);
}
const obj7 = { direction: "horizontal", children: null };
items2[1] = tmp5Result;
obj3.children = items2;
items[1] = hasOwnProperty(React3, obj3);
obj7.children = items;
obj2.children = hasOwnProperty(Stack_Stack.Stack, obj7);
return React4(React2, obj2);
};