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.
Files changed (352) hide show
  1. package/README.EN.md +35 -17
  2. package/README.md +34 -18
  3. package/package.json +152 -120
  4. package/src/Accordion/Accordion.tsx +30 -0
  5. package/src/Accordion/AccordionBody.tsx +127 -0
  6. package/src/Accordion/AccordionHeader.tsx +42 -0
  7. package/src/Alert/Alert.tsx +39 -0
  8. package/src/Avatar/AvatarContainer.tsx +22 -0
  9. package/src/Avatar/AvatarExtraText.tsx +19 -0
  10. package/src/Avatar/AvatarGroupContainer.tsx +23 -0
  11. package/src/Avatar/AvatarIcon.tsx +57 -0
  12. package/src/Avatar/AvatarPresence.tsx +24 -0
  13. package/src/Avatar/AvatarStatus.tsx +24 -0
  14. package/src/Avatar/AvatarWrapper.tsx +24 -0
  15. package/src/Badge/Badge.tsx +40 -0
  16. package/src/BottomNav/BottomNav.tsx +20 -0
  17. package/src/BottomNav/BottomNavItem.tsx +75 -0
  18. package/src/Breadcrumb/Breadcrumb.tsx +40 -0
  19. package/src/Button/Button.tsx +55 -0
  20. package/src/Callout/Callout.tsx +35 -0
  21. package/src/Callout/CalloutText.tsx +29 -0
  22. package/src/Callout/CalloutTitle.tsx +24 -0
  23. package/src/Card/Card.tsx +49 -0
  24. package/src/Card/CardBody.tsx +21 -0
  25. package/src/Card/CardCategory.tsx +48 -0
  26. package/src/Card/CardFooterCTA.tsx +19 -0
  27. package/src/Card/CardReadMore.tsx +35 -0
  28. package/src/Card/CardSignature.tsx +19 -0
  29. package/src/Card/CardTag.tsx +19 -0
  30. package/src/Card/CardTagsHeader.tsx +28 -0
  31. package/src/Card/CardText.tsx +19 -0
  32. package/src/Card/CardTitle.tsx +17 -0
  33. package/src/Chips/Chip.tsx +37 -0
  34. package/src/Chips/ChipLabel.tsx +19 -0
  35. package/src/Collapse/Collapse.tsx +100 -0
  36. package/src/CookieBar/CookieBar.tsx +19 -0
  37. package/src/CookieBar/CookieBarButton.tsx +27 -0
  38. package/src/CookieBar/CookieBarButtons.tsx +19 -0
  39. package/src/Dimmer/Dimmer.tsx +51 -0
  40. package/src/Dimmer/DimmerButtons.tsx +35 -0
  41. package/src/FontLoader/FontLoader.tsx +32 -0
  42. package/src/Forward/Forward.tsx +40 -0
  43. package/src/Grid/GridItem.tsx +23 -0
  44. package/src/Grid/GridItemText.tsx +20 -0
  45. package/src/Grid/GridItemTextWrapper.tsx +21 -0
  46. package/src/Grid/GridList.tsx +20 -0
  47. package/src/Grid/GridRow.tsx +20 -0
  48. package/src/Grid/index.ts +11 -0
  49. package/src/{components/Header/Header.js → Header/Header.tsx} +19 -24
  50. package/src/Header/HeaderBrand.tsx +90 -0
  51. package/src/Header/HeaderContent.tsx +42 -0
  52. package/src/Header/HeaderContext.tsx +9 -0
  53. package/src/Header/HeaderLinkZone.tsx +19 -0
  54. package/src/Header/HeaderRightZone.tsx +26 -0
  55. package/src/Header/HeaderSearch.tsx +33 -0
  56. package/src/Header/HeaderSocialsZone.tsx +26 -0
  57. package/src/Header/HeaderToggler.tsx +46 -0
  58. package/src/{components/Header/Headers.js → Header/Headers.tsx} +17 -22
  59. package/src/Hero/Hero.tsx +34 -0
  60. package/src/Hero/HeroBackground.tsx +25 -0
  61. package/src/Hero/HeroBody.tsx +21 -0
  62. package/src/Hero/HeroButton.tsx +19 -0
  63. package/src/Hero/HeroCategory.tsx +15 -0
  64. package/src/Hero/HeroTitle.tsx +16 -0
  65. package/src/Hero/index.ts +13 -0
  66. package/src/Icon/EmptyIcon.tsx +7 -0
  67. package/src/Icon/Icon.tsx +116 -0
  68. package/src/Icon/assets/ItArrowDown.tsx +9 -0
  69. package/src/Icon/assets/ItArrowDownCircle.tsx +9 -0
  70. package/src/Icon/assets/ItArrowDownTriangle.tsx +9 -0
  71. package/src/Icon/assets/ItArrowLeft.tsx +9 -0
  72. package/src/Icon/assets/ItArrowLeftCircle.tsx +9 -0
  73. package/src/Icon/assets/ItArrowLeftTriangle.tsx +9 -0
  74. package/src/Icon/assets/ItArrowRight.tsx +9 -0
  75. package/src/Icon/assets/ItArrowRightCircle.tsx +9 -0
  76. package/src/Icon/assets/ItArrowRightTriangle.tsx +9 -0
  77. package/src/Icon/assets/ItArrowUp.tsx +9 -0
  78. package/src/Icon/assets/ItArrowUpCircle.tsx +9 -0
  79. package/src/Icon/assets/ItArrowUpTriangle.tsx +9 -0
  80. package/src/Icon/assets/ItBan.tsx +9 -0
  81. package/src/Icon/assets/ItBehance.tsx +9 -0
  82. package/src/Icon/assets/ItBookmark.tsx +9 -0
  83. package/src/Icon/assets/ItBox.tsx +12 -0
  84. package/src/Icon/assets/ItBurger.tsx +9 -0
  85. package/src/Icon/assets/ItCalendar.tsx +9 -0
  86. package/src/Icon/assets/ItCamera.tsx +9 -0
  87. package/src/Icon/assets/ItCard.tsx +9 -0
  88. package/src/Icon/assets/ItChartLine.tsx +12 -0
  89. package/src/Icon/assets/ItCheck.tsx +9 -0
  90. package/src/Icon/assets/ItCheckCircle.tsx +9 -0
  91. package/src/Icon/assets/ItChevronLeft.tsx +8 -0
  92. package/src/Icon/assets/ItChevronRight.tsx +8 -0
  93. package/src/Icon/assets/ItClip.tsx +9 -0
  94. package/src/Icon/assets/ItClock.tsx +9 -0
  95. package/src/Icon/assets/ItClose.tsx +9 -0
  96. package/src/Icon/assets/ItCloseBig.tsx +9 -0
  97. package/src/Icon/assets/ItCloseCircle.tsx +9 -0
  98. package/src/Icon/assets/ItCodeCircle.tsx +9 -0
  99. package/src/Icon/assets/ItCollapse.tsx +8 -0
  100. package/src/Icon/assets/ItComment.tsx +9 -0
  101. package/src/Icon/assets/ItCopy.tsx +9 -0
  102. package/src/Icon/assets/ItDelete.tsx +12 -0
  103. package/src/Icon/assets/ItDesignersItalia.tsx +9 -0
  104. package/src/Icon/assets/ItDownload.tsx +9 -0
  105. package/src/Icon/assets/ItError.tsx +9 -0
  106. package/src/Icon/assets/ItExchangeCircle.tsx +9 -0
  107. package/src/Icon/assets/ItExpand.tsx +8 -0
  108. package/src/Icon/assets/ItExternalLink.tsx +9 -0
  109. package/src/Icon/assets/ItFacebook.tsx +9 -0
  110. package/src/Icon/assets/ItFacebookSquare.tsx +9 -0
  111. package/src/Icon/assets/ItFile.tsx +9 -0
  112. package/src/Icon/assets/ItFiles.tsx +9 -0
  113. package/src/Icon/assets/ItFlag.tsx +9 -0
  114. package/src/Icon/assets/ItFlickr.tsx +10 -0
  115. package/src/Icon/assets/ItFlickrSquare.tsx +9 -0
  116. package/src/Icon/assets/ItFolder.tsx +9 -0
  117. package/src/Icon/assets/ItFullscreen.tsx +11 -0
  118. package/src/Icon/assets/ItFunnel.tsx +9 -0
  119. package/src/Icon/assets/ItGithub.tsx +9 -0
  120. package/src/Icon/assets/ItHearing.tsx +9 -0
  121. package/src/Icon/assets/ItHelp.tsx +9 -0
  122. package/src/Icon/assets/ItHelpCircle.tsx +9 -0
  123. package/src/Icon/assets/ItHorn.tsx +9 -0
  124. package/src/Icon/assets/ItInbox.tsx +12 -0
  125. package/src/Icon/assets/ItInfoCircle.tsx +9 -0
  126. package/src/Icon/assets/ItInstagram.tsx +9 -0
  127. package/src/Icon/assets/ItKey.tsx +9 -0
  128. package/src/Icon/assets/ItLessCircle.tsx +12 -0
  129. package/src/Icon/assets/ItLink.tsx +9 -0
  130. package/src/Icon/assets/ItLinkedin.tsx +9 -0
  131. package/src/Icon/assets/ItLinkedinSquare.tsx +9 -0
  132. package/src/Icon/assets/ItList.tsx +9 -0
  133. package/src/Icon/assets/ItLock.tsx +12 -0
  134. package/src/Icon/assets/ItLocked.tsx +9 -0
  135. package/src/Icon/assets/ItMail.tsx +9 -0
  136. package/src/Icon/assets/ItMapMarker.tsx +9 -0
  137. package/src/Icon/assets/ItMapMarkerCircle.tsx +12 -0
  138. package/src/Icon/assets/ItMapMarkerMinus.tsx +9 -0
  139. package/src/Icon/assets/ItMapMarkerPlus.tsx +12 -0
  140. package/src/Icon/assets/ItMaximize.tsx +11 -0
  141. package/src/Icon/assets/ItMaximizeAlt.tsx +11 -0
  142. package/src/Icon/assets/ItMedium.tsx +9 -0
  143. package/src/Icon/assets/ItMediumSquare.tsx +9 -0
  144. package/src/Icon/assets/ItMinimize.tsx +11 -0
  145. package/src/Icon/assets/ItMinus.tsx +9 -0
  146. package/src/Icon/assets/ItMinusCircle.tsx +9 -0
  147. package/src/Icon/assets/ItMoreActions.tsx +9 -0
  148. package/src/Icon/assets/ItMoreItems.tsx +9 -0
  149. package/src/Icon/assets/ItNote.tsx +9 -0
  150. package/src/Icon/assets/ItOpenSource.tsx +9 -0
  151. package/src/Icon/assets/ItPa.tsx +9 -0
  152. package/src/Icon/assets/ItPasswordInvisible.tsx +9 -0
  153. package/src/Icon/assets/ItPasswordVisible.tsx +9 -0
  154. package/src/Icon/assets/ItPencil.tsx +9 -0
  155. package/src/Icon/assets/ItPiattaforme.tsx +10 -0
  156. package/src/Icon/assets/ItPin.tsx +9 -0
  157. package/src/Icon/assets/ItPlug.tsx +9 -0
  158. package/src/Icon/assets/ItPlus.tsx +9 -0
  159. package/src/Icon/assets/ItPlusCircle.tsx +9 -0
  160. package/src/Icon/assets/ItPresentation.tsx +9 -0
  161. package/src/Icon/assets/ItPrint.tsx +9 -0
  162. package/src/Icon/assets/ItRefresh.tsx +9 -0
  163. package/src/Icon/assets/ItRestore.tsx +9 -0
  164. package/src/Icon/assets/ItRss.tsx +11 -0
  165. package/src/Icon/assets/ItRssSquare.tsx +9 -0
  166. package/src/Icon/assets/ItSearch.tsx +9 -0
  167. package/src/Icon/assets/ItSettings.tsx +9 -0
  168. package/src/Icon/assets/ItShare.tsx +9 -0
  169. package/src/Icon/assets/ItSoftware.tsx +10 -0
  170. package/src/Icon/assets/ItStarFull.tsx +9 -0
  171. package/src/Icon/assets/ItStarOutline.tsx +9 -0
  172. package/src/Icon/assets/ItTeamDigitale.tsx +8 -0
  173. package/src/Icon/assets/ItTelegram.tsx +11 -0
  174. package/src/Icon/assets/ItTelephone.tsx +9 -0
  175. package/src/Icon/assets/ItTool.tsx +9 -0
  176. package/src/Icon/assets/ItTwitter.tsx +9 -0
  177. package/src/Icon/assets/ItTwitterSquare.tsx +9 -0
  178. package/src/Icon/assets/ItUnlocked.tsx +9 -0
  179. package/src/Icon/assets/ItUpload.tsx +9 -0
  180. package/src/Icon/assets/ItUser.tsx +9 -0
  181. package/src/Icon/assets/ItVideo.tsx +9 -0
  182. package/src/Icon/assets/ItWarning.tsx +9 -0
  183. package/src/Icon/assets/ItWarningCircle.tsx +9 -0
  184. package/src/Icon/assets/ItWhatsapp.tsx +9 -0
  185. package/src/Icon/assets/ItWhatsappSquare.tsx +10 -0
  186. package/src/Icon/assets/ItWifi.tsx +12 -0
  187. package/src/Icon/assets/ItYoutube.tsx +9 -0
  188. package/src/Icon/assets/ItZoomIn.tsx +9 -0
  189. package/src/Icon/assets/ItZoomOut.tsx +9 -0
  190. package/src/Icon/assets/index.tsx +504 -0
  191. package/src/Input/Input.tsx +342 -0
  192. package/src/Input/InputContainer.tsx +34 -0
  193. package/src/Input/TextArea.tsx +184 -0
  194. package/src/Input/TimeInput.tsx +303 -0
  195. package/src/Input/utils.tsx +166 -0
  196. package/src/LinkList/LinkList.tsx +65 -0
  197. package/src/LinkList/LinkListItem.tsx +98 -0
  198. package/src/Megamenu/Megamenu.tsx +37 -0
  199. package/src/Megamenu/MegamenuFooter.tsx +20 -0
  200. package/src/Megamenu/MegamenuHighlightColumn.tsx +33 -0
  201. package/src/Megamenu/MegamenuItem.tsx +27 -0
  202. package/src/Modal/Modal.tsx +79 -0
  203. package/src/Modal/ModalBody.tsx +11 -0
  204. package/src/Modal/ModalFooter.tsx +11 -0
  205. package/src/Modal/ModalHeader.tsx +70 -0
  206. package/src/Nav/Nav.tsx +56 -0
  207. package/src/Notification/Notification.tsx +60 -0
  208. package/src/Notification/NotificationContent.tsx +135 -0
  209. package/src/Notification/NotificationManager.tsx +65 -0
  210. package/src/Notification/core.tsx +46 -0
  211. package/src/Notification/index.ts +9 -0
  212. package/src/Notification/types.ts +12 -0
  213. package/src/Notification/usePosition.tsx +11 -0
  214. package/src/Pager/Pager.tsx +48 -0
  215. package/src/PasswordInput/PasswordInput.tsx +43 -0
  216. package/src/Progress/Progress.tsx +94 -0
  217. package/src/Rating/Rating.tsx +130 -0
  218. package/src/ResponsiveImage/ResponsiveImage.tsx +25 -0
  219. package/src/Section/Section.tsx +86 -0
  220. package/src/Select/Select.tsx +97 -0
  221. package/src/Select/shared.tsx +45 -0
  222. package/src/Sidebar/Sidebar.tsx +46 -0
  223. package/src/Skiplink/Skiplink.tsx +20 -0
  224. package/src/Skiplink/SkiplinkItem.tsx +29 -0
  225. package/src/Spinner/Spinner.tsx +55 -0
  226. package/src/Stepper/StepperContainer.tsx +30 -0
  227. package/src/Stepper/StepperContent.tsx +51 -0
  228. package/src/Stepper/StepperDots.tsx +21 -0
  229. package/src/Stepper/StepperHeader.tsx +19 -0
  230. package/src/Stepper/StepperHeaderElement.tsx +77 -0
  231. package/src/Stepper/StepperNav.tsx +19 -0
  232. package/src/ThumbNav/ThumbNav.tsx +37 -0
  233. package/src/ThumbNav/ThumbNavItem.tsx +35 -0
  234. package/src/Timeline/TimelinePin.tsx +67 -0
  235. package/src/Timeline/TimelineWrapper.tsx +19 -0
  236. package/src/Toggle/Toggle.tsx +29 -0
  237. package/src/Toolbar/Toolbar.tsx +28 -0
  238. package/src/Toolbar/ToolbarDividerItem.tsx +5 -0
  239. package/src/Toolbar/ToolbarItem.tsx +95 -0
  240. package/src/assets.d.ts +4 -0
  241. package/src/index.tsx +350 -0
  242. package/src/utils.tsx +26 -0
  243. package/.editorconfig +0 -18
  244. package/.eslintrc +0 -65
  245. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
  246. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  247. package/.github/PULL_REQUEST_TEMPLATE.md +0 -24
  248. package/AUTHORS +0 -3
  249. package/CODE_OF_CONDUCT.EN.md +0 -77
  250. package/CODE_OF_CONDUCT.md +0 -69
  251. package/dist/design-react-kit.cjs.js +0 -3698
  252. package/dist/design-react-kit.cjs.js.map +0 -1
  253. package/dist/design-react-kit.d.ts +0 -1704
  254. package/dist/design-react-kit.es.js +0 -3188
  255. package/dist/design-react-kit.es.js.map +0 -1
  256. package/dist/design-react-kit.full.js +0 -17596
  257. package/dist/design-react-kit.full.js.map +0 -1
  258. package/dist/design-react-kit.full.min.js +0 -2
  259. package/dist/design-react-kit.full.min.js.map +0 -1
  260. package/dist/design-react-kit.js +0 -13394
  261. package/dist/design-react-kit.js.map +0 -1
  262. package/dist/design-react-kit.min.js +0 -2
  263. package/dist/design-react-kit.min.js.map +0 -1
  264. package/src/Storyshots.test.js +0 -9
  265. package/src/components/Accordion/Accordion.js +0 -22
  266. package/src/components/Accordion/AccordionBody.js +0 -118
  267. package/src/components/Accordion/AccordionHeader.js +0 -37
  268. package/src/components/Autocomplete/Autocomplete.js +0 -255
  269. package/src/components/Avatar/AvatarContainer.js +0 -24
  270. package/src/components/Avatar/AvatarExtraText.js +0 -22
  271. package/src/components/Avatar/AvatarGroupContainer.js +0 -23
  272. package/src/components/Avatar/AvatarIcon.js +0 -32
  273. package/src/components/Avatar/AvatarPresence.js +0 -25
  274. package/src/components/Avatar/AvatarStatus.js +0 -25
  275. package/src/components/Avatar/AvatarWrapper.js +0 -25
  276. package/src/components/Badge/Badge.js +0 -28
  277. package/src/components/BottomNav/BottomNav.js +0 -27
  278. package/src/components/BottomNav/BottomNavItem.js +0 -69
  279. package/src/components/Button/Button.js +0 -26
  280. package/src/components/Callout/Callout.js +0 -33
  281. package/src/components/Callout/CalloutText.js +0 -37
  282. package/src/components/Callout/CalloutTitle.js +0 -27
  283. package/src/components/Card/Card.js +0 -50
  284. package/src/components/Card/CardCategory.js +0 -43
  285. package/src/components/Card/CardFooterCTA.js +0 -17
  286. package/src/components/Card/CardReadMore.js +0 -45
  287. package/src/components/Card/CardSignature.js +0 -17
  288. package/src/components/Card/CardTag.js +0 -23
  289. package/src/components/Card/CardTagsHeader.js +0 -21
  290. package/src/components/Chips/Chip.js +0 -50
  291. package/src/components/Chips/ChipLabel.js +0 -25
  292. package/src/components/Collapse/Collapse.js +0 -66
  293. package/src/components/CookieBar/CookieBar.js +0 -22
  294. package/src/components/CookieBar/CookieBarButton.js +0 -25
  295. package/src/components/CookieBar/CookieBarButtons.js +0 -23
  296. package/src/components/Dimmer/Dimmer.js +0 -38
  297. package/src/components/Dimmer/DimmerButtons.js +0 -35
  298. package/src/components/FontLoader/FontLoader.js +0 -22
  299. package/src/components/FormGroup/FormGroup.js +0 -137
  300. package/src/components/Forward/Forward.js +0 -32
  301. package/src/components/Header/HeaderBrand.js +0 -86
  302. package/src/components/Header/HeaderContent.js +0 -49
  303. package/src/components/Header/HeaderContext.js +0 -14
  304. package/src/components/Header/HeaderLinkZone.js +0 -24
  305. package/src/components/Header/HeaderRightZone.js +0 -33
  306. package/src/components/Header/HeaderSearch.js +0 -36
  307. package/src/components/Header/HeaderSocialsZone.js +0 -30
  308. package/src/components/Header/HeaderToggler.js +0 -50
  309. package/src/components/Hero/Hero.js +0 -10
  310. package/src/components/Icon/Icon.js +0 -42
  311. package/src/components/Input/Input.js +0 -261
  312. package/src/components/Input/InputContainer.js +0 -39
  313. package/src/components/Input/utils.js +0 -126
  314. package/src/components/LinkList/LinkList.js +0 -65
  315. package/src/components/LinkList/LinkListItem.js +0 -88
  316. package/src/components/Nav/Nav.js +0 -37
  317. package/src/components/Notification/Notification.js +0 -78
  318. package/src/components/Offcanvas/Offcanvas.js +0 -101
  319. package/src/components/Pager/Pager.js +0 -32
  320. package/src/components/PagerList/PagerList.js +0 -28
  321. package/src/components/PasswordInput/PasswordInput.js +0 -41
  322. package/src/components/PasswordMeter/PasswordMeter.js +0 -80
  323. package/src/components/Progress/Progress.js +0 -88
  324. package/src/components/Rating/Rating.js +0 -130
  325. package/src/components/Section/Section.js +0 -49
  326. package/src/components/Separator/Separator.js +0 -34
  327. package/src/components/Sidebar/Sidebar.js +0 -53
  328. package/src/components/Skiplink/Skiplink.js +0 -25
  329. package/src/components/Skiplink/SkiplinkItem.js +0 -25
  330. package/src/components/Spinner/Spinner.js +0 -65
  331. package/src/components/Stepper/StepperContainer.js +0 -33
  332. package/src/components/Stepper/StepperContent.js +0 -54
  333. package/src/components/Stepper/StepperDots.js +0 -27
  334. package/src/components/Stepper/StepperHeader.js +0 -27
  335. package/src/components/Stepper/StepperHeaderElement.js +0 -45
  336. package/src/components/Stepper/StepperNav.js +0 -27
  337. package/src/components/Table/Table.js +0 -68
  338. package/src/components/Timeline/TimelinePin.js +0 -59
  339. package/src/components/Timeline/TimelineWrapper.js +0 -21
  340. package/src/components/Toggle/Toggle.js +0 -27
  341. package/src/components/utils.js +0 -1
  342. package/src/index.js +0 -144
  343. package/static/favicons/android-chrome-192x192.png +0 -0
  344. package/static/favicons/android-chrome-512x512.png +0 -0
  345. package/static/favicons/apple-touch-icon.png +0 -0
  346. package/static/favicons/browserconfig.xml +0 -9
  347. package/static/favicons/favicon-16x16.png +0 -0
  348. package/static/favicons/favicon-32x32.png +0 -0
  349. package/static/favicons/favicon.ico +0 -0
  350. package/static/favicons/manifest.webmanifest +0 -21
  351. package/static/favicons/mstile-150x150.png +0 -0
  352. package/static/favicons/safari-pinned-tab.svg +0 -23
@@ -1,261 +0,0 @@
1
- /* eslint react/prefer-stateless-function: 0 */
2
-
3
- import React from 'react'
4
- import PropTypes from 'prop-types'
5
- import { Util } from 'reactstrap'
6
- import isNumber from 'is-number'
7
-
8
- import InputContainer from './InputContainer'
9
- import Icon from '../Icon/Icon'
10
- import {
11
- getTag,
12
- getFormControlClass,
13
- getClasses,
14
- getInfoTextControlClass
15
- } from './utils'
16
-
17
- const { deprecated, warnOnce } = Util
18
-
19
- const propTypes = {
20
- children: PropTypes.node,
21
- type: PropTypes.string,
22
- size: PropTypes.string,
23
- label: PropTypes.string,
24
- placeholder: PropTypes.string,
25
- value: PropTypes.string,
26
- id: PropTypes.string,
27
- infoText: PropTypes.string,
28
- normalized: PropTypes.bool,
29
- bsSize: PropTypes.string,
30
- state: deprecated(
31
- PropTypes.string,
32
- 'Please use the props "valid" and "invalid" to indicate the state.'
33
- ),
34
- valid: PropTypes.bool,
35
- invalid: PropTypes.bool,
36
- tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
37
- innerRef: PropTypes.oneOfType([
38
- PropTypes.object,
39
- PropTypes.func,
40
- PropTypes.string
41
- ]),
42
- static: deprecated(PropTypes.bool, 'Please use the prop "plaintext"'),
43
- plaintext: PropTypes.bool,
44
- addon: PropTypes.bool,
45
- className: PropTypes.string,
46
- cssModule: PropTypes.object
47
- }
48
-
49
- const defaultProps = {
50
- type: 'text'
51
- }
52
-
53
- class Input extends React.Component {
54
- state = {
55
- isFocused: false,
56
- hidden: true,
57
- icon: true
58
- }
59
-
60
- toggleFocusLabel = () => {
61
- this.setState({
62
- isFocused: true
63
- })
64
- }
65
-
66
- toggleBlurLabel = e => {
67
- if (e.target.value === '') {
68
- this.setState({
69
- isFocused: !this.state.isFocused
70
- })
71
- }
72
- }
73
-
74
- toggleShow = () => {
75
- this.setState({ hidden: !this.state.hidden, icon: !this.state.icon })
76
- }
77
-
78
- render() {
79
- const {
80
- id,
81
- className,
82
- cssModule,
83
- type,
84
- state,
85
- tag,
86
- addon,
87
- static: staticInput,
88
- plaintext,
89
- innerRef,
90
- label,
91
- infoText,
92
- placeholder,
93
- normalized,
94
- value,
95
- ...attributes
96
- } = this.props
97
- let { bsSize, valid, invalid } = this.props
98
-
99
- const Tag = getTag({ tag, plaintext, staticInput, type })
100
- const formControlClass = getFormControlClass(
101
- {
102
- plaintext,
103
- staticInput,
104
- type,
105
- addon
106
- },
107
- cssModule
108
- )
109
- const infoTextControlClass = getInfoTextControlClass(
110
- { valid, invalid },
111
- cssModule
112
- )
113
-
114
- if (state && valid == null && invalid == null) {
115
- invalid = state === 'danger'
116
- valid = state === 'success'
117
- }
118
-
119
- if (attributes.size && !isNumber(attributes.size)) {
120
- warnOnce(
121
- 'Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'
122
- )
123
- bsSize = attributes.size
124
- delete attributes.size
125
- }
126
-
127
- if (Tag === 'input' || typeof tag !== 'string') {
128
- attributes.type = type
129
- }
130
-
131
- if (
132
- attributes.children &&
133
- !(
134
- plaintext ||
135
- staticInput ||
136
- type === 'select' ||
137
- typeof Tag !== 'string' ||
138
- Tag === 'select'
139
- )
140
- ) {
141
- warnOnce(
142
- `Input with a type of "${type}" cannot have children. Please use "value"/"defaultValue" instead.`
143
- )
144
- delete attributes.children
145
- }
146
-
147
- const inputPassword = attributes.type === 'password'
148
-
149
- // Styling
150
- const {
151
- activeClass,
152
- infoTextClass,
153
- inputClasses,
154
- wrapperClass
155
- } = getClasses(
156
- className,
157
- {
158
- valid,
159
- invalid,
160
- bsSize,
161
- placeholder,
162
- value,
163
- label,
164
- infoText,
165
- normalized,
166
- inputPassword,
167
- formControlClass,
168
- infoTextControlClass,
169
- isFocused: this.state.isFocused
170
- },
171
- cssModule
172
- )
173
-
174
- // set of attributes always shared by the Input components
175
- const sharedAttributes = {
176
- id,
177
- onFocus: this.toggleFocusLabel,
178
- onBlur: this.toggleBlurLabel,
179
- value: value,
180
- ref: innerRef
181
- }
182
-
183
- // set of attributes always shared by the wrapper component
184
- const containerProps = {
185
- id,
186
- activeClass,
187
- label,
188
- infoTextClass,
189
- infoText,
190
- wrapperClass
191
- }
192
-
193
- if (placeholder) {
194
- return (
195
- <InputContainer {...containerProps}>
196
- <Tag
197
- {...attributes}
198
- {...sharedAttributes}
199
- className={inputClasses}
200
- placeholder={placeholder}
201
- />
202
- </InputContainer>
203
- )
204
- }
205
-
206
- if (inputPassword) {
207
- return (
208
- <InputContainer {...containerProps}>
209
- <Tag
210
- {...attributes}
211
- {...sharedAttributes}
212
- type={this.state.hidden ? 'password' : 'text'}
213
- className={inputClasses}
214
- placeholder={placeholder}
215
- />
216
- <span className="password-icon" aria-hidden="true">
217
- <Icon
218
- size="sm"
219
- icon={`it-password-${this.state.icon ? 'visible' : 'invisible'}`}
220
- className="password-icon-visible"
221
- onClick={this.toggleShow}
222
- />
223
- </span>
224
- </InputContainer>
225
- )
226
- }
227
- if (normalized) {
228
- return (
229
- <InputContainer {...containerProps}>
230
- <Tag
231
- {...attributes}
232
- {...sharedAttributes}
233
- className={inputClasses}
234
- readOnly
235
- />
236
- </InputContainer>
237
- )
238
- }
239
- if (label || infoText) {
240
- return (
241
- <InputContainer {...containerProps}>
242
- <Tag {...attributes} {...sharedAttributes} className={inputClasses} />
243
- </InputContainer>
244
- )
245
- }
246
-
247
- return (
248
- <Tag
249
- {...attributes}
250
- ref={innerRef}
251
- className={inputClasses}
252
- {...sharedAttributes}
253
- />
254
- )
255
- }
256
- }
257
-
258
- Input.propTypes = propTypes
259
- Input.defaultProps = defaultProps
260
-
261
- export default Input
@@ -1,39 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
-
4
- const propTypes = {
5
- value: PropTypes.string,
6
- id: PropTypes.string,
7
- label: PropTypes.string,
8
- infoText: PropTypes.string,
9
- wrapperClass: PropTypes.string,
10
- activeClass: PropTypes.string,
11
- infoTextClass: PropTypes.string,
12
- children: PropTypes.node
13
- }
14
- const defaultProps = {}
15
-
16
- const InputContainer = ({
17
- id,
18
- activeClass,
19
- label,
20
- infoTextClass,
21
- infoText,
22
- wrapperClass,
23
- children
24
- }) => {
25
- return (
26
- <div className={wrapperClass}>
27
- {children}
28
- <label htmlFor={id} className={activeClass}>
29
- {label}
30
- </label>
31
- <small className={infoTextClass}>{infoText}</small>
32
- </div>
33
- )
34
- }
35
-
36
- InputContainer.propTypes = propTypes
37
- InputContainer.defaultProps = defaultProps
38
-
39
- export default InputContainer
@@ -1,126 +0,0 @@
1
- import classNames from 'classnames'
2
- import { Util } from 'reactstrap'
3
- const { mapToCssModules } = Util
4
-
5
- function getFormControlClassInternal({ plaintext, staticInput, type, addon }) {
6
- const formControlClass = 'form-control'
7
- if (plaintext || staticInput) {
8
- return `${formControlClass}-plaintext`
9
- }
10
- if (type === 'file') {
11
- return `${formControlClass}-file`
12
- }
13
- if (['radio', 'checkbox'].indexOf(type) > -1) {
14
- if (addon) {
15
- return null
16
- }
17
- }
18
- return formControlClass
19
- }
20
-
21
- export function getFormControlClass(props, cssModule) {
22
- return mapToCssModules(getFormControlClassInternal(props), cssModule)
23
- }
24
-
25
- export function getInfoTextControlClass({ valid, invalid }, cssModule) {
26
- return mapToCssModules(
27
- classNames({
28
- 'form-text text-muted': valid || invalid
29
- }),
30
- cssModule
31
- )
32
- }
33
-
34
- export function getTag({ tag, plaintext, staticInput, type }) {
35
- if (tag) {
36
- return tag
37
- }
38
- if (['radio', 'checkbox'].indexOf(type) > -1) {
39
- return 'input'
40
- }
41
- if ((plaintext, staticInput)) {
42
- return 'p'
43
- }
44
- return 'input'
45
- }
46
-
47
- export function getClasses(
48
- className,
49
- {
50
- isFocused,
51
- valid,
52
- invalid,
53
- bsSize,
54
- placeholder,
55
- value,
56
- label,
57
- infoText,
58
- normalized,
59
- inputPassword,
60
- formControlClass,
61
- infoTextControlClass
62
- },
63
- cssModule
64
- ) {
65
- const hasPlainCondition = placeholder || label || infoText
66
- const baseCondition = hasPlainCondition && !normalized && !inputPassword
67
- const passwordOnlyCondition =
68
- inputPassword && !hasPlainCondition && !normalized
69
- const normalizedOnlyCondition =
70
- normalized && !hasPlainCondition && !inputPassword
71
-
72
- const classes = mapToCssModules(
73
- classNames(
74
- className,
75
- {
76
- 'is-invalid': invalid,
77
- 'is-valid': valid,
78
- [`form-control-${bsSize}`]: bsSize
79
- },
80
- formControlClass
81
- ),
82
- cssModule
83
- )
84
- const wrapperClass = mapToCssModules(
85
- classNames(className, 'form-group'),
86
- cssModule
87
- )
88
- const infoTextClass = mapToCssModules(
89
- classNames(
90
- {
91
- 'valid-feedback': valid,
92
- 'invalid-feedback': invalid
93
- },
94
- infoTextControlClass
95
- ),
96
- cssModule
97
- )
98
-
99
- const inputClasses = mapToCssModules(
100
- classNames(
101
- classes,
102
- !baseCondition && {
103
- // we can model here only if stylings
104
- 'form-control-plaintext': normalizedOnlyCondition,
105
- 'form-control': passwordOnlyCondition,
106
- 'input-password': passwordOnlyCondition,
107
- 'focus--mouse': passwordOnlyCondition || normalizedOnlyCondition
108
- }
109
- ),
110
- cssModule
111
- )
112
-
113
- const activeClass = mapToCssModules(
114
- classNames({
115
- active: isFocused || placeholder || value
116
- }),
117
- cssModule
118
- )
119
-
120
- return {
121
- wrapperClass,
122
- inputClasses,
123
- activeClass,
124
- infoTextClass
125
- }
126
- }
@@ -1,65 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import classNames from 'classnames'
4
-
5
- const propTypes = {
6
- /** Utilizzarlo in caso di utilizzo di componenti personalizzati */
7
- tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
8
- /** Da utilizzare in caso di titolo principale della lista. Passare una componente React da mostrare come titolo */
9
- header: PropTypes.node,
10
- /** Classi aggiuntive da usare per il componente lista del LinkList */
11
- className: PropTypes.string,
12
- /** Classi aggiuntive da usare per il componente wrapper del LinkList */
13
- wrapperClassName: PropTypes.string,
14
- /** Quando è abilitato gestisce una lista in cui ciascun elemento è composto da più componenti/elementi. */
15
- multiline: PropTypes.bool,
16
- sublist: PropTypes.bool,
17
- avatar: PropTypes.bool
18
- }
19
-
20
- const defaultProps = {
21
- tag: 'div'
22
- }
23
-
24
- const LinkList = props => {
25
- const {
26
- className,
27
- wrapperClassName,
28
- tag: Tag,
29
- multiline,
30
- header,
31
- sublist,
32
- avatar,
33
- ...attributes
34
- } = props
35
- const wrapperClasses = classNames(
36
- multiline ? 'multiline' : false,
37
- 'link-list-wrapper',
38
- wrapperClassName
39
- )
40
- const classes = classNames(
41
- className,
42
- sublist ? 'link-sublist' : 'link-list',
43
- avatar && 'avatar-group'
44
- )
45
-
46
- if (sublist) {
47
- return (
48
- <>
49
- {header}
50
- <ul {...attributes} className={classes} />
51
- </>
52
- )
53
- }
54
- return (
55
- <Tag className={wrapperClasses}>
56
- {header}
57
- <ul {...attributes} className={classes} />
58
- </Tag>
59
- )
60
- }
61
-
62
- LinkList.propTypes = propTypes
63
- LinkList.defaultProps = defaultProps
64
-
65
- export default LinkList
@@ -1,88 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import classNames from 'classnames'
4
-
5
- const propTypes = {
6
- /** Indica se l'elemento è attivo o no */
7
- active: PropTypes.bool,
8
- /** Indica se l'elemento è disabilitato o no */
9
- disabled: PropTypes.bool,
10
- /** Indica se l'elemento è un titolo. */
11
- header: PropTypes.bool,
12
- /** Indica se l'elemento è un divisore */
13
- divider: PropTypes.bool,
14
- /** Utilizzarlo in caso di utilizzo di componenti personalizzati */
15
- tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
16
- /** Classi aggiuntive da usare per il componente LinkListItem */
17
- className: PropTypes.any,
18
- /** Indica il link a cui l'elemento deve puntare. */
19
- href: PropTypes.string,
20
- /** Indica la taglia/grandezza dell'elemento */
21
- size: PropTypes.string
22
- }
23
-
24
- const defaultProps = {
25
- tag: 'a'
26
- }
27
-
28
- const handleDisabledOnClick = e => {
29
- e.preventDefault()
30
- }
31
-
32
- const LinkListItem = ({
33
- className,
34
- active,
35
- disabled,
36
- header,
37
- divider,
38
- href,
39
- size,
40
- tag: Tag,
41
- ...attributes
42
- }) => {
43
- const classes = classNames(
44
- className,
45
- {
46
- active,
47
- disabled,
48
- header,
49
- divider,
50
- size
51
- },
52
- 'list-item'
53
- )
54
-
55
- // Prevent click event when disabled.
56
- if (disabled) {
57
- attributes.onClick = handleDisabledOnClick
58
- }
59
-
60
- if (header) {
61
- Tag = 'h3'
62
- } else if (divider) {
63
- Tag = 'span'
64
- }
65
-
66
- if (header && href) {
67
- return (
68
- <li>
69
- <Tag>
70
- <a href={href || '#'} {...attributes} className={classes} />
71
- </Tag>
72
- </li>
73
- )
74
- }
75
-
76
- attributes.href = href
77
-
78
- return (
79
- <li>
80
- <Tag {...attributes} className={classes} />
81
- </li>
82
- )
83
- }
84
-
85
- LinkListItem.propTypes = propTypes
86
- LinkListItem.defaultProps = defaultProps
87
-
88
- export default LinkListItem
@@ -1,37 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import { Nav as NavBase } from 'reactstrap'
4
-
5
- const propTypes = {
6
- /** Renderizza i componenti NavItem al suo interno come tab. */
7
- tabs: PropTypes.bool,
8
- /** Renderizza i componenti NavItem al suo interno come pills. */
9
- pills: PropTypes.bool,
10
- /** Renderizza i componenti NavItem al suo interno come tab. */
11
- card: PropTypes.bool,
12
- /** Se abilitato tutti i NavItem all'interno avranno la stessa larghezza */
13
- justified: PropTypes.bool,
14
- /** Se abilitato i NavItem all'intero occuperanno tutto lo spazio disponibile */
15
- fill: PropTypes.bool,
16
- /** Da utilizzare per rendere il componente Nav verticale. Viene abilitato automaticamente in versione mobile. Valori possibili sono `true`, `false` o `"xs"` */
17
- vertical: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
18
- /** Da utilizzare per cambiare l'allineamento all'interno della Nav. Valori possibili sono `"center"` o `"end"` per posizionare il contenuto a centro o sulla destra. */
19
- horizontal: PropTypes.string,
20
- /** Se utilizzata all'interno di una navbar, impostarlo su `true`. In caso di Header Nav, impostarlo a `true` insieme a inHeader. */
21
- navbar: PropTypes.bool,
22
- /** Utilizzarlo in caso di utilizzo di componenti personalizzati */
23
- tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
24
- }
25
-
26
- const defaultProps = {
27
- tag: 'ul',
28
- vertical: false
29
- }
30
-
31
- const Nav = ({ ...attributes }) => {
32
- return <NavBase {...attributes} />
33
- }
34
-
35
- Nav.propTypes = propTypes
36
- Nav.defaultProps = defaultProps
37
- export default Nav
@@ -1,78 +0,0 @@
1
- import React from 'react'
2
- import { Toast, ToastHeader, ToastBody, Button } from 'reactstrap'
3
- import Icon from '../Icon/Icon'
4
- import classNames from 'classnames'
5
- import PropTypes from 'prop-types'
6
-
7
- const propTypes = {
8
- header: PropTypes.string,
9
- children: PropTypes.element,
10
- state: PropTypes.string,
11
- dismissable: PropTypes.bool,
12
- fix: PropTypes.string,
13
- withIcon: PropTypes.bool,
14
- style: PropTypes.object
15
- }
16
-
17
- const defaultProps = {}
18
-
19
- function pickIcon(state) {
20
- var iconClass = 'it-check-circle'
21
- switch (state) {
22
- case 'success':
23
- iconClass = 'it-check-circle'
24
- break
25
- case 'error':
26
- iconClass = 'it-close-circle'
27
- break
28
- case 'info':
29
- iconClass = 'it-info-circle'
30
- break
31
- case 'warning':
32
- iconClass = 'it-error'
33
- }
34
- return iconClass
35
- }
36
- const Notification = props => {
37
- const {
38
- header,
39
- state,
40
- dismissable,
41
- fix,
42
- withIcon,
43
- style,
44
- children,
45
- ...attributes
46
- } = props
47
- const wrapperClass = classNames(
48
- 'notification',
49
- fix,
50
- withIcon ? 'with-icon' : null,
51
- state,
52
- dismissable ? 'dismissable' : null
53
- )
54
- const icon = pickIcon(state)
55
- const btnClass = classNames('btn', 'notification-close')
56
- return (
57
- <Toast className={wrapperClass} style={style}>
58
- <ToastHeader>
59
- <h5>
60
- {header}
61
- <Icon icon={icon} />
62
- </h5>
63
- </ToastHeader>
64
- {children && <ToastBody {...attributes}>{children}</ToastBody>}
65
-
66
- {dismissable && (
67
- <Button className={btnClass}>
68
- <Icon icon="it-close" />
69
- <span className="sr-only">Chiudi notifica: Titolo notifica</span>
70
- </Button>
71
- )}
72
- </Toast>
73
- )
74
- }
75
-
76
- Notification.defaultProps = defaultProps
77
- Notification.propTypes = propTypes
78
- export default Notification