// Module ID: 9520 // Function ID: 9521 // Name: Checkbox // Dependencies: [17, 21, 4606, 4325, 1114, 5024, 5668, 4602, 2] // Exports: Checkbox // Module 9520 (Checkbox) import useA11yRolesNative from "useA11yRolesNative" /* 4325 */; import Text_Text from "Text/Text" /* 4602 */; import Stack_Stack from "Stack/Stack" /* 5024 */; import FormCheckbox from "FormCheckbox" /* 5668 */; import get_ActivityIndicator from "module_17" /* 17 */; import jsxProd from "jsxProd" /* 21 */; import createStyles from "createStyles" /* 4606 */; 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(4602).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(4602).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); };