@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,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
|
+
}
|