design-react-kit 3.3.1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.EN.md +35 -17
- package/README.md +34 -18
- package/package.json +152 -120
- package/src/Accordion/Accordion.tsx +30 -0
- package/src/Accordion/AccordionBody.tsx +127 -0
- package/src/Accordion/AccordionHeader.tsx +42 -0
- package/src/Alert/Alert.tsx +39 -0
- package/src/Avatar/AvatarContainer.tsx +22 -0
- package/src/Avatar/AvatarExtraText.tsx +19 -0
- package/src/Avatar/AvatarGroupContainer.tsx +23 -0
- package/src/Avatar/AvatarIcon.tsx +57 -0
- package/src/Avatar/AvatarPresence.tsx +24 -0
- package/src/Avatar/AvatarStatus.tsx +24 -0
- package/src/Avatar/AvatarWrapper.tsx +24 -0
- package/src/Badge/Badge.tsx +40 -0
- package/src/BottomNav/BottomNav.tsx +20 -0
- package/src/BottomNav/BottomNavItem.tsx +75 -0
- package/src/Breadcrumb/Breadcrumb.tsx +40 -0
- package/src/Button/Button.tsx +55 -0
- package/src/Callout/Callout.tsx +35 -0
- package/src/Callout/CalloutText.tsx +29 -0
- package/src/Callout/CalloutTitle.tsx +24 -0
- package/src/Card/Card.tsx +49 -0
- package/src/Card/CardBody.tsx +21 -0
- package/src/Card/CardCategory.tsx +48 -0
- package/src/Card/CardFooterCTA.tsx +19 -0
- package/src/Card/CardReadMore.tsx +35 -0
- package/src/Card/CardSignature.tsx +19 -0
- package/src/Card/CardTag.tsx +19 -0
- package/src/Card/CardTagsHeader.tsx +28 -0
- package/src/Card/CardText.tsx +19 -0
- package/src/Card/CardTitle.tsx +17 -0
- package/src/Chips/Chip.tsx +37 -0
- package/src/Chips/ChipLabel.tsx +19 -0
- package/src/Collapse/Collapse.tsx +100 -0
- package/src/CookieBar/CookieBar.tsx +19 -0
- package/src/CookieBar/CookieBarButton.tsx +27 -0
- package/src/CookieBar/CookieBarButtons.tsx +19 -0
- package/src/Dimmer/Dimmer.tsx +51 -0
- package/src/Dimmer/DimmerButtons.tsx +35 -0
- package/src/FontLoader/FontLoader.tsx +32 -0
- package/src/Forward/Forward.tsx +40 -0
- package/src/Grid/GridItem.tsx +23 -0
- package/src/Grid/GridItemText.tsx +20 -0
- package/src/Grid/GridItemTextWrapper.tsx +21 -0
- package/src/Grid/GridList.tsx +20 -0
- package/src/Grid/GridRow.tsx +20 -0
- package/src/Grid/index.ts +11 -0
- package/src/{components/Header/Header.js → Header/Header.tsx} +19 -24
- package/src/Header/HeaderBrand.tsx +90 -0
- package/src/Header/HeaderContent.tsx +42 -0
- package/src/Header/HeaderContext.tsx +9 -0
- package/src/Header/HeaderLinkZone.tsx +19 -0
- package/src/Header/HeaderRightZone.tsx +26 -0
- package/src/Header/HeaderSearch.tsx +33 -0
- package/src/Header/HeaderSocialsZone.tsx +26 -0
- package/src/Header/HeaderToggler.tsx +46 -0
- package/src/{components/Header/Headers.js → Header/Headers.tsx} +17 -22
- package/src/Hero/Hero.tsx +34 -0
- package/src/Hero/HeroBackground.tsx +25 -0
- package/src/Hero/HeroBody.tsx +21 -0
- package/src/Hero/HeroButton.tsx +19 -0
- package/src/Hero/HeroCategory.tsx +15 -0
- package/src/Hero/HeroTitle.tsx +16 -0
- package/src/Hero/index.ts +13 -0
- package/src/Icon/EmptyIcon.tsx +7 -0
- package/src/Icon/Icon.tsx +116 -0
- package/src/Icon/assets/ItArrowDown.tsx +9 -0
- package/src/Icon/assets/ItArrowDownCircle.tsx +9 -0
- package/src/Icon/assets/ItArrowDownTriangle.tsx +9 -0
- package/src/Icon/assets/ItArrowLeft.tsx +9 -0
- package/src/Icon/assets/ItArrowLeftCircle.tsx +9 -0
- package/src/Icon/assets/ItArrowLeftTriangle.tsx +9 -0
- package/src/Icon/assets/ItArrowRight.tsx +9 -0
- package/src/Icon/assets/ItArrowRightCircle.tsx +9 -0
- package/src/Icon/assets/ItArrowRightTriangle.tsx +9 -0
- package/src/Icon/assets/ItArrowUp.tsx +9 -0
- package/src/Icon/assets/ItArrowUpCircle.tsx +9 -0
- package/src/Icon/assets/ItArrowUpTriangle.tsx +9 -0
- package/src/Icon/assets/ItBan.tsx +9 -0
- package/src/Icon/assets/ItBehance.tsx +9 -0
- package/src/Icon/assets/ItBookmark.tsx +9 -0
- package/src/Icon/assets/ItBox.tsx +12 -0
- package/src/Icon/assets/ItBurger.tsx +9 -0
- package/src/Icon/assets/ItCalendar.tsx +9 -0
- package/src/Icon/assets/ItCamera.tsx +9 -0
- package/src/Icon/assets/ItCard.tsx +9 -0
- package/src/Icon/assets/ItChartLine.tsx +12 -0
- package/src/Icon/assets/ItCheck.tsx +9 -0
- package/src/Icon/assets/ItCheckCircle.tsx +9 -0
- package/src/Icon/assets/ItChevronLeft.tsx +8 -0
- package/src/Icon/assets/ItChevronRight.tsx +8 -0
- package/src/Icon/assets/ItClip.tsx +9 -0
- package/src/Icon/assets/ItClock.tsx +9 -0
- package/src/Icon/assets/ItClose.tsx +9 -0
- package/src/Icon/assets/ItCloseBig.tsx +9 -0
- package/src/Icon/assets/ItCloseCircle.tsx +9 -0
- package/src/Icon/assets/ItCodeCircle.tsx +9 -0
- package/src/Icon/assets/ItCollapse.tsx +8 -0
- package/src/Icon/assets/ItComment.tsx +9 -0
- package/src/Icon/assets/ItCopy.tsx +9 -0
- package/src/Icon/assets/ItDelete.tsx +12 -0
- package/src/Icon/assets/ItDesignersItalia.tsx +9 -0
- package/src/Icon/assets/ItDownload.tsx +9 -0
- package/src/Icon/assets/ItError.tsx +9 -0
- package/src/Icon/assets/ItExchangeCircle.tsx +9 -0
- package/src/Icon/assets/ItExpand.tsx +8 -0
- package/src/Icon/assets/ItExternalLink.tsx +9 -0
- package/src/Icon/assets/ItFacebook.tsx +9 -0
- package/src/Icon/assets/ItFacebookSquare.tsx +9 -0
- package/src/Icon/assets/ItFile.tsx +9 -0
- package/src/Icon/assets/ItFiles.tsx +9 -0
- package/src/Icon/assets/ItFlag.tsx +9 -0
- package/src/Icon/assets/ItFlickr.tsx +10 -0
- package/src/Icon/assets/ItFlickrSquare.tsx +9 -0
- package/src/Icon/assets/ItFolder.tsx +9 -0
- package/src/Icon/assets/ItFullscreen.tsx +11 -0
- package/src/Icon/assets/ItFunnel.tsx +9 -0
- package/src/Icon/assets/ItGithub.tsx +9 -0
- package/src/Icon/assets/ItHearing.tsx +9 -0
- package/src/Icon/assets/ItHelp.tsx +9 -0
- package/src/Icon/assets/ItHelpCircle.tsx +9 -0
- package/src/Icon/assets/ItHorn.tsx +9 -0
- package/src/Icon/assets/ItInbox.tsx +12 -0
- package/src/Icon/assets/ItInfoCircle.tsx +9 -0
- package/src/Icon/assets/ItInstagram.tsx +9 -0
- package/src/Icon/assets/ItKey.tsx +9 -0
- package/src/Icon/assets/ItLessCircle.tsx +12 -0
- package/src/Icon/assets/ItLink.tsx +9 -0
- package/src/Icon/assets/ItLinkedin.tsx +9 -0
- package/src/Icon/assets/ItLinkedinSquare.tsx +9 -0
- package/src/Icon/assets/ItList.tsx +9 -0
- package/src/Icon/assets/ItLock.tsx +12 -0
- package/src/Icon/assets/ItLocked.tsx +9 -0
- package/src/Icon/assets/ItMail.tsx +9 -0
- package/src/Icon/assets/ItMapMarker.tsx +9 -0
- package/src/Icon/assets/ItMapMarkerCircle.tsx +12 -0
- package/src/Icon/assets/ItMapMarkerMinus.tsx +9 -0
- package/src/Icon/assets/ItMapMarkerPlus.tsx +12 -0
- package/src/Icon/assets/ItMaximize.tsx +11 -0
- package/src/Icon/assets/ItMaximizeAlt.tsx +11 -0
- package/src/Icon/assets/ItMedium.tsx +9 -0
- package/src/Icon/assets/ItMediumSquare.tsx +9 -0
- package/src/Icon/assets/ItMinimize.tsx +11 -0
- package/src/Icon/assets/ItMinus.tsx +9 -0
- package/src/Icon/assets/ItMinusCircle.tsx +9 -0
- package/src/Icon/assets/ItMoreActions.tsx +9 -0
- package/src/Icon/assets/ItMoreItems.tsx +9 -0
- package/src/Icon/assets/ItNote.tsx +9 -0
- package/src/Icon/assets/ItOpenSource.tsx +9 -0
- package/src/Icon/assets/ItPa.tsx +9 -0
- package/src/Icon/assets/ItPasswordInvisible.tsx +9 -0
- package/src/Icon/assets/ItPasswordVisible.tsx +9 -0
- package/src/Icon/assets/ItPencil.tsx +9 -0
- package/src/Icon/assets/ItPiattaforme.tsx +10 -0
- package/src/Icon/assets/ItPin.tsx +9 -0
- package/src/Icon/assets/ItPlug.tsx +9 -0
- package/src/Icon/assets/ItPlus.tsx +9 -0
- package/src/Icon/assets/ItPlusCircle.tsx +9 -0
- package/src/Icon/assets/ItPresentation.tsx +9 -0
- package/src/Icon/assets/ItPrint.tsx +9 -0
- package/src/Icon/assets/ItRefresh.tsx +9 -0
- package/src/Icon/assets/ItRestore.tsx +9 -0
- package/src/Icon/assets/ItRss.tsx +11 -0
- package/src/Icon/assets/ItRssSquare.tsx +9 -0
- package/src/Icon/assets/ItSearch.tsx +9 -0
- package/src/Icon/assets/ItSettings.tsx +9 -0
- package/src/Icon/assets/ItShare.tsx +9 -0
- package/src/Icon/assets/ItSoftware.tsx +10 -0
- package/src/Icon/assets/ItStarFull.tsx +9 -0
- package/src/Icon/assets/ItStarOutline.tsx +9 -0
- package/src/Icon/assets/ItTeamDigitale.tsx +8 -0
- package/src/Icon/assets/ItTelegram.tsx +11 -0
- package/src/Icon/assets/ItTelephone.tsx +9 -0
- package/src/Icon/assets/ItTool.tsx +9 -0
- package/src/Icon/assets/ItTwitter.tsx +9 -0
- package/src/Icon/assets/ItTwitterSquare.tsx +9 -0
- package/src/Icon/assets/ItUnlocked.tsx +9 -0
- package/src/Icon/assets/ItUpload.tsx +9 -0
- package/src/Icon/assets/ItUser.tsx +9 -0
- package/src/Icon/assets/ItVideo.tsx +9 -0
- package/src/Icon/assets/ItWarning.tsx +9 -0
- package/src/Icon/assets/ItWarningCircle.tsx +9 -0
- package/src/Icon/assets/ItWhatsapp.tsx +9 -0
- package/src/Icon/assets/ItWhatsappSquare.tsx +10 -0
- package/src/Icon/assets/ItWifi.tsx +12 -0
- package/src/Icon/assets/ItYoutube.tsx +9 -0
- package/src/Icon/assets/ItZoomIn.tsx +9 -0
- package/src/Icon/assets/ItZoomOut.tsx +9 -0
- package/src/Icon/assets/index.tsx +504 -0
- package/src/Input/Input.tsx +342 -0
- package/src/Input/InputContainer.tsx +34 -0
- package/src/Input/TextArea.tsx +184 -0
- package/src/Input/TimeInput.tsx +303 -0
- package/src/Input/utils.tsx +166 -0
- package/src/LinkList/LinkList.tsx +65 -0
- package/src/LinkList/LinkListItem.tsx +98 -0
- package/src/Megamenu/Megamenu.tsx +37 -0
- package/src/Megamenu/MegamenuFooter.tsx +20 -0
- package/src/Megamenu/MegamenuHighlightColumn.tsx +33 -0
- package/src/Megamenu/MegamenuItem.tsx +27 -0
- package/src/Modal/Modal.tsx +79 -0
- package/src/Modal/ModalBody.tsx +11 -0
- package/src/Modal/ModalFooter.tsx +11 -0
- package/src/Modal/ModalHeader.tsx +70 -0
- package/src/Nav/Nav.tsx +56 -0
- package/src/Notification/Notification.tsx +60 -0
- package/src/Notification/NotificationContent.tsx +135 -0
- package/src/Notification/NotificationManager.tsx +65 -0
- package/src/Notification/core.tsx +46 -0
- package/src/Notification/index.ts +9 -0
- package/src/Notification/types.ts +12 -0
- package/src/Notification/usePosition.tsx +11 -0
- package/src/Pager/Pager.tsx +48 -0
- package/src/PasswordInput/PasswordInput.tsx +43 -0
- package/src/Progress/Progress.tsx +94 -0
- package/src/Rating/Rating.tsx +130 -0
- package/src/ResponsiveImage/ResponsiveImage.tsx +25 -0
- package/src/Section/Section.tsx +86 -0
- package/src/Select/Select.tsx +97 -0
- package/src/Select/shared.tsx +45 -0
- package/src/Sidebar/Sidebar.tsx +46 -0
- package/src/Skiplink/Skiplink.tsx +20 -0
- package/src/Skiplink/SkiplinkItem.tsx +29 -0
- package/src/Spinner/Spinner.tsx +55 -0
- package/src/Stepper/StepperContainer.tsx +30 -0
- package/src/Stepper/StepperContent.tsx +51 -0
- package/src/Stepper/StepperDots.tsx +21 -0
- package/src/Stepper/StepperHeader.tsx +19 -0
- package/src/Stepper/StepperHeaderElement.tsx +77 -0
- package/src/Stepper/StepperNav.tsx +19 -0
- package/src/ThumbNav/ThumbNav.tsx +37 -0
- package/src/ThumbNav/ThumbNavItem.tsx +35 -0
- package/src/Timeline/TimelinePin.tsx +67 -0
- package/src/Timeline/TimelineWrapper.tsx +19 -0
- package/src/Toggle/Toggle.tsx +29 -0
- package/src/Toolbar/Toolbar.tsx +28 -0
- package/src/Toolbar/ToolbarDividerItem.tsx +5 -0
- package/src/Toolbar/ToolbarItem.tsx +95 -0
- package/src/assets.d.ts +4 -0
- package/src/index.tsx +350 -0
- package/src/utils.tsx +26 -0
- package/.editorconfig +0 -18
- package/.eslintrc +0 -65
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -24
- package/AUTHORS +0 -3
- package/CODE_OF_CONDUCT.EN.md +0 -77
- package/CODE_OF_CONDUCT.md +0 -69
- package/dist/design-react-kit.cjs.js +0 -3698
- package/dist/design-react-kit.cjs.js.map +0 -1
- package/dist/design-react-kit.d.ts +0 -1704
- package/dist/design-react-kit.es.js +0 -3188
- package/dist/design-react-kit.es.js.map +0 -1
- package/dist/design-react-kit.full.js +0 -17596
- package/dist/design-react-kit.full.js.map +0 -1
- package/dist/design-react-kit.full.min.js +0 -2
- package/dist/design-react-kit.full.min.js.map +0 -1
- package/dist/design-react-kit.js +0 -13394
- package/dist/design-react-kit.js.map +0 -1
- package/dist/design-react-kit.min.js +0 -2
- package/dist/design-react-kit.min.js.map +0 -1
- package/src/Storyshots.test.js +0 -9
- package/src/components/Accordion/Accordion.js +0 -22
- package/src/components/Accordion/AccordionBody.js +0 -118
- package/src/components/Accordion/AccordionHeader.js +0 -37
- package/src/components/Autocomplete/Autocomplete.js +0 -255
- package/src/components/Avatar/AvatarContainer.js +0 -24
- package/src/components/Avatar/AvatarExtraText.js +0 -22
- package/src/components/Avatar/AvatarGroupContainer.js +0 -23
- package/src/components/Avatar/AvatarIcon.js +0 -32
- package/src/components/Avatar/AvatarPresence.js +0 -25
- package/src/components/Avatar/AvatarStatus.js +0 -25
- package/src/components/Avatar/AvatarWrapper.js +0 -25
- package/src/components/Badge/Badge.js +0 -28
- package/src/components/BottomNav/BottomNav.js +0 -27
- package/src/components/BottomNav/BottomNavItem.js +0 -69
- package/src/components/Button/Button.js +0 -26
- package/src/components/Callout/Callout.js +0 -33
- package/src/components/Callout/CalloutText.js +0 -37
- package/src/components/Callout/CalloutTitle.js +0 -27
- package/src/components/Card/Card.js +0 -50
- package/src/components/Card/CardCategory.js +0 -43
- package/src/components/Card/CardFooterCTA.js +0 -17
- package/src/components/Card/CardReadMore.js +0 -45
- package/src/components/Card/CardSignature.js +0 -17
- package/src/components/Card/CardTag.js +0 -23
- package/src/components/Card/CardTagsHeader.js +0 -21
- package/src/components/Chips/Chip.js +0 -50
- package/src/components/Chips/ChipLabel.js +0 -25
- package/src/components/Collapse/Collapse.js +0 -66
- package/src/components/CookieBar/CookieBar.js +0 -22
- package/src/components/CookieBar/CookieBarButton.js +0 -25
- package/src/components/CookieBar/CookieBarButtons.js +0 -23
- package/src/components/Dimmer/Dimmer.js +0 -38
- package/src/components/Dimmer/DimmerButtons.js +0 -35
- package/src/components/FontLoader/FontLoader.js +0 -22
- package/src/components/FormGroup/FormGroup.js +0 -137
- package/src/components/Forward/Forward.js +0 -32
- package/src/components/Header/HeaderBrand.js +0 -86
- package/src/components/Header/HeaderContent.js +0 -49
- package/src/components/Header/HeaderContext.js +0 -14
- package/src/components/Header/HeaderLinkZone.js +0 -24
- package/src/components/Header/HeaderRightZone.js +0 -33
- package/src/components/Header/HeaderSearch.js +0 -36
- package/src/components/Header/HeaderSocialsZone.js +0 -30
- package/src/components/Header/HeaderToggler.js +0 -50
- package/src/components/Hero/Hero.js +0 -10
- package/src/components/Icon/Icon.js +0 -42
- package/src/components/Input/Input.js +0 -261
- package/src/components/Input/InputContainer.js +0 -39
- package/src/components/Input/utils.js +0 -126
- package/src/components/LinkList/LinkList.js +0 -65
- package/src/components/LinkList/LinkListItem.js +0 -88
- package/src/components/Nav/Nav.js +0 -37
- package/src/components/Notification/Notification.js +0 -78
- package/src/components/Offcanvas/Offcanvas.js +0 -101
- package/src/components/Pager/Pager.js +0 -32
- package/src/components/PagerList/PagerList.js +0 -28
- package/src/components/PasswordInput/PasswordInput.js +0 -41
- package/src/components/PasswordMeter/PasswordMeter.js +0 -80
- package/src/components/Progress/Progress.js +0 -88
- package/src/components/Rating/Rating.js +0 -130
- package/src/components/Section/Section.js +0 -49
- package/src/components/Separator/Separator.js +0 -34
- package/src/components/Sidebar/Sidebar.js +0 -53
- package/src/components/Skiplink/Skiplink.js +0 -25
- package/src/components/Skiplink/SkiplinkItem.js +0 -25
- package/src/components/Spinner/Spinner.js +0 -65
- package/src/components/Stepper/StepperContainer.js +0 -33
- package/src/components/Stepper/StepperContent.js +0 -54
- package/src/components/Stepper/StepperDots.js +0 -27
- package/src/components/Stepper/StepperHeader.js +0 -27
- package/src/components/Stepper/StepperHeaderElement.js +0 -45
- package/src/components/Stepper/StepperNav.js +0 -27
- package/src/components/Table/Table.js +0 -68
- package/src/components/Timeline/TimelinePin.js +0 -59
- package/src/components/Timeline/TimelineWrapper.js +0 -21
- package/src/components/Toggle/Toggle.js +0 -27
- package/src/components/utils.js +0 -1
- package/src/index.js +0 -144
- package/static/favicons/android-chrome-192x192.png +0 -0
- package/static/favicons/android-chrome-512x512.png +0 -0
- package/static/favicons/apple-touch-icon.png +0 -0
- package/static/favicons/browserconfig.xml +0 -9
- package/static/favicons/favicon-16x16.png +0 -0
- package/static/favicons/favicon-32x32.png +0 -0
- package/static/favicons/favicon.ico +0 -0
- package/static/favicons/manifest.webmanifest +0 -21
- package/static/favicons/mstile-150x150.png +0 -0
- package/static/favicons/safari-pinned-tab.svg +0 -23
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
FC,
|
|
3
|
+
HTMLAttributes,
|
|
4
|
+
MouseEventHandler,
|
|
5
|
+
ElementType,
|
|
6
|
+
Ref
|
|
7
|
+
} from 'react';
|
|
8
|
+
import { Alert as InnerAlert, FadeProps, CSSModule } from 'reactstrap';
|
|
9
|
+
|
|
10
|
+
// Copy over from reactstrap and add new ones
|
|
11
|
+
export interface AlertProps extends HTMLAttributes<HTMLElement> {
|
|
12
|
+
closeClassName?: string;
|
|
13
|
+
closeAriaLabel?: string;
|
|
14
|
+
/** Oggetto contenente la nuova mappatura per le classi CSS. */
|
|
15
|
+
cssModule?: CSSModule;
|
|
16
|
+
/** Le varianti di colore definite in Bootstrap Italia */
|
|
17
|
+
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | string;
|
|
18
|
+
/** Quando abilitato mostra un'animazione di entrata ed uscita del componente Alert. Valore di default: true. */
|
|
19
|
+
fade?: boolean;
|
|
20
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
21
|
+
tag?: ElementType;
|
|
22
|
+
transition?: FadeProps;
|
|
23
|
+
/** Da utilizzare per impostare un riferimento all'elemento DOM */
|
|
24
|
+
innerRef?: Ref<HTMLElement>;
|
|
25
|
+
isOpen?: boolean;
|
|
26
|
+
toggle?: MouseEventHandler<any>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const defaultProps = {
|
|
30
|
+
color: 'success',
|
|
31
|
+
isOpen: true,
|
|
32
|
+
fade: true
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Alert: FC<AlertProps> = (props) => {
|
|
36
|
+
return <InnerAlert {...props} />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
Alert.defaultProps = defaultProps;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarContainerProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
6
|
+
tag?: ElementType;
|
|
7
|
+
/** Classi aggiuntive da usare per il componente AvatarContainer */
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const AvatarContainer: FC<AvatarContainerProps> = ({
|
|
12
|
+
className,
|
|
13
|
+
tag = 'div',
|
|
14
|
+
...attributes
|
|
15
|
+
}) => {
|
|
16
|
+
const Tag = tag;
|
|
17
|
+
const wrapperClasses = classNames(
|
|
18
|
+
'd-flex align-items-center justify-content-around flex-wrap flex-sm-nowrap',
|
|
19
|
+
className
|
|
20
|
+
);
|
|
21
|
+
return <Tag {...attributes} className={wrapperClasses} />;
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarExtraTextProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
6
|
+
tag?: ElementType;
|
|
7
|
+
/** Classi aggiuntive da usare per il componente AvatarExtraText */
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const AvatarExtraText: FC<AvatarExtraTextProps> = ({
|
|
12
|
+
className,
|
|
13
|
+
tag = 'div',
|
|
14
|
+
...attributes
|
|
15
|
+
}) => {
|
|
16
|
+
const Tag = tag;
|
|
17
|
+
const wrapperClass = classNames('extra-text', className);
|
|
18
|
+
return <Tag className={wrapperClass} {...attributes} />;
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarGroupContainerProps
|
|
5
|
+
extends HTMLAttributes<HTMLUListElement> {
|
|
6
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
7
|
+
tag?: ElementType;
|
|
8
|
+
/** Classi aggiuntive da usare per il componente interno AvatarGroupContainer */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Classi aggiuntive da usare per il componente più esterno di AvatarGroupContainer */
|
|
11
|
+
wrapperClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const AvatarGroupContainer: FC<AvatarGroupContainerProps> = ({
|
|
15
|
+
className,
|
|
16
|
+
tag = 'ul',
|
|
17
|
+
wrapperClassName,
|
|
18
|
+
...attributes
|
|
19
|
+
}) => {
|
|
20
|
+
const Tag = tag;
|
|
21
|
+
const wrapperClasses = classNames('avatar-group-stacked', wrapperClassName);
|
|
22
|
+
return <Tag {...attributes} className={wrapperClasses}></Tag>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarIconProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Utilizzarlo in caso di utilizzo di componenti personalizzati, come ad esempio
|
|
7
|
+
* un link gestito da handler onClick.
|
|
8
|
+
* */
|
|
9
|
+
tag?: ElementType;
|
|
10
|
+
/** Classi aggiuntive da usare per il componente AvatarIcon */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Le varianti di colore definite in Bootstrap Italia */
|
|
13
|
+
color?: 'primary' | 'secondary' | 'green' | 'orange' | 'red' | string;
|
|
14
|
+
/** Le dimensioni dell'icona definite in Bootstrap Italia */
|
|
15
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
16
|
+
/**
|
|
17
|
+
* Quando definito rende l'icona un link cliccabile. Nota: se definito ignora la prop Tag.
|
|
18
|
+
* */
|
|
19
|
+
href?: string;
|
|
20
|
+
/** Da utilizzare per impostare un riferimento all'elemento DOM */
|
|
21
|
+
innerRef?: Ref<HTMLElement | HTMLAnchorElement>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const AvatarIcon: FC<AvatarIconProps> = ({
|
|
25
|
+
className,
|
|
26
|
+
tag = 'div',
|
|
27
|
+
size = 'md',
|
|
28
|
+
href,
|
|
29
|
+
color,
|
|
30
|
+
innerRef,
|
|
31
|
+
children,
|
|
32
|
+
...attributes
|
|
33
|
+
}) => {
|
|
34
|
+
const Tag = tag;
|
|
35
|
+
const typeClass = classNames('avatar', {
|
|
36
|
+
[`size-${size}`]: size,
|
|
37
|
+
[`avatar-${color}`]: color
|
|
38
|
+
});
|
|
39
|
+
if (href) {
|
|
40
|
+
return (
|
|
41
|
+
<a
|
|
42
|
+
href={href}
|
|
43
|
+
{...attributes}
|
|
44
|
+
className={typeClass}
|
|
45
|
+
ref={innerRef as Ref<HTMLAnchorElement>}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</a>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Tag {...attributes} className={typeClass}>
|
|
54
|
+
{children}
|
|
55
|
+
</Tag>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarPresenceProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
6
|
+
tag?: ElementType;
|
|
7
|
+
/** Classi aggiuntive da usare per il componente AvatarPresence */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Utilizzare questo attributo per indicare il tipo di presenza dell'utente. */
|
|
10
|
+
presence: 'active' | 'busy' | 'hidden' | string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const AvatarPresence: FC<AvatarPresenceProps> = ({
|
|
14
|
+
className,
|
|
15
|
+
tag = 'div',
|
|
16
|
+
presence,
|
|
17
|
+
...attributes
|
|
18
|
+
}) => {
|
|
19
|
+
const Tag = tag;
|
|
20
|
+
const typeClass = classNames('avatar-presence', {
|
|
21
|
+
presence
|
|
22
|
+
});
|
|
23
|
+
return <Tag {...attributes} className={typeClass} />;
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarStatusProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
6
|
+
tag?: ElementType;
|
|
7
|
+
/** Classi aggiuntive da usare per il componente AvatarStatus */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Utilizzare questo attributo per indicare il tipo di stato dell'utente. */
|
|
10
|
+
status: 'approved' | 'declined' | 'notify' | string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const AvatarStatus: FC<AvatarStatusProps> = ({
|
|
14
|
+
className,
|
|
15
|
+
tag = 'div',
|
|
16
|
+
status,
|
|
17
|
+
...attributes
|
|
18
|
+
}) => {
|
|
19
|
+
const Tag = tag;
|
|
20
|
+
const typeClass = classNames('avatar-status', {
|
|
21
|
+
status
|
|
22
|
+
});
|
|
23
|
+
return <Tag {...attributes} className={typeClass} />;
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface AvatarWrapperProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
6
|
+
tag?: ElementType;
|
|
7
|
+
/** Classi aggiuntive da usare per il componente AvatarStatus */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Utilizzare questo attributo qualora si volesse utilizzare un componente AvatarExtraText all'interno dell'Avatar. */
|
|
10
|
+
extra?: 'text' | string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const AvatarWrapper: FC<AvatarWrapperProps> = ({
|
|
14
|
+
className,
|
|
15
|
+
tag = 'div',
|
|
16
|
+
extra,
|
|
17
|
+
...attributes
|
|
18
|
+
}) => {
|
|
19
|
+
const Tag = tag;
|
|
20
|
+
const wrapperClass = classNames('avatar-wrapper', className, {
|
|
21
|
+
[`avatar-extra-${extra}`]: extra
|
|
22
|
+
});
|
|
23
|
+
return <Tag {...attributes} className={wrapperClass} />;
|
|
24
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
FC,
|
|
3
|
+
HTMLAttributes,
|
|
4
|
+
ElementType,
|
|
5
|
+
Ref,
|
|
6
|
+
ReactChild,
|
|
7
|
+
AnchorHTMLAttributes
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { Badge as BadgeReact, CSSModule } from 'reactstrap';
|
|
10
|
+
|
|
11
|
+
export type BadgeProps = {
|
|
12
|
+
/** Le varianti di colore definite in Bootstrap Italia */
|
|
13
|
+
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | string;
|
|
14
|
+
/** Quando attivo rende i Badge arrotondati */
|
|
15
|
+
pill?: boolean;
|
|
16
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
17
|
+
tag?: ElementType;
|
|
18
|
+
/** Classi aggiuntive da usare per il componente Badge */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Oggetto contenente la nuova mappatura per le classi CSS. */
|
|
21
|
+
cssModule?: CSSModule;
|
|
22
|
+
/** Da utilizzare per impostare un riferimento all'elemento DOM */
|
|
23
|
+
innerRef?: Ref<HTMLElement>;
|
|
24
|
+
/** Il contenuto del badge */
|
|
25
|
+
children: ReactChild;
|
|
26
|
+
} & (HTMLAttributes<HTMLElement> | AnchorHTMLAttributes<HTMLAnchorElement>);
|
|
27
|
+
|
|
28
|
+
export const Badge: FC<BadgeProps> = ({
|
|
29
|
+
color = 'secondary',
|
|
30
|
+
pill = false,
|
|
31
|
+
tag = 'span',
|
|
32
|
+
children,
|
|
33
|
+
...attributes
|
|
34
|
+
}) => {
|
|
35
|
+
return (
|
|
36
|
+
<BadgeReact color={color} pill={pill} tag={tag} {...attributes}>
|
|
37
|
+
{children}
|
|
38
|
+
</BadgeReact>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ElementType, FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface BottomNavProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
5
|
+
tag?: ElementType;
|
|
6
|
+
/** Classi aggiuntive da usare per il componente BottomNav */
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const BottomNav: FC<BottomNavProps> = ({
|
|
11
|
+
tag = 'nav',
|
|
12
|
+
...attributes
|
|
13
|
+
}) => {
|
|
14
|
+
const Tag = tag;
|
|
15
|
+
return (
|
|
16
|
+
<Tag className='bottom-nav'>
|
|
17
|
+
<ul {...attributes} />
|
|
18
|
+
</Tag>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { ElementType, FC, HTMLAttributes, MouseEvent } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Icon } from '../Icon/Icon';
|
|
4
|
+
|
|
5
|
+
export interface BottomNavItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
6
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
7
|
+
tag?: ElementType;
|
|
8
|
+
/** Classi aggiuntive da usare per il componente BottomNavItem */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Quando abilitato mostra l'elemento come attivo */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** Indica l'URL a cui puntare (utilizzare o questo o onClick) */
|
|
13
|
+
url?: string;
|
|
14
|
+
/** Etichetta da associare all'elemento */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Testo esplicativo per dispositivi screen reader. */
|
|
17
|
+
srText?: string;
|
|
18
|
+
/** Icona da utilizzare per l'elemento */
|
|
19
|
+
iconName?: string;
|
|
20
|
+
/** Quando abilitato indica una sezione che richiede attenzione o presenta nuovi contenuti */
|
|
21
|
+
alert?: boolean;
|
|
22
|
+
/** Visualizza dei badge con indicazioni numeriche in alto a destra dell'icona */
|
|
23
|
+
badge?: number;
|
|
24
|
+
/** Da utilizzare al posto di url quando la gestione del click è in JS */
|
|
25
|
+
onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Indica l'URL a cui far puntare il componente BottomNavItem.
|
|
28
|
+
* @deprecated. Usare `url` o `onLinkClick`
|
|
29
|
+
* */
|
|
30
|
+
link?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const BottomNavItem: FC<BottomNavItemProps> = ({
|
|
34
|
+
active = false,
|
|
35
|
+
badge,
|
|
36
|
+
alert = false,
|
|
37
|
+
url,
|
|
38
|
+
srText,
|
|
39
|
+
iconName = 'it-comment',
|
|
40
|
+
label,
|
|
41
|
+
tag = 'a',
|
|
42
|
+
onLinkClick,
|
|
43
|
+
link,
|
|
44
|
+
...attributes
|
|
45
|
+
}) => {
|
|
46
|
+
const Tag = tag;
|
|
47
|
+
const activeClass = classNames({ active });
|
|
48
|
+
const badgeWrapper = Boolean(badge) && (
|
|
49
|
+
<div className='badge-wrapper'>
|
|
50
|
+
<span className='bottom-nav-badge'>{badge}</span>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
const alertWrapper = Boolean(alert) && (
|
|
54
|
+
<div className='badge-wrapper'>
|
|
55
|
+
<span className='bottom-nav-alert' />
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
return (
|
|
59
|
+
<li {...attributes}>
|
|
60
|
+
<Tag
|
|
61
|
+
href={url || link || '#'}
|
|
62
|
+
className={activeClass}
|
|
63
|
+
onClick={onLinkClick}
|
|
64
|
+
>
|
|
65
|
+
{badgeWrapper}
|
|
66
|
+
{alertWrapper}
|
|
67
|
+
<Icon icon={iconName} />
|
|
68
|
+
<span className='bottom-nav-label'>
|
|
69
|
+
{label}
|
|
70
|
+
{srText ? <span className='sr-only'>{srText}</span> : null}
|
|
71
|
+
</span>
|
|
72
|
+
</Tag>
|
|
73
|
+
</li>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ElementType, FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { Breadcrumb as BreadcrumbBase, CSSModule } from 'reactstrap';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
export interface BreadcrumbProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
7
|
+
tag?: ElementType;
|
|
8
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati per la l'elemento lista interno */
|
|
9
|
+
listTag?: ElementType;
|
|
10
|
+
/** Classi aggiuntive da usare per il componente Nav */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Classi aggiuntive da usare per il componente di lista interno */
|
|
13
|
+
listClassName?: string;
|
|
14
|
+
/** Oggetto contenente la nuova mappatura per le classi CSS. */
|
|
15
|
+
cssModule?: CSSModule;
|
|
16
|
+
/** Indica se si vuole la versione con fondo scuro */
|
|
17
|
+
dark?: boolean;
|
|
18
|
+
/** Etichetta significativa per descrivere il tipo di navigazione */
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Breadcrumb: FC<BreadcrumbProps> = ({
|
|
23
|
+
className,
|
|
24
|
+
listClassName,
|
|
25
|
+
dark,
|
|
26
|
+
'aria-label': label,
|
|
27
|
+
...attributes
|
|
28
|
+
}) => {
|
|
29
|
+
const classes = classNames(className, 'breadcrumb-container');
|
|
30
|
+
const listClasses = classNames(listClassName, { dark });
|
|
31
|
+
const ariaLabel = label ?? 'breadcrumb';
|
|
32
|
+
return (
|
|
33
|
+
<BreadcrumbBase
|
|
34
|
+
className={classes}
|
|
35
|
+
listClassName={listClasses}
|
|
36
|
+
aria-label={ariaLabel}
|
|
37
|
+
{...attributes}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { FC, ButtonHTMLAttributes, ElementType, Ref } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { Button as ButtonBase } from 'reactstrap';
|
|
5
|
+
import type { CSSModule } from 'reactstrap';
|
|
6
|
+
|
|
7
|
+
// reactstrap wrapper
|
|
8
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
/** Quando abilitato, estende il componente Button fino a prendere tutta la larghezza disponibile */
|
|
10
|
+
block?: boolean;
|
|
11
|
+
/** Utilizzarlo disabilitare il colore di sfondo, ed applicarlo invece al bordo. */
|
|
12
|
+
outline?: boolean;
|
|
13
|
+
/** Utilizzarlo in caso di componenti personalizzati */
|
|
14
|
+
tag?: ElementType;
|
|
15
|
+
/** Classi aggiuntive da usare per il componente Button */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Oggetto contenente la nuova mappatura per le classi CSS. */
|
|
18
|
+
cssModule?: CSSModule;
|
|
19
|
+
innerRef?: Ref<HTMLButtonElement>;
|
|
20
|
+
/** Da utilizzare si usa una icona nel contenuto del Button */
|
|
21
|
+
icon?: boolean;
|
|
22
|
+
/** Da utilizzare per le varianti di dimensione del componente Button */
|
|
23
|
+
size?: 'lg' | 'sm' | 'xs';
|
|
24
|
+
/** Da utilizzare per i bottoni di chiusura all'interno di altri componenti (i.e. Chips, Modali, etc...) */
|
|
25
|
+
close?: boolean;
|
|
26
|
+
active?: boolean;
|
|
27
|
+
href?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Button: FC<ButtonProps> = ({
|
|
31
|
+
tag = 'button',
|
|
32
|
+
icon = false,
|
|
33
|
+
color = '',
|
|
34
|
+
className,
|
|
35
|
+
...attributes
|
|
36
|
+
}) => {
|
|
37
|
+
const classes = classNames(className, {
|
|
38
|
+
'btn-icon': icon
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const ariaAttributes = {
|
|
42
|
+
...(attributes.disabled && { 'aria-disabled': true })
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const baseProps = { color, tag };
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ButtonBase
|
|
49
|
+
className={classes}
|
|
50
|
+
{...baseProps}
|
|
51
|
+
{...attributes}
|
|
52
|
+
{...ariaAttributes}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { FC, ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface CalloutProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Classi aggiuntive per il componente */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Permette di dichiarare il colore del bordo e del titolo */
|
|
8
|
+
color?: 'success' | 'warning' | 'danger' | 'note' | 'important' | string;
|
|
9
|
+
/** Permette personalizzare il tag utilizzato per il Callout (diverso da "div"). Accetta sia tag HTML che componenti React. */
|
|
10
|
+
tag?: ElementType;
|
|
11
|
+
/** Abilita il Callout di tipo Highlight */
|
|
12
|
+
highlight?: boolean;
|
|
13
|
+
/** Abilita il Callout di tipo Approfondimento */
|
|
14
|
+
detailed?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Callout: FC<CalloutProps> = ({
|
|
18
|
+
children,
|
|
19
|
+
color = '',
|
|
20
|
+
highlight = false,
|
|
21
|
+
detailed,
|
|
22
|
+
tag = 'div',
|
|
23
|
+
...attributes
|
|
24
|
+
}) => {
|
|
25
|
+
const Tag = tag;
|
|
26
|
+
const classes = classNames('callout', color, {
|
|
27
|
+
'callout-highlight': highlight,
|
|
28
|
+
'callout-more': detailed
|
|
29
|
+
});
|
|
30
|
+
return (
|
|
31
|
+
<Tag className={classes} {...attributes}>
|
|
32
|
+
{children}
|
|
33
|
+
</Tag>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { FC, ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface CalloutTextProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Aumenta la dimensione del testo nel paragrafo contenuto */
|
|
6
|
+
bigText?: boolean;
|
|
7
|
+
/** Classi aggiuntive per il componente */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Permette personalizzare il tag utilizzato per il contenitore del titolo (diverso da "div"). Accetta sia tag HTML che componenti React. */
|
|
10
|
+
tag?: ElementType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const CalloutText: FC<CalloutTextProps> = ({
|
|
14
|
+
bigText = false,
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
tag = 'p',
|
|
18
|
+
...attributes
|
|
19
|
+
}) => {
|
|
20
|
+
const Tag = tag;
|
|
21
|
+
const classes = classNames(className, {
|
|
22
|
+
'callout-big-text': bigText
|
|
23
|
+
});
|
|
24
|
+
return (
|
|
25
|
+
<Tag className={classes} {...attributes}>
|
|
26
|
+
{children}
|
|
27
|
+
</Tag>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { FC, ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface CalloutTitleProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Classi aggiuntive per il componente */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Permette personalizzare il tag utilizzato per il contenitore del titolo (diverso da "div"). Accetta sia tag HTML che componenti React. */
|
|
8
|
+
tag?: ElementType;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const CalloutTitle: FC<CalloutTitleProps> = ({
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
tag = 'div',
|
|
15
|
+
...attributes
|
|
16
|
+
}) => {
|
|
17
|
+
const Tag = tag;
|
|
18
|
+
const classes = classNames(className, 'callout-title');
|
|
19
|
+
return (
|
|
20
|
+
<Tag className={classes} {...attributes}>
|
|
21
|
+
{children}
|
|
22
|
+
</Tag>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Card as CardBase, CSSModule } from 'reactstrap';
|
|
4
|
+
|
|
5
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
6
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
7
|
+
tag?: ElementType;
|
|
8
|
+
/** Classi aggiuntive da usare per il componente Card */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Da utilizzare per impostare un riferimento all'elemento DOM */
|
|
11
|
+
innerRef?: Ref<HTMLElement>;
|
|
12
|
+
/** Oggetto contenente la nuova mappatura per le classi CSS. */
|
|
13
|
+
cssModule?: CSSModule;
|
|
14
|
+
/** Abilita la versione teaser della Card */
|
|
15
|
+
teaser?: boolean;
|
|
16
|
+
/** Quando attivo distanzia la Card nella versione mobile */
|
|
17
|
+
spacing?: boolean;
|
|
18
|
+
/** Quando attivo rimuove il componente contenitore della carta. Utile per card multiple nello stesso contenitore */
|
|
19
|
+
noWrapper?: boolean;
|
|
20
|
+
/** Classi aggiuntive per l'elemento contenitore */
|
|
21
|
+
wrapperClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Card: FC<CardProps> = ({
|
|
25
|
+
tag = 'div',
|
|
26
|
+
teaser,
|
|
27
|
+
spacing,
|
|
28
|
+
noWrapper = false,
|
|
29
|
+
wrapperClassName,
|
|
30
|
+
...attributes
|
|
31
|
+
}) => {
|
|
32
|
+
const wrapperClasses = classNames('card-wrapper', wrapperClassName, {
|
|
33
|
+
'card-space': spacing,
|
|
34
|
+
'card-teaser-wrapper': teaser
|
|
35
|
+
});
|
|
36
|
+
const cardClasses = classNames(attributes.className, {
|
|
37
|
+
'card-teaser': teaser
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (noWrapper) {
|
|
41
|
+
return <CardBase {...attributes} className={cardClasses} tag={tag} />;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className={wrapperClasses}>
|
|
46
|
+
<CardBase {...attributes} className={cardClasses} tag={tag} />
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ElementType, Ref } from 'react';
|
|
2
|
+
import { CardBody as InnerCardBody, CSSModule } from 'reactstrap';
|
|
3
|
+
|
|
4
|
+
// Note: this is a wrapper class around a reactstrap component.
|
|
5
|
+
// TODO: remove this class and restore the direct import when
|
|
6
|
+
// https://github.com/storybookjs/storybook/issues/10536 gets resolved
|
|
7
|
+
|
|
8
|
+
export interface CardBodyProps extends HTMLAttributes<HTMLElement> {
|
|
9
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
10
|
+
tag?: ElementType;
|
|
11
|
+
/** Classi aggiuntive da usare per il componente Card */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Da utilizzare per impostare un riferimento all'elemento DOM */
|
|
14
|
+
innerRef?: Ref<HTMLElement>;
|
|
15
|
+
/** Oggetto contenente la nuova mappatura per le classi CSS. */
|
|
16
|
+
cssModule?: CSSModule;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const CardBody: FC<CardBodyProps> = ({ tag = 'div', ...props }) => (
|
|
20
|
+
<InnerCardBody {...props} tag={tag} />
|
|
21
|
+
);
|