@luscii-healthtech/web-ui 0.1.0

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 (311) hide show
  1. package/README.md +181 -0
  2. package/dist/components/Acknowledgement/Acknowledgement.d.ts +22 -0
  3. package/dist/components/Avatar/Avatar.d.ts +29 -0
  4. package/dist/components/Badge/Badge.d.ts +7 -0
  5. package/dist/components/Button/Button.d.ts +5 -0
  6. package/dist/components/Button/Button.types.d.ts +32 -0
  7. package/dist/components/Button/ButtonIcon.d.ts +7 -0
  8. package/dist/components/ButtonV2/ButtonV2.d.ts +13 -0
  9. package/dist/components/ButtonV2/PrimaryButton.d.ts +12 -0
  10. package/dist/components/ButtonV2/SecondaryButton.d.ts +8 -0
  11. package/dist/components/ButtonV2/TertiaryButton.d.ts +8 -0
  12. package/dist/components/Carousel/Carousel.d.ts +8 -0
  13. package/dist/components/Carousel/GliderContainer.d.ts +7 -0
  14. package/dist/components/CenteredHero/CenteredHero.d.ts +22 -0
  15. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  16. package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +33 -0
  17. package/dist/components/Datepicker/Datepicker.d.ts +24 -0
  18. package/dist/components/Dropdown/Dropdown.d.ts +47 -0
  19. package/dist/components/EmptyListMessage/EmptyListMessage.d.ts +14 -0
  20. package/dist/components/ErrorBlock/ErrorBlock.d.ts +13 -0
  21. package/dist/components/Icons/AddIcon.d.ts +3 -0
  22. package/dist/components/Icons/AlertsIcon.d.ts +6 -0
  23. package/dist/components/Icons/BellIcon.d.ts +6 -0
  24. package/dist/components/Icons/ChartIcon.d.ts +3 -0
  25. package/dist/components/Icons/ChatBox.d.ts +5 -0
  26. package/dist/components/Icons/CheckIcon.d.ts +2 -0
  27. package/dist/components/Icons/ChevronIcon.d.ts +8 -0
  28. package/dist/components/Icons/CrossIcon.d.ts +7 -0
  29. package/dist/components/Icons/DeleteIcon.d.ts +6 -0
  30. package/dist/components/Icons/DownArrowIcon.d.ts +6 -0
  31. package/dist/components/Icons/DragIcon.d.ts +3 -0
  32. package/dist/components/Icons/EditIcon.d.ts +6 -0
  33. package/dist/components/Icons/EmptyStateDashboardIcon.d.ts +2 -0
  34. package/dist/components/Icons/ExclamationMarkIcon.d.ts +6 -0
  35. package/dist/components/Icons/EyeIcon.d.ts +3 -0
  36. package/dist/components/Icons/GearIcon.d.ts +3 -0
  37. package/dist/components/Icons/GroupIcon.d.ts +3 -0
  38. package/dist/components/Icons/HeartIcon.d.ts +6 -0
  39. package/dist/components/Icons/LeftArrowIcon.d.ts +6 -0
  40. package/dist/components/Icons/LightBulbIcon.d.ts +6 -0
  41. package/dist/components/Icons/LockIcon.d.ts +6 -0
  42. package/dist/components/Icons/MessagesIcon.d.ts +6 -0
  43. package/dist/components/Icons/NotesIcon.d.ts +6 -0
  44. package/dist/components/Icons/PinIcon.d.ts +6 -0
  45. package/dist/components/Icons/PrintIcon.d.ts +3 -0
  46. package/dist/components/Icons/RightArrowIcon.d.ts +6 -0
  47. package/dist/components/Icons/SmallCircleIcon.d.ts +6 -0
  48. package/dist/components/Icons/SmallDiamondIcon.d.ts +6 -0
  49. package/dist/components/Icons/SmallSquareIcon.d.ts +6 -0
  50. package/dist/components/Icons/SpaceRocketIcon.d.ts +6 -0
  51. package/dist/components/Icons/types/IconProps.type.d.ts +3 -0
  52. package/dist/components/InfoBlock/InfoBlock.d.ts +14 -0
  53. package/dist/components/InfoField/InfoField.d.ts +18 -0
  54. package/dist/components/Input/Input.d.ts +44 -0
  55. package/dist/components/Line/Line.d.ts +14 -0
  56. package/dist/components/ListItem/ListItem.d.ts +9 -0
  57. package/dist/components/ListTable/ListTable.d.ts +35 -0
  58. package/dist/components/ListTable/ListTableCell.d.ts +10 -0
  59. package/dist/components/ListTable/ListTableHeader.d.ts +7 -0
  60. package/dist/components/ListTable/ListTableRow.d.ts +9 -0
  61. package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +11 -0
  62. package/dist/components/Menu/Menu.d.ts +14 -0
  63. package/dist/components/Modal/Modal.d.ts +31 -0
  64. package/dist/components/Modal/ModalWithButtons.d.ts +9 -0
  65. package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
  66. package/dist/components/MultiSelect/MultiSelectUtils.d.ts +1 -0
  67. package/dist/components/NavMenu/NavLayout.d.ts +20 -0
  68. package/dist/components/NavMenu/NavMenu.d.ts +1 -0
  69. package/dist/components/NavMenu/NavMenuContent.d.ts +7 -0
  70. package/dist/components/NavMenu/NavMenuItem.d.ts +15 -0
  71. package/dist/components/NotificationBanner/NotificationBanner.d.ts +22 -0
  72. package/dist/components/Page/CRUDPage.d.ts +43 -0
  73. package/dist/components/Page/Page.d.ts +58 -0
  74. package/dist/components/PaginationMenu/PaginationMenu.d.ts +20 -0
  75. package/dist/components/PaginationMenu/PaginationMenuLarge.d.ts +13 -0
  76. package/dist/components/PaginationMenu/PaginationMenuSmall.d.ts +8 -0
  77. package/dist/components/PreviewPhone/PreviewPhone.d.ts +7 -0
  78. package/dist/components/PreviewPhone/useWindowDimensions.d.ts +4 -0
  79. package/dist/components/Radio/Radio.d.ts +18 -0
  80. package/dist/components/RadioGroup/RadioGroup.d.ts +31 -0
  81. package/dist/components/Section/Section.d.ts +15 -0
  82. package/dist/components/Select/LegacySelect.d.ts +32 -0
  83. package/dist/components/Select/Select.d.ts +6 -0
  84. package/dist/components/Select/options.transformer.d.ts +14 -0
  85. package/dist/components/Select/select.utils.d.ts +7 -0
  86. package/dist/components/SettingsMenuButton/SettingsMenuButton.d.ts +16 -0
  87. package/dist/components/Spinner/Spinner.d.ts +6 -0
  88. package/dist/components/Steps/Step.d.ts +10 -0
  89. package/dist/components/Steps/Steps.d.ts +11 -0
  90. package/dist/components/Switcher/Switcher.d.ts +26 -0
  91. package/dist/components/Switcher/SwitcherItem.d.ts +24 -0
  92. package/dist/components/TabLinks/TabLinks.d.ts +14 -0
  93. package/dist/components/Tabbar/Tabbar.d.ts +10 -0
  94. package/dist/components/Tabbar/TabbarItem.d.ts +15 -0
  95. package/dist/components/Tag/Tag.d.ts +17 -0
  96. package/dist/components/Tag/TagGroup.d.ts +13 -0
  97. package/dist/components/Text/LegacyText.d.ts +37 -0
  98. package/dist/components/Text/Text.d.ts +27 -0
  99. package/dist/components/TextEditor/TextEditor.d.ts +14 -0
  100. package/dist/components/TextEditorV2/TextEditorV2.d.ts +6 -0
  101. package/dist/components/TextLink/TextLink.d.ts +11 -0
  102. package/dist/components/TextListItem/TextListItem.d.ts +12 -0
  103. package/dist/components/Textarea/Textarea.d.ts +22 -0
  104. package/dist/components/Title/LegacyTitle.d.ts +22 -0
  105. package/dist/components/Title/Title.d.ts +14 -0
  106. package/dist/components/ViewItem/ViewItem.d.ts +16 -0
  107. package/dist/index.d.ts +8 -0
  108. package/dist/index.js +8 -0
  109. package/dist/types/general.types.d.ts +7 -0
  110. package/dist/utils/useOutsideClick.d.ts +2 -0
  111. package/dist/web-ui.cjs.development.js +23 -0
  112. package/dist/web-ui.cjs.development.js.map +1 -0
  113. package/dist/web-ui.cjs.production.min.js +2 -0
  114. package/dist/web-ui.cjs.production.min.js.map +1 -0
  115. package/dist/web-ui.esm.js +17 -0
  116. package/dist/web-ui.esm.js.map +1 -0
  117. package/package.json +122 -0
  118. package/src/assets/add.svg +5 -0
  119. package/src/assets/add_hover.svg +4 -0
  120. package/src/assets/big-menu-icon-hover.svg +6 -0
  121. package/src/assets/big-menu-icon.svg +6 -0
  122. package/src/assets/check-cross-icon.svg +7 -0
  123. package/src/assets/check-icon-primary.svg +5 -0
  124. package/src/assets/check-icon.svg +3 -0
  125. package/src/assets/chevron-double.svg +3 -0
  126. package/src/assets/close.svg +3 -0
  127. package/src/assets/color-variant-cross.svg +3 -0
  128. package/src/assets/cross-dark.svg +3 -0
  129. package/src/assets/delete.svg +4 -0
  130. package/src/assets/delete_hover.svg +4 -0
  131. package/src/assets/edit.svg +6 -0
  132. package/src/assets/edit_hover.svg +6 -0
  133. package/src/assets/error-icon.svg +7 -0
  134. package/src/assets/grid-view-icon-active.svg +6 -0
  135. package/src/assets/grid-view-icon.svg +6 -0
  136. package/src/assets/groups.svg +3 -0
  137. package/src/assets/hamburger.svg +5 -0
  138. package/src/assets/happy-star.svg +9 -0
  139. package/src/assets/hcps.svg +3 -0
  140. package/src/assets/info-icon.svg +6 -0
  141. package/src/assets/left-arrow-blue.svg +3 -0
  142. package/src/assets/left-arrow-grey.svg +3 -0
  143. package/src/assets/list-view-icon-active.svg +3 -0
  144. package/src/assets/list-view-icon.svg +3 -0
  145. package/src/assets/loading.svg +16 -0
  146. package/src/assets/modal-close-icon-active.svg +9 -0
  147. package/src/assets/modal-close-icon.svg +9 -0
  148. package/src/assets/no-open-alerts.svg +19 -0
  149. package/src/assets/patients.svg +3 -0
  150. package/src/assets/phone-mockup.svg +9 -0
  151. package/src/assets/programs.svg +3 -0
  152. package/src/assets/right-arrow-blue.svg +3 -0
  153. package/src/assets/right-arrow-grey.svg +3 -0
  154. package/src/assets/search-cancel.svg +3 -0
  155. package/src/assets/search-not-found.svg +70 -0
  156. package/src/assets/search.svg +3 -0
  157. package/src/assets/spinner-gray.svg +6 -0
  158. package/src/assets/spinner.svg +6 -0
  159. package/src/assets/starIcon.svg +3 -0
  160. package/src/assets/success-icon.svg +7 -0
  161. package/src/components/Acknowledgement/Acknowledgement.js +61 -0
  162. package/src/components/Acknowledgement/Acknowledgement.scss +49 -0
  163. package/src/components/Avatar/Avatar.js +81 -0
  164. package/src/components/Avatar/Avatar.scss +153 -0
  165. package/src/components/Badge/Badge.tsx +23 -0
  166. package/src/components/Button/Button.examples.md +46 -0
  167. package/src/components/Button/Button.tsx +200 -0
  168. package/src/components/Button/Button.types.ts +41 -0
  169. package/src/components/Button/ButtonIcon.tsx +42 -0
  170. package/src/components/ButtonV2/ButtonV2.tsx +91 -0
  171. package/src/components/ButtonV2/PrimaryButton.tsx +43 -0
  172. package/src/components/ButtonV2/SecondaryButton.tsx +31 -0
  173. package/src/components/ButtonV2/TertiaryButton.tsx +31 -0
  174. package/src/components/Carousel/Carousel.tsx +52 -0
  175. package/src/components/Carousel/GliderContainer.scss +13 -0
  176. package/src/components/Carousel/GliderContainer.tsx +22 -0
  177. package/src/components/CenteredHero/CenteredHero.js +50 -0
  178. package/src/components/Checkbox/Checkbox.scss +115 -0
  179. package/src/components/Checkbox/Checkbox.tsx +114 -0
  180. package/src/components/ConfirmationDialog/ConfirmationDialog.scss +15 -0
  181. package/src/components/ConfirmationDialog/ConfirmationDialog.tsx +84 -0
  182. package/src/components/Datepicker/Datepicker.js +96 -0
  183. package/src/components/Datepicker/Datepicker.scss +331 -0
  184. package/src/components/Dropdown/Dropdown.js +364 -0
  185. package/src/components/Dropdown/Dropdown.scss +83 -0
  186. package/src/components/EmptyListMessage/EmptyListMessage.tsx +34 -0
  187. package/src/components/ErrorBlock/ErrorBlock.js +24 -0
  188. package/src/components/ErrorBlock/ErrorBlock.scss +20 -0
  189. package/src/components/Icons/AddIcon.tsx +27 -0
  190. package/src/components/Icons/AlertsIcon.tsx +26 -0
  191. package/src/components/Icons/BellIcon.tsx +26 -0
  192. package/src/components/Icons/ChartIcon.tsx +20 -0
  193. package/src/components/Icons/ChatBox.tsx +23 -0
  194. package/src/components/Icons/CheckIcon.tsx +23 -0
  195. package/src/components/Icons/ChevronIcon.tsx +30 -0
  196. package/src/components/Icons/CrossIcon.tsx +26 -0
  197. package/src/components/Icons/DeleteIcon.tsx +23 -0
  198. package/src/components/Icons/DownArrowIcon.tsx +17 -0
  199. package/src/components/Icons/DragIcon.tsx +23 -0
  200. package/src/components/Icons/EditIcon.tsx +23 -0
  201. package/src/components/Icons/EmptyStateDashboardIcon.tsx +130 -0
  202. package/src/components/Icons/ExclamationMarkIcon.tsx +23 -0
  203. package/src/components/Icons/EyeIcon.tsx +21 -0
  204. package/src/components/Icons/GearIcon.tsx +21 -0
  205. package/src/components/Icons/GroupIcon.tsx +21 -0
  206. package/src/components/Icons/HeartIcon.tsx +23 -0
  207. package/src/components/Icons/LeftArrowIcon.tsx +23 -0
  208. package/src/components/Icons/LightBulbIcon.tsx +28 -0
  209. package/src/components/Icons/LockIcon.tsx +23 -0
  210. package/src/components/Icons/MessagesIcon.tsx +23 -0
  211. package/src/components/Icons/NotesIcon.tsx +23 -0
  212. package/src/components/Icons/PinIcon.tsx +23 -0
  213. package/src/components/Icons/PrintIcon.tsx +15 -0
  214. package/src/components/Icons/RightArrowIcon.tsx +23 -0
  215. package/src/components/Icons/SmallCircleIcon.tsx +21 -0
  216. package/src/components/Icons/SmallDiamondIcon.tsx +31 -0
  217. package/src/components/Icons/SmallSquareIcon.tsx +21 -0
  218. package/src/components/Icons/SpaceRocketIcon.tsx +23 -0
  219. package/src/components/Icons/types/IconProps.type.ts +3 -0
  220. package/src/components/InfoBlock/InfoBlock.js +24 -0
  221. package/src/components/InfoBlock/InfoBlock.scss +20 -0
  222. package/src/components/InfoField/InfoField.tsx +86 -0
  223. package/src/components/Input/Input.examples.md +94 -0
  224. package/src/components/Input/Input.js +141 -0
  225. package/src/components/Line/Line.js +38 -0
  226. package/src/components/ListItem/ListItem.scss +20 -0
  227. package/src/components/ListItem/ListItem.tsx +26 -0
  228. package/src/components/ListTable/ListTable.tsx +157 -0
  229. package/src/components/ListTable/ListTableCell.tsx +67 -0
  230. package/src/components/ListTable/ListTableHeader.tsx +33 -0
  231. package/src/components/ListTable/ListTableRow.tsx +46 -0
  232. package/src/components/LoadingIndicator/LoadingIndicator.scss +50 -0
  233. package/src/components/LoadingIndicator/LoadingIndicator.tsx +44 -0
  234. package/src/components/Menu/Menu.js +74 -0
  235. package/src/components/Menu/Menu.scss +27 -0
  236. package/src/components/Modal/Modal.scss +117 -0
  237. package/src/components/Modal/Modal.tsx +104 -0
  238. package/src/components/Modal/ModalWithButtons.tsx +34 -0
  239. package/src/components/MultiSelect/MultiSelect.js +117 -0
  240. package/src/components/MultiSelect/MultiSelect.scss +29 -0
  241. package/src/components/MultiSelect/MultiSelectUtils.js +23 -0
  242. package/src/components/NavMenu/NavLayout.tsx +40 -0
  243. package/src/components/NavMenu/NavMenu.js +35 -0
  244. package/src/components/NavMenu/NavMenuContent.tsx +23 -0
  245. package/src/components/NavMenu/NavMenuItem.tsx +96 -0
  246. package/src/components/NotificationBanner/NotificationBanner.tsx +57 -0
  247. package/src/components/Page/CRUDPage.js +123 -0
  248. package/src/components/Page/CRUDPage.scss +32 -0
  249. package/src/components/Page/Page.js +102 -0
  250. package/src/components/Page/Page.scss +59 -0
  251. package/src/components/PaginationMenu/PaginationMenu.js +31 -0
  252. package/src/components/PaginationMenu/PaginationMenuLarge.tsx +94 -0
  253. package/src/components/PaginationMenu/PaginationMenuSmall.tsx +40 -0
  254. package/src/components/PreviewPhone/PreviewPhone.tsx +53 -0
  255. package/src/components/PreviewPhone/useWindowDimensions.js +26 -0
  256. package/src/components/Radio/Radio.js +99 -0
  257. package/src/components/Radio/Radio.scss +58 -0
  258. package/src/components/RadioGroup/RadioGroup.js +63 -0
  259. package/src/components/RadioGroup/RadioGroup.scss +37 -0
  260. package/src/components/Section/Section.scss +74 -0
  261. package/src/components/Section/Section.tsx +67 -0
  262. package/src/components/Select/LegacySelect.js +114 -0
  263. package/src/components/Select/Select.examples.md +161 -0
  264. package/src/components/Select/Select.tsx +136 -0
  265. package/src/components/Select/options.transformer.ts +36 -0
  266. package/src/components/Select/select.utils.spec.ts +63 -0
  267. package/src/components/Select/select.utils.ts +45 -0
  268. package/src/components/SettingsMenuButton/SettingsMenuButton.tsx +111 -0
  269. package/src/components/Spinner/Spinner.tsx +23 -0
  270. package/src/components/Steps/Step.tsx +22 -0
  271. package/src/components/Steps/Steps.tsx +24 -0
  272. package/src/components/Switcher/Switcher.js +58 -0
  273. package/src/components/Switcher/SwitcherItem.js +61 -0
  274. package/src/components/Switcher/SwitcherItem.scss +67 -0
  275. package/src/components/TabLinks/TabLinks.tsx +63 -0
  276. package/src/components/Tabbar/Tabbar.tsx +29 -0
  277. package/src/components/Tabbar/TabbarItem.tsx +53 -0
  278. package/src/components/Tag/Tag.tsx +39 -0
  279. package/src/components/Tag/TagGroup.tsx +25 -0
  280. package/src/components/Text/LegacyText.js +78 -0
  281. package/src/components/Text/Text.scss +67 -0
  282. package/src/components/Text/Text.tsx +81 -0
  283. package/src/components/TextEditor/TextEditor.js +61 -0
  284. package/src/components/TextEditor/TextEditor.scss +14 -0
  285. package/src/components/TextEditorV2/TextEditorV2.js +58 -0
  286. package/src/components/TextEditorV2/TextEditorV2.scss +110 -0
  287. package/src/components/TextLink/TextLink.tsx +42 -0
  288. package/src/components/TextListItem/TextListItem.js +31 -0
  289. package/src/components/TextListItem/TextListItem.scss +10 -0
  290. package/src/components/Textarea/Textarea.js +108 -0
  291. package/src/components/Textarea/Textarea.scss +56 -0
  292. package/src/components/Title/LegacyTitle.js +64 -0
  293. package/src/components/Title/Title.scss +65 -0
  294. package/src/components/Title/Title.tsx +57 -0
  295. package/src/components/ViewItem/ViewItem.tsx +73 -0
  296. package/src/index.tsx +14 -0
  297. package/src/styles/_colors.scss +59 -0
  298. package/src/styles/_layout.scss +64 -0
  299. package/src/styles/_shadows.scss +19 -0
  300. package/src/styles/_typography.scss +8 -0
  301. package/src/styles/_utils.scss +45 -0
  302. package/src/styles/fonts/avenir/3A0AF8_0_0.eot +0 -0
  303. package/src/styles/fonts/avenir/3A0AF8_0_0.ttf +0 -0
  304. package/src/styles/fonts/avenir/3A0AF8_0_0.woff +0 -0
  305. package/src/styles/fonts/avenir/3A0AF8_0_0.woff2 +0 -0
  306. package/src/styles/fonts/avenir/3A0AF8_1_0.eot +0 -0
  307. package/src/styles/fonts/avenir/3A0AF8_1_0.ttf +0 -0
  308. package/src/styles/fonts/avenir/3A0AF8_1_0.woff +0 -0
  309. package/src/styles/fonts/avenir/3A0AF8_1_0.woff2 +0 -0
  310. package/src/types/general.types.ts +11 -0
  311. package/src/utils/useOutsideClick.js +19 -0
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ interface SmallSquareIconProps {
4
+ className?: string;
5
+ }
6
+
7
+ export const SmallSquareIcon = (props: SmallSquareIconProps): JSX.Element => {
8
+ return (
9
+ <svg
10
+ className={props.className}
11
+ width="24"
12
+ height="24"
13
+ viewBox="0 0 24 24"
14
+ fill="none"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ >
17
+ <rect x="6" y="6" width="12" height="12" rx="2" fill="currentColor" />
18
+ <circle cx="15.5" cy="8.5" r="1.5" fill="white" fillOpacity="0.1" />
19
+ </svg>
20
+ );
21
+ };
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+
3
+ interface SpaceRocketIconProps {
4
+ className?: string;
5
+ }
6
+
7
+ export const SpaceRocketIcon = (props: SpaceRocketIconProps): JSX.Element => {
8
+ return (
9
+ <svg
10
+ className={props.className}
11
+ width="24"
12
+ height="24"
13
+ viewBox="0 0 24 24"
14
+ fill="none"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ >
17
+ <path
18
+ d="M9.18977 6.34976C7.14977 8.63976 5.74977 11.9298 5.61977 12.2398L3.35977 11.2698C2.70977 10.9898 2.54977 10.1398 3.04977 9.63976L6.05977 6.62976C6.52977 6.15976 7.20977 5.94976 7.86977 6.07976L9.18977 6.34976ZM10.6798 16.5098C10.9798 16.8098 11.4198 16.8898 11.7998 16.7098C12.9598 16.1698 15.4498 14.8998 17.0598 13.2898C21.6498 8.69976 21.6898 4.95976 21.4198 3.35976C21.3498 2.95976 21.0298 2.63976 20.6298 2.56976C19.0298 2.29976 15.2898 2.33976 10.6998 6.92976C9.08977 8.53976 7.82977 11.0298 7.27977 12.1898C7.09977 12.5698 7.18977 13.0198 7.47977 13.3098L10.6798 16.5098ZM17.6498 14.8098C15.3598 16.8498 12.0698 18.2498 11.7598 18.3798L12.7298 20.6398C13.0098 21.2898 13.8598 21.4498 14.3598 20.9498L17.3698 17.9398C17.8398 17.4698 18.0498 16.7898 17.9198 16.1298L17.6498 14.8098ZM8.93977 17.4098C9.13977 18.4698 8.78977 19.4498 8.11977 20.1198C7.34977 20.8898 4.95977 21.4598 3.40977 21.7598C2.71977 21.8898 2.10977 21.2798 2.23977 20.5898C2.53977 19.0398 3.09977 16.6498 3.87977 15.8798C4.54977 15.2098 5.52977 14.8598 6.58977 15.0598C7.75977 15.2798 8.71977 16.2398 8.93977 17.4098ZM12.9998 8.99976C12.9998 7.89976 13.8998 6.99976 14.9998 6.99976C16.0998 6.99976 16.9998 7.89976 16.9998 8.99976C16.9998 10.0998 16.0998 10.9998 14.9998 10.9998C13.8998 10.9998 12.9998 10.0998 12.9998 8.99976Z"
19
+ fill="currentColor"
20
+ />
21
+ </svg>
22
+ );
23
+ };
@@ -0,0 +1,3 @@
1
+ export interface IconProps {
2
+ className?: string;
3
+ }
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import classNames from "classnames";
4
+
5
+ import "./InfoBlock.scss";
6
+ import { Text } from "../Text/Text";
7
+
8
+ InfoBlock.propTypes = {
9
+ message: PropTypes.string.isRequired,
10
+ containsDangerousHtml: PropTypes.bool,
11
+ className: PropTypes.string,
12
+ };
13
+
14
+ function InfoBlock({ message, className, containsDangerousHtml = false }) {
15
+ const containerClassName = classNames("cweb-info-block", className);
16
+
17
+ return (
18
+ <div className={containerClassName}>
19
+ <Text text={message} containsDangerousHtml={containsDangerousHtml} />
20
+ </div>
21
+ );
22
+ }
23
+
24
+ export default InfoBlock;
@@ -0,0 +1,20 @@
1
+ @import '../../styles/colors';
2
+
3
+ .cweb-info-block {
4
+ position: relative;
5
+ padding: 16px 16px 16px 56px;
6
+ background-color: $color-emphasis-background;
7
+ border-radius: 8px;
8
+
9
+ &:before {
10
+ content: "";
11
+ position: absolute;
12
+ left: 16px;
13
+ top: 14px;
14
+ z-index: 1;
15
+ width: 24px;
16
+ height: 23px;
17
+ background: url("../../assets/info-icon.svg") no-repeat center;
18
+ background-size: contain;
19
+ }
20
+ }
@@ -0,0 +1,86 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ import ClipboardJS from "clipboard";
4
+
5
+ import { Text } from "../Text/Text";
6
+
7
+ type InfoFieldLinkType = "none" | "link" | "clipboard" | "tel";
8
+
9
+ interface InfoFieldProps {
10
+ label: string;
11
+ value: string;
12
+ linkType: InfoFieldLinkType;
13
+ supportsMultiline?: boolean;
14
+ onCopyToClipboard?: () => void;
15
+ icon?: JSX.Element;
16
+ className?: string;
17
+ }
18
+
19
+ export const InfoField = (props: InfoFieldProps): JSX.Element => {
20
+ const clipboard = new ClipboardJS("button");
21
+
22
+ clipboard.on("success", function (e) {
23
+ props.onCopyToClipboard && props.onCopyToClipboard();
24
+ e.clearSelection();
25
+ });
26
+
27
+ let ContainerElement: React.ElementType;
28
+ let containerProps: any;
29
+
30
+ switch (props.linkType) {
31
+ case "link":
32
+ ContainerElement = "a";
33
+ containerProps = {
34
+ href: props.value,
35
+ target: "_blank",
36
+ rel: "noopener noreferrer",
37
+ };
38
+ break;
39
+ case "tel":
40
+ ContainerElement = "a";
41
+ containerProps = { href: `tel:${props.value}` };
42
+ break;
43
+
44
+ case "clipboard":
45
+ ContainerElement = "button";
46
+ containerProps = {
47
+ type: "button",
48
+ "data-clipboard-text": props.value,
49
+ };
50
+ break;
51
+
52
+ case "none":
53
+ default:
54
+ ContainerElement = "div";
55
+ break;
56
+ }
57
+
58
+ return (
59
+ <div className={classNames("flex flex-row align-center items-center", props.className)}>
60
+ {props.icon}
61
+ <ContainerElement className={"flex flex-col overflow-hidden ml-3 first:ml-0"} {...containerProps}>
62
+ <Text
63
+ text={props.label}
64
+ type={"sm"}
65
+ color={"gray-500"}
66
+ className={classNames(
67
+ { "break-words": props.supportsMultiline },
68
+ { "whitespace-no-wrap": !props.supportsMultiline }
69
+ )}
70
+ />
71
+ <Text
72
+ className={classNames(
73
+ { "break-words": props.supportsMultiline },
74
+ { "whitespace-no-wrap": !props.supportsMultiline }
75
+ )}
76
+ text={props.value}
77
+ truncate={!props.supportsMultiline}
78
+ />
79
+ </ContainerElement>
80
+ </div>
81
+ );
82
+ };
83
+
84
+ InfoField.defaultProps = {
85
+ linkType: "none",
86
+ };
@@ -0,0 +1,94 @@
1
+ ```js
2
+ const lockIcon = require("../../../styleguide/assets/icons/lock-icon.svg");
3
+ const mailIcon = require("../../../styleguide/assets/icons/mail-icon.svg");
4
+
5
+ class InputExample extends React.Component {
6
+ constructor(props) {
7
+ super(props);
8
+
9
+ this.state = {
10
+ value: "",
11
+ password: "",
12
+ };
13
+
14
+ this.handleChange = this.handleChange.bind(this);
15
+ }
16
+
17
+ handleChange(event) {
18
+ this.setState({
19
+ [event.target.name]: event.target.value,
20
+ });
21
+ }
22
+
23
+ render() {
24
+ return (
25
+ <div className="styleguide-flex-vertical styleguide-width-400 styleguide-height-150">
26
+ <Text text={"Text:"} />
27
+ <Input name="value" icon={mailIcon} value={this.state.value} onChange={this.handleChange} />
28
+
29
+ <Text text={"Password:"} />
30
+ <Input
31
+ name="password"
32
+ type="password"
33
+ icon={lockIcon}
34
+ value={this.state.password}
35
+ onChange={this.handleChange}
36
+ />
37
+ </div>
38
+ );
39
+ }
40
+ }
41
+ <InputExample />;
42
+ ```
43
+
44
+ ```js
45
+ const inForm = require("../HOCs/form/helpers/inForm").default;
46
+ const InputInForm = inForm(Input);
47
+
48
+ class InputExampleInForm extends React.Component {
49
+ constructor(props) {
50
+ super(props);
51
+
52
+ this.state = {
53
+ value: "",
54
+ error: null,
55
+ };
56
+
57
+ this.handleChange = this.handleChange.bind(this);
58
+ this.handleError = this.handleError.bind(this);
59
+ }
60
+
61
+ handleChange(event) {
62
+ this.setState({
63
+ value: event.target.value,
64
+ });
65
+ }
66
+
67
+ handleError() {
68
+ this.setState((prevState) => {
69
+ return {
70
+ error: prevState.error ? null : "This field is required",
71
+ };
72
+ });
73
+ }
74
+
75
+ render() {
76
+ return (
77
+ <div className="styleguide-in-form styleguide-component-block">
78
+ <Title type="tagline" text={"Example Input use in Form"} />
79
+
80
+ <InputInForm
81
+ label="Field Label"
82
+ error={this.state.error}
83
+ name="my-input"
84
+ value={this.state.value}
85
+ onChange={this.handleChange}
86
+ />
87
+
88
+ <Button text="Toggle ErrorWrapper" className="styleguide-margin-top-10" onClick={this.handleError} />
89
+ </div>
90
+ );
91
+ }
92
+ }
93
+ <InputExampleInForm />;
94
+ ```
@@ -0,0 +1,141 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import classNames from "classnames";
4
+
5
+ import cross from "../../assets/color-variant-cross.svg";
6
+
7
+ const INPUT_TYPES = {
8
+ EMAIL: "email",
9
+ NUMBER: "number",
10
+ PASSWORD: "password",
11
+ TEXT: "text",
12
+ };
13
+
14
+ Input.propTypes = {
15
+ className: PropTypes.string,
16
+ type: PropTypes.oneOf([INPUT_TYPES.EMAIL, INPUT_TYPES.NUMBER, INPUT_TYPES.PASSWORD, INPUT_TYPES.TEXT]),
17
+ value: PropTypes.any,
18
+ name: PropTypes.string.isRequired,
19
+ placeholder: PropTypes.string,
20
+ clearable: PropTypes.bool,
21
+ maxLength: PropTypes.number,
22
+ isDisabled: PropTypes.bool,
23
+ withPrefix: PropTypes.string,
24
+ withSuffix: PropTypes.string,
25
+ icon: PropTypes.string,
26
+ onChange: PropTypes.func.isRequired,
27
+ onBlur: PropTypes.func,
28
+ onFocus: PropTypes.func,
29
+ onKeyPress: PropTypes.func,
30
+ onKeyDown: PropTypes.func,
31
+ id: PropTypes.string,
32
+ setRef: PropTypes.any,
33
+ };
34
+
35
+ function Input({
36
+ withSuffix = "",
37
+ withPrefix = "",
38
+ className = "",
39
+ clearable = false,
40
+ type = INPUT_TYPES.TEXT,
41
+ isDisabled = false,
42
+ icon,
43
+ setRef = () => undefined,
44
+ onChange,
45
+ name,
46
+ value,
47
+ ...otherProps
48
+ }) {
49
+ const hasNoExtraContent = withPrefix === "" && withSuffix === "";
50
+
51
+ let style;
52
+ if (icon) {
53
+ style = {
54
+ backgroundSize: "1.125rem",
55
+ backgroundPosition: "1rem",
56
+ backgroundImage: `url(${icon})`,
57
+ backgroundRepeat: "no-repeat",
58
+ };
59
+ }
60
+
61
+ return (
62
+ <div className="relative flex flex-row">
63
+ <span
64
+ className={classNames(
65
+ "h-11",
66
+ {
67
+ hidden: hasNoExtraContent,
68
+ "order-1": withPrefix !== "",
69
+ "order-2": withSuffix !== "",
70
+ "rounded-l border-l": withPrefix !== "",
71
+ "rounded-r border-r": withSuffix !== "",
72
+ },
73
+ "border-t border-b border-solid border-input-border",
74
+ "flex flex-col items-center p-3",
75
+ "text-sm",
76
+ "text-slate-500",
77
+ "bg-main-background"
78
+ )}
79
+ >
80
+ {withSuffix || withPrefix}
81
+ </span>
82
+ <input
83
+ {...otherProps}
84
+ name={name}
85
+ value={value}
86
+ onChange={onChange}
87
+ ref={setRef}
88
+ size={otherProps.maxLength}
89
+ type={type}
90
+ disabled={isDisabled}
91
+ className={classNames(
92
+ "cweb-input",
93
+ "block",
94
+ { "pl-10": icon, "pr-11": clearable },
95
+ "h-11",
96
+ "p-2",
97
+ "border",
98
+ "text-sm",
99
+ "text-slate-700",
100
+ "bg-white",
101
+ "placeholder-slate-500",
102
+ "border-solid",
103
+ "border-input-border",
104
+ "hover:border-input-border-dark",
105
+ "focus:outline-primary",
106
+ "transition-colors",
107
+ "duration-300",
108
+ "focus:border-primary",
109
+ {
110
+ "z-10": withSuffix !== "" || withPrefix !== "", // to make sure the outline is displayed completely
111
+ rounded: hasNoExtraContent,
112
+ "rounded-l": withSuffix !== "",
113
+ "rounded-r": withPrefix !== "",
114
+ "order-2": withPrefix !== "",
115
+ "order-1": withSuffix !== "",
116
+ },
117
+ "shadow-default",
118
+ className
119
+ )}
120
+ style={style}
121
+ />
122
+ <span
123
+ style={{
124
+ background: `url(${cross}) center no-repeat`,
125
+ backgroundSize: "1.5rem",
126
+ }}
127
+ className={classNames(
128
+ "absolute right-0 transform top-1/2",
129
+ "-translate-y-1/2 block w-6 h-6 mr-3 cursor-pointer text-input-icon",
130
+ { hidden: !clearable }
131
+ )}
132
+ onClick={() => {
133
+ onChange && onChange({ target: { name: name, value: "" }, currentTarget: { name: name, value: "" } });
134
+ }}
135
+ />
136
+ </div>
137
+ );
138
+ }
139
+
140
+ export default Input;
141
+ export { INPUT_TYPES };
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import classNames from "classnames";
4
+
5
+ const Line = ({ left, right, className }) => (
6
+ <div className={classNames(className, "cweb-line", "flex flex-row flex-no-wrap")}>
7
+ <div className={"flex"}>
8
+ {left?.map(
9
+ (item) =>
10
+ item && (
11
+ <div key={item.key ?? item.props.id} className={"mr-3 flex items-center"}>
12
+ {item}
13
+ </div>
14
+ )
15
+ )}
16
+ </div>
17
+ <div className={"flex-grow"} />
18
+ <div className={"flex"}>
19
+ {right?.map((item) => {
20
+ return (
21
+ item && (
22
+ <div key={item.key ?? item.props.id} className={"ml-3 first:ml-0"}>
23
+ {item}
24
+ </div>
25
+ )
26
+ );
27
+ })}
28
+ </div>
29
+ </div>
30
+ );
31
+
32
+ Line.propTypes = {
33
+ left: PropTypes.array,
34
+ right: PropTypes.array,
35
+ className: PropTypes.string,
36
+ };
37
+
38
+ export default Line;
@@ -0,0 +1,20 @@
1
+ @import "../../styles/colors";
2
+ @import "../../styles/layout";
3
+
4
+ .cweb-list-item {
5
+ @include flexbox-horizontal(center);
6
+ padding: 16px 0 16px 0;
7
+ border-bottom: 1px solid $color-divider;
8
+
9
+ &:last-child {
10
+ border-bottom: none;
11
+ }
12
+
13
+ &.cweb-list-item-clickable {
14
+ cursor: pointer;
15
+ }
16
+
17
+ &.cweb-list-item-clickable:hover {
18
+ background-color: $color-pale-grey;
19
+ }
20
+ }
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+
4
+ import "./ListItem.scss";
5
+
6
+ export interface ListItemProps {
7
+ className?: string;
8
+ onClick?: any; // func
9
+ children?: any;
10
+ }
11
+
12
+ export const ListItem: React.FC<ListItemProps> = (props) => {
13
+ const { children, className, onClick, ...rest } = props;
14
+
15
+ const classes = classNames("cweb-list-item", className, {
16
+ "cweb-list-item-clickable": !!onClick,
17
+ });
18
+
19
+ return (
20
+ <div className={classes} onClick={onClick} {...rest}>
21
+ {children}
22
+ </div>
23
+ );
24
+ };
25
+
26
+ export default ListItem;
@@ -0,0 +1,157 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import classNames from "classnames";
3
+
4
+ import { TextProps, Text } from "../Text/Text";
5
+ import PaginationMenu from "../PaginationMenu/PaginationMenu";
6
+ import LoadingIndicator from "../LoadingIndicator/LoadingIndicator";
7
+ import SearchNotFoundImage from "../../assets/search-not-found.svg";
8
+ import { RestPropped } from "../../types/general.types";
9
+
10
+ import ListTableRow from "./ListTableRow";
11
+ import { ListTableHeader } from "./ListTableHeader";
12
+
13
+ export type ListTableItem = RestPropped;
14
+
15
+ export interface ListTableProps<ItemType extends ListTableItem, CellType> extends RestPropped {
16
+ items?: ItemType[];
17
+ configuration: ListTablePropsConfiguration<ItemType, CellType>;
18
+ pageCount?: number;
19
+ currentPage?: number;
20
+ onRowClick?: (arg: ItemType) => void;
21
+ onPageClick?: (arg: number) => void;
22
+ isLoading?: boolean;
23
+ showHeader?: boolean;
24
+ className?: string;
25
+ localization: {page: string, next :string, previous: string};
26
+ }
27
+
28
+ export interface ListTablePropsConfiguration<ItemType extends ListTableItem, CellType> {
29
+ // this value is used if the field function is returning nothing
30
+ emptyValue?: string;
31
+ fields: ListTablePropsConfigurationField<ItemType, CellType>[];
32
+ idField: keyof ItemType;
33
+ emptyListText: string;
34
+ }
35
+
36
+ export interface ListTablePropsConfigurationField<ItemType extends ListTableItem, CellType> {
37
+ // this is used as a key and is expected to be unique. It doesn't do anything else other than guiding the developer
38
+ name: string;
39
+ // this sets the column title in the header
40
+ title?: string;
41
+ className?: string;
42
+ // this function can return any item that will be displayed directly in the table cell
43
+ // if this function returns a string, it will be wrapped in Text
44
+ field: (arg: ItemType) => string | CellType;
45
+ // if field results in a string, then these props will be spread into the Text component
46
+ textProps?: Omit<TextProps, "text">;
47
+ }
48
+
49
+ export function ListTable<ItemType extends ListTableItem, CellType>({
50
+ items = [],
51
+ configuration,
52
+ pageCount = 0,
53
+ currentPage = 1,
54
+ onPageClick,
55
+ onRowClick,
56
+ isLoading = false,
57
+ showHeader = true,
58
+ className,
59
+ localization,
60
+ ...restProps
61
+ }: ListTableProps<ItemType, CellType>): JSX.Element {
62
+ // For not displaying empty view at creation
63
+ const [isPristine, setIsPristine] = useState(true);
64
+
65
+ useEffect(() => {
66
+ setIsPristine(false);
67
+ }, [items, isLoading]);
68
+
69
+ const showEmptyView = !isPristine && !isLoading && !(items && items.length > 0);
70
+
71
+ return (
72
+ <div
73
+ className={classNames(
74
+ "cweb-list-table",
75
+ "relative w-full max-w-full rounded-lg overflow-hidden bg-white",
76
+ className
77
+ )}
78
+ {...restProps}
79
+ >
80
+ <table className="w-full border-collapse cweb-list-table-table">
81
+ {showHeader && <ListTableHeader configurationFields={configuration.fields} />}
82
+
83
+ <tbody>
84
+ {!isLoading &&
85
+ items &&
86
+ items.map((item) => (
87
+ <ListTableRow
88
+ key={item[configuration.idField]}
89
+ onClick={onRowClick}
90
+ item={item}
91
+ configuration={configuration}
92
+ />
93
+ ))}
94
+
95
+ {isLoading && (
96
+ <tr>
97
+ <td colSpan={configuration.fields.length}>
98
+ <LoadingIndicator
99
+ className={classNames(
100
+ "cweb-list-table-content-loader",
101
+ "relative h-16",
102
+ "flex justify-center flex-row items-center",
103
+ "py-0 px-3"
104
+ )}
105
+ asModal={false}
106
+ />
107
+ </td>
108
+ </tr>
109
+ )}
110
+
111
+ {showEmptyView && (
112
+ <tr>
113
+ <td colSpan={configuration.fields.length}>
114
+ <div
115
+ className={classNames(
116
+ "cweb-list-table-no-items",
117
+ "flex justify-center flex-col items-center",
118
+ "py-4 px-3"
119
+ )}
120
+ >
121
+ <img className="mb-4 no-item-found-image" src={SearchNotFoundImage} alt="no-image-found" />
122
+ <Text
123
+ className={classNames(
124
+ "no-item-found-text",
125
+ "w-56 text-base text-gray-600 text-center whitespace-pre-wrap"
126
+ )}
127
+ text={configuration.emptyListText}
128
+ />
129
+ </div>
130
+ </td>
131
+ </tr>
132
+ )}
133
+ </tbody>
134
+
135
+ {!showEmptyView && pageCount > 0 && onPageClick && (
136
+ <tfoot>
137
+ <tr>
138
+ <td colSpan={configuration.fields.length}>
139
+ <div
140
+ className={classNames(
141
+ "cweb-list-table-footer",
142
+ "flex justify-center flex-row items-center",
143
+ "h-20 py-4 px-4"
144
+ )}
145
+ >
146
+ <PaginationMenu onPageClick={onPageClick} pageCount={pageCount} currentPage={currentPage} localization={localization}/>
147
+ </div>
148
+ </td>
149
+ </tr>
150
+ </tfoot>
151
+ )}
152
+ </table>
153
+ </div>
154
+ );
155
+ }
156
+
157
+ export default ListTable;