UNPKG

braid-design-system

Version:
24 lines (23 loc) 1.04 kB
"use strict"; const jsxRuntime = require("react/jsx-runtime"); const react = require("react"); const lib_components_private_InlineField_InlineField_cjs = require("../private/InlineField/InlineField.cjs"); const lib_components_private_validateTabIndex_cjs = require("../private/validateTabIndex.cjs"); const lib_components_Checkbox_resolveCheckedGroup_cjs = require("./resolveCheckedGroup.cjs"); const Checkbox = react.forwardRef( ({ checked, tabIndex, ...restProps }, ref) => { const calculatedChecked = Array.isArray(checked) ? lib_components_Checkbox_resolveCheckedGroup_cjs.resolveCheckedGroup(checked) : checked; return /* @__PURE__ */ jsxRuntime.jsx( lib_components_private_InlineField_InlineField_cjs.InlineField, { ...restProps, tabIndex: lib_components_private_validateTabIndex_cjs.validTabIndexes.includes(tabIndex) ? tabIndex : void 0, checked: calculatedChecked, type: "checkbox", ref } ); } ); Checkbox.displayName = "Checkbox"; exports.Checkbox = Checkbox;