@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,96 @@
1
+ import React, { Component } from "react";
2
+ import ReactDatePicker from "react-datepicker";
3
+ import PropTypes from "prop-types";
4
+ import classNames from "classnames";
5
+ import moment from "moment";
6
+
7
+ import Button from "../Button/Button";
8
+
9
+ import "react-datepicker/dist/react-datepicker.css";
10
+ import "./Datepicker.scss";
11
+
12
+ export default class Datepicker extends Component {
13
+ handleCloseButtonClick = (event) => {
14
+ event.preventDefault();
15
+
16
+ this.datepickerRef.setOpen(false);
17
+ };
18
+
19
+ getDateFormat = () => {
20
+ const { showTimeSelect, formatDateWithTime = false } = this.props;
21
+
22
+ return showTimeSelect || formatDateWithTime ? "L LT" : "L";
23
+ };
24
+
25
+ render() {
26
+ const {
27
+ className,
28
+ hasCloseButton,
29
+ closeButtonText,
30
+ adjustDateOnChange = true,
31
+ showMonthDropdown = true,
32
+ showYearDropdown = true,
33
+ shouldCloseOnSelect = false,
34
+ allowSameDay = false,
35
+ minDate,
36
+ maxDate,
37
+ isDisabled = false,
38
+ selected,
39
+ ...otherProps
40
+ } = this.props;
41
+
42
+ const dateFormat = this.getDateFormat();
43
+ const pickerClassName = classNames("cweb-datepicker text-slate-700 text-sm", className);
44
+ const getCloseButtonText = () => {
45
+ if (!closeButtonText) {
46
+ return "OK";
47
+ }
48
+ return closeButtonText;
49
+ };
50
+
51
+ return (
52
+ <ReactDatePicker
53
+ {...otherProps}
54
+ adjustDateOnChange={adjustDateOnChange}
55
+ ref={(element) => (this.datepickerRef = element)}
56
+ className={pickerClassName}
57
+ calendarClassName="cweb-datepicker-calendar"
58
+ shouldCloseOnSelect={shouldCloseOnSelect}
59
+ allowSameDay={allowSameDay}
60
+ closeButtonText
61
+ minDate={minDate}
62
+ maxDate={maxDate}
63
+ disabled={isDisabled}
64
+ showMonthDropdown={showMonthDropdown}
65
+ showYearDropdown={showYearDropdown}
66
+ dateFormat={dateFormat}
67
+ timeFormat="HH:mm"
68
+ selected={selected}
69
+ dropdownMode="select"
70
+ >
71
+ <div className="m-2">
72
+ {hasCloseButton ? (
73
+ <Button
74
+ text={getCloseButtonText()}
75
+ className="w-full cweb-datepicker-close-button"
76
+ onClick={this.handleCloseButtonClick}
77
+ />
78
+ ) : null}
79
+ </div>
80
+ </ReactDatePicker>
81
+ );
82
+ }
83
+ }
84
+
85
+ Datepicker.propTypes = {
86
+ className: PropTypes.string,
87
+ selected: PropTypes.object,
88
+ hasCloseButton: PropTypes.bool,
89
+ closeButtonText: PropTypes.string,
90
+ onChange: PropTypes.func.isRequired,
91
+ showMonthDropdown: PropTypes.bool,
92
+ showYearDropdown: PropTypes.bool,
93
+ minDate: PropTypes.instanceOf(moment),
94
+ maxDate: PropTypes.instanceOf(moment),
95
+ isDisabled: PropTypes.bool,
96
+ };
@@ -0,0 +1,331 @@
1
+ @import "../../styles/colors";
2
+ @import "../../styles/typography";
3
+ @import "../../styles/layout";
4
+ @import "../../styles/utils";
5
+
6
+ .cweb-datepicker {
7
+ width: 182px;
8
+ height: $default-height;
9
+ border: 1px solid $color-border;
10
+ border-radius: $default-border-radius;
11
+ background-color: $color-white;
12
+ outline: none;
13
+ padding: 12px 12px 11px 12px;
14
+
15
+ input.cweb-datepicker {
16
+ font-size: 14px;
17
+ }
18
+
19
+ &::placeholder {
20
+ color: $color-placeholder;
21
+ }
22
+
23
+ &:-ms-input-placeholder {
24
+ color: $color-placeholder !important;
25
+ }
26
+
27
+ &::-ms-input-placeholder {
28
+ color: $color-placeholder;
29
+ }
30
+ }
31
+
32
+ .react-datepicker-popper {
33
+ z-index: 5;
34
+
35
+ &[data-placement^="bottom"] {
36
+ margin-top: 4px;
37
+
38
+ .react-datepicker__triangle {
39
+ border-bottom-color: $color-white;
40
+ margin-top: -4px;
41
+ }
42
+ }
43
+
44
+ &[data-placement^="top"] {
45
+ margin-bottom: 4px;
46
+
47
+ .react-datepicker__triangle {
48
+ border-top-color: $color-white;
49
+ margin-bottom: -4px;
50
+ }
51
+ }
52
+ }
53
+
54
+ .cweb-datepicker-calendar {
55
+ @include cweb-box-shadow(0, 4px, 8px, rgba(0, 0, 0, 0.2));
56
+
57
+ $header-navigation-height: 19px;
58
+
59
+ padding: 0;
60
+ border: 1px solid $color-border;
61
+ display: flex;
62
+ flex-direction: column;
63
+ justify-content: flex-start;
64
+ align-items: center;
65
+
66
+ .react-datepicker__triangle {
67
+ left: 10px;
68
+ border: 6px solid transparent;
69
+ }
70
+
71
+ .react-datepicker__navigation {
72
+ top: $header-navigation-height;
73
+ width: $header-navigation-height;
74
+ height: 10px;
75
+ background: url("../../assets/icons/arrow-down-icon.svg") no-repeat center;
76
+
77
+ &.react-datepicker__navigation--previous {
78
+ border: 0;
79
+ transform: rotate(90deg);
80
+ }
81
+
82
+ &.react-datepicker__navigation--next {
83
+ border: 0;
84
+ transform: rotate(-90deg);
85
+ }
86
+ }
87
+
88
+ .react-datepicker__time-container {
89
+ .react-datepicker__time-box {
90
+ width: auto;
91
+ }
92
+
93
+ .react-datepicker__time-list {
94
+ overflow-x: hidden;
95
+ }
96
+
97
+ .react-datepicker__time-list-item {
98
+ @include text(14px, $header-navigation-height, $color-slate-700);
99
+ @include flexbox-horizontal(center, center);
100
+
101
+ height: 40px !important;
102
+ padding: 0 !important;
103
+
104
+ &.react-datepicker__time-list-item--selected {
105
+ color: $color-white;
106
+ background-color: $color-primary !important;
107
+ position: relative;
108
+
109
+ &:hover {
110
+ background-color: $color-primary-emphasis !important;
111
+ }
112
+
113
+ &:before {
114
+ $triangle-width: 6px;
115
+
116
+ content: "";
117
+ position: absolute;
118
+ bottom: -($triangle-width / 2);
119
+ right: 0;
120
+ left: initial;
121
+ top: initial;
122
+ border-style: solid;
123
+ border-width: $triangle-width $triangle-width $triangle-width 0;
124
+ border-color: transparent $color-white transparent transparent;
125
+ transform: rotate(-135deg);
126
+ }
127
+ }
128
+ }
129
+ }
130
+
131
+ .react-datepicker__header {
132
+ padding-top: 0;
133
+ border: none;
134
+ background-color: $color-white;
135
+ font-size: 14px;
136
+
137
+ .react-datepicker__current-month {
138
+ @include text(14px, $header-navigation-height, $color-body, 600);
139
+ @include vertical-padding(16px);
140
+
141
+ text-transform: capitalize;
142
+ }
143
+
144
+ .react-datepicker__header__dropdown {
145
+ margin-bottom: 15px;
146
+ }
147
+
148
+ .react-datepicker__month-select,
149
+ .react-datepicker__year-select {
150
+ @include text(14px, $header-navigation-height, $color-slate-700);
151
+
152
+ height: $default-height;
153
+ padding-left: 12px;
154
+ border-radius: 4px;
155
+ background: $color-white url("../../assets/icons/chevron-double.svg") no-repeat right 8px center;
156
+ text-transform: capitalize;
157
+ -webkit-appearance: none;
158
+ -moz-appearance: none;
159
+ border: 1px solid $color-border;
160
+ transition: all 0.4s ease;
161
+
162
+ &:hover,
163
+ &:focus {
164
+ color: $color-primary;
165
+ border-color: $color-primary;
166
+ cursor: pointer;
167
+ }
168
+ }
169
+
170
+ .react-datepicker__month-select {
171
+ min-width: 172px;
172
+ }
173
+
174
+ .react-datepicker__year-select {
175
+ min-width: 107px;
176
+ }
177
+
178
+ &.react-datepicker__header--time {
179
+ @include flexbox-horizontal(center, center);
180
+
181
+ height: 52px;
182
+ padding: 0;
183
+ background-color: $color-chrome;
184
+ }
185
+ }
186
+
187
+ .react-datepicker__day-names,
188
+ .react-datepicker__month {
189
+ margin: 0.4rem;
190
+ }
191
+
192
+ .react-datepicker__month {
193
+ padding-bottom: 8px;
194
+ }
195
+
196
+ .react-datepicker__day-names,
197
+ .react-datepicker__week {
198
+ display: flex;
199
+ justify-content: center;
200
+ align-items: center;
201
+ }
202
+
203
+ .react-datepicker__day-name,
204
+ .react-datepicker__day {
205
+ @include text(14px, $header-navigation-height, $color-slate-700);
206
+
207
+ width: 41px;
208
+ display: flex;
209
+ justify-content: center;
210
+ align-items: center;
211
+ }
212
+
213
+ .react-datepicker__day-name {
214
+ height: 19px;
215
+ text-transform: capitalize;
216
+ }
217
+
218
+ .react-datepicker__day {
219
+ height: 30px;
220
+ border-radius: 4px;
221
+ transition: background-color 0.3s ease-in-out;
222
+
223
+ &.react-datepicker__day--highlighted {
224
+ background-color: $color-white;
225
+ color: $color-primary;
226
+ position: relative;
227
+
228
+ &:after {
229
+ content: "";
230
+ position: absolute;
231
+ width: 4px;
232
+ height: 4px;
233
+ border-radius: 50%;
234
+ background-color: $color-primary;
235
+ left: 0;
236
+ right: 0;
237
+ bottom: 2px;
238
+ margin: 0 auto;
239
+ }
240
+
241
+ &.react-datepicker__day--selected,
242
+ &.react-datepicker__day--keyboard-selected,
243
+ &.react-datepicker__day--in-range {
244
+ &:after {
245
+ background-color: $color-white;
246
+ }
247
+ }
248
+ }
249
+
250
+ &.react-datepicker__day--today {
251
+ font-weight: bold;
252
+ }
253
+
254
+ &.react-datepicker__day--in-selecting-range {
255
+ background-color: $color-emphasis-background;
256
+ }
257
+
258
+ &:hover {
259
+ background-color: $color-slate-50;
260
+ }
261
+
262
+ &.react-datepicker__day--in-range,
263
+ &.react-datepicker__day--selected {
264
+ color: $color-white;
265
+ background-color: $color-primary;
266
+
267
+ &:hover {
268
+ background-color: $color-primary-emphasis;
269
+ }
270
+ }
271
+
272
+ &.react-datepicker__day--keyboard-selected {
273
+ color: $color-white;
274
+ background-color: $color-primary-emphasis;
275
+ }
276
+
277
+ &.react-datepicker__day--selected {
278
+ position: relative;
279
+ }
280
+
281
+ &.react-datepicker__day--range-start {
282
+ position: relative;
283
+
284
+ &:before {
285
+ $triangle-width: 6px;
286
+
287
+ content: "";
288
+ position: absolute;
289
+ top: -($triangle-width / 2);
290
+ left: 0;
291
+ bottom: initial;
292
+ right: initial;
293
+ border-style: solid;
294
+ border-width: $triangle-width $triangle-width $triangle-width 0;
295
+ border-color: transparent $color-white transparent transparent;
296
+ transform: rotate(45deg);
297
+ }
298
+ }
299
+
300
+ &.react-datepicker__day--range-end {
301
+ position: relative;
302
+
303
+ &:before {
304
+ $triangle-width: 6px;
305
+
306
+ content: "";
307
+ position: absolute;
308
+ bottom: -($triangle-width / 2);
309
+ right: 0;
310
+ left: initial;
311
+ top: initial;
312
+ border-style: solid;
313
+ border-width: $triangle-width $triangle-width $triangle-width 0;
314
+ border-color: transparent $color-white transparent transparent;
315
+ transform: rotate(-135deg);
316
+ }
317
+ }
318
+
319
+ &.react-datepicker__day--disabled {
320
+ color: $color-border;
321
+
322
+ &:hover {
323
+ background-color: $color-white;
324
+ }
325
+ }
326
+
327
+ &.react-datepicker__day--outside-month {
328
+ color: $color-border;
329
+ }
330
+ }
331
+ }