@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.
- package/dist/components/Avatar/Avatar.d.ts +11 -11
- package/dist/components/CenteredHero/CenteredHero.d.ts +1 -1
- package/dist/components/Container/types/FlexContainerProps.type.d.ts +3 -2
- package/dist/components/Datepicker/Datepicker.d.ts +12 -11
- package/dist/components/Dropdown/Dropdown.d.ts +17 -7
- package/dist/components/ErrorBlock/ErrorBlock.d.ts +3 -3
- package/dist/components/Form/form.transformer.d.ts +3 -20
- package/dist/components/Form/form.types.d.ts +5 -5
- package/dist/components/InfoBlock/InfoBlock.d.ts +4 -4
- package/dist/components/Input/SearchInput.d.ts +1 -1
- package/dist/components/Line/Line.d.ts +4 -4
- package/dist/components/Menu/Menu.d.ts +6 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +7 -7
- package/dist/components/Page/CRUDPage.d.ts +13 -13
- package/dist/components/Page/Page.d.ts +13 -13
- package/dist/components/PaginationMenu/PaginationMenu.utils.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +5 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -10
- package/dist/components/Select/LegacySelect.d.ts +8 -9
- package/dist/components/Select/SelectV2.d.ts +1 -1
- package/dist/components/Switcher/Switcher.d.ts +6 -6
- package/dist/components/Switcher/SwitcherItem.d.ts +7 -7
- package/dist/components/Text/LegacyText.d.ts +18 -18
- package/dist/components/TextEditor/TextEditor.d.ts +4 -4
- package/dist/components/Textarea/Textarea.d.ts +16 -16
- package/dist/components/Title/LegacyTitle.d.ts +10 -10
- package/dist/web-ui-tailwind.css +8 -0
- package/dist/web-ui.cjs.development.js +81 -74
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +81 -74
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +7 -3
- package/src/assets/add.svg +0 -5
- package/src/assets/add_hover.svg +0 -4
- package/src/assets/arrow-down-icon.svg +0 -3
- package/src/assets/big-menu-icon-hover.svg +0 -6
- package/src/assets/big-menu-icon.svg +0 -6
- package/src/assets/check-cross-icon.svg +0 -7
- package/src/assets/check-icon-primary.svg +0 -5
- package/src/assets/check-icon.svg +0 -3
- package/src/assets/chevron-double.svg +0 -3
- package/src/assets/close.svg +0 -3
- package/src/assets/color-variant-cross.svg +0 -3
- package/src/assets/cross-dark.svg +0 -3
- package/src/assets/delete.svg +0 -4
- package/src/assets/delete_hover.svg +0 -4
- package/src/assets/edit.svg +0 -6
- package/src/assets/edit_hover.svg +0 -6
- package/src/assets/error-icon.svg +0 -7
- package/src/assets/grid-view-icon-active.svg +0 -6
- package/src/assets/grid-view-icon.svg +0 -6
- package/src/assets/groups.svg +0 -3
- package/src/assets/hamburger.svg +0 -5
- package/src/assets/happy-star.svg +0 -9
- package/src/assets/hcps.svg +0 -3
- package/src/assets/indeterminate-icon.svg +0 -3
- package/src/assets/info-icon.svg +0 -6
- package/src/assets/left-arrow-blue.svg +0 -3
- package/src/assets/left-arrow-grey.svg +0 -3
- package/src/assets/list-view-icon-active.svg +0 -3
- package/src/assets/list-view-icon.svg +0 -3
- package/src/assets/loading.svg +0 -16
- package/src/assets/modal-close-icon-active.svg +0 -9
- package/src/assets/modal-close-icon.svg +0 -9
- package/src/assets/no-open-alerts.svg +0 -19
- package/src/assets/patients.svg +0 -3
- package/src/assets/phone-mockup.svg +0 -9
- package/src/assets/programs.svg +0 -3
- package/src/assets/right-arrow-blue.svg +0 -3
- package/src/assets/right-arrow-grey.svg +0 -3
- package/src/assets/search-cancel.svg +0 -3
- package/src/assets/search-not-found.svg +0 -70
- package/src/assets/search.svg +0 -3
- package/src/assets/spinner-gray.svg +0 -6
- package/src/assets/spinner.svg +0 -5
- package/src/assets/starIcon.svg +0 -3
- package/src/assets/success-icon.svg +0 -6
- package/src/components/Accordion/Accordion.tsx +0 -33
- package/src/components/Accordion/AccordionItem.tsx +0 -50
- package/src/components/Avatar/Avatar.js +0 -81
- package/src/components/Avatar/Avatar.scss +0 -153
- package/src/components/Badge/Badge.tsx +0 -23
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -46
- package/src/components/Button/Button.examples.md +0 -46
- package/src/components/Button/Button.tsx +0 -200
- package/src/components/Button/Button.types.ts +0 -41
- package/src/components/Button/ButtonIcon.tsx +0 -42
- package/src/components/ButtonV2/ButtonProps.type.ts +0 -44
- package/src/components/ButtonV2/ButtonV2.tsx +0 -97
- package/src/components/ButtonV2/PrimaryButton.tsx +0 -25
- package/src/components/ButtonV2/SecondaryButton.tsx +0 -26
- package/src/components/ButtonV2/TertiaryButton.tsx +0 -26
- package/src/components/Carousel/Carousel.tsx +0 -52
- package/src/components/Carousel/GliderContainer.scss +0 -13
- package/src/components/Carousel/GliderContainer.tsx +0 -22
- package/src/components/CenteredHero/CenteredHero.tsx +0 -63
- package/src/components/CheckBoxListModal/CheckboxListModal.tsx +0 -180
- package/src/components/Checkbox/Checkbox.scss +0 -125
- package/src/components/Checkbox/Checkbox.tsx +0 -147
- package/src/components/CheckboxList/CheckboxGroup.tsx +0 -120
- package/src/components/CheckboxList/CheckboxList.tsx +0 -46
- package/src/components/CheckboxList/CheckboxList.types.ts +0 -47
- package/src/components/CheckboxList/CheckboxListItem.tsx +0 -54
- package/src/components/ConfirmationDialog/ConfirmationDialog.scss +0 -15
- package/src/components/ConfirmationDialog/ConfirmationDialog.tsx +0 -84
- package/src/components/Container/FlexColumn.tsx +0 -18
- package/src/components/Container/FlexContainer.tsx +0 -46
- package/src/components/Container/FlexRow.tsx +0 -18
- package/src/components/Container/types/FlexContainerProps.type.ts +0 -18
- package/src/components/Datepicker/Datepicker.js +0 -96
- package/src/components/Datepicker/Datepicker.scss +0 -332
- package/src/components/Dropdown/Dropdown.js +0 -416
- package/src/components/Dropdown/Dropdown.scss +0 -83
- package/src/components/EmptyListMessage/EmptyListMessage.tsx +0 -34
- package/src/components/ErrorBlock/ErrorBlock.js +0 -24
- package/src/components/ErrorBlock/ErrorBlock.scss +0 -20
- package/src/components/Form/Form.tsx +0 -138
- package/src/components/Form/FormFieldDecorator.tsx +0 -66
- package/src/components/Form/FormInput.tsx +0 -47
- package/src/components/Form/FormRadioGroup.tsx +0 -23
- package/src/components/Form/FormSelect.tsx +0 -32
- package/src/components/Form/form.transformer.ts +0 -9
- package/src/components/Form/form.types.ts +0 -139
- package/src/components/Icons/AddIcon.tsx +0 -29
- package/src/components/Icons/AlertsIcon.tsx +0 -39
- package/src/components/Icons/BellIcon.tsx +0 -39
- package/src/components/Icons/ChartIcon.tsx +0 -22
- package/src/components/Icons/ChatBoxIcon.tsx +0 -23
- package/src/components/Icons/CheckIcon.tsx +0 -26
- package/src/components/Icons/ChevronDoubleIcon.tsx +0 -25
- package/src/components/Icons/ChevronDownIcon.tsx +0 -20
- package/src/components/Icons/ChevronRightIcon.tsx +0 -20
- package/src/components/Icons/CrossIcon.tsx +0 -24
- package/src/components/Icons/DeleteIcon.tsx +0 -23
- package/src/components/Icons/DownArrowIcon.tsx +0 -23
- package/src/components/Icons/DragIcon.tsx +0 -25
- package/src/components/Icons/DynamicIcon.tsx +0 -25
- package/src/components/Icons/EditIcon.tsx +0 -23
- package/src/components/Icons/EmptyIcon.tsx +0 -29
- package/src/components/Icons/EmptyStateDashboardIcon.tsx +0 -130
- package/src/components/Icons/ExclamationMarkIcon.tsx +0 -23
- package/src/components/Icons/EyeIcon.tsx +0 -23
- package/src/components/Icons/GearIcon.tsx +0 -23
- package/src/components/Icons/GroupIcon.tsx +0 -23
- package/src/components/Icons/HamburgerIcon.tsx +0 -31
- package/src/components/Icons/HeartIcon.tsx +0 -23
- package/src/components/Icons/ImageIcon.tsx +0 -23
- package/src/components/Icons/LeftArrowIcon.tsx +0 -23
- package/src/components/Icons/LightBulbIcon.tsx +0 -31
- package/src/components/Icons/LockIcon.tsx +0 -23
- package/src/components/Icons/MessagesIcon.tsx +0 -23
- package/src/components/Icons/NotesIcon.tsx +0 -23
- package/src/components/Icons/PinIcon.tsx +0 -23
- package/src/components/Icons/PrintIcon.tsx +0 -22
- package/src/components/Icons/RightArrowIcon.tsx +0 -23
- package/src/components/Icons/SearchCancelIcon.tsx +0 -23
- package/src/components/Icons/SearchIcon.tsx +0 -23
- package/src/components/Icons/SmallCircleIcon.tsx +0 -21
- package/src/components/Icons/SmallDiamondIcon.tsx +0 -31
- package/src/components/Icons/SmallSquareIcon.tsx +0 -21
- package/src/components/Icons/SpaceRocketIcon.tsx +0 -23
- package/src/components/Icons/StarIcon.tsx +0 -23
- package/src/components/Icons/WarningIcon.tsx +0 -24
- package/src/components/Icons/types/IconProps.type.ts +0 -5
- package/src/components/InfoBlock/InfoBlock.js +0 -24
- package/src/components/InfoBlock/InfoBlock.scss +0 -20
- package/src/components/InfoField/InfoField.tsx +0 -94
- package/src/components/Input/Input.css +0 -3
- package/src/components/Input/Input.tsx +0 -211
- package/src/components/Input/SearchInput.tsx +0 -24
- package/src/components/Line/Line.js +0 -38
- package/src/components/List/List.scss +0 -23
- package/src/components/List/List.tsx +0 -138
- package/src/components/List/List.types.ts +0 -41
- package/src/components/List/ListItem.tsx +0 -89
- package/src/components/List/ListItemSkeleton.tsx +0 -26
- package/src/components/List/ListSkeleton.scss +0 -5
- package/src/components/List/ListSkeleton.tsx +0 -30
- package/src/components/LoadingIndicator/LoadingIndicator.scss +0 -50
- package/src/components/LoadingIndicator/LoadingIndicator.tsx +0 -46
- package/src/components/Menu/Menu.js +0 -74
- package/src/components/Menu/Menu.scss +0 -27
- package/src/components/Modal/Modal.scss +0 -117
- package/src/components/Modal/Modal.tsx +0 -104
- package/src/components/Modal/ModalWithButtons.tsx +0 -34
- package/src/components/MultiSelect/MultiSelect.js +0 -117
- package/src/components/MultiSelect/MultiSelect.scss +0 -29
- package/src/components/MultiSelect/MultiSelectUtils.js +0 -23
- package/src/components/NavMenu/NavLayout.tsx +0 -40
- package/src/components/NavMenu/NavMenu.tsx +0 -39
- package/src/components/NavMenu/NavMenu.utils.ts +0 -6
- package/src/components/NavMenu/NavMenuContent.tsx +0 -23
- package/src/components/NavMenu/NavMenuItem.tsx +0 -102
- package/src/components/NotificationBanner/NotificationBanner.tsx +0 -104
- package/src/components/Page/CRUDPage.js +0 -123
- package/src/components/Page/CRUDPage.scss +0 -32
- package/src/components/Page/Page.js +0 -102
- package/src/components/Page/Page.scss +0 -59
- package/src/components/PageHeader/PageHeader.tsx +0 -51
- package/src/components/PaginationMenu/PaginationMenu.tsx +0 -47
- package/src/components/PaginationMenu/PaginationMenu.types.ts +0 -46
- package/src/components/PaginationMenu/PaginationMenu.utils.ts +0 -49
- package/src/components/PaginationMenu/PaginationMenuLarge.tsx +0 -96
- package/src/components/PaginationMenu/PaginationMenuSmall.tsx +0 -43
- package/src/components/PreviewPhone/PreviewPhone.tsx +0 -52
- package/src/components/PreviewPhone/useWindowDimensions.js +0 -26
- package/src/components/Radio/Radio.js +0 -102
- package/src/components/Radio/Radio.scss +0 -58
- package/src/components/Radio/RadioV2.css +0 -15
- package/src/components/Radio/RadioV2.tsx +0 -87
- package/src/components/RadioGroup/RadioGroup.js +0 -66
- package/src/components/RadioGroup/RadioGroup.scss +0 -37
- package/src/components/RadioGroup/RadioGroupV2.tsx +0 -35
- package/src/components/Section/Section.scss +0 -74
- package/src/components/Section/Section.tsx +0 -68
- package/src/components/Section/SectionItem.scss +0 -20
- package/src/components/Section/SectionItem.tsx +0 -26
- package/src/components/Section/SectionItemWithContent.tsx +0 -30
- package/src/components/Select/LegacySelect.js +0 -114
- package/src/components/Select/Select.scss +0 -29
- package/src/components/Select/Select.tsx +0 -151
- package/src/components/Select/SelectV2.tsx +0 -171
- package/src/components/Select/options.transformer.ts +0 -36
- package/src/components/Select/select.utils.spec.ts +0 -63
- package/src/components/Select/select.utils.ts +0 -45
- package/src/components/SettingsMenuButton/SettingsMenuButton.tsx +0 -111
- package/src/components/Spinner/Spinner.tsx +0 -23
- package/src/components/Steps/Step.tsx +0 -31
- package/src/components/Steps/Steps.tsx +0 -24
- package/src/components/Switcher/Switcher.js +0 -58
- package/src/components/Switcher/SwitcherItem.js +0 -61
- package/src/components/Switcher/SwitcherItem.scss +0 -67
- package/src/components/TabLinks/TabLinks.tsx +0 -63
- package/src/components/Tabbar/Tabbar.tsx +0 -60
- package/src/components/Tabbar/TabbarItem.tsx +0 -66
- package/src/components/Table/Table.tsx +0 -91
- package/src/components/Table/Table.types.ts +0 -28
- package/src/components/Table/Table.utils.ts +0 -23
- package/src/components/Table/TableBody.tsx +0 -57
- package/src/components/Table/TableBodyRow.tsx +0 -47
- package/src/components/Table/TableBodyRowDataCell.tsx +0 -76
- package/src/components/Table/TableFooter.tsx +0 -21
- package/src/components/Table/TableHeader.tsx +0 -28
- package/src/components/Tag/Tag.tsx +0 -58
- package/src/components/Tag/Tag.utils.ts +0 -4
- package/src/components/Tag/TagGroup.tsx +0 -29
- package/src/components/Text/LegacyText.js +0 -78
- package/src/components/Text/Text.scss +0 -67
- package/src/components/Text/Text.tsx +0 -131
- package/src/components/TextEditor/TextEditor.js +0 -61
- package/src/components/TextEditor/TextEditor.scss +0 -14
- package/src/components/TextEditorV2/TextEditorV2.js +0 -52
- package/src/components/TextEditorV2/TextEditorV2.scss +0 -110
- package/src/components/TextLink/TextLink.tsx +0 -42
- package/src/components/Textarea/Textarea.js +0 -108
- package/src/components/Textarea/Textarea.scss +0 -56
- package/src/components/Timeline/Timeline.tsx +0 -28
- package/src/components/Timeline/TimelineStep.tsx +0 -36
- package/src/components/Title/LegacyTitle.js +0 -64
- package/src/components/Title/Title.scss +0 -6
- package/src/components/Title/Title.tsx +0 -62
- package/src/components/Toaster/Toaster.scss +0 -57
- package/src/components/Toaster/Toaster.tsx +0 -100
- package/src/components/Toaster/toast-elements-getter.ts +0 -72
- package/src/components/Toaster/toast-progress-animator.ts +0 -53
- package/src/components/Toaster/toast.ts +0 -112
- package/src/components/ViewItem/ViewItem.tsx +0 -85
- package/src/custom.d.ts +0 -4
- package/src/index.tsx +0 -170
- package/src/styles/_colors.scss +0 -59
- package/src/styles/_layout.scss +0 -64
- package/src/styles/_shadows.scss +0 -19
- package/src/styles/_skeleton.scss +0 -63
- package/src/styles/_typography.scss +0 -8
- package/src/styles/_utils.scss +0 -45
- 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 +0 -11
- package/src/utils/useOutsideClick.js +0 -19
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import { Spinner } from "../Spinner/Spinner";
|
|
5
|
-
import Text from "../Text/Text";
|
|
6
|
-
|
|
7
|
-
import { ButtonProps } from "./ButtonProps.type";
|
|
8
|
-
|
|
9
|
-
export const ButtonV2 = ({
|
|
10
|
-
onClick,
|
|
11
|
-
text,
|
|
12
|
-
textColor,
|
|
13
|
-
textHoverColor,
|
|
14
|
-
icon,
|
|
15
|
-
isDisabled,
|
|
16
|
-
isPending,
|
|
17
|
-
className,
|
|
18
|
-
...otherAttributes
|
|
19
|
-
}: ButtonProps): JSX.Element => {
|
|
20
|
-
function handleClick(event: React.MouseEvent<HTMLButtonElement>) {
|
|
21
|
-
event.stopPropagation();
|
|
22
|
-
onClick?.(event);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!text && !icon) {
|
|
26
|
-
console.error(
|
|
27
|
-
"A text or an icon is required to use this component, please make sure to pass at least one of them as a prop."
|
|
28
|
-
);
|
|
29
|
-
return <span>Invalid props passed to this component.</span>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const buttonClassName = classNames(
|
|
33
|
-
[
|
|
34
|
-
"h-11",
|
|
35
|
-
"relative flex flex-row justify-center items-center",
|
|
36
|
-
"border",
|
|
37
|
-
"transition-outline transition-colors duration-300 ease-in-out",
|
|
38
|
-
"rounded-full",
|
|
39
|
-
"leading-none",
|
|
40
|
-
"shadow-sm",
|
|
41
|
-
"cursor-pointer",
|
|
42
|
-
"focus:outline-primary",
|
|
43
|
-
"group",
|
|
44
|
-
],
|
|
45
|
-
{
|
|
46
|
-
"w-11": !text && icon,
|
|
47
|
-
"pl-4 pr-6": text && icon,
|
|
48
|
-
"px-4": text && !icon,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"opacity-50": isDisabled,
|
|
52
|
-
"pointer-events-none": isDisabled || isPending,
|
|
53
|
-
},
|
|
54
|
-
className
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<button
|
|
59
|
-
{...otherAttributes}
|
|
60
|
-
className={buttonClassName}
|
|
61
|
-
type={"button"}
|
|
62
|
-
onClick={handleClick}
|
|
63
|
-
disabled={isDisabled}
|
|
64
|
-
aria-disabled={isDisabled}
|
|
65
|
-
>
|
|
66
|
-
{icon && React.createElement(icon, { className: "w-6 h-6" })}
|
|
67
|
-
|
|
68
|
-
{isPending && (
|
|
69
|
-
<span
|
|
70
|
-
className="opacity-100"
|
|
71
|
-
// IE11 center translate fix
|
|
72
|
-
style={{
|
|
73
|
-
position: "absolute",
|
|
74
|
-
left: "50%",
|
|
75
|
-
top: "50%",
|
|
76
|
-
transform: "translate(-50%, -50%)",
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
<Spinner className="text-white" />
|
|
80
|
-
</span>
|
|
81
|
-
)}
|
|
82
|
-
|
|
83
|
-
{text && (
|
|
84
|
-
<Text
|
|
85
|
-
className={classNames({
|
|
86
|
-
invisible: isPending,
|
|
87
|
-
"ml-1": icon,
|
|
88
|
-
})}
|
|
89
|
-
text={text}
|
|
90
|
-
color={textColor}
|
|
91
|
-
hoverColor={textHoverColor}
|
|
92
|
-
hoverInGroup
|
|
93
|
-
/>
|
|
94
|
-
)}
|
|
95
|
-
</button>
|
|
96
|
-
);
|
|
97
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import { ButtonV2 } from "./ButtonV2";
|
|
5
|
-
import { ButtonWithPendingStateProps } from "./ButtonProps.type";
|
|
6
|
-
|
|
7
|
-
export const PrimaryButton = (
|
|
8
|
-
props: ButtonWithPendingStateProps
|
|
9
|
-
): JSX.Element => {
|
|
10
|
-
return (
|
|
11
|
-
<ButtonV2
|
|
12
|
-
{...props}
|
|
13
|
-
className={classNames(
|
|
14
|
-
[
|
|
15
|
-
"text-white",
|
|
16
|
-
"bg-blue-800",
|
|
17
|
-
"border-primary-transparent",
|
|
18
|
-
"hover:bg-blue-900",
|
|
19
|
-
],
|
|
20
|
-
props.className
|
|
21
|
-
)}
|
|
22
|
-
textColor="white"
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import { ButtonV2 } from "./ButtonV2";
|
|
5
|
-
import { BaseButtonProps } from "./ButtonProps.type";
|
|
6
|
-
|
|
7
|
-
export const SecondaryButton = (props: BaseButtonProps): JSX.Element => {
|
|
8
|
-
return (
|
|
9
|
-
<ButtonV2
|
|
10
|
-
{...props}
|
|
11
|
-
className={classNames(
|
|
12
|
-
[
|
|
13
|
-
"text-blue-800",
|
|
14
|
-
"bg-white",
|
|
15
|
-
"border-slate-300",
|
|
16
|
-
"hover:text-blue-900",
|
|
17
|
-
"hover:border-slate-400",
|
|
18
|
-
"focus:border-blue-800",
|
|
19
|
-
],
|
|
20
|
-
props.className
|
|
21
|
-
)}
|
|
22
|
-
textColor="blue-800"
|
|
23
|
-
textHoverColor="blue-900"
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import { ButtonV2 } from "./ButtonV2";
|
|
5
|
-
import { BaseButtonProps } from "./ButtonProps.type";
|
|
6
|
-
|
|
7
|
-
export const TertiaryButton = (props: BaseButtonProps): JSX.Element => {
|
|
8
|
-
return (
|
|
9
|
-
<ButtonV2
|
|
10
|
-
{...props}
|
|
11
|
-
className={classNames(
|
|
12
|
-
[
|
|
13
|
-
"text-blue-800",
|
|
14
|
-
"bg-transparent",
|
|
15
|
-
"border-transparent",
|
|
16
|
-
"hover:text-blue-900",
|
|
17
|
-
"focus:border-blue-800",
|
|
18
|
-
"shadow-none",
|
|
19
|
-
],
|
|
20
|
-
props.className
|
|
21
|
-
)}
|
|
22
|
-
textColor="blue-800"
|
|
23
|
-
textHoverColor="blue-900"
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import Glider from "react-glider";
|
|
4
|
-
|
|
5
|
-
import { GliderContainer } from "./GliderContainer";
|
|
6
|
-
|
|
7
|
-
interface CarouselProps {
|
|
8
|
-
id: string;
|
|
9
|
-
slides: React.ReactNode[];
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const Carousel = ({ slides, className, id }: CarouselProps): JSX.Element => {
|
|
14
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
15
|
-
useEffect(() => setIsVisible(false), [id]);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
// hack to force Glider to re mount when id changes
|
|
18
|
-
if (!isVisible) {
|
|
19
|
-
setIsVisible(true);
|
|
20
|
-
}
|
|
21
|
-
}, [isVisible]);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
isVisible ? (
|
|
25
|
-
<Glider
|
|
26
|
-
hasDots
|
|
27
|
-
hasArrows
|
|
28
|
-
skipTrack
|
|
29
|
-
// draggable
|
|
30
|
-
scrollLock
|
|
31
|
-
rewind
|
|
32
|
-
arrows={{
|
|
33
|
-
prev: ".entity-preview-left",
|
|
34
|
-
next: ".entity-preview-right",
|
|
35
|
-
}}
|
|
36
|
-
id={id} // this should force Glider to rebuild, but it does not
|
|
37
|
-
dots={".entity-preview-dots"}
|
|
38
|
-
className={classNames("h-full", className)}
|
|
39
|
-
containerElement={GliderContainer}
|
|
40
|
-
>
|
|
41
|
-
<div className="glider-track h-full">
|
|
42
|
-
{slides?.map((slide, index) => (
|
|
43
|
-
<div key={index} className={"overflow-hidden"}>
|
|
44
|
-
{slide}
|
|
45
|
-
</div>
|
|
46
|
-
))}
|
|
47
|
-
</div>
|
|
48
|
-
</Glider>
|
|
49
|
-
) : <></>);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default Carousel;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import Button, { BUTTON_ROLES } from "../Button/Button";
|
|
4
|
-
|
|
5
|
-
import "./GliderContainer.scss";
|
|
6
|
-
|
|
7
|
-
interface GliderContainerProps {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const GliderContainer = (props: GliderContainerProps): JSX.Element => (
|
|
12
|
-
<div className={"relative h-full pb-6 glider-contain px-17 pb-6"}>
|
|
13
|
-
{props.children}
|
|
14
|
-
<div className={"entity-preview-left absolute top-1/2 left-0"}>
|
|
15
|
-
<Button iconName={"chevron-left-blue"} role={BUTTON_ROLES.QUATERNARY} />
|
|
16
|
-
</div>
|
|
17
|
-
<div className={"entity-preview-right absolute top-1/2 right-0"}>
|
|
18
|
-
<Button iconName={"chevron-right-blue"} role={BUTTON_ROLES.QUATERNARY} />
|
|
19
|
-
</div>
|
|
20
|
-
<div className="entity-preview-dots" />
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
|
|
4
|
-
import Button from "../Button/Button";
|
|
5
|
-
import { ButtonProps } from "../Button/Button.types";
|
|
6
|
-
import Text from "../Text/Text";
|
|
7
|
-
import { Title } from "../Title/Title";
|
|
8
|
-
|
|
9
|
-
export type BackgroundColor = "white" | "slate-50";
|
|
10
|
-
|
|
11
|
-
export interface CenteredHeroProps {
|
|
12
|
-
title: string;
|
|
13
|
-
text: string;
|
|
14
|
-
image: string;
|
|
15
|
-
buttons: ButtonProps[];
|
|
16
|
-
background?: BackgroundColor;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const CenteredHero = ({
|
|
20
|
-
title,
|
|
21
|
-
text,
|
|
22
|
-
image,
|
|
23
|
-
buttons,
|
|
24
|
-
background = "slate-50",
|
|
25
|
-
}: CenteredHeroProps): JSX.Element => {
|
|
26
|
-
return (
|
|
27
|
-
<div
|
|
28
|
-
className={classNames(
|
|
29
|
-
"p-6 flex flex-col items-center align-center w-full",
|
|
30
|
-
{
|
|
31
|
-
"bg-white": background === "white",
|
|
32
|
-
"bg-slate-50": background === "slate-50",
|
|
33
|
-
}
|
|
34
|
-
)}
|
|
35
|
-
>
|
|
36
|
-
{image && <img src={image} className="h-36 w-36 mb-4" />}
|
|
37
|
-
{title && <Title text={title} type={"base"} />}
|
|
38
|
-
{text && <Text text={text} />}
|
|
39
|
-
|
|
40
|
-
{buttons?.length > 0 && (
|
|
41
|
-
<div className="flex flex-row mt-4">
|
|
42
|
-
{buttons
|
|
43
|
-
.filter(
|
|
44
|
-
(button) => button.title && button.handleOnClick && button.type
|
|
45
|
-
)
|
|
46
|
-
.map((button) => (
|
|
47
|
-
<Button
|
|
48
|
-
className="mr-4 last:mr-0"
|
|
49
|
-
key={button.title}
|
|
50
|
-
role={button.role}
|
|
51
|
-
type={button.type}
|
|
52
|
-
title={button.title}
|
|
53
|
-
text={button.text}
|
|
54
|
-
onClick={button.handleOnClick}
|
|
55
|
-
/>
|
|
56
|
-
))}
|
|
57
|
-
</div>
|
|
58
|
-
)}
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export default CenteredHero;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
import groupBy from "lodash/groupBy";
|
|
5
|
-
|
|
6
|
-
import { CheckboxChangeEvent } from "../CheckboxList/CheckboxList.types";
|
|
7
|
-
import { SecondaryButton } from "../ButtonV2/SecondaryButton";
|
|
8
|
-
import { PrimaryButton } from "../ButtonV2/PrimaryButton";
|
|
9
|
-
import { ModalWithButtons } from "../Modal/ModalWithButtons";
|
|
10
|
-
import LoadingIndicator from "../LoadingIndicator/LoadingIndicator";
|
|
11
|
-
import { SearchInput } from "../Input/SearchInput";
|
|
12
|
-
import Text from "../Text/Text";
|
|
13
|
-
import CheckboxList from "../CheckboxList/CheckboxList";
|
|
14
|
-
|
|
15
|
-
export interface Item {
|
|
16
|
-
id: string;
|
|
17
|
-
label: string;
|
|
18
|
-
isChecked: boolean;
|
|
19
|
-
group?: string;
|
|
20
|
-
isPinned?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface Group {
|
|
24
|
-
title?: string;
|
|
25
|
-
items: Item[];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface CheckboxListModalTexts {
|
|
29
|
-
title: string;
|
|
30
|
-
confirmLabel: string;
|
|
31
|
-
cancelLabel: string;
|
|
32
|
-
searchPlaceHolder?: string;
|
|
33
|
-
emptyState: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface CheckboxListModalProps {
|
|
37
|
-
texts: CheckboxListModalTexts;
|
|
38
|
-
initialItems: Array<Item>;
|
|
39
|
-
isLoadingInitialItems?: boolean;
|
|
40
|
-
isOpen: boolean;
|
|
41
|
-
onSave: (newItems: Item[]) => void;
|
|
42
|
-
onCloseClick: () => void;
|
|
43
|
-
filterItem: (item: Item, searchQuery: string) => boolean;
|
|
44
|
-
className?: string;
|
|
45
|
-
hasSearch: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const transformToGroups = (items: Item[]): Group[] => {
|
|
49
|
-
const pinned = items.find((option) => option.isPinned);
|
|
50
|
-
|
|
51
|
-
const itemsWithGroup = items.filter((option) => option.group);
|
|
52
|
-
const groups = Object.entries(groupBy(itemsWithGroup, "group")).map(
|
|
53
|
-
(group) => ({
|
|
54
|
-
title: group[0],
|
|
55
|
-
items: group[1].sort((a, b) =>
|
|
56
|
-
a.label > b.label ? 1 : b.label > a.label ? -1 : 0
|
|
57
|
-
),
|
|
58
|
-
})
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const itemsWithoutGroup = items.filter((option) => !option.group);
|
|
62
|
-
const restGroup = {
|
|
63
|
-
name: undefined,
|
|
64
|
-
items: itemsWithoutGroup,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
if (pinned) {
|
|
68
|
-
const myGroup = {
|
|
69
|
-
items: [pinned],
|
|
70
|
-
};
|
|
71
|
-
return [myGroup, ...groups, restGroup];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return [...groups, restGroup];
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const CheckboxListModal = ({
|
|
78
|
-
texts,
|
|
79
|
-
initialItems,
|
|
80
|
-
isLoadingInitialItems,
|
|
81
|
-
isOpen,
|
|
82
|
-
onSave,
|
|
83
|
-
onCloseClick,
|
|
84
|
-
filterItem = () => true,
|
|
85
|
-
className,
|
|
86
|
-
hasSearch = false,
|
|
87
|
-
}: CheckboxListModalProps): JSX.Element => {
|
|
88
|
-
const containerClassName = classNames(className);
|
|
89
|
-
|
|
90
|
-
const [items, setItems] = useState<Item[]>([]);
|
|
91
|
-
const [visibleItems, setVisibleItems] = useState<Item[]>([]);
|
|
92
|
-
const [groups, setGroups] = useState<Group[]>([]);
|
|
93
|
-
const [search, setSearch] = useState("");
|
|
94
|
-
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
setItems(initialItems);
|
|
97
|
-
}, [initialItems]);
|
|
98
|
-
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
setVisibleItems(items.filter((item) => filterItem(item, search)));
|
|
101
|
-
}, [items, search]);
|
|
102
|
-
|
|
103
|
-
useEffect(() => {
|
|
104
|
-
setGroups(transformToGroups(visibleItems));
|
|
105
|
-
}, [visibleItems]);
|
|
106
|
-
|
|
107
|
-
const handleOnItemChange = (event: CheckboxChangeEvent) => {
|
|
108
|
-
const updatedItems = [...items];
|
|
109
|
-
const index = updatedItems.findIndex((item) => item.id === event.id);
|
|
110
|
-
updatedItems[index].isChecked = event.newCheckedValue;
|
|
111
|
-
setItems(updatedItems);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const handleOnCloseClick = (
|
|
115
|
-
event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent
|
|
116
|
-
) => {
|
|
117
|
-
event.stopPropagation();
|
|
118
|
-
onCloseClick();
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const handleOnSaveClick = () => {
|
|
122
|
-
onSave(items.filter((item) => item.isChecked));
|
|
123
|
-
onCloseClick();
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const handleOnSearchChange = (event) => {
|
|
127
|
-
setSearch(event.currentTarget.value ?? "");
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const closeButton = (
|
|
131
|
-
<SecondaryButton
|
|
132
|
-
text={texts.cancelLabel}
|
|
133
|
-
onClick={handleOnCloseClick}
|
|
134
|
-
key="close-checkbox-list-modal"
|
|
135
|
-
className="mr-2"
|
|
136
|
-
/>
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const saveButton = (
|
|
140
|
-
<PrimaryButton
|
|
141
|
-
text={texts.confirmLabel}
|
|
142
|
-
onClick={handleOnSaveClick}
|
|
143
|
-
key="save-selected-checkbox-list-items"
|
|
144
|
-
/>
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<ModalWithButtons
|
|
149
|
-
isOpen={isOpen}
|
|
150
|
-
title={texts.title}
|
|
151
|
-
onCloseClick={handleOnCloseClick}
|
|
152
|
-
withPadding
|
|
153
|
-
shouldCloseOnOverlayClick
|
|
154
|
-
className={containerClassName}
|
|
155
|
-
buttons={[closeButton, saveButton]}
|
|
156
|
-
buttonsAlignment="justify-end"
|
|
157
|
-
>
|
|
158
|
-
<div className="max-h-135 overflow-y-auto pr-4">
|
|
159
|
-
{isLoadingInitialItems && <LoadingIndicator />}
|
|
160
|
-
|
|
161
|
-
{hasSearch && !isLoadingInitialItems && (
|
|
162
|
-
<SearchInput
|
|
163
|
-
className="w-130 mb-2"
|
|
164
|
-
value={search}
|
|
165
|
-
placeholder={texts.searchPlaceHolder}
|
|
166
|
-
onChange={handleOnSearchChange}
|
|
167
|
-
/>
|
|
168
|
-
)}
|
|
169
|
-
|
|
170
|
-
{!isLoadingInitialItems && items?.length > 0 && (
|
|
171
|
-
<CheckboxList groups={groups} onChange={handleOnItemChange} />
|
|
172
|
-
)}
|
|
173
|
-
|
|
174
|
-
{!isLoadingInitialItems && items?.length === 0 && (
|
|
175
|
-
<Text text={texts.emptyState} />
|
|
176
|
-
)}
|
|
177
|
-
</div>
|
|
178
|
-
</ModalWithButtons>
|
|
179
|
-
);
|
|
180
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
@import "../../styles/colors";
|
|
2
|
-
@import "../../styles/layout";
|
|
3
|
-
|
|
4
|
-
.cweb-checkbox {
|
|
5
|
-
outline: none;
|
|
6
|
-
transition: all 0.3s ease;
|
|
7
|
-
|
|
8
|
-
.cweb-checkbox-input {
|
|
9
|
-
position: absolute;
|
|
10
|
-
-webkit-appearance: none;
|
|
11
|
-
height: 1px;
|
|
12
|
-
opacity: 0;
|
|
13
|
-
width: 1px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.type-regular {
|
|
17
|
-
.cweb-checkbox-label {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
margin-bottom: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.cweb-checkbox-icon-container {
|
|
24
|
-
width: 16px;
|
|
25
|
-
height: 16px;
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
flex: 0 0 auto;
|
|
30
|
-
border: 1px solid $color-border;
|
|
31
|
-
border-radius: $default-border-radius;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.hasError {
|
|
35
|
-
.cweb-checkbox-icon-container {
|
|
36
|
-
border: 1px solid $color-negative;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.cweb-checkbox-icon {
|
|
41
|
-
display: block;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&.is-focused {
|
|
45
|
-
.cweb-checkbox-icon-container {
|
|
46
|
-
border-color: $color-primary;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&.is-checked {
|
|
51
|
-
.cweb-checkbox-icon {
|
|
52
|
-
width: 0.5rem;
|
|
53
|
-
height: 0.5rem;
|
|
54
|
-
padding: 4px;
|
|
55
|
-
background: url("../../assets/check-icon.svg") no-repeat center;
|
|
56
|
-
background-size: contain;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&.is-indeterminate {
|
|
61
|
-
.cweb-checkbox-icon {
|
|
62
|
-
width: 0.5rem;
|
|
63
|
-
height: 0.5rem;
|
|
64
|
-
padding: 4px;
|
|
65
|
-
background: url("../../assets/indeterminate-icon.svg") no-repeat center;
|
|
66
|
-
background-size: contain;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.is-disabled.show-cross-when-disabled {
|
|
71
|
-
.cweb-checkbox-icon {
|
|
72
|
-
width: 10px;
|
|
73
|
-
height: 10px;
|
|
74
|
-
background: url("../../assets/check-cross-icon.svg") no-repeat center;
|
|
75
|
-
background-size: contain;
|
|
76
|
-
opacity: 0.6;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&.type-switch {
|
|
82
|
-
.cweb-checkbox-label {
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
margin-bottom: 0;
|
|
86
|
-
width: 56px;
|
|
87
|
-
height: 28px;
|
|
88
|
-
position: relative;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.cweb-checkbox-icon-container {
|
|
92
|
-
position: absolute;
|
|
93
|
-
cursor: pointer;
|
|
94
|
-
top: 0;
|
|
95
|
-
left: 0;
|
|
96
|
-
right: 0;
|
|
97
|
-
bottom: 0;
|
|
98
|
-
background-color: $input-background;
|
|
99
|
-
border-radius: 16px;
|
|
100
|
-
|
|
101
|
-
&:after {
|
|
102
|
-
position: relative;
|
|
103
|
-
display: block;
|
|
104
|
-
content: "";
|
|
105
|
-
height: 20px;
|
|
106
|
-
width: 20px;
|
|
107
|
-
top: 4px;
|
|
108
|
-
left: 4px;
|
|
109
|
-
background-color: white;
|
|
110
|
-
border-radius: 50%;
|
|
111
|
-
transition: all 0.2s ease;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&.is-checked {
|
|
116
|
-
.cweb-checkbox-icon-container {
|
|
117
|
-
background-color: $color-toggle-switch-background;
|
|
118
|
-
|
|
119
|
-
&:after {
|
|
120
|
-
left: 32px;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|