design-react-kit
Version:
Componenti React per Bootstrap 5
1 lines • 1.7 kB
Source Map (JSON)
{"version":3,"sources":["../../src/Toggle/Toggle.tsx"],"sourcesContent":["import React, { ElementType, FC, ReactNode } from 'react';\n\nimport { Label, Input } from 'reactstrap';\nimport { CSSModule } from 'reactstrap/types/lib/utils';\nimport { InputProps } from '../Input/Input';\n\nexport interface ToggleProps extends InputProps {\n /** Label da mostrare per il componente */\n label: string | ReactNode;\n /** Dimensioni ammissibili per il componente */\n bsSize?: 'lg' | 'sm';\n /** Utilizzarlo in caso di utilizzo di componenti personalizzati */\n tag?: ElementType;\n /** Da utilizzare per impostare un riferimento all'elemento DOM */\n innerRef?: React.Ref<HTMLInputElement>;\n /** Oggetto contenente la nuova mappatura per le classi CSS. */\n cssModule?: CSSModule;\n testId?: string;\n}\n\nexport const Toggle: FC<ToggleProps> = ({ label, testId, ...rest }) => {\n return (\n <div className='toggles' data-testid={testId}>\n <Label check for={rest.id}>\n {label}\n <Input {...rest} type='checkbox' aria-describedby={rest.id ? rest.id + 'Description' : ''} />\n <span className='lever' />\n </Label>\n </div>\n );\n};\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkD,sBAElDC,EAA6B,sBAkBhBH,EAA0B,CAAC,CAAE,MAAAI,EAAO,OAAAC,EAAQ,GAAGC,CAAK,IAE7D,EAAAC,QAAA,cAAC,OAAI,UAAU,UAAU,cAAaF,GACpC,EAAAE,QAAA,cAAC,SAAM,MAAK,GAAC,IAAKD,EAAK,IACpBF,EACD,EAAAG,QAAA,cAAC,SAAO,GAAGD,EAAM,KAAK,WAAW,mBAAkBA,EAAK,GAAKA,EAAK,GAAK,cAAgB,GAAI,EAC3F,EAAAC,QAAA,cAAC,QAAK,UAAU,QAAQ,CAC1B,CACF","names":["Toggle_exports","__export","Toggle","__toCommonJS","import_react","import_reactstrap","label","testId","rest","React"]}