@luscii-healthtech/web-ui 2.9.0 → 2.10.2

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 (287) hide show
  1. package/dist/components/Avatar/Avatar.d.ts +11 -11
  2. package/dist/components/CenteredHero/CenteredHero.d.ts +1 -1
  3. package/dist/components/Container/types/FlexContainerProps.type.d.ts +3 -2
  4. package/dist/components/Datepicker/Datepicker.d.ts +12 -11
  5. package/dist/components/Dropdown/Dropdown.d.ts +17 -7
  6. package/dist/components/ErrorBlock/ErrorBlock.d.ts +3 -3
  7. package/dist/components/Form/form.transformer.d.ts +3 -20
  8. package/dist/components/Form/form.types.d.ts +5 -5
  9. package/dist/components/InfoBlock/InfoBlock.d.ts +4 -4
  10. package/dist/components/Input/SearchInput.d.ts +1 -1
  11. package/dist/components/Line/Line.d.ts +4 -4
  12. package/dist/components/Menu/Menu.d.ts +6 -0
  13. package/dist/components/MultiSelect/MultiSelect.d.ts +7 -7
  14. package/dist/components/Page/CRUDPage.d.ts +13 -13
  15. package/dist/components/Page/Page.d.ts +13 -13
  16. package/dist/components/PaginationMenu/PaginationMenu.utils.d.ts +1 -1
  17. package/dist/components/Radio/Radio.d.ts +5 -1
  18. package/dist/components/RadioGroup/RadioGroup.d.ts +9 -10
  19. package/dist/components/Select/LegacySelect.d.ts +8 -9
  20. package/dist/components/Select/SelectV2.d.ts +1 -1
  21. package/dist/components/Switcher/Switcher.d.ts +6 -6
  22. package/dist/components/Switcher/SwitcherItem.d.ts +7 -7
  23. package/dist/components/Text/LegacyText.d.ts +18 -18
  24. package/dist/components/TextEditor/TextEditor.d.ts +4 -4
  25. package/dist/components/Textarea/Textarea.d.ts +16 -16
  26. package/dist/components/Title/LegacyTitle.d.ts +10 -10
  27. package/dist/web-ui-tailwind.css +8 -0
  28. package/dist/web-ui.cjs.development.js +81 -74
  29. package/dist/web-ui.cjs.development.js.map +1 -1
  30. package/dist/web-ui.cjs.production.min.js +1 -1
  31. package/dist/web-ui.cjs.production.min.js.map +1 -1
  32. package/dist/web-ui.esm.js +81 -74
  33. package/dist/web-ui.esm.js.map +1 -1
  34. package/package.json +7 -3
  35. package/src/assets/add.svg +0 -5
  36. package/src/assets/add_hover.svg +0 -4
  37. package/src/assets/arrow-down-icon.svg +0 -3
  38. package/src/assets/big-menu-icon-hover.svg +0 -6
  39. package/src/assets/big-menu-icon.svg +0 -6
  40. package/src/assets/check-cross-icon.svg +0 -7
  41. package/src/assets/check-icon-primary.svg +0 -5
  42. package/src/assets/check-icon.svg +0 -3
  43. package/src/assets/chevron-double.svg +0 -3
  44. package/src/assets/close.svg +0 -3
  45. package/src/assets/color-variant-cross.svg +0 -3
  46. package/src/assets/cross-dark.svg +0 -3
  47. package/src/assets/delete.svg +0 -4
  48. package/src/assets/delete_hover.svg +0 -4
  49. package/src/assets/edit.svg +0 -6
  50. package/src/assets/edit_hover.svg +0 -6
  51. package/src/assets/error-icon.svg +0 -7
  52. package/src/assets/grid-view-icon-active.svg +0 -6
  53. package/src/assets/grid-view-icon.svg +0 -6
  54. package/src/assets/groups.svg +0 -3
  55. package/src/assets/hamburger.svg +0 -5
  56. package/src/assets/happy-star.svg +0 -9
  57. package/src/assets/hcps.svg +0 -3
  58. package/src/assets/indeterminate-icon.svg +0 -3
  59. package/src/assets/info-icon.svg +0 -6
  60. package/src/assets/left-arrow-blue.svg +0 -3
  61. package/src/assets/left-arrow-grey.svg +0 -3
  62. package/src/assets/list-view-icon-active.svg +0 -3
  63. package/src/assets/list-view-icon.svg +0 -3
  64. package/src/assets/loading.svg +0 -16
  65. package/src/assets/modal-close-icon-active.svg +0 -9
  66. package/src/assets/modal-close-icon.svg +0 -9
  67. package/src/assets/no-open-alerts.svg +0 -19
  68. package/src/assets/patients.svg +0 -3
  69. package/src/assets/phone-mockup.svg +0 -9
  70. package/src/assets/programs.svg +0 -3
  71. package/src/assets/right-arrow-blue.svg +0 -3
  72. package/src/assets/right-arrow-grey.svg +0 -3
  73. package/src/assets/search-cancel.svg +0 -3
  74. package/src/assets/search-not-found.svg +0 -70
  75. package/src/assets/search.svg +0 -3
  76. package/src/assets/spinner-gray.svg +0 -6
  77. package/src/assets/spinner.svg +0 -5
  78. package/src/assets/starIcon.svg +0 -3
  79. package/src/assets/success-icon.svg +0 -6
  80. package/src/components/Accordion/Accordion.tsx +0 -33
  81. package/src/components/Accordion/AccordionItem.tsx +0 -50
  82. package/src/components/Avatar/Avatar.js +0 -81
  83. package/src/components/Avatar/Avatar.scss +0 -153
  84. package/src/components/Badge/Badge.tsx +0 -23
  85. package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -46
  86. package/src/components/Button/Button.examples.md +0 -46
  87. package/src/components/Button/Button.tsx +0 -200
  88. package/src/components/Button/Button.types.ts +0 -41
  89. package/src/components/Button/ButtonIcon.tsx +0 -42
  90. package/src/components/ButtonV2/ButtonProps.type.ts +0 -44
  91. package/src/components/ButtonV2/ButtonV2.tsx +0 -97
  92. package/src/components/ButtonV2/PrimaryButton.tsx +0 -25
  93. package/src/components/ButtonV2/SecondaryButton.tsx +0 -26
  94. package/src/components/ButtonV2/TertiaryButton.tsx +0 -26
  95. package/src/components/Carousel/Carousel.tsx +0 -52
  96. package/src/components/Carousel/GliderContainer.scss +0 -13
  97. package/src/components/Carousel/GliderContainer.tsx +0 -22
  98. package/src/components/CenteredHero/CenteredHero.tsx +0 -63
  99. package/src/components/CheckBoxListModal/CheckboxListModal.tsx +0 -180
  100. package/src/components/Checkbox/Checkbox.scss +0 -125
  101. package/src/components/Checkbox/Checkbox.tsx +0 -147
  102. package/src/components/CheckboxList/CheckboxGroup.tsx +0 -120
  103. package/src/components/CheckboxList/CheckboxList.tsx +0 -46
  104. package/src/components/CheckboxList/CheckboxList.types.ts +0 -47
  105. package/src/components/CheckboxList/CheckboxListItem.tsx +0 -54
  106. package/src/components/ConfirmationDialog/ConfirmationDialog.scss +0 -15
  107. package/src/components/ConfirmationDialog/ConfirmationDialog.tsx +0 -84
  108. package/src/components/Container/FlexColumn.tsx +0 -18
  109. package/src/components/Container/FlexContainer.tsx +0 -46
  110. package/src/components/Container/FlexRow.tsx +0 -18
  111. package/src/components/Container/types/FlexContainerProps.type.ts +0 -18
  112. package/src/components/Datepicker/Datepicker.js +0 -96
  113. package/src/components/Datepicker/Datepicker.scss +0 -332
  114. package/src/components/Dropdown/Dropdown.js +0 -416
  115. package/src/components/Dropdown/Dropdown.scss +0 -83
  116. package/src/components/EmptyListMessage/EmptyListMessage.tsx +0 -34
  117. package/src/components/ErrorBlock/ErrorBlock.js +0 -24
  118. package/src/components/ErrorBlock/ErrorBlock.scss +0 -20
  119. package/src/components/Form/Form.tsx +0 -138
  120. package/src/components/Form/FormFieldDecorator.tsx +0 -66
  121. package/src/components/Form/FormInput.tsx +0 -47
  122. package/src/components/Form/FormRadioGroup.tsx +0 -23
  123. package/src/components/Form/FormSelect.tsx +0 -32
  124. package/src/components/Form/form.transformer.ts +0 -9
  125. package/src/components/Form/form.types.ts +0 -139
  126. package/src/components/Icons/AddIcon.tsx +0 -29
  127. package/src/components/Icons/AlertsIcon.tsx +0 -39
  128. package/src/components/Icons/BellIcon.tsx +0 -39
  129. package/src/components/Icons/ChartIcon.tsx +0 -22
  130. package/src/components/Icons/ChatBoxIcon.tsx +0 -23
  131. package/src/components/Icons/CheckIcon.tsx +0 -26
  132. package/src/components/Icons/ChevronDoubleIcon.tsx +0 -25
  133. package/src/components/Icons/ChevronDownIcon.tsx +0 -20
  134. package/src/components/Icons/ChevronRightIcon.tsx +0 -20
  135. package/src/components/Icons/CrossIcon.tsx +0 -24
  136. package/src/components/Icons/DeleteIcon.tsx +0 -23
  137. package/src/components/Icons/DownArrowIcon.tsx +0 -23
  138. package/src/components/Icons/DragIcon.tsx +0 -25
  139. package/src/components/Icons/DynamicIcon.tsx +0 -25
  140. package/src/components/Icons/EditIcon.tsx +0 -23
  141. package/src/components/Icons/EmptyIcon.tsx +0 -29
  142. package/src/components/Icons/EmptyStateDashboardIcon.tsx +0 -130
  143. package/src/components/Icons/ExclamationMarkIcon.tsx +0 -23
  144. package/src/components/Icons/EyeIcon.tsx +0 -23
  145. package/src/components/Icons/GearIcon.tsx +0 -23
  146. package/src/components/Icons/GroupIcon.tsx +0 -23
  147. package/src/components/Icons/HamburgerIcon.tsx +0 -31
  148. package/src/components/Icons/HeartIcon.tsx +0 -23
  149. package/src/components/Icons/ImageIcon.tsx +0 -23
  150. package/src/components/Icons/LeftArrowIcon.tsx +0 -23
  151. package/src/components/Icons/LightBulbIcon.tsx +0 -31
  152. package/src/components/Icons/LockIcon.tsx +0 -23
  153. package/src/components/Icons/MessagesIcon.tsx +0 -23
  154. package/src/components/Icons/NotesIcon.tsx +0 -23
  155. package/src/components/Icons/PinIcon.tsx +0 -23
  156. package/src/components/Icons/PrintIcon.tsx +0 -22
  157. package/src/components/Icons/RightArrowIcon.tsx +0 -23
  158. package/src/components/Icons/SearchCancelIcon.tsx +0 -23
  159. package/src/components/Icons/SearchIcon.tsx +0 -23
  160. package/src/components/Icons/SmallCircleIcon.tsx +0 -21
  161. package/src/components/Icons/SmallDiamondIcon.tsx +0 -31
  162. package/src/components/Icons/SmallSquareIcon.tsx +0 -21
  163. package/src/components/Icons/SpaceRocketIcon.tsx +0 -23
  164. package/src/components/Icons/StarIcon.tsx +0 -23
  165. package/src/components/Icons/WarningIcon.tsx +0 -24
  166. package/src/components/Icons/types/IconProps.type.ts +0 -5
  167. package/src/components/InfoBlock/InfoBlock.js +0 -24
  168. package/src/components/InfoBlock/InfoBlock.scss +0 -20
  169. package/src/components/InfoField/InfoField.tsx +0 -94
  170. package/src/components/Input/Input.css +0 -3
  171. package/src/components/Input/Input.tsx +0 -211
  172. package/src/components/Input/SearchInput.tsx +0 -24
  173. package/src/components/Line/Line.js +0 -38
  174. package/src/components/List/List.scss +0 -23
  175. package/src/components/List/List.tsx +0 -138
  176. package/src/components/List/List.types.ts +0 -41
  177. package/src/components/List/ListItem.tsx +0 -89
  178. package/src/components/List/ListItemSkeleton.tsx +0 -26
  179. package/src/components/List/ListSkeleton.scss +0 -5
  180. package/src/components/List/ListSkeleton.tsx +0 -30
  181. package/src/components/LoadingIndicator/LoadingIndicator.scss +0 -50
  182. package/src/components/LoadingIndicator/LoadingIndicator.tsx +0 -46
  183. package/src/components/Menu/Menu.js +0 -74
  184. package/src/components/Menu/Menu.scss +0 -27
  185. package/src/components/Modal/Modal.scss +0 -117
  186. package/src/components/Modal/Modal.tsx +0 -104
  187. package/src/components/Modal/ModalWithButtons.tsx +0 -34
  188. package/src/components/MultiSelect/MultiSelect.js +0 -117
  189. package/src/components/MultiSelect/MultiSelect.scss +0 -29
  190. package/src/components/MultiSelect/MultiSelectUtils.js +0 -23
  191. package/src/components/NavMenu/NavLayout.tsx +0 -40
  192. package/src/components/NavMenu/NavMenu.tsx +0 -39
  193. package/src/components/NavMenu/NavMenu.utils.ts +0 -6
  194. package/src/components/NavMenu/NavMenuContent.tsx +0 -23
  195. package/src/components/NavMenu/NavMenuItem.tsx +0 -102
  196. package/src/components/NotificationBanner/NotificationBanner.tsx +0 -104
  197. package/src/components/Page/CRUDPage.js +0 -123
  198. package/src/components/Page/CRUDPage.scss +0 -32
  199. package/src/components/Page/Page.js +0 -102
  200. package/src/components/Page/Page.scss +0 -59
  201. package/src/components/PageHeader/PageHeader.tsx +0 -51
  202. package/src/components/PaginationMenu/PaginationMenu.tsx +0 -47
  203. package/src/components/PaginationMenu/PaginationMenu.types.ts +0 -46
  204. package/src/components/PaginationMenu/PaginationMenu.utils.ts +0 -49
  205. package/src/components/PaginationMenu/PaginationMenuLarge.tsx +0 -96
  206. package/src/components/PaginationMenu/PaginationMenuSmall.tsx +0 -43
  207. package/src/components/PreviewPhone/PreviewPhone.tsx +0 -52
  208. package/src/components/PreviewPhone/useWindowDimensions.js +0 -26
  209. package/src/components/Radio/Radio.js +0 -102
  210. package/src/components/Radio/Radio.scss +0 -58
  211. package/src/components/Radio/RadioV2.css +0 -15
  212. package/src/components/Radio/RadioV2.tsx +0 -87
  213. package/src/components/RadioGroup/RadioGroup.js +0 -66
  214. package/src/components/RadioGroup/RadioGroup.scss +0 -37
  215. package/src/components/RadioGroup/RadioGroupV2.tsx +0 -35
  216. package/src/components/Section/Section.scss +0 -74
  217. package/src/components/Section/Section.tsx +0 -68
  218. package/src/components/Section/SectionItem.scss +0 -20
  219. package/src/components/Section/SectionItem.tsx +0 -26
  220. package/src/components/Section/SectionItemWithContent.tsx +0 -30
  221. package/src/components/Select/LegacySelect.js +0 -114
  222. package/src/components/Select/Select.scss +0 -29
  223. package/src/components/Select/Select.tsx +0 -151
  224. package/src/components/Select/SelectV2.tsx +0 -171
  225. package/src/components/Select/options.transformer.ts +0 -36
  226. package/src/components/Select/select.utils.spec.ts +0 -63
  227. package/src/components/Select/select.utils.ts +0 -45
  228. package/src/components/SettingsMenuButton/SettingsMenuButton.tsx +0 -111
  229. package/src/components/Spinner/Spinner.tsx +0 -23
  230. package/src/components/Steps/Step.tsx +0 -31
  231. package/src/components/Steps/Steps.tsx +0 -24
  232. package/src/components/Switcher/Switcher.js +0 -58
  233. package/src/components/Switcher/SwitcherItem.js +0 -61
  234. package/src/components/Switcher/SwitcherItem.scss +0 -67
  235. package/src/components/TabLinks/TabLinks.tsx +0 -63
  236. package/src/components/Tabbar/Tabbar.tsx +0 -60
  237. package/src/components/Tabbar/TabbarItem.tsx +0 -66
  238. package/src/components/Table/Table.tsx +0 -91
  239. package/src/components/Table/Table.types.ts +0 -28
  240. package/src/components/Table/Table.utils.ts +0 -23
  241. package/src/components/Table/TableBody.tsx +0 -57
  242. package/src/components/Table/TableBodyRow.tsx +0 -47
  243. package/src/components/Table/TableBodyRowDataCell.tsx +0 -76
  244. package/src/components/Table/TableFooter.tsx +0 -21
  245. package/src/components/Table/TableHeader.tsx +0 -28
  246. package/src/components/Tag/Tag.tsx +0 -58
  247. package/src/components/Tag/Tag.utils.ts +0 -4
  248. package/src/components/Tag/TagGroup.tsx +0 -29
  249. package/src/components/Text/LegacyText.js +0 -78
  250. package/src/components/Text/Text.scss +0 -67
  251. package/src/components/Text/Text.tsx +0 -131
  252. package/src/components/TextEditor/TextEditor.js +0 -61
  253. package/src/components/TextEditor/TextEditor.scss +0 -14
  254. package/src/components/TextEditorV2/TextEditorV2.js +0 -52
  255. package/src/components/TextEditorV2/TextEditorV2.scss +0 -110
  256. package/src/components/TextLink/TextLink.tsx +0 -42
  257. package/src/components/Textarea/Textarea.js +0 -108
  258. package/src/components/Textarea/Textarea.scss +0 -56
  259. package/src/components/Timeline/Timeline.tsx +0 -28
  260. package/src/components/Timeline/TimelineStep.tsx +0 -36
  261. package/src/components/Title/LegacyTitle.js +0 -64
  262. package/src/components/Title/Title.scss +0 -6
  263. package/src/components/Title/Title.tsx +0 -62
  264. package/src/components/Toaster/Toaster.scss +0 -57
  265. package/src/components/Toaster/Toaster.tsx +0 -100
  266. package/src/components/Toaster/toast-elements-getter.ts +0 -72
  267. package/src/components/Toaster/toast-progress-animator.ts +0 -53
  268. package/src/components/Toaster/toast.ts +0 -112
  269. package/src/components/ViewItem/ViewItem.tsx +0 -85
  270. package/src/custom.d.ts +0 -4
  271. package/src/index.tsx +0 -170
  272. package/src/styles/_colors.scss +0 -59
  273. package/src/styles/_layout.scss +0 -64
  274. package/src/styles/_shadows.scss +0 -19
  275. package/src/styles/_skeleton.scss +0 -63
  276. package/src/styles/_typography.scss +0 -8
  277. package/src/styles/_utils.scss +0 -45
  278. package/src/styles/fonts/avenir/3A0AF8_0_0.eot +0 -0
  279. package/src/styles/fonts/avenir/3A0AF8_0_0.ttf +0 -0
  280. package/src/styles/fonts/avenir/3A0AF8_0_0.woff +0 -0
  281. package/src/styles/fonts/avenir/3A0AF8_0_0.woff2 +0 -0
  282. package/src/styles/fonts/avenir/3A0AF8_1_0.eot +0 -0
  283. package/src/styles/fonts/avenir/3A0AF8_1_0.ttf +0 -0
  284. package/src/styles/fonts/avenir/3A0AF8_1_0.woff +0 -0
  285. package/src/styles/fonts/avenir/3A0AF8_1_0.woff2 +0 -0
  286. package/src/types/general.types.ts +0 -11
  287. package/src/utils/useOutsideClick.js +0 -19
@@ -1,104 +0,0 @@
1
- import React from "react";
2
- import classNames from "classnames";
3
- import ReactModal from "react-modal";
4
-
5
- import "./Modal.scss";
6
- import { Title } from "../Title/Title";
7
-
8
- export const MODAL_SIZES = {
9
- DEFAULT: "default",
10
- WIDE: "wide",
11
- WIDER: "wider",
12
- EXTRA_SMALL: "extra-small",
13
- } as const;
14
-
15
- type MODAL_SIZES_NAMES = keyof typeof MODAL_SIZES;
16
- export type MODAL_SIZES_VALUES = typeof MODAL_SIZES[MODAL_SIZES_NAMES];
17
-
18
- export interface ModalProps {
19
- children: React.ReactNode;
20
- type?: MODAL_SIZES_VALUES;
21
- isOpen?: boolean;
22
- shouldCloseOnOverlayClick?: boolean;
23
- showTitleBar?: boolean;
24
- title?: string;
25
- onCloseClick?: (event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void;
26
- backAltText?: string;
27
- closeAltText?: string;
28
- className?: string;
29
- closeButtonId?: string;
30
- withPadding?: boolean;
31
- showHeader?: boolean;
32
- }
33
-
34
- /**
35
- * Don't use this modal directly if you need to add buttons to it.
36
- * There's a component called <ModalWithButtons /> you can use instead.
37
- */
38
- function Modal({
39
- children,
40
- type = MODAL_SIZES.DEFAULT,
41
- isOpen = false,
42
- shouldCloseOnOverlayClick = true,
43
- showTitleBar = true,
44
- title,
45
- onCloseClick,
46
- closeAltText = "Close",
47
- className,
48
- closeButtonId,
49
- withPadding = false,
50
- showHeader = true,
51
- }: ModalProps): JSX.Element {
52
- const containerClassName = classNames("cweb-modal", className, {
53
- "type-default": type === MODAL_SIZES.DEFAULT,
54
- "type-wide": type === MODAL_SIZES.WIDE,
55
- "type-wider": type === MODAL_SIZES.WIDER,
56
- "type-extra-small": type === MODAL_SIZES.EXTRA_SMALL,
57
- });
58
-
59
- const overlayClassName = classNames("cweb-modal-overlay", {
60
- "no-title-bar": !showTitleBar,
61
- });
62
-
63
- ReactModal.setAppElement("body");
64
-
65
- return (
66
- <ReactModal
67
- isOpen={isOpen}
68
- contentLabel={title}
69
- portalClassName="cweb-modal-portal"
70
- overlayClassName={overlayClassName}
71
- bodyOpenClassName="cweb-modal-body-open"
72
- htmlOpenClassName="cweb-modal-html-open"
73
- onRequestClose={onCloseClick}
74
- shouldFocusAfterRender={false}
75
- shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}
76
- className={containerClassName}
77
- >
78
- {showHeader && (
79
- <div
80
- className={classNames({
81
- "cweb-modal-title-section": showTitleBar,
82
- "cweb-modal-no-title-section": !showTitleBar,
83
- })}
84
- >
85
- {showTitleBar && title && <Title text={title} type="sm" className="cweb-modal-title" />}
86
- <button
87
- data-test-id="close-modal-button"
88
- role="icon"
89
- title={closeAltText}
90
- id={closeButtonId}
91
- className="cweb-modal-close-button"
92
- onClick={onCloseClick}
93
- />
94
- </div>
95
- )}
96
-
97
- {children ? (
98
- <div className={classNames("cweb-modal-content", { "px-6 py-4": withPadding })}>{children}</div>
99
- ) : null}
100
- </ReactModal>
101
- );
102
- }
103
-
104
- export default Modal;
@@ -1,34 +0,0 @@
1
- import classNames from "classnames";
2
- import React from "react";
3
-
4
- import Modal, { ModalProps } from "./Modal";
5
-
6
- export type ButtonsAlignment = "justify-end" | "justify-between";
7
-
8
- type ModalWithButtonProps = ModalProps & {
9
- buttons: [JSX.Element, JSX.Element?];
10
- buttonsAlignment: ButtonsAlignment;
11
- };
12
-
13
- export const ModalWithButtons = (props: ModalWithButtonProps): JSX.Element => {
14
- const { buttons, buttonsAlignment = "justify-between", children, ...rest } = props;
15
- return (
16
- <Modal {...rest} withPadding={false}>
17
- <div className={classNames("cweb-modal-content", { "px-6 py-4": props.withPadding })}>{children}</div>
18
- <div
19
- className={classNames(
20
- "flex items-center",
21
- {
22
- "justify-end": buttonsAlignment === "justify-end" || buttons.length === 1,
23
- "justify-between": buttonsAlignment === "justify-between" && buttons.length >= 2,
24
- },
25
- "px-6 py-4",
26
- "border-t border-solid rounded-b-lg border-chrome",
27
- "bg-slate-50"
28
- )}
29
- >
30
- {buttons}
31
- </div>
32
- </Modal>
33
- );
34
- };
@@ -1,117 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import Checkbox from "../Checkbox/Checkbox";
5
- import { TEXT_TYPE_OPTIONS } from "../Text/LegacyText";
6
-
7
- import { handleImplicitSelect } from "./MultiSelectUtils";
8
-
9
- import "./MultiSelect.scss";
10
-
11
- export function MultiSelect({
12
- checkboxList,
13
- radioLabel,
14
- onChange,
15
- validationError,
16
- name,
17
- implicitSelect,
18
- radioOnDemand,
19
- }) {
20
- const [list, setList] = useState(checkboxList);
21
-
22
- useEffect(() => {
23
- onChange({
24
- target: {
25
- name,
26
- value: list,
27
- },
28
- });
29
- }, [list]);
30
-
31
- function handleChange(event, indexSelected) {
32
- let newList = [...list];
33
-
34
- const isChecked = event.target.checked;
35
- const updateCheckbox = { ...list[indexSelected], isChecked: isChecked, isOn: false };
36
- newList.splice(indexSelected, 1, updateCheckbox);
37
-
38
- if (implicitSelect) {
39
- newList = handleImplicitSelect(implicitSelect, event, newList, "isChecked");
40
- }
41
- setList(newList);
42
- }
43
-
44
- function handleRadioChange(event, indexSelected) {
45
- let newList = [...list];
46
-
47
- const isChecked = event.target.checked;
48
- const updateCheckbox = { ...list[indexSelected], isOn: isChecked };
49
- newList.splice(indexSelected, 1, updateCheckbox);
50
-
51
- if (implicitSelect) {
52
- newList = handleImplicitSelect(implicitSelect, event, newList, "isOn");
53
- }
54
-
55
- setList(newList);
56
- }
57
-
58
- return (
59
- <ul>
60
- {list.map((checkbox, index) => {
61
- const text = [checkbox.name];
62
-
63
- if (checkbox.description && checkbox.description !== checkbox.name) {
64
- text.push(checkbox.description);
65
- }
66
-
67
- return (
68
- <div className="cweb-multiselect" key={checkbox.identifier}>
69
- <Checkbox
70
- text={text.join(" - ")}
71
- name={checkbox.identifier}
72
- isChecked={checkbox.isChecked || false}
73
- onChange={(event) => handleChange(event, index)}
74
- className="cweb-multiselect-checkbox"
75
- textType={TEXT_TYPE_OPTIONS.SMALL_DARK}
76
- error={validationError}
77
- key={checkbox.identifier}
78
- />
79
-
80
- {radioOnDemand && (
81
- <div className="cweb-switch-wrapper">
82
- <p className="cweb-switch-title">{radioLabel}</p>
83
- <Checkbox
84
- type="switch"
85
- name={`${checkbox.identifier}-toggle`}
86
- isChecked={checkbox.isOn}
87
- onChange={(event) => handleRadioChange(event, index)}
88
- textType={TEXT_TYPE_OPTIONS.SMALL_DARK}
89
- error={validationError}
90
- className="cweb-multiselect-switch"
91
- isDisabled={!checkbox.isChecked}
92
- key={checkbox.identifier}
93
- />
94
- </div>
95
- )}
96
- </div>
97
- );
98
- })}
99
- </ul>
100
- );
101
- }
102
-
103
- MultiSelect.propTypes = {
104
- name: PropTypes.string,
105
- checkboxList: PropTypes.arrayOf(
106
- PropTypes.shape({
107
- isChecked: PropTypes.bool,
108
- name: PropTypes.string.isRequired,
109
- description: PropTypes.string,
110
- identifier: PropTypes.string.isRequired,
111
- })
112
- ),
113
- onChange: PropTypes.func,
114
- validationError: PropTypes.string,
115
- implicitSelect: PropTypes.object,
116
- radioOnDemand: PropTypes.bool,
117
- };
@@ -1,29 +0,0 @@
1
- @import "../../styles/colors";
2
-
3
- .cweb-multiselect {
4
- display: flex;
5
- .cweb-multiselect-checkbox {
6
- margin-bottom: 0px;
7
- margin-top: 0.5rem;
8
- width: 100%;
9
- text-transform: capitalize;
10
- }
11
-
12
- .cweb-switch-wrapper {
13
- display: flex;
14
- .cweb-multiselect-switch {
15
- width: 50px;
16
- .cweb-checkbox.type-switch.is-checked {
17
- .cweb-checkbox-icon-container {
18
- background-color: $color-branding-support-1;
19
- }
20
- }
21
- }
22
- .cweb-switch-title {
23
- width: 100px;
24
- color: $color-text-lighter;
25
- font-size: 16px;
26
- line-height: 1.8em;
27
- }
28
- }
29
- }
@@ -1,23 +0,0 @@
1
- export function handleImplicitSelect(implicitSelected, event, list, property) {
2
- /*For certain values, if one checkbox is selected
3
- other checkboxes have to be selected/unselected automatically */
4
- const newList = [...list];
5
- const selectCheckboxName = event.target.name;
6
- const isChecked = event.target.checked;
7
- const implicitSelectedValues = implicitSelected[selectCheckboxName];
8
-
9
- if (implicitSelectedValues) {
10
- implicitSelectedValues.forEach((value) => {
11
- const selectedIndex = newList.findIndex((checkbox) => value === checkbox.identifier);
12
- let upadteCheckbox;
13
- if (property === "isChecked") {
14
- //if normal checkbox is false the switcher must be set to false as well
15
- upadteCheckbox = { ...newList[selectedIndex], isChecked: isChecked, isOn: false };
16
- } else {
17
- upadteCheckbox = { ...newList[selectedIndex], [property]: isChecked };
18
- }
19
- newList.splice(selectedIndex, 1, upadteCheckbox);
20
- });
21
- }
22
- return newList;
23
- }
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- import classNames from "classnames";
3
-
4
- export interface NavMenuLayoutProps {
5
- menu: JSX.Element;
6
- children: JSX.Element | JSX.Element[]; //rendered as the page
7
- patientSidebar?: JSX.Element; //if passed will show the patients sidebar
8
- isNavDisabled?: boolean; //don't show any navigation, for instance when constrained to a single patient
9
- disableScrolling?: boolean;
10
- }
11
-
12
- /**
13
- *
14
- * @param props {NavMenuLayoutProps} - explaining specifically the `disableScrolling` prop:
15
- *
16
- * The patient overview page has some challenges we want to overcome in regards to the multiple scrollable
17
- * content (the charts and the action bar with alerts, etc).
18
- *
19
- * In order to have the setup working on the patient overview page and the rest of the application, we have to
20
- * progamatically disable/enable if that location will have a normal scrolling mechanism with specific margin/padding,
21
- * or we will need to let the components take care of that.
22
- */
23
- export const NavLayout = (props: NavMenuLayoutProps): JSX.Element => {
24
- return (
25
- <div className={"flex flex-col mb-3 lg:mb-0 lg:flex-row h-full w-full"}>
26
- {!props.isNavDisabled && (
27
- <>
28
- {props.menu}
29
- {props.patientSidebar && props.patientSidebar}
30
- </>
31
- )}
32
- <div
33
- data-test-id="page-main-content"
34
- className={classNames(["w-full", { "max-h-screen overflow-y-auto px-4 lg:px-8": !props.disableScrolling }])}
35
- >
36
- {props.children}
37
- </div>
38
- </div>
39
- );
40
- };
@@ -1,39 +0,0 @@
1
- import * as React from "react";
2
- import { useState } from "react";
3
-
4
- import Button from "../Button/Button";
5
-
6
- import { NavMenuContent } from "./NavMenuContent";
7
- import { NavMenuItemProps } from "./NavMenuItem";
8
-
9
- export type NavMenuElement = NavMenuItemProps | { type: "separator" | "spacer" }
10
- export type NavMenuProps = { items: NavMenuElement[] };
11
-
12
- export function NavMenu({ items }: NavMenuProps): JSX.Element {
13
- const [isOpen, setIsOpen] = useState(false);
14
-
15
- const handleToggleOpen = () => {
16
- setIsOpen(!isOpen);
17
- };
18
-
19
- return (
20
- <>
21
- <div className={"hidden h-screen lg:flex"}>
22
- <NavMenuContent items={items} />
23
- </div>
24
- <div className={"lg:hidden relative bg-nav-header w-screen flex items-center p-2 shadow-lg"}>
25
- <Button
26
- hasIcon={true}
27
- role="secondaryDark"
28
- iconName={isOpen ? "close" : "hamburger"}
29
- onClick={handleToggleOpen}
30
- />
31
- </div>
32
- {isOpen && (
33
- <div className="absolute z-20">
34
- <NavMenuContent items={items} />
35
- </div>
36
- )}
37
- </>
38
- );
39
- }
@@ -1,6 +0,0 @@
1
- import { NavMenuElement } from "./NavMenu";
2
- import { NavMenuItemProps } from "./NavMenuItem";
3
-
4
- export function isNavMenuItem(item: NavMenuElement): item is NavMenuItemProps {
5
- return item.type === "base" || item.type === undefined;
6
- }
@@ -1,23 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { NavMenuProps } from "./NavMenu";
4
- import { NavMenuItem } from "./NavMenuItem";
5
- import { isNavMenuItem } from "./NavMenu.utils";
6
-
7
- export const NavMenuContent = ({ items }: NavMenuProps): JSX.Element => {
8
- return (
9
- <div className={"flex flex-col bg-nav-menu w-46 pl-1 py-2 lg:relative shadow-lg"}>
10
- {items.map((item, index) => {
11
- if (item.type === "separator") {
12
- return <div key={`${item.type}-${index}`} className={"border-b ml-3 border-slate-600"} />;
13
- } else if (item.type === "spacer") {
14
- return <div key={`${item.type}-${index}`} className={"mt-auto"} />;
15
- } else if (isNavMenuItem(item)) {
16
- return <NavMenuItem {...item} key={item.title} />;
17
- } else {
18
- return null as never;
19
- }
20
- })}
21
- </div>
22
- );
23
- };
@@ -1,102 +0,0 @@
1
- import * as React from "react";
2
- import { useState } from "react";
3
- import { navigate } from "@reach/router";
4
- import classNames from "classnames";
5
-
6
- import { Text } from "../Text/Text";
7
-
8
- export interface NavMenuItemProps {
9
- href?: string;
10
- linkTo?: string;
11
- title: string;
12
- isSelected: boolean;
13
- img: string;
14
- imgOnHover: string;
15
- dataTestId: string;
16
- gtmEvent?: string;
17
- isExternal?: boolean;
18
- type?: "base";
19
- track?: (event: string) => void;
20
- }
21
-
22
- export const NavMenuItem = (props: NavMenuItemProps): JSX.Element => {
23
- const [currentImg, setCurrentImg] = useState(
24
- props.isSelected ? props.imgOnHover : props.img
25
- );
26
-
27
- const classes = classNames(
28
- [
29
- "flex",
30
- "flex-row",
31
- "items-center",
32
- "w-auto",
33
- "rounded",
34
- "px-2",
35
- "py-1",
36
- "my-2",
37
- "mx-2",
38
- "hover:bg-gray-600",
39
- "transition",
40
- "ease-in",
41
- "duration-150",
42
- "lg:last:pb-2",
43
- "focus:outline-primary",
44
- "group",
45
- ],
46
- {
47
- "bg-nav-menu": !props.isSelected,
48
- "bg-gray-600": props.isSelected,
49
- }
50
- );
51
-
52
- const handleOnMouseOver = () => {
53
- if (!props.isSelected) {
54
- setCurrentImg(props.imgOnHover);
55
- }
56
- };
57
-
58
- const handleOnMouseOut = () => {
59
- if (!props.isSelected) {
60
- setCurrentImg(props.img);
61
- }
62
- };
63
-
64
- return (
65
- <a
66
- href={props.href ?? props.linkTo ?? "#"}
67
- data-test-id={props.dataTestId}
68
- className={classes}
69
- onMouseOver={handleOnMouseOver}
70
- onMouseOut={handleOnMouseOut}
71
- onClick={handleMenuClick}
72
- >
73
- <img src={currentImg} className={"mr-4 ml-0"} />
74
- <Text
75
- type={"strong"}
76
- text={props.title}
77
- hoverInGroup
78
- color="slate-200"
79
- hoverColor="white"
80
- />
81
- </a>
82
- );
83
-
84
- function handleMenuClick(event: React.MouseEvent<HTMLElement>) {
85
- if (event.metaKey || event.ctrlKey) {
86
- // if ctrl or meta key are held on click, allow default behavior of opening link in new tab
87
- return;
88
- }
89
-
90
- event.preventDefault();
91
-
92
- props.track && props.gtmEvent && props.track(props.gtmEvent);
93
-
94
- if (props.isExternal) {
95
- window.open(props.href, "_blank");
96
- } else if (props.href) {
97
- window.location.assign(props.href);
98
- } else if (props.linkTo) {
99
- navigate(props.linkTo);
100
- }
101
- }
102
- };
@@ -1,104 +0,0 @@
1
- import React from "react";
2
- import classNames from "classnames";
3
-
4
- import { Text, TextColor } from "../Text/Text";
5
- import { TextLink } from "../TextLink/TextLink";
6
- import { DynamicIcon, DynamicIconProps } from "../Icons/DynamicIcon";
7
-
8
- export type NotificationBannerColor =
9
- | "base"
10
- | "blue"
11
- | "red"
12
- | "green"
13
- | "amber";
14
-
15
- export interface NotificationBannerLinkProps {
16
- text: string;
17
- enabled: boolean;
18
- handleClick?: () => void;
19
- }
20
-
21
- export interface NotificationBannerProps {
22
- text: string;
23
- color?: NotificationBannerColor;
24
- /**
25
- * The icon can either be one of our icon components or an image url
26
- */
27
- icon?: DynamicIconProps["icon"];
28
- linkProps?: NotificationBannerLinkProps;
29
- className?: string;
30
- stretch?: boolean;
31
- /**
32
- * When stretching the banner, you can also decide if the content should be centered or not.
33
- */
34
- centerContent?: boolean;
35
- }
36
-
37
- export const NotificationBanner = (
38
- props: NotificationBannerProps
39
- ): JSX.Element => {
40
- const { stretch = true, centerContent = false } = props;
41
- const classes = classNames(
42
- "px-6 py-4 h-13 flex flex-row items-center border border-solid rounded",
43
- props.className,
44
- {
45
- "bg-slate-100 border-slate-300 text-slate-700": props.color === "base",
46
- "bg-blue-50 border-blue-700 text-blue-800": props.color === "blue",
47
- "bg-red-50 border-red-700 text-red-700": props.color === "red",
48
- "bg-green-50 border-green-700 text-green-700": props.color === "green",
49
- "bg-amber-50 border-amber-700 text-amber-700": props.color === "amber",
50
- },
51
- {
52
- "justify-center": centerContent,
53
- }
54
- );
55
-
56
- const textColor: Record<NotificationBannerColor, TextColor> = {
57
- red: "red",
58
- amber: "amber",
59
- green: "green",
60
- base: "base",
61
- // Blue must be 800 here to pass the contrast test
62
- blue: "blue-800",
63
- };
64
-
65
- const color = props.color ? textColor[props.color] : "base";
66
-
67
- return (
68
- <div
69
- data-test-id="notification-banner"
70
- className={classNames({
71
- "w-full": stretch,
72
- "inline-block": !stretch,
73
- })}
74
- >
75
- <div className={classes}>
76
- {props.icon && <DynamicIcon className="w-6 h-6" icon={props.icon} />}
77
- {/* space-x-1 here makes it look more natural as a full sentence with the link */}
78
- <div className="flex flex-row items-center space-x-1">
79
- <Text
80
- className={classNames({
81
- "ml-3": props.icon,
82
- })}
83
- text={props.text}
84
- color={color}
85
- />
86
- {props.linkProps && (
87
- <TextLink
88
- text={props.linkProps.text}
89
- enabled={props.linkProps.enabled}
90
- rel="noopener"
91
- target="_blank"
92
- onClick={props.linkProps.handleClick}
93
- />
94
- )}
95
- </div>
96
- </div>
97
- </div>
98
- );
99
- };
100
-
101
- NotificationBanner.defaultProps = {
102
- color: "base",
103
- onButtonClick: undefined,
104
- };