UNPKG

design-react-kit

Version:

Componenti React per Bootstrap 5

1 lines 2.01 kB
{"version":3,"sources":["../../src/Callout/Callout.tsx"],"sourcesContent":["import React, { FC, ElementType, HTMLAttributes } from 'react';\nimport classNames from 'classnames';\n\nexport interface CalloutProps extends HTMLAttributes<HTMLElement> {\n /** Classi aggiuntive per il componente */\n className?: string;\n /** Permette di dichiarare il colore del bordo e del titolo */\n color?: 'success' | 'warning' | 'danger' | 'note' | 'important' | string;\n /** Permette personalizzare il tag utilizzato per il Callout (diverso da \"div\"). Accetta sia tag HTML che componenti React. */\n tag?: ElementType;\n /** Abilita il Callout di tipo Highlight */\n highlight?: boolean;\n /** Abilita il Callout di tipo Approfondimento */\n detailed?: boolean;\n testId?: string;\n}\n\nexport const Callout: FC<CalloutProps> = ({\n children,\n color = '',\n highlight = false,\n className,\n detailed,\n tag = 'div',\n testId,\n ...attributes\n}) => {\n const Tag = tag;\n const classes = classNames(className, color, 'callout', {\n 'callout-highlight': highlight,\n 'callout-more': detailed\n });\n return (\n <Tag className={classes} {...attributes} data-testid={testId}>\n {!highlight && !detailed ? <div className='callout-inner'>{children}</div> : children}\n </Tag>\n );\n};\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuD,sBACvDC,EAAuB,2BAgBVH,EAA4B,CAAC,CACxC,SAAAI,EACA,MAAAC,EAAQ,GACR,UAAAC,EAAY,GACZ,UAAAC,EACA,SAAAC,EACA,IAAAC,EAAM,MACN,OAAAC,EACA,GAAGC,CACL,IAAM,CACJ,IAAMC,EAAMH,EACNI,KAAU,EAAAC,SAAWP,EAAWF,EAAO,UAAW,CACtD,oBAAqBC,EACrB,eAAgBE,CAClB,CAAC,EACD,OACE,EAAAO,QAAA,cAACH,EAAA,CAAI,UAAWC,EAAU,GAAGF,EAAY,cAAaD,GACnD,CAACJ,GAAa,CAACE,EAAW,EAAAO,QAAA,cAAC,OAAI,UAAU,iBAAiBX,CAAS,EAASA,CAC/E,CAEJ","names":["Callout_exports","__export","Callout","__toCommonJS","import_react","import_classnames","children","color","highlight","className","detailed","tag","testId","attributes","Tag","classes","classNames","React"]}