@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.
- package/README.md +181 -0
- package/dist/components/Acknowledgement/Acknowledgement.d.ts +22 -0
- package/dist/components/Avatar/Avatar.d.ts +29 -0
- package/dist/components/Badge/Badge.d.ts +7 -0
- package/dist/components/Button/Button.d.ts +5 -0
- package/dist/components/Button/Button.types.d.ts +32 -0
- package/dist/components/Button/ButtonIcon.d.ts +7 -0
- package/dist/components/ButtonV2/ButtonV2.d.ts +13 -0
- package/dist/components/ButtonV2/PrimaryButton.d.ts +12 -0
- package/dist/components/ButtonV2/SecondaryButton.d.ts +8 -0
- package/dist/components/ButtonV2/TertiaryButton.d.ts +8 -0
- package/dist/components/Carousel/Carousel.d.ts +8 -0
- package/dist/components/Carousel/GliderContainer.d.ts +7 -0
- package/dist/components/CenteredHero/CenteredHero.d.ts +22 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +33 -0
- package/dist/components/Datepicker/Datepicker.d.ts +24 -0
- package/dist/components/Dropdown/Dropdown.d.ts +47 -0
- package/dist/components/EmptyListMessage/EmptyListMessage.d.ts +14 -0
- package/dist/components/ErrorBlock/ErrorBlock.d.ts +13 -0
- package/dist/components/Icons/AddIcon.d.ts +3 -0
- package/dist/components/Icons/AlertsIcon.d.ts +6 -0
- package/dist/components/Icons/BellIcon.d.ts +6 -0
- package/dist/components/Icons/ChartIcon.d.ts +3 -0
- package/dist/components/Icons/ChatBox.d.ts +5 -0
- package/dist/components/Icons/CheckIcon.d.ts +2 -0
- package/dist/components/Icons/ChevronIcon.d.ts +8 -0
- package/dist/components/Icons/CrossIcon.d.ts +7 -0
- package/dist/components/Icons/DeleteIcon.d.ts +6 -0
- package/dist/components/Icons/DownArrowIcon.d.ts +6 -0
- package/dist/components/Icons/DragIcon.d.ts +3 -0
- package/dist/components/Icons/EditIcon.d.ts +6 -0
- package/dist/components/Icons/EmptyStateDashboardIcon.d.ts +2 -0
- package/dist/components/Icons/ExclamationMarkIcon.d.ts +6 -0
- package/dist/components/Icons/EyeIcon.d.ts +3 -0
- package/dist/components/Icons/GearIcon.d.ts +3 -0
- package/dist/components/Icons/GroupIcon.d.ts +3 -0
- package/dist/components/Icons/HeartIcon.d.ts +6 -0
- package/dist/components/Icons/LeftArrowIcon.d.ts +6 -0
- package/dist/components/Icons/LightBulbIcon.d.ts +6 -0
- package/dist/components/Icons/LockIcon.d.ts +6 -0
- package/dist/components/Icons/MessagesIcon.d.ts +6 -0
- package/dist/components/Icons/NotesIcon.d.ts +6 -0
- package/dist/components/Icons/PinIcon.d.ts +6 -0
- package/dist/components/Icons/PrintIcon.d.ts +3 -0
- package/dist/components/Icons/RightArrowIcon.d.ts +6 -0
- package/dist/components/Icons/SmallCircleIcon.d.ts +6 -0
- package/dist/components/Icons/SmallDiamondIcon.d.ts +6 -0
- package/dist/components/Icons/SmallSquareIcon.d.ts +6 -0
- package/dist/components/Icons/SpaceRocketIcon.d.ts +6 -0
- package/dist/components/Icons/types/IconProps.type.d.ts +3 -0
- package/dist/components/InfoBlock/InfoBlock.d.ts +14 -0
- package/dist/components/InfoField/InfoField.d.ts +18 -0
- package/dist/components/Input/Input.d.ts +44 -0
- package/dist/components/Line/Line.d.ts +14 -0
- package/dist/components/ListItem/ListItem.d.ts +9 -0
- package/dist/components/ListTable/ListTable.d.ts +35 -0
- package/dist/components/ListTable/ListTableCell.d.ts +10 -0
- package/dist/components/ListTable/ListTableHeader.d.ts +7 -0
- package/dist/components/ListTable/ListTableRow.d.ts +9 -0
- package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +11 -0
- package/dist/components/Menu/Menu.d.ts +14 -0
- package/dist/components/Modal/Modal.d.ts +31 -0
- package/dist/components/Modal/ModalWithButtons.d.ts +9 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
- package/dist/components/MultiSelect/MultiSelectUtils.d.ts +1 -0
- package/dist/components/NavMenu/NavLayout.d.ts +20 -0
- package/dist/components/NavMenu/NavMenu.d.ts +1 -0
- package/dist/components/NavMenu/NavMenuContent.d.ts +7 -0
- package/dist/components/NavMenu/NavMenuItem.d.ts +15 -0
- package/dist/components/NotificationBanner/NotificationBanner.d.ts +22 -0
- package/dist/components/Page/CRUDPage.d.ts +43 -0
- package/dist/components/Page/Page.d.ts +58 -0
- package/dist/components/PaginationMenu/PaginationMenu.d.ts +20 -0
- package/dist/components/PaginationMenu/PaginationMenuLarge.d.ts +13 -0
- package/dist/components/PaginationMenu/PaginationMenuSmall.d.ts +8 -0
- package/dist/components/PreviewPhone/PreviewPhone.d.ts +7 -0
- package/dist/components/PreviewPhone/useWindowDimensions.d.ts +4 -0
- package/dist/components/Radio/Radio.d.ts +18 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +31 -0
- package/dist/components/Section/Section.d.ts +15 -0
- package/dist/components/Select/LegacySelect.d.ts +32 -0
- package/dist/components/Select/Select.d.ts +6 -0
- package/dist/components/Select/options.transformer.d.ts +14 -0
- package/dist/components/Select/select.utils.d.ts +7 -0
- package/dist/components/SettingsMenuButton/SettingsMenuButton.d.ts +16 -0
- package/dist/components/Spinner/Spinner.d.ts +6 -0
- package/dist/components/Steps/Step.d.ts +10 -0
- package/dist/components/Steps/Steps.d.ts +11 -0
- package/dist/components/Switcher/Switcher.d.ts +26 -0
- package/dist/components/Switcher/SwitcherItem.d.ts +24 -0
- package/dist/components/TabLinks/TabLinks.d.ts +14 -0
- package/dist/components/Tabbar/Tabbar.d.ts +10 -0
- package/dist/components/Tabbar/TabbarItem.d.ts +15 -0
- package/dist/components/Tag/Tag.d.ts +17 -0
- package/dist/components/Tag/TagGroup.d.ts +13 -0
- package/dist/components/Text/LegacyText.d.ts +37 -0
- package/dist/components/Text/Text.d.ts +27 -0
- package/dist/components/TextEditor/TextEditor.d.ts +14 -0
- package/dist/components/TextEditorV2/TextEditorV2.d.ts +6 -0
- package/dist/components/TextLink/TextLink.d.ts +11 -0
- package/dist/components/TextListItem/TextListItem.d.ts +12 -0
- package/dist/components/Textarea/Textarea.d.ts +22 -0
- package/dist/components/Title/LegacyTitle.d.ts +22 -0
- package/dist/components/Title/Title.d.ts +14 -0
- package/dist/components/ViewItem/ViewItem.d.ts +16 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/types/general.types.d.ts +7 -0
- package/dist/utils/useOutsideClick.d.ts +2 -0
- package/dist/web-ui.cjs.development.js +23 -0
- package/dist/web-ui.cjs.development.js.map +1 -0
- package/dist/web-ui.cjs.production.min.js +2 -0
- package/dist/web-ui.cjs.production.min.js.map +1 -0
- package/dist/web-ui.esm.js +17 -0
- package/dist/web-ui.esm.js.map +1 -0
- package/package.json +122 -0
- package/src/assets/add.svg +5 -0
- package/src/assets/add_hover.svg +4 -0
- package/src/assets/big-menu-icon-hover.svg +6 -0
- package/src/assets/big-menu-icon.svg +6 -0
- package/src/assets/check-cross-icon.svg +7 -0
- package/src/assets/check-icon-primary.svg +5 -0
- package/src/assets/check-icon.svg +3 -0
- package/src/assets/chevron-double.svg +3 -0
- package/src/assets/close.svg +3 -0
- package/src/assets/color-variant-cross.svg +3 -0
- package/src/assets/cross-dark.svg +3 -0
- package/src/assets/delete.svg +4 -0
- package/src/assets/delete_hover.svg +4 -0
- package/src/assets/edit.svg +6 -0
- package/src/assets/edit_hover.svg +6 -0
- package/src/assets/error-icon.svg +7 -0
- package/src/assets/grid-view-icon-active.svg +6 -0
- package/src/assets/grid-view-icon.svg +6 -0
- package/src/assets/groups.svg +3 -0
- package/src/assets/hamburger.svg +5 -0
- package/src/assets/happy-star.svg +9 -0
- package/src/assets/hcps.svg +3 -0
- package/src/assets/info-icon.svg +6 -0
- package/src/assets/left-arrow-blue.svg +3 -0
- package/src/assets/left-arrow-grey.svg +3 -0
- package/src/assets/list-view-icon-active.svg +3 -0
- package/src/assets/list-view-icon.svg +3 -0
- package/src/assets/loading.svg +16 -0
- package/src/assets/modal-close-icon-active.svg +9 -0
- package/src/assets/modal-close-icon.svg +9 -0
- package/src/assets/no-open-alerts.svg +19 -0
- package/src/assets/patients.svg +3 -0
- package/src/assets/phone-mockup.svg +9 -0
- package/src/assets/programs.svg +3 -0
- package/src/assets/right-arrow-blue.svg +3 -0
- package/src/assets/right-arrow-grey.svg +3 -0
- package/src/assets/search-cancel.svg +3 -0
- package/src/assets/search-not-found.svg +70 -0
- package/src/assets/search.svg +3 -0
- package/src/assets/spinner-gray.svg +6 -0
- package/src/assets/spinner.svg +6 -0
- package/src/assets/starIcon.svg +3 -0
- package/src/assets/success-icon.svg +7 -0
- package/src/components/Acknowledgement/Acknowledgement.js +61 -0
- package/src/components/Acknowledgement/Acknowledgement.scss +49 -0
- package/src/components/Avatar/Avatar.js +81 -0
- package/src/components/Avatar/Avatar.scss +153 -0
- package/src/components/Badge/Badge.tsx +23 -0
- package/src/components/Button/Button.examples.md +46 -0
- package/src/components/Button/Button.tsx +200 -0
- package/src/components/Button/Button.types.ts +41 -0
- package/src/components/Button/ButtonIcon.tsx +42 -0
- package/src/components/ButtonV2/ButtonV2.tsx +91 -0
- package/src/components/ButtonV2/PrimaryButton.tsx +43 -0
- package/src/components/ButtonV2/SecondaryButton.tsx +31 -0
- package/src/components/ButtonV2/TertiaryButton.tsx +31 -0
- package/src/components/Carousel/Carousel.tsx +52 -0
- package/src/components/Carousel/GliderContainer.scss +13 -0
- package/src/components/Carousel/GliderContainer.tsx +22 -0
- package/src/components/CenteredHero/CenteredHero.js +50 -0
- package/src/components/Checkbox/Checkbox.scss +115 -0
- package/src/components/Checkbox/Checkbox.tsx +114 -0
- package/src/components/ConfirmationDialog/ConfirmationDialog.scss +15 -0
- package/src/components/ConfirmationDialog/ConfirmationDialog.tsx +84 -0
- package/src/components/Datepicker/Datepicker.js +96 -0
- package/src/components/Datepicker/Datepicker.scss +331 -0
- package/src/components/Dropdown/Dropdown.js +364 -0
- package/src/components/Dropdown/Dropdown.scss +83 -0
- package/src/components/EmptyListMessage/EmptyListMessage.tsx +34 -0
- package/src/components/ErrorBlock/ErrorBlock.js +24 -0
- package/src/components/ErrorBlock/ErrorBlock.scss +20 -0
- package/src/components/Icons/AddIcon.tsx +27 -0
- package/src/components/Icons/AlertsIcon.tsx +26 -0
- package/src/components/Icons/BellIcon.tsx +26 -0
- package/src/components/Icons/ChartIcon.tsx +20 -0
- package/src/components/Icons/ChatBox.tsx +23 -0
- package/src/components/Icons/CheckIcon.tsx +23 -0
- package/src/components/Icons/ChevronIcon.tsx +30 -0
- package/src/components/Icons/CrossIcon.tsx +26 -0
- package/src/components/Icons/DeleteIcon.tsx +23 -0
- package/src/components/Icons/DownArrowIcon.tsx +17 -0
- package/src/components/Icons/DragIcon.tsx +23 -0
- package/src/components/Icons/EditIcon.tsx +23 -0
- package/src/components/Icons/EmptyStateDashboardIcon.tsx +130 -0
- package/src/components/Icons/ExclamationMarkIcon.tsx +23 -0
- package/src/components/Icons/EyeIcon.tsx +21 -0
- package/src/components/Icons/GearIcon.tsx +21 -0
- package/src/components/Icons/GroupIcon.tsx +21 -0
- package/src/components/Icons/HeartIcon.tsx +23 -0
- package/src/components/Icons/LeftArrowIcon.tsx +23 -0
- package/src/components/Icons/LightBulbIcon.tsx +28 -0
- package/src/components/Icons/LockIcon.tsx +23 -0
- package/src/components/Icons/MessagesIcon.tsx +23 -0
- package/src/components/Icons/NotesIcon.tsx +23 -0
- package/src/components/Icons/PinIcon.tsx +23 -0
- package/src/components/Icons/PrintIcon.tsx +15 -0
- package/src/components/Icons/RightArrowIcon.tsx +23 -0
- package/src/components/Icons/SmallCircleIcon.tsx +21 -0
- package/src/components/Icons/SmallDiamondIcon.tsx +31 -0
- package/src/components/Icons/SmallSquareIcon.tsx +21 -0
- package/src/components/Icons/SpaceRocketIcon.tsx +23 -0
- package/src/components/Icons/types/IconProps.type.ts +3 -0
- package/src/components/InfoBlock/InfoBlock.js +24 -0
- package/src/components/InfoBlock/InfoBlock.scss +20 -0
- package/src/components/InfoField/InfoField.tsx +86 -0
- package/src/components/Input/Input.examples.md +94 -0
- package/src/components/Input/Input.js +141 -0
- package/src/components/Line/Line.js +38 -0
- package/src/components/ListItem/ListItem.scss +20 -0
- package/src/components/ListItem/ListItem.tsx +26 -0
- package/src/components/ListTable/ListTable.tsx +157 -0
- package/src/components/ListTable/ListTableCell.tsx +67 -0
- package/src/components/ListTable/ListTableHeader.tsx +33 -0
- package/src/components/ListTable/ListTableRow.tsx +46 -0
- package/src/components/LoadingIndicator/LoadingIndicator.scss +50 -0
- package/src/components/LoadingIndicator/LoadingIndicator.tsx +44 -0
- package/src/components/Menu/Menu.js +74 -0
- package/src/components/Menu/Menu.scss +27 -0
- package/src/components/Modal/Modal.scss +117 -0
- package/src/components/Modal/Modal.tsx +104 -0
- package/src/components/Modal/ModalWithButtons.tsx +34 -0
- package/src/components/MultiSelect/MultiSelect.js +117 -0
- package/src/components/MultiSelect/MultiSelect.scss +29 -0
- package/src/components/MultiSelect/MultiSelectUtils.js +23 -0
- package/src/components/NavMenu/NavLayout.tsx +40 -0
- package/src/components/NavMenu/NavMenu.js +35 -0
- package/src/components/NavMenu/NavMenuContent.tsx +23 -0
- package/src/components/NavMenu/NavMenuItem.tsx +96 -0
- package/src/components/NotificationBanner/NotificationBanner.tsx +57 -0
- package/src/components/Page/CRUDPage.js +123 -0
- package/src/components/Page/CRUDPage.scss +32 -0
- package/src/components/Page/Page.js +102 -0
- package/src/components/Page/Page.scss +59 -0
- package/src/components/PaginationMenu/PaginationMenu.js +31 -0
- package/src/components/PaginationMenu/PaginationMenuLarge.tsx +94 -0
- package/src/components/PaginationMenu/PaginationMenuSmall.tsx +40 -0
- package/src/components/PreviewPhone/PreviewPhone.tsx +53 -0
- package/src/components/PreviewPhone/useWindowDimensions.js +26 -0
- package/src/components/Radio/Radio.js +99 -0
- package/src/components/Radio/Radio.scss +58 -0
- package/src/components/RadioGroup/RadioGroup.js +63 -0
- package/src/components/RadioGroup/RadioGroup.scss +37 -0
- package/src/components/Section/Section.scss +74 -0
- package/src/components/Section/Section.tsx +67 -0
- package/src/components/Select/LegacySelect.js +114 -0
- package/src/components/Select/Select.examples.md +161 -0
- package/src/components/Select/Select.tsx +136 -0
- package/src/components/Select/options.transformer.ts +36 -0
- package/src/components/Select/select.utils.spec.ts +63 -0
- package/src/components/Select/select.utils.ts +45 -0
- package/src/components/SettingsMenuButton/SettingsMenuButton.tsx +111 -0
- package/src/components/Spinner/Spinner.tsx +23 -0
- package/src/components/Steps/Step.tsx +22 -0
- package/src/components/Steps/Steps.tsx +24 -0
- package/src/components/Switcher/Switcher.js +58 -0
- package/src/components/Switcher/SwitcherItem.js +61 -0
- package/src/components/Switcher/SwitcherItem.scss +67 -0
- package/src/components/TabLinks/TabLinks.tsx +63 -0
- package/src/components/Tabbar/Tabbar.tsx +29 -0
- package/src/components/Tabbar/TabbarItem.tsx +53 -0
- package/src/components/Tag/Tag.tsx +39 -0
- package/src/components/Tag/TagGroup.tsx +25 -0
- package/src/components/Text/LegacyText.js +78 -0
- package/src/components/Text/Text.scss +67 -0
- package/src/components/Text/Text.tsx +81 -0
- package/src/components/TextEditor/TextEditor.js +61 -0
- package/src/components/TextEditor/TextEditor.scss +14 -0
- package/src/components/TextEditorV2/TextEditorV2.js +58 -0
- package/src/components/TextEditorV2/TextEditorV2.scss +110 -0
- package/src/components/TextLink/TextLink.tsx +42 -0
- package/src/components/TextListItem/TextListItem.js +31 -0
- package/src/components/TextListItem/TextListItem.scss +10 -0
- package/src/components/Textarea/Textarea.js +108 -0
- package/src/components/Textarea/Textarea.scss +56 -0
- package/src/components/Title/LegacyTitle.js +64 -0
- package/src/components/Title/Title.scss +65 -0
- package/src/components/Title/Title.tsx +57 -0
- package/src/components/ViewItem/ViewItem.tsx +73 -0
- package/src/index.tsx +14 -0
- package/src/styles/_colors.scss +59 -0
- package/src/styles/_layout.scss +64 -0
- package/src/styles/_shadows.scss +19 -0
- package/src/styles/_typography.scss +8 -0
- package/src/styles/_utils.scss +45 -0
- package/src/styles/fonts/avenir/3A0AF8_0_0.eot +0 -0
- package/src/styles/fonts/avenir/3A0AF8_0_0.ttf +0 -0
- package/src/styles/fonts/avenir/3A0AF8_0_0.woff +0 -0
- package/src/styles/fonts/avenir/3A0AF8_0_0.woff2 +0 -0
- package/src/styles/fonts/avenir/3A0AF8_1_0.eot +0 -0
- package/src/styles/fonts/avenir/3A0AF8_1_0.ttf +0 -0
- package/src/styles/fonts/avenir/3A0AF8_1_0.woff +0 -0
- package/src/styles/fonts/avenir/3A0AF8_1_0.woff2 +0 -0
- package/src/types/general.types.ts +11 -0
- package/src/utils/useOutsideClick.js +19 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
|
|
5
|
+
import "./Title.scss";
|
|
6
|
+
|
|
7
|
+
const TITLE_TYPE_OPTIONS = {
|
|
8
|
+
DEFAULT: "default",
|
|
9
|
+
BIG: "big",
|
|
10
|
+
SMALL: "small",
|
|
11
|
+
TINY: "tiny",
|
|
12
|
+
BOLD: "bold",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
LegacyTitle.propTypes = {
|
|
16
|
+
text: PropTypes.string.isRequired,
|
|
17
|
+
type: PropTypes.oneOf([
|
|
18
|
+
TITLE_TYPE_OPTIONS.DEFAULT,
|
|
19
|
+
TITLE_TYPE_OPTIONS.BIG,
|
|
20
|
+
TITLE_TYPE_OPTIONS.SMALL,
|
|
21
|
+
TITLE_TYPE_OPTIONS.TINY,
|
|
22
|
+
TITLE_TYPE_OPTIONS.BOLD,
|
|
23
|
+
]),
|
|
24
|
+
className: PropTypes.string,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function LegacyTitle({ text, type, className = "", ...otherProps }) {
|
|
28
|
+
let ContainerElement;
|
|
29
|
+
|
|
30
|
+
const containerClassName = classNames("cweb-title", className, {
|
|
31
|
+
"type-default": !type || type === TITLE_TYPE_OPTIONS.DEFAULT,
|
|
32
|
+
"type-big": type === TITLE_TYPE_OPTIONS.BIG,
|
|
33
|
+
"type-small": type === TITLE_TYPE_OPTIONS.SMALL,
|
|
34
|
+
"type-tiny": type === TITLE_TYPE_OPTIONS.TINY,
|
|
35
|
+
"type-bold": type === TITLE_TYPE_OPTIONS.BOLD,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
switch (type) {
|
|
39
|
+
case TITLE_TYPE_OPTIONS.DEFAULT:
|
|
40
|
+
case TITLE_TYPE_OPTIONS.BOLD:
|
|
41
|
+
case TITLE_TYPE_OPTIONS.BIG:
|
|
42
|
+
ContainerElement = "h1";
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
case TITLE_TYPE_OPTIONS.SMALL:
|
|
46
|
+
case TITLE_TYPE_OPTIONS.TINY:
|
|
47
|
+
ContainerElement = "h3";
|
|
48
|
+
break;
|
|
49
|
+
|
|
50
|
+
default:
|
|
51
|
+
ContainerElement = "h1";
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<ContainerElement {...otherProps} className={containerClassName}>
|
|
57
|
+
{text}
|
|
58
|
+
</ContainerElement>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default LegacyTitle;
|
|
63
|
+
|
|
64
|
+
export { TITLE_TYPE_OPTIONS };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import "../../styles/layout";
|
|
2
|
+
@import "../../styles/colors";
|
|
3
|
+
|
|
4
|
+
@font-face {
|
|
5
|
+
font-family: "AvenirNextLTPro-Regular";
|
|
6
|
+
src: url("../../styles/fonts/avenir/3A0AF8_1_0.eot");
|
|
7
|
+
src: url("../../styles/fonts/avenir/3A0AF8_1_0.eot?#iefix") format("embedded-opentype"),
|
|
8
|
+
url("../../styles/fonts/avenir/3A0AF8_1_0.woff2") format("woff2"),
|
|
9
|
+
url("../../styles/fonts/avenir/3A0AF8_1_0.woff") format("woff"),
|
|
10
|
+
url("../../styles/fonts/avenir/3A0AF8_1_0.ttf") format("truetype");
|
|
11
|
+
}
|
|
12
|
+
@mixin title($font-size, $color) {
|
|
13
|
+
font-family: "AvenirNextLTPro-Regular", "Roboto", sans-serif;
|
|
14
|
+
color: $color;
|
|
15
|
+
font-size: $font-size;
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
@font-face {
|
|
19
|
+
font-family: "AvenirNextLTPro-Bold";
|
|
20
|
+
src: url("../../styles/fonts/avenir/3A0AF8_0_0.eot");
|
|
21
|
+
src: url("../../styles/fonts/avenir/3A0AF8_0_0.eot?#iefix") format("embedded-opentype"),
|
|
22
|
+
url("../../styles/fonts/avenir/3A0AF8_0_0.woff2") format("woff2"),
|
|
23
|
+
url("../../styles/fonts/avenir/3A0AF8_0_0.woff") format("woff"),
|
|
24
|
+
url("../../styles/fonts/avenir/3A0AF8_0_0.ttf") format("truetype");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin title-bold($font-size, $color) {
|
|
28
|
+
font-family: "AvenirNextLTPro-Bold", "Roboto", sans-serif;
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
color: $color;
|
|
31
|
+
font-size: $font-size;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.title {
|
|
36
|
+
font-family: "AvenirNextLTPro-Bold", "Roboto", sans-serif;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.cweb-title {
|
|
40
|
+
$color: $color-text-emphasis;
|
|
41
|
+
|
|
42
|
+
$font-size: 1.75em;
|
|
43
|
+
$font-size-big: 2.25em;
|
|
44
|
+
$font-size-small: 1.25em;
|
|
45
|
+
$font-size-tiny: 1em;
|
|
46
|
+
|
|
47
|
+
@include flexbox-horizontal(center);
|
|
48
|
+
@include title($font-size, $color);
|
|
49
|
+
|
|
50
|
+
&.type-tiny {
|
|
51
|
+
@include title-bold($font-size-tiny, $color);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.type-small {
|
|
55
|
+
@include title-bold($font-size-small, $color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.type-big {
|
|
59
|
+
font-size: $font-size-big;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.type-bold {
|
|
63
|
+
@include title-bold($font-size, $color);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import "./Title.scss";
|
|
5
|
+
|
|
6
|
+
export type TitleStyle = "sm" | "base" | "lg" | "xl" | "2xl";
|
|
7
|
+
|
|
8
|
+
export interface TextProps {
|
|
9
|
+
text: string;
|
|
10
|
+
type?: TitleStyle; //defaults to "base"
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Title = (props: TextProps): JSX.Element => {
|
|
15
|
+
const containerClassName = classNames(
|
|
16
|
+
"title", //this is used to load the correct font from the css
|
|
17
|
+
"font-bold",
|
|
18
|
+
{
|
|
19
|
+
"text-slate-700": !props.className?.match(/\s(text-)/),
|
|
20
|
+
"text-xl": props.type === "sm",
|
|
21
|
+
"text-2xl": props.type === "base",
|
|
22
|
+
"text-3xl": props.type === "lg",
|
|
23
|
+
"text-4xl ": props.type === "xl",
|
|
24
|
+
"text-6xl ": props.type === "2xl",
|
|
25
|
+
},
|
|
26
|
+
props.className
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
let ContainerElement: React.ElementType;
|
|
30
|
+
|
|
31
|
+
switch (props.type) {
|
|
32
|
+
case "sm":
|
|
33
|
+
ContainerElement = "h5";
|
|
34
|
+
break;
|
|
35
|
+
case "base":
|
|
36
|
+
ContainerElement = "h4";
|
|
37
|
+
break;
|
|
38
|
+
case "lg":
|
|
39
|
+
ContainerElement = "h3";
|
|
40
|
+
break;
|
|
41
|
+
case "xl":
|
|
42
|
+
ContainerElement = "h2";
|
|
43
|
+
break;
|
|
44
|
+
case "2xl":
|
|
45
|
+
ContainerElement = "h1";
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
ContainerElement = "h4";
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return <ContainerElement className={containerClassName}>{props.text}</ContainerElement>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
Title.defaultProps = {
|
|
56
|
+
type: "base",
|
|
57
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
|
|
4
|
+
import Text, { TextProps } from "../Text/Text";
|
|
5
|
+
import Button from "../Button/Button";
|
|
6
|
+
import { RestPropped } from "../../types/general.types";
|
|
7
|
+
import { ButtonProps } from "../Button/Button.types";
|
|
8
|
+
|
|
9
|
+
export interface ViewItemProps<AccessoryType> extends RestPropped {
|
|
10
|
+
titleProps?: TextProps;
|
|
11
|
+
// deprecated: use titleProps instead
|
|
12
|
+
title?: string;
|
|
13
|
+
titleAccessory?: AccessoryType;
|
|
14
|
+
// these props are injected in a Text component, allowing for customisation
|
|
15
|
+
contentProps?: TextProps[];
|
|
16
|
+
// these strings are injected in a default Text component
|
|
17
|
+
// deprecated: use contentProps instead
|
|
18
|
+
content?: string[];
|
|
19
|
+
// if contentProps and content are both empty or null, this value will be presented instead
|
|
20
|
+
defaultContent?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
buttons?: ButtonProps[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function ViewItem<AccessoryType>({
|
|
26
|
+
titleProps,
|
|
27
|
+
title,
|
|
28
|
+
titleAccessory,
|
|
29
|
+
contentProps,
|
|
30
|
+
content,
|
|
31
|
+
defaultContent = "-",
|
|
32
|
+
className,
|
|
33
|
+
buttons,
|
|
34
|
+
...restProps
|
|
35
|
+
}: ViewItemProps<AccessoryType>): JSX.Element {
|
|
36
|
+
const titlePropsMerged = titleProps ?? { text: title ?? defaultContent };
|
|
37
|
+
const contentPropsMerged =
|
|
38
|
+
contentProps ??
|
|
39
|
+
content?.map((line) => {
|
|
40
|
+
return { text: line, className: "cweb-view-content-text" } as TextProps;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className={classNames("vitals-view-item", className)} {...restProps}>
|
|
45
|
+
<div className={"vitals-view-item-title-line flex justify-start flex-row items-start"}>
|
|
46
|
+
{titlePropsMerged && (
|
|
47
|
+
<Text
|
|
48
|
+
className={classNames(titlePropsMerged.className, "vitals-view-item-title mb-1 mr-2")}
|
|
49
|
+
color="gray-500"
|
|
50
|
+
{...titlePropsMerged}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
{titleAccessory}
|
|
54
|
+
</div>
|
|
55
|
+
{contentPropsMerged &&
|
|
56
|
+
contentPropsMerged?.map((textProps) => <Text {...textProps} key={textProps.key || textProps.text} />)}
|
|
57
|
+
{(!contentPropsMerged || contentPropsMerged?.length === 0) && <Text text={defaultContent} key="empty-text" />}
|
|
58
|
+
|
|
59
|
+
<div className="flex flex-row cweb-view-buttons" key="cweb-view-buttons">
|
|
60
|
+
{buttons &&
|
|
61
|
+
buttons.map((button) => (
|
|
62
|
+
<Button
|
|
63
|
+
{...button}
|
|
64
|
+
className={classNames("cweb-view-button ml-3", button.className)}
|
|
65
|
+
key={button.key || button.text}
|
|
66
|
+
/>
|
|
67
|
+
))}
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default ViewItem;
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ReactChild } from "react";
|
|
2
|
+
|
|
3
|
+
export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children?: ReactChild;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Please do not use types off of a default export module or else Storybook Docs will suffer.
|
|
8
|
+
// see: https://github.com/storybookjs/storybook/issues/9556
|
|
9
|
+
/**
|
|
10
|
+
* A custom Thing component. Neat!
|
|
11
|
+
*/
|
|
12
|
+
export const Thing: FC<Props> = ({ children }) => {
|
|
13
|
+
return <div className={"mt-10 bg-red-500 p-5 rounded-md"}>{children || "this is a test"}</div>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//colors
|
|
2
|
+
|
|
3
|
+
$input-border: #d1d5db;
|
|
4
|
+
$input-background: #d1d5db;
|
|
5
|
+
$input-border-dark: #9ca3af;
|
|
6
|
+
|
|
7
|
+
$color-background-secondary: #f3f4f6;
|
|
8
|
+
|
|
9
|
+
$color-toggle-switch-background: #6abfa6;
|
|
10
|
+
|
|
11
|
+
$color-primary: #0074dd;
|
|
12
|
+
$color-secondary: #374151;
|
|
13
|
+
$color-white: #ffffff;
|
|
14
|
+
$color-body: #2d2d2d;
|
|
15
|
+
|
|
16
|
+
$color-emphasis-background: #e8f5fc;
|
|
17
|
+
$color-primary-emphasis: #045baa;
|
|
18
|
+
$color-primary-light: #2da8e5;
|
|
19
|
+
$color-luscii-pink: #ff0099;
|
|
20
|
+
$color-luscii-green: #6abfa5;
|
|
21
|
+
|
|
22
|
+
$color-positive: #4ad461;
|
|
23
|
+
$color-positive-support: #e7f5ec;
|
|
24
|
+
$color-negative: #ff6266;
|
|
25
|
+
$color-negative-support: #fff1f1;
|
|
26
|
+
$color-warning: #ffad62;
|
|
27
|
+
$color-warning-support: #ffedd5;
|
|
28
|
+
|
|
29
|
+
$color-chrome: #f3f3f3;
|
|
30
|
+
$color-divider: #eeeeee;
|
|
31
|
+
$color-border: #cccccc;
|
|
32
|
+
$color-accent: #b9b9b9;
|
|
33
|
+
//$color-text-lighter: #9F9F9F; This is an experiment from Dennis to see if it becomes better for our users. Leaving this here if we want to switch back.
|
|
34
|
+
$color-text-lighter: #737373;
|
|
35
|
+
$color-pale-grey: #f2fafd;
|
|
36
|
+
$color-pale-green: #e7f5ec;
|
|
37
|
+
$color-pale-grey-2: #f1f1f1;
|
|
38
|
+
$color-placeholder: #64748b; // slate-500
|
|
39
|
+
$color-slate-50: #f8fafc; // slate-50
|
|
40
|
+
$color-slate-100: #f1f5f9; // slate-100
|
|
41
|
+
$color-slate-700: #334155; // slate-700
|
|
42
|
+
$color-text-secondary: #737373;
|
|
43
|
+
$color-text-emphasis: #0f3554;
|
|
44
|
+
|
|
45
|
+
$color-comp-dark: #32918f;
|
|
46
|
+
$color-comp-light: #57bbb9;
|
|
47
|
+
$color-comp-alt: #43bbe7;
|
|
48
|
+
$color-comp-active: #516ed0;
|
|
49
|
+
$color-comp-darker: #46375f;
|
|
50
|
+
$color-comp-darkest: #1f1e1e;
|
|
51
|
+
|
|
52
|
+
$color-negative-alt: #ff6660;
|
|
53
|
+
$color-negative-alt-emphasis: #e55b56;
|
|
54
|
+
$color-branding-support-1: #6abfa5;
|
|
55
|
+
$color-branding-support-2: #6670a5;
|
|
56
|
+
$color-branding-support-4: #0f3554;
|
|
57
|
+
|
|
58
|
+
$color-helper-1: #c5d0de;
|
|
59
|
+
$color-emphasis-2: #f0f8f6;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// media query breakpoints
|
|
2
|
+
$max-small-screen-width: 767px;
|
|
3
|
+
$min-medium-screen-width: $max-small-screen-width + 1px;
|
|
4
|
+
|
|
5
|
+
$default-height: 44px;
|
|
6
|
+
$default-border-radius: 4px;
|
|
7
|
+
$header-container-height: 75px;
|
|
8
|
+
|
|
9
|
+
$header-z-index: 10000;
|
|
10
|
+
$sidemenu-z-index: 10001;
|
|
11
|
+
$sidebar-container-z-index: 11000;
|
|
12
|
+
$modal-window-overlay-z-index: 12000;
|
|
13
|
+
$modal-window-z-index: 13000;
|
|
14
|
+
$modal-window-drag-item-z-index: $modal-window-z-index + 100;
|
|
15
|
+
|
|
16
|
+
@mixin flexbox-layout($align-items: flex-start, $justify-content: flex-start, $flex-direction: row) {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: $justify-content;
|
|
19
|
+
flex-direction: $flex-direction;
|
|
20
|
+
align-items: $align-items;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// tailwind: flex justify-start flex-row items-start
|
|
24
|
+
@mixin flexbox-horizontal($align-items: flex-start, $justify-content: flex-start) {
|
|
25
|
+
@include flexbox-layout($align-items, $justify-content, row);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// tailwind: flex justify-start flex-col items-start
|
|
29
|
+
@mixin flexbox-vertical($align-items: flex-start, $justify-content: flex-start) {
|
|
30
|
+
@include flexbox-layout($align-items, $justify-content, column);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@mixin horizontal-static-position($position: absolute, $z-index: 1, $distance: 0) {
|
|
34
|
+
position: $position;
|
|
35
|
+
left: $distance;
|
|
36
|
+
right: $distance;
|
|
37
|
+
z-index: $z-index;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@mixin static-position($position: absolute, $z-index: 1, $distance: 0) {
|
|
41
|
+
@include horizontal-static-position($position, $z-index, $distance);
|
|
42
|
+
top: $distance;
|
|
43
|
+
bottom: $distance;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@mixin vertical-padding($padding-top, $padding-bottom: $padding-top) {
|
|
47
|
+
padding-top: $padding-top;
|
|
48
|
+
padding-bottom: $padding-bottom;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin horizontal-padding($padding-left, $padding-right: $padding-left) {
|
|
52
|
+
padding-left: $padding-left;
|
|
53
|
+
padding-right: $padding-right;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@mixin vertical-margin($margin-top, $margin-bottom: $margin-top) {
|
|
57
|
+
margin-top: $margin-top;
|
|
58
|
+
margin-bottom: $margin-bottom;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@mixin horizontal-margin($margin-left, $margin-right: $margin-left) {
|
|
62
|
+
margin-left: $margin-left;
|
|
63
|
+
margin-right: $margin-right;
|
|
64
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@mixin box-shadow-1dp() {
|
|
2
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 1px -1px rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.14);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin box-shadow-2dp() {
|
|
6
|
+
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.2), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.14);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin box-shadow-4dp() {
|
|
10
|
+
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin box-shadow-8dp() {
|
|
14
|
+
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin box-shadow-basic($x: 0px, $y: 5px) {
|
|
18
|
+
box-shadow: $x $y 14px 2px rgba(0, 0, 0, 0.12);
|
|
19
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@mixin cweb-reset-element() {
|
|
2
|
+
border: none;
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding: 0;
|
|
5
|
+
width: auto;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
background: transparent;
|
|
8
|
+
color: inherit;
|
|
9
|
+
font: inherit;
|
|
10
|
+
line-height: normal;
|
|
11
|
+
-webkit-font-smoothing: inherit;
|
|
12
|
+
-moz-osx-font-smoothing: inherit;
|
|
13
|
+
-webkit-appearance: none;
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
outline: none;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin cweb-truncate() {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@mixin cweb-box-shadow($top, $left, $blur, $color, $top2: false, $left2: false, $blur2: false, $color2: false) {
|
|
26
|
+
$spread: 0;
|
|
27
|
+
$params: $top $left $blur $spread $color;
|
|
28
|
+
@if $top2
|
|
29
|
+
{ $params: $top $left $blur $spread $color, $top2 $left2 $blur2 $spread $color2; }
|
|
30
|
+
|
|
31
|
+
box-shadow: $params;
|
|
32
|
+
|
|
33
|
+
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
34
|
+
$spread: 1px;
|
|
35
|
+
$params: $top $left $blur $spread $color;
|
|
36
|
+
@if $top2
|
|
37
|
+
{ $params: $top $left $blur $spread $color, $top2 $left2 $blur2 $spread $color2; }
|
|
38
|
+
|
|
39
|
+
box-shadow: $params;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cweb-box-shadow-default {
|
|
44
|
+
@include cweb-box-shadow(0, 2px, 2px, rgba(0, 0, 0, 0.24), 0, 0, 2px, rgba(0, 0, 0, 0.12));
|
|
45
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This type is used to allow for other props to be injected into the component
|
|
2
|
+
// For instance, for a data-testid or key
|
|
3
|
+
export interface RestPropped {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface HookReturn<T> extends RestPropped {
|
|
9
|
+
data: T | undefined;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
const useOutsideClick = (ref, callback) => {
|
|
4
|
+
const handleClick = (e) => {
|
|
5
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
6
|
+
callback();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
document.addEventListener("click", handleClick);
|
|
12
|
+
|
|
13
|
+
return () => {
|
|
14
|
+
document.removeEventListener("click", handleClick);
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default useOutsideClick;
|