design-react-kit
Version:
Componenti React per Bootstrap 5
1 lines • 9.94 kB
Source Map (JSON)
{"version":3,"sources":["../../src/Hero/index.ts","../../src/Hero/Hero.tsx","../../src/Hero/HeroBackground.tsx","../../src/Hero/HeroBody.tsx","../../src/Hero/HeroButton.tsx","../../src/Button/Button.tsx","../../src/Hero/HeroCategory.tsx","../../src/Hero/HeroTitle.tsx"],"sourcesContent":["export { Hero } from './Hero';\nexport { HeroBackground } from './HeroBackground';\nexport { HeroBody } from './HeroBody';\nexport { HeroButton } from './HeroButton';\nexport { HeroCategory } from './HeroCategory';\nexport { HeroTitle } from './HeroTitle';\n\nexport type { HeroProps } from './Hero';\nexport type { HeroBackgroundProps } from './HeroBackground';\nexport type { HeroBodyProps } from './HeroBody';\nexport type { HeroButtonProps } from './HeroButton';\nexport type { HeroCategoryProps } from './HeroCategory';\nexport type { HeroTitleProps } from './HeroTitle';\n","import classname from 'classnames';\nimport React, { ElementType, FC, HTMLAttributes } from 'react';\n\nexport interface HeroProps extends HTMLAttributes<HTMLElement> {\n /** Utilizzarlo in caso di utilizzo di componenti personalizzati */\n tag?: ElementType;\n /** Indica se il componente Hero deve ridurre l'altezza */\n small?: boolean;\n /** Indica al componente Hero di centrare i contenuti testuali orizzontalmente */\n centered?: boolean;\n /** Da utilizzare per creare un testi in overlay su immagini, al fine di migliorare la leggibilità di testo */\n overlay?: 'dark' | 'primary' | 'filter';\n /** Aggiunge margine negativo in fondo al componente Hero per creare una sovrapposizione con il contenuto seguente. */\n overlap?: boolean;\n testId?: string;\n}\n\nexport const Hero: FC<HeroProps> = ({\n tag: Tag = 'section',\n small,\n centered,\n overlay,\n overlap,\n className,\n testId,\n ...attributes\n}) => {\n const classes = classname('it-hero-wrapper', className, {\n 'it-overlay': overlay,\n ['it-' + overlay]: overlay,\n 'it-hero-small-size': small,\n 'it-text-centered': centered,\n 'it-bottom-overlapping-content': overlap\n });\n return <Tag className={classes} {...attributes} data-testid={testId} />;\n};\n","import React, { FC, HTMLAttributes } from 'react';\n\nexport interface HeroBackgroundProps extends HTMLAttributes<HTMLImageElement> {\n /** Un testo alternativo per descrivere l'immagine mostrata */\n alt: string;\n /** L'URI dell'immagine da mostrare */\n src: string;\n /** Il titolo dell'immagine */\n title?: string;\n testId?: string;\n}\n\nexport const HeroBackground: FC<HeroBackgroundProps> = ({ alt, testId, ...attributes }) => {\n return (\n <div className='img-responsive-wrapper' data-testid={testId}>\n <div className='img-responsive'>\n <div className='img-wrapper'>\n <img {...attributes} alt={alt} />\n </div>\n </div>\n </div>\n );\n};\n","import React, { FC, HTMLAttributes } from 'react';\nimport classname from 'classnames';\nimport { Col, Container, Row } from 'reactstrap';\n\nexport interface HeroBodyProps extends HTMLAttributes<HTMLElement> {\n /** Eventuali classi aggiuntive */\n className?: string;\n testId?: string;\n}\n\nexport const HeroBody: FC<HeroBodyProps> = ({ children, className, testId }) => {\n const classes = classname('it-hero-text-wrapper', 'bg-dark', className);\n return (\n <Container>\n <Row>\n <Col>\n <div className={classes} data-testid={testId}>\n {children}\n </div>\n </Col>\n </Row>\n </Container>\n );\n};\n","import React, { FC } from 'react';\nimport classname from 'classnames';\nimport { Button, ButtonProps } from '../Button/Button';\n\nexport interface HeroButtonProps extends ButtonProps {\n wrapperClassName?: string;\n testId?: string;\n}\n\nexport const HeroButton: FC<HeroButtonProps> = ({ wrapperClassName, testId, ...attributes }) => {\n const classes = classname('it-btn-container', wrapperClassName);\n return (\n <div className={classes} data-testid={testId}>\n <Button size='sm' {...attributes} />\n </div>\n );\n};\n","import React, { FC, ButtonHTMLAttributes, ElementType, Ref } from 'react';\nimport classNames from 'classnames';\n\nimport { Button as ButtonBase } from 'reactstrap';\nimport { CSSModule } from 'reactstrap/types/lib/utils';\n\n// reactstrap wrapper\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Quando abilitato, estende il componente Button fino a prendere tutta la larghezza disponibile */\n block?: boolean;\n /** Utilizzarlo disabilitare il colore di sfondo, ed applicarlo invece al bordo. */\n outline?: boolean;\n /** Utilizzarlo in caso di componenti personalizzati */\n tag?: ElementType;\n /** Classi aggiuntive da usare per il componente Button */\n className?: string;\n /** Oggetto contenente la nuova mappatura per le classi CSS. */\n cssModule?: CSSModule;\n innerRef?: Ref<HTMLButtonElement>;\n /** Da utilizzare si usa una icona nel contenuto del Button */\n icon?: boolean;\n /** Da utilizzare per le varianti di dimensione del componente Button */\n size?: 'lg' | 'sm' | 'xs';\n /** Da utilizzare per i bottoni di chiusura all'interno di altri componenti (i.e. Chips, Modali, etc...) */\n close?: boolean;\n active?: boolean;\n href?: string;\n testId?: string;\n}\n\nexport const Button: FC<ButtonProps> = ({\n tag = 'button',\n icon = false,\n color = '',\n className,\n testId,\n ...attributes\n}) => {\n const classes = classNames(className, {\n 'btn-icon': icon\n });\n\n const ariaAttributes = {\n ...(attributes.disabled && { 'aria-disabled': true })\n };\n\n const baseProps = { color, tag };\n\n return <ButtonBase className={classes} data-testid={testId} {...baseProps} {...attributes} {...ariaAttributes} />;\n};\n","import React, { FC, HTMLAttributes } from 'react';\nimport classname from 'classnames';\n\nexport interface HeroCategoryProps extends HTMLAttributes<HTMLSpanElement> {\n /** Eventuali classi aggiuntive per la categoria */\n className?: string;\n testId?: string;\n}\n\nexport const HeroCategory: FC<HeroCategoryProps> = ({ className, testId, ...attributes }) => {\n const classes = classname('it-category', className);\n return <span {...attributes} className={classes} data-testid={testId} />;\n};\n","import React, { ElementType, FC, HTMLAttributes } from 'react';\nimport classname from 'classnames';\n\nexport interface HeroTitleProps extends HTMLAttributes<HTMLSpanElement> {\n /** Indica il tag da utilizzare per il titolo */\n tag?: ElementType;\n testId?: string;\n}\n\nexport const HeroTitle: FC<HeroTitleProps> = ({ tag: Tag = 'h1', className, testId, ...attributes }) => {\n const classes = classname(className);\n return <Tag {...attributes} className={classes} data-testid={testId} />;\n};\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,mBAAAC,EAAA,aAAAC,E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le","__toCommonJS","import_classnames","import_react","Hero","Tag","small","centered","overlay","overlap","className","testId","attributes","classes","classname","React","import_react","HeroBackground","alt","testId","attributes","React","import_react","import_classnames","import_reactstrap","HeroBody","children","className","testId","classes","classname","React","import_react","import_classnames","import_react","import_classnames","import_reactstrap","Button","tag","icon","color","className","testId","attributes","classes","classNames","ariaAttributes","React","ButtonBase","HeroButton","wrapperClassName","testId","attributes","classes","classname","React","Button","import_react","import_classnames","HeroCategory","className","testId","attributes","classes","classname","React","import_react","import_classnames","HeroTitle","Tag","className","testId","attributes","classes","classname","React"]}