{"version":3,"file":"ListItemSwitch.mjs","sources":["../../../src/listItem/Switch/ListItemSwitch.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport SwitchComp, { type SwitchProps } from '../../switch';\nimport { useListItemControl } from '../useListItemControl';\nimport { ListItemContext } from '../ListItemContext';\n\nexport type ListItemSwitchProps = Omit<\n  SwitchProps,\n  'disabled' | 'id' | 'aria-labelledby' | 'aria-label'\n>;\n\n/**\n * This component allows for rendering a switch control within a fully interactive ListItem. <br />It's a thin wrapper around the\n * [CheckboxButton component](https://storybook.wise.design/?path=/docs/actions-switch--docs),\n * but offers only a subset of its features in line with the ListItem's constraints. <br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item---switch) for details.\n */\nexport const Switch = function (props: ListItemSwitchProps) {\n  const { baseItemProps } = useListItemControl('switch', { ...props });\n  const { ids, describedByIds } = useContext(ListItemContext);\n\n  return (\n    <SwitchComp\n      {...props}\n      aria-describedby={describedByIds}\n      className=\"wds-list-item-control\"\n      disabled={baseItemProps.disabled}\n      id={ids.control}\n    />\n  );\n};\n\nSwitch.displayName = 'ListItem.Switch';\n"],"names":["Switch","props","baseItemProps","useListItemControl","ids","describedByIds","useContext","ListItemContext","_jsx","SwitchComp","className","disabled","id","control","displayName"],"mappings":";;;;;;MAiBaA,MAAM,GAAG,UAAUC,KAA0B,EAAA;EACxD,MAAM;AAAEC,IAAAA;AAAa,GAAE,GAAGC,kBAAkB,CAAC,QAAQ,EAAE;IAAE,GAAGF;AAAK,GAAE,CAAC;EACpE,MAAM;IAAEG,GAAG;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;EAE3D,oBACEC,GAAA,CAACC,QAAU,EAAA;AAAA,IAAA,GACLR,KAAK;AACT,IAAA,kBAAA,EAAkBI,cAAe;AACjCK,IAAAA,SAAS,EAAC,uBAAuB;IACjCC,QAAQ,EAAET,aAAa,CAACS,QAAS;IACjCC,EAAE,EAAER,GAAG,CAACS;AAAQ,GAAA,CAChB;AAEN;AAEAb,MAAM,CAACc,WAAW,GAAG,iBAAiB;;;;"}