@hellobetterdigitalnz/betterui 0.0.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/.editorconfig +17 -0
- package/.eslintrc.cjs +14 -0
- package/.storybook/main.ts +23 -0
- package/.storybook/preview.ts +17 -0
- package/README.md +30 -0
- package/index.html +13 -0
- package/package.json +45 -0
- package/public/image/table-image.png +0 -0
- package/public/vite.svg +1 -0
- package/src/App.tsx +30 -0
- package/src/Components/DataDisplay/Accordion/Accordion.stories.tsx +57 -0
- package/src/Components/DataDisplay/Accordion/Accordion.tsx +14 -0
- package/src/Components/DataDisplay/Accordion/AccordionContext.tsx +11 -0
- package/src/Components/DataDisplay/Accordion/AccordionContextInterface.tsx +8 -0
- package/src/Components/DataDisplay/Accordion/AccordionItem.tsx +62 -0
- package/src/Components/DataDisplay/Accordion/AccordionItemProps.tsx +12 -0
- package/src/Components/DataDisplay/Accordion/AccordionProps.tsx +8 -0
- package/src/Components/DataDisplay/Accordion/AccordionProvider.tsx +65 -0
- package/src/Components/DataDisplay/Accordion/AccordionProviderInterface.tsx +8 -0
- package/src/Components/DataDisplay/Accordion/accordion.module.scss +56 -0
- package/src/Components/DataDisplay/Badge/Badge.stories.tsx +44 -0
- package/src/Components/DataDisplay/Badge/Badge.tsx +32 -0
- package/src/Components/DataDisplay/Badge/BadgeProps.tsx +6 -0
- package/src/Components/DataDisplay/Badge/badge.module.scss +42 -0
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCard.stories.tsx +26 -0
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCard.tsx +47 -0
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCardInterface.tsx +15 -0
- package/src/Components/DataDisplay/Cards/BannerCard/banner-card.scss +54 -0
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCard.stories.tsx +31 -0
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCard.tsx +53 -0
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCardInterface.tsx +17 -0
- package/src/Components/DataDisplay/Cards/PathwayCard/pathway-card-stories.scss +3 -0
- package/src/Components/DataDisplay/Cards/PathwayCard/pathway-card.scss +62 -0
- package/src/Components/DataDisplay/Media/Media.tsx +26 -0
- package/src/Components/DataDisplay/Media/MediaProps.tsx +9 -0
- package/src/Components/DataDisplay/Media/media.scss +0 -0
- package/src/Components/DataDisplay/Modal/Modal.tsx +5 -0
- package/src/Components/DataDisplay/Modal/ModalActions.tsx +5 -0
- package/src/Components/DataDisplay/Modal/ModalActionsLeft.tsx +5 -0
- package/src/Components/DataDisplay/Modal/ModalActionsRight.tsx +5 -0
- package/src/Components/DataDisplay/Modal/ModalBody.tsx +5 -0
- package/src/Components/DataDisplay/Modal/ModalCurtain.tsx +5 -0
- package/src/Components/DataDisplay/Modal/ModalHeader.tsx +5 -0
- package/src/Components/DataDisplay/NotificationsBell/NotificationBell.stories.tsx +27 -0
- package/src/Components/DataDisplay/NotificationsBell/NotificationsBell.tsx +51 -0
- package/src/Components/DataDisplay/NotificationsBell/NotificationsBellProps.tsx +9 -0
- package/src/Components/DataDisplay/NotificationsBell/notificationBell.module.scss +48 -0
- package/src/Components/DataDisplay/NotificationsPanel/Notification.stories.tsx +128 -0
- package/src/Components/DataDisplay/NotificationsPanel/Notification.tsx +59 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationProps.tsx +11 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroup.tsx +17 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroupProps.tsx +8 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroups.tsx +42 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroupsProps.tsx +7 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsHeader.tsx +27 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsHeaderProps.tsx +9 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsNone.tsx +11 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsPanel.tsx +8 -0
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsPanelProps.tsx +7 -0
- package/src/Components/DataDisplay/NotificationsPanel/notificationPanel.module.scss +196 -0
- package/src/Components/DataDisplay/Tab/Tab.stories.tsx +72 -0
- package/src/Components/DataDisplay/Tab/Tab.tsx +20 -0
- package/src/Components/DataDisplay/Tab/TabBody.tsx +6 -0
- package/src/Components/DataDisplay/Tab/TabBodyContent.tsx +15 -0
- package/src/Components/DataDisplay/Tab/TabBodyContentProps.tsx +9 -0
- package/src/Components/DataDisplay/Tab/TabBodyProps.tsx +8 -0
- package/src/Components/DataDisplay/Tab/TabContext.tsx +9 -0
- package/src/Components/DataDisplay/Tab/TabContextProps.tsx +6 -0
- package/src/Components/DataDisplay/Tab/TabNav.tsx +6 -0
- package/src/Components/DataDisplay/Tab/TabNavItem.tsx +49 -0
- package/src/Components/DataDisplay/Tab/TabNavItemProps.tsx +9 -0
- package/src/Components/DataDisplay/Tab/TabNavProps.tsx +8 -0
- package/src/Components/DataDisplay/Tab/TabProps.tsx +8 -0
- package/src/Components/DataDisplay/Tab/tab.module.scss +35 -0
- package/src/Components/DataDisplay/Tab/tab.stories.scss +3 -0
- package/src/Components/DataDisplay/Table/Table.stories.tsx +64 -0
- package/src/Components/DataDisplay/Table/Table.tsx +10 -0
- package/src/Components/DataDisplay/Table/TableBody.tsx +13 -0
- package/src/Components/DataDisplay/Table/TableBodyProps.tsx +8 -0
- package/src/Components/DataDisplay/Table/TableCell.tsx +30 -0
- package/src/Components/DataDisplay/Table/TableCellAction.tsx +27 -0
- package/src/Components/DataDisplay/Table/TableCellActionProps.tsx +11 -0
- package/src/Components/DataDisplay/Table/TableCellProps.tsx +11 -0
- package/src/Components/DataDisplay/Table/TableCellWithDesc.tsx +21 -0
- package/src/Components/DataDisplay/Table/TableCellWithDescProps.tsx +9 -0
- package/src/Components/DataDisplay/Table/TableCellWithImage.tsx +39 -0
- package/src/Components/DataDisplay/Table/TableCellWithImageProps.tsx +10 -0
- package/src/Components/DataDisplay/Table/TableFooter.tsx +5 -0
- package/src/Components/DataDisplay/Table/TableHead.tsx +11 -0
- package/src/Components/DataDisplay/Table/TableHeadProps.tsx +8 -0
- package/src/Components/DataDisplay/Table/TableHeaderCell.tsx +17 -0
- package/src/Components/DataDisplay/Table/TableHeaderCellProps.tsx +10 -0
- package/src/Components/DataDisplay/Table/TableProps.tsx +8 -0
- package/src/Components/DataDisplay/Table/TableRow.tsx +9 -0
- package/src/Components/DataDisplay/Table/TableRowProps.tsx +8 -0
- package/src/Components/DataDisplay/Table/table.module.scss +103 -0
- package/src/Components/Form/Button/Button.stories.tsx +66 -0
- package/src/Components/Form/Button/Button.tsx +64 -0
- package/src/Components/Form/Button/ButtonProps.tsx +18 -0
- package/src/Components/Form/Button/button.module.scss +142 -0
- package/src/Components/Form/Checkbox/Checkbox.stories.tsx +49 -0
- package/src/Components/Form/Checkbox/Checkbox.tsx +85 -0
- package/src/Components/Form/Checkbox/CheckboxProps.tsx +22 -0
- package/src/Components/Form/Checkbox/checkbox.module.scss +63 -0
- package/src/Components/Form/CheckboxSelect/CheckboxSelect.tsx +5 -0
- package/src/Components/Form/CheckboxSelect/CheckboxSelectItem.tsx +5 -0
- package/src/Components/Form/CheckboxSet/CheckboxSet.stories.tsx +93 -0
- package/src/Components/Form/CheckboxSet/CheckboxSet.tsx +14 -0
- package/src/Components/Form/CheckboxSet/CheckboxSetItem.tsx +88 -0
- package/src/Components/Form/CheckboxSet/CheckboxSetProps.tsx +9 -0
- package/src/Components/Form/CheckboxSet/checkboxSet.module.scss +13 -0
- package/src/Components/Form/CurrencyField/CurrenctField.stories.tsx +22 -0
- package/src/Components/Form/CurrencyField/CurrencyField.tsx +59 -0
- package/src/Components/Form/CurrencyField/CurrencyFieldProps.tsx +8 -0
- package/src/Components/Form/DateField/DateField.stories.tsx +22 -0
- package/src/Components/Form/DateField/DateField.tsx +58 -0
- package/src/Components/Form/DropdownBadge/DropdownBadge.stories.tsx +49 -0
- package/src/Components/Form/DropdownBadge/DropdownBadge.tsx +160 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeItem.tsx +40 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeItemProps.tsx +10 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeProps.tsx +31 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelector.tsx +11 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelectorProps.tsx +7 -0
- package/src/Components/Form/DropdownBadge/dropdownBadge.module.scss +105 -0
- package/src/Components/Form/DropdownField/DropdownField.stories.tsx +50 -0
- package/src/Components/Form/DropdownField/DropdownField.tsx +118 -0
- package/src/Components/Form/DropdownField/DropdownFieldItem.tsx +26 -0
- package/src/Components/Form/DropdownField/DropdownFieldItemProps.tsx +9 -0
- package/src/Components/Form/DropdownField/DropdownFieldProps.tsx +33 -0
- package/src/Components/Form/DropdownField/DropdownFieldSelector.tsx +15 -0
- package/src/Components/Form/DropdownField/DropdownFieldSelectorProps.tsx +7 -0
- package/src/Components/Form/DropdownField/dropdown.module.scss +79 -0
- package/src/Components/Form/EmailField/EmailField.stories.ts +23 -0
- package/src/Components/Form/EmailField/EmailField.tsx +51 -0
- package/src/Components/Form/ErrorMessage/ErrorMessage.tsx +5 -0
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.tsx +5 -0
- package/src/Components/Form/IconButton/IconButton.stories.tsx +45 -0
- package/src/Components/Form/IconButton/IconButton.tsx +58 -0
- package/src/Components/Form/IconButton/IconButtonProps.tsx +15 -0
- package/src/Components/Form/IconButton/iconButton.module.scss +111 -0
- package/src/Components/Form/InputProps.tsx +25 -0
- package/src/Components/Form/MultiSelectField/MultiSelectField.tsx +5 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldItem.tsx +5 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldTag.tsx +5 -0
- package/src/Components/Form/PasswordField/PasswordField.stories.tsx +22 -0
- package/src/Components/Form/PasswordField/PasswordField.tsx +70 -0
- package/src/Components/Form/RadioButtons/RadioButton.tsx +70 -0
- package/src/Components/Form/RadioButtons/RadioButtonProps.tsx +22 -0
- package/src/Components/Form/RadioButtons/RadioButtons.stories.tsx +64 -0
- package/src/Components/Form/RadioButtons/RadioButtons.tsx +18 -0
- package/src/Components/Form/RadioButtons/RadioButtonsProps.tsx +10 -0
- package/src/Components/Form/RadioButtons/radioButton.stories.scss +3 -0
- package/src/Components/Form/RadioButtons/radiobutton.module.scss +63 -0
- package/src/Components/Form/TextField/TextField.stories.ts +23 -0
- package/src/Components/Form/TextField/TextField.tsx +52 -0
- package/src/Components/Form/Textarea/Textarea.stories.ts +31 -0
- package/src/Components/Form/Textarea/Textarea.tsx +71 -0
- package/src/Components/Form/Textarea/TextareaProps.tsx +27 -0
- package/src/Components/Form/Textarea/textarea.module.scss +49 -0
- package/src/Components/Form/TimeField/TimeField.stories.tsx +22 -0
- package/src/Components/Form/TimeField/TimeField.tsx +58 -0
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.stories.tsx +49 -0
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.tsx +87 -0
- package/src/Components/Form/ToggleSwitch/ToggleSwitchProps.tsx +22 -0
- package/src/Components/Form/ToggleSwitch/toggleSwitch.module.scss +82 -0
- package/src/Components/Form/inputs.module.scss +121 -0
- package/src/Components/Icons/Arrows/CaretDown/CaretDown.tsx +49 -0
- package/src/Components/Icons/Arrows/CaretUp/CaretUp.tsx +49 -0
- package/src/Components/Icons/Commerce/CurrencyDollarSimple/CurrencyDollarSimple.tsx +105 -0
- package/src/Components/Icons/Communication/AddressBook/AddressBook.stories.ts +28 -0
- package/src/Components/Icons/Communication/AddressBook/AddressBook.tsx +50 -0
- package/src/Components/Icons/Communication/Asterick/Asterisk.stories.ts +28 -0
- package/src/Components/Icons/Communication/Asterick/Asterisk.tsx +50 -0
- package/src/Components/Icons/Communication/AsterickSimple/AsteriskSimple.stories.ts +28 -0
- package/src/Components/Icons/Communication/AsterickSimple/AsteriskSimple.tsx +49 -0
- package/src/Components/Icons/Communication/At/At.stories.ts +28 -0
- package/src/Components/Icons/Communication/At/At.tsx +49 -0
- package/src/Components/Icons/Communication/Broadcast/Broadcast.stories.ts +27 -0
- package/src/Components/Icons/Communication/Broadcast/Broadcast.tsx +49 -0
- package/src/Components/Icons/Communication/Chat/Chat.stories.ts +28 -0
- package/src/Components/Icons/Communication/Chat/Chat.tsx +49 -0
- package/src/Components/Icons/Design/Eye/Eye.tsx +105 -0
- package/src/Components/Icons/Design/EyeSlash/EyeSlash.tsx +105 -0
- package/src/Components/Icons/IconProps.tsx +5 -0
- package/src/Components/Icons/MathAndFinance/XIcon/XIcon.tsx +107 -0
- package/src/Components/Icons/SystemAndDevice/Bell/Bell.tsx +49 -0
- package/src/Components/Icons/Time/CalendarBank/CalendarBank.tsx +105 -0
- package/src/Components/Icons/Time/Clock/Clock.tsx +105 -0
- package/src/Components/Layout/CalloutPopup/CalloutPopup.tsx +5 -0
- package/src/Components/Layout/Header/Header.tsx +5 -0
- package/src/Components/Layout/Header/HeaderLeft.tsx +5 -0
- package/src/Components/Layout/Header/HeaderRight.tsx +5 -0
- package/src/Components/Layout/Pagination/Pagination.tsx +5 -0
- package/src/Components/Layout/Pagination/PaginationFirst.tsx +5 -0
- package/src/Components/Layout/Pagination/PaginationLast.tsx +5 -0
- package/src/Components/Layout/Pagination/PaginationNext.tsx +5 -0
- package/src/Components/Layout/Pagination/PaginationNumber.tsx +5 -0
- package/src/Components/Layout/Pagination/PaginationPrevious.tsx +5 -0
- package/src/Components/Layout/ProfileAvatar/ProfileAvatar.tsx +5 -0
- package/src/Components/Layout/ProfileAvatar/ProfileAvatarProps.tsx +4 -0
- package/src/Components/Layout/ProfileDropdown/ProfileDropdown.tsx +5 -0
- package/src/Components/Layout/ProfileDropdown/ProfileHeader.tsx +5 -0
- package/src/Components/Layout/ProfileDropdown/ProfileLink.tsx +5 -0
- package/src/Components/Layout/ProfileDropdown/ProfileLinks.tsx +5 -0
- package/src/Components/Layout/ProfileDropdown/ProfileNavigationItem.tsx +5 -0
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchPanel.tsx +5 -0
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchUser.tsx +5 -0
- package/src/Components/Layout/Sidebar/Sidebar.tsx +5 -0
- package/src/Components/Layout/Sidebar/SidebarChevron.tsx +5 -0
- package/src/Components/Layout/Sidebar/SidebarNavigation.tsx +5 -0
- package/src/Components/Layout/Sidebar/SidebarNavigationItem.tsx +5 -0
- package/src/Components/Layout/Sidebar/SidebarSubNavigation.tsx +5 -0
- package/src/Notification/Notification.tsx +83 -0
- package/src/Notification/NotificationInterface.tsx +9 -0
- package/src/Notification/NotificationList.tsx +29 -0
- package/src/Notification/NotificationListHolder.tsx +14 -0
- package/src/Notification/NotificationListHolderInterface.tsx +8 -0
- package/src/Notification/NotificationListInterface.tsx +11 -0
- package/src/Notification/notification.scss +225 -0
- package/src/global.scss +231 -0
- package/src/main.tsx +9 -0
- package/src/variables.scss +2 -0
- package/src/vite-env.d.ts +1 -0
- package/tokens/color/color.mdx +82 -0
- package/tokens/shadow/shadow-panel.scss +12 -0
- package/tokens/shadow/shadow.mdx +34 -0
- package/tokens/typography/typography.mdx +31 -0
- package/tsconfig.json +25 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +7 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useState, useEffect, useRef } from "react";
|
|
2
|
+
import NotificationInterface from "./NotificationInterface.tsx";
|
|
3
|
+
import './notification.scss'
|
|
4
|
+
import Bell from "../Components/Icons/SystemAndDevice/Bell/Bell.tsx";
|
|
5
|
+
export const Notification = ({ children, extraClass = '',markAllAsReadOnClick }: NotificationInterface) => {
|
|
6
|
+
const [dropdown, setDropdown] = useState(false);
|
|
7
|
+
const notificationRef = useRef(null);
|
|
8
|
+
const [isScrollbarVisible, setIsScrollbarVisible] = useState(false);
|
|
9
|
+
|
|
10
|
+
const handleOutsideClick = (event:any) => {
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
if (notificationRef.current && !notificationRef.current.contains(event.target)) {
|
|
13
|
+
setDropdown(false);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (dropdown) {
|
|
19
|
+
document.addEventListener('mousedown', handleOutsideClick);
|
|
20
|
+
} else {
|
|
21
|
+
document.removeEventListener('mousedown', handleOutsideClick);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
document.removeEventListener('mousedown', handleOutsideClick);
|
|
26
|
+
};
|
|
27
|
+
}, [dropdown]);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const listContainer = document.getElementById('listContainer');
|
|
31
|
+
|
|
32
|
+
if (listContainer) {
|
|
33
|
+
const handleResize = () => {
|
|
34
|
+
const updatedScrollbarVisible = listContainer.scrollHeight > listContainer.clientHeight;
|
|
35
|
+
setIsScrollbarVisible(updatedScrollbarVisible);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
window.addEventListener('resize', handleResize);
|
|
39
|
+
|
|
40
|
+
handleResize();
|
|
41
|
+
|
|
42
|
+
// Cleanup the event listener on component unmount
|
|
43
|
+
return () => {
|
|
44
|
+
window.removeEventListener('resize', handleResize);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
className={`notification ${extraClass}`}
|
|
53
|
+
onClick={() => setDropdown(!dropdown)}
|
|
54
|
+
ref={notificationRef}
|
|
55
|
+
>
|
|
56
|
+
<div className={`notification-icon ${dropdown ? 'noti-active': '' }`}>
|
|
57
|
+
<Bell />
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
{(children && dropdown) && (
|
|
61
|
+
<div className={`notification-dropdown`}>
|
|
62
|
+
<div className={`notification-dropdown__inner`}>
|
|
63
|
+
<div className={`notification-dropdown__header`}>
|
|
64
|
+
<div className={`notification-dropdown__header-wrapper`}>
|
|
65
|
+
<div>
|
|
66
|
+
<h5>Notifications</h5>
|
|
67
|
+
</div>
|
|
68
|
+
<div onClick={markAllAsReadOnClick} className={'mark-all-action'}>
|
|
69
|
+
<h6>Mark all as Read</h6>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div id={'listContainer'} className={`notification-dropdown__container-list ${isScrollbarVisible ? 'spacing' : '' }`}>
|
|
74
|
+
<ul className={`notification-dropdown__list`}>
|
|
75
|
+
{children}
|
|
76
|
+
</ul>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './notification.scss'
|
|
2
|
+
import NotificationListInterface from "./NotificationListInterface.tsx";
|
|
3
|
+
import {XIcon} from "../../tokens/icons/MathAndFinance/XIcon.tsx";
|
|
4
|
+
|
|
5
|
+
export const NotificationList = ({ notificationInitials , boldText, summaryText, notificatonItemOnClick, regularText, extraClass, closeOnClick }: NotificationListInterface) => {
|
|
6
|
+
|
|
7
|
+
return <>
|
|
8
|
+
<li onClick={notificatonItemOnClick} className={`notification-list ${extraClass}`}>
|
|
9
|
+
<div className={`notification-list__wrapper`}>
|
|
10
|
+
<div className={`notification-list__icon`}>
|
|
11
|
+
<div className={'notification-list-pip'}></div>
|
|
12
|
+
<div onClick={closeOnClick} className={'notification-list-close-icon'}><XIcon/></div>
|
|
13
|
+
</div>
|
|
14
|
+
<div className={`notification-list__content`}>
|
|
15
|
+
{notificationInitials && (
|
|
16
|
+
<div className={`notification-list__initial`}>
|
|
17
|
+
<div className={`notification-list__initial-wrapper`}>
|
|
18
|
+
{notificationInitials}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
)}
|
|
22
|
+
<div className={`notification-list__desc`}>
|
|
23
|
+
<p>{boldText && (<span className={'bold-text'}>{boldText}</span>)}{regularText && ( <span className={'regular-text'}>{regularText}</span>)}{summaryText && ( <span className={'summary-text'}>{summaryText}</span>)}</p>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</li>
|
|
28
|
+
</>
|
|
29
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './notification.scss'
|
|
2
|
+
import NotificationListHolderInterface from "./NotificationListHolderInterface.tsx";
|
|
3
|
+
|
|
4
|
+
export const NotificationListHolder = ({ children, title }: NotificationListHolderInterface) => {
|
|
5
|
+
|
|
6
|
+
return <>
|
|
7
|
+
<div className={`notification-holder`}>
|
|
8
|
+
<h6>{title}</h6>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
{children}
|
|
12
|
+
</div>
|
|
13
|
+
</>
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface NotificationListInterface {
|
|
2
|
+
notificationInitials?: string;
|
|
3
|
+
extraClass?: string;
|
|
4
|
+
boldText?:string;
|
|
5
|
+
regularText?:string;
|
|
6
|
+
summaryText?:string;
|
|
7
|
+
notificatonItemOnClick?:() => void;
|
|
8
|
+
closeOnClick?:() => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default NotificationListInterface
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
.notification {
|
|
2
|
+
position: relative;
|
|
3
|
+
padding-right: var(--spacing-2);
|
|
4
|
+
|
|
5
|
+
&-icon {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
width: 40px;
|
|
10
|
+
height: 40px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
border-radius: 100%;
|
|
13
|
+
|
|
14
|
+
svg {
|
|
15
|
+
width: 24px;
|
|
16
|
+
height: 24px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background: var(--color-gray-100);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.noti-active {
|
|
24
|
+
background: var(--color-gray-200);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
&-dropdown {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 100%;
|
|
33
|
+
right: 0;
|
|
34
|
+
min-width: 100%;
|
|
35
|
+
padding-top: 8px;
|
|
36
|
+
|
|
37
|
+
&__header {
|
|
38
|
+
border-bottom: 1px solid var(--color-gray-200);
|
|
39
|
+
|
|
40
|
+
&-wrapper {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
padding: var(--spacing-1-1\/2) var(--spacing-2);
|
|
45
|
+
|
|
46
|
+
h5 {
|
|
47
|
+
font-size: var(--font-size-h5);
|
|
48
|
+
font-weight: var(--font-weight-h5);
|
|
49
|
+
line-height: var(--line-height-h5);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.mark-all-action {
|
|
53
|
+
h6 {
|
|
54
|
+
font-size: var(--font-size-body-sm);
|
|
55
|
+
font-weight: var(--font-weight-body-sm);
|
|
56
|
+
line-height: var(--line-height-body-sm);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: all 0.3s;
|
|
59
|
+
|
|
60
|
+
&:hover {
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.notification-dropdown__container-list{
|
|
70
|
+
overflow-y: auto;
|
|
71
|
+
max-height: 500px;
|
|
72
|
+
|
|
73
|
+
&.spacing{
|
|
74
|
+
margin-right: 4px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&::-webkit-scrollbar {
|
|
78
|
+
width: 4px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&::-webkit-scrollbar-track {
|
|
82
|
+
background: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&::-webkit-scrollbar-thumb {
|
|
86
|
+
border-radius: 2px;
|
|
87
|
+
background: rgba(0, 0, 0, 0.10);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
91
|
+
background: rgba(0, 0, 0, 0.15);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__list {
|
|
96
|
+
min-height: 70px;
|
|
97
|
+
list-style: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-dropdown__inner {
|
|
103
|
+
border-radius: 8px;
|
|
104
|
+
width: 100%;
|
|
105
|
+
background: white;
|
|
106
|
+
box-shadow: var(--drop-shadow-default);
|
|
107
|
+
padding: calc(var(--spacing) * 2);
|
|
108
|
+
min-width: 320px;
|
|
109
|
+
max-width: 320px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.notification-list {
|
|
114
|
+
padding: var(--spacing-1) var(--spacing-2) var(--spacing-1) var(--spacing-3\/4);
|
|
115
|
+
transition:background-color 0.2s linear;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
|
|
118
|
+
&:hover{
|
|
119
|
+
background: var(--color-gray-100);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:hover .notification-list-pip{
|
|
123
|
+
opacity: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:hover .notification-list-close-icon{
|
|
127
|
+
opacity: 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&__wrapper {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&-pip {
|
|
136
|
+
width: 8px;
|
|
137
|
+
height: 8px;
|
|
138
|
+
border-radius: 100%;
|
|
139
|
+
background: var(--color-primary-500);
|
|
140
|
+
position: absolute;
|
|
141
|
+
top: 50%;
|
|
142
|
+
left: 50%;
|
|
143
|
+
opacity: 1;
|
|
144
|
+
transform: translate(-50%, -50%);
|
|
145
|
+
transition: opacity 0.2s linear;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-close-icon{
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
opacity: 0;
|
|
153
|
+
|
|
154
|
+
svg{
|
|
155
|
+
width: 12px;
|
|
156
|
+
height: 12px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&__icon {
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
position: relative;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
margin-right: var(--spacing-3\/4);
|
|
168
|
+
transition: opacity 0.2s linear;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&__content{
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&__initial{
|
|
178
|
+
flex-shrink: 1;
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
width: 32px;
|
|
183
|
+
height: 32px;
|
|
184
|
+
background: var(--color-primary-700);
|
|
185
|
+
color:var(--color-lite);
|
|
186
|
+
border-radius: 100%;
|
|
187
|
+
margin-right: var(--spacing-3\/4);
|
|
188
|
+
|
|
189
|
+
&-wrapper{
|
|
190
|
+
--font-size-body-sm: 600;
|
|
191
|
+
font-size:var(--font-size-body-sm);
|
|
192
|
+
font-weight:var(--font-weight-body-sm);
|
|
193
|
+
line-height:var(--line-height-body-sm);
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&__desc{
|
|
200
|
+
font-size: var(--font-size-body-xsm);
|
|
201
|
+
font-weight: var(--font-size-body-xsm);
|
|
202
|
+
line-height: var(--line-height-body-xsm);
|
|
203
|
+
|
|
204
|
+
.bold-text{
|
|
205
|
+
font-weight: 600;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.summary-text{
|
|
209
|
+
color: var(--color-primary-500);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.notification-holder{
|
|
217
|
+
padding: var(--spacing-1-1\/2) var(--spacing-2) var(--spacing-1\/2) var(--spacing-2);
|
|
218
|
+
h6{
|
|
219
|
+
color: var(--color-gray-600);
|
|
220
|
+
font-size: 12px;
|
|
221
|
+
font-style: normal;
|
|
222
|
+
font-weight: 600;
|
|
223
|
+
line-height: 22px;
|
|
224
|
+
}
|
|
225
|
+
}
|
package/src/global.scss
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&display=swap');
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--font: Figtree, sans-serif;
|
|
5
|
+
--body-font: Figtree, sans-serif;
|
|
6
|
+
|
|
7
|
+
color-scheme: light dark;
|
|
8
|
+
color: rgba(255, 255, 255, 0.87);
|
|
9
|
+
background-color: #242424;
|
|
10
|
+
|
|
11
|
+
font-synthesis: none;
|
|
12
|
+
text-rendering: optimizeLegibility;
|
|
13
|
+
-webkit-font-smoothing: antialiased;
|
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
|
|
16
|
+
//font-size variables
|
|
17
|
+
--font-size-body-sm: 14px;
|
|
18
|
+
--font-size-body-xsm: 12px;
|
|
19
|
+
--font-size-body-regular: 16px;
|
|
20
|
+
--font-size-large: 18px;
|
|
21
|
+
--font-size-h1: 32px;
|
|
22
|
+
--font-size-h2: 24px;
|
|
23
|
+
--font-size-h3: 20px;
|
|
24
|
+
--font-size-h4: 18px;
|
|
25
|
+
--font-size-h5: 16px;
|
|
26
|
+
--font-size-label: 14px;
|
|
27
|
+
--font-size-input: 16px;
|
|
28
|
+
--font-size-button: 16px;
|
|
29
|
+
|
|
30
|
+
//font-weight variables
|
|
31
|
+
--font-weight-body-sm: 400;
|
|
32
|
+
--font-weight-body-xsm: 400;
|
|
33
|
+
--font-weight-body-regular: 400;
|
|
34
|
+
--font-weight-h1: 600;
|
|
35
|
+
--font-weight-h2: 600;
|
|
36
|
+
--font-weight-h3: 600;
|
|
37
|
+
--font-weight-h4: 600;
|
|
38
|
+
--font-weight-h5: 600;
|
|
39
|
+
--font-weight-label: 400;
|
|
40
|
+
--font-weight-input: 400;
|
|
41
|
+
--font-weight-button: 600;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
//Line-height variables
|
|
45
|
+
--line-height-body-sm: 1.57;
|
|
46
|
+
--line-height-body-xsm: 1.83;
|
|
47
|
+
--line-height-body-regular: 1.5;
|
|
48
|
+
--line-height-h1: 1.25;
|
|
49
|
+
--line-height-h2: 1.33;
|
|
50
|
+
--line-height-h3: 1.4;
|
|
51
|
+
--line-height-h4: 1.44;
|
|
52
|
+
--line-height-h5: 1.5;
|
|
53
|
+
--line-height-label: 1.25;
|
|
54
|
+
--line-height-input: 1.5;
|
|
55
|
+
--line-height-button: 1;
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
--space-unit: 4px;
|
|
59
|
+
--spacing-1\/4: var(--space-unit);
|
|
60
|
+
--spacing-1\/2: calc(2 * var(--space-unit));
|
|
61
|
+
--spacing-3\/4: calc(3 * var(--space-unit));
|
|
62
|
+
--spacing-1: calc(4 * var(--space-unit));
|
|
63
|
+
--spacing-1-1\/4: calc(5 * var(--space-unit));
|
|
64
|
+
--spacing-1-1\/2: calc(6 * var(--space-unit));
|
|
65
|
+
--spacing-1-3\/4: calc(7 * var(--space-unit));
|
|
66
|
+
--spacing-2: calc(8 * var(--space-unit));
|
|
67
|
+
--spacing-2-1\/2: calc(10 * var(--space-unit));
|
|
68
|
+
--spacing-3: calc(12 * var(--space-unit));
|
|
69
|
+
--spacing-3-1\/2: calc(14 * var(--space-unit));
|
|
70
|
+
--spacing-4: calc(16 * var(--space-unit));
|
|
71
|
+
--spacing-4-1\/2: calc(18 * var(--space-unit));
|
|
72
|
+
--spacing-5: calc(20 * var(--space-unit));
|
|
73
|
+
--spacing-6: calc(24 * var(--space-unit));
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
--color-white: #FFFFFF;
|
|
77
|
+
|
|
78
|
+
--color-primary-50: #EEF6FC;
|
|
79
|
+
--color-primary-100: #CDE4F5;
|
|
80
|
+
--color-primary-200: #acd2ee;
|
|
81
|
+
--color-primary-300: #8ac0e7;
|
|
82
|
+
--color-primary-400: #69aee0;
|
|
83
|
+
--color-primary-500: #58A5DD;
|
|
84
|
+
--color-primary-600: #4684b1;
|
|
85
|
+
--color-primary-700: #356385;
|
|
86
|
+
--color-primary-800: #234258;
|
|
87
|
+
--color-primary-900: #12212c;
|
|
88
|
+
--color-primary-1000: #0f1c25;
|
|
89
|
+
|
|
90
|
+
--color-secondary-50: #eceef0;
|
|
91
|
+
--color-secondary-100: #d9dce2;
|
|
92
|
+
--color-secondary-200: #a1a8b6;
|
|
93
|
+
--color-secondary-300: #7b8598;
|
|
94
|
+
--color-secondary-400: #56627b;
|
|
95
|
+
--color-secondary-500: #43506C;
|
|
96
|
+
--color-secondary-600: #364056;
|
|
97
|
+
--color-secondary-700: #2f384c;
|
|
98
|
+
--color-secondary-800: #222836;
|
|
99
|
+
--color-secondary-900: #1b202b;
|
|
100
|
+
--color-secondary-1000: #191e28;
|
|
101
|
+
|
|
102
|
+
--color-gray-50: #FAFAFA;
|
|
103
|
+
--color-gray-100: #F5F5F5;
|
|
104
|
+
--color-gray-200: #EEEEEE;
|
|
105
|
+
--color-gray-300: #E0E0E0;
|
|
106
|
+
--color-gray-400: #BDBDBD;
|
|
107
|
+
--color-gray-500: #9E9E9E;
|
|
108
|
+
--color-gray-600: #757575;
|
|
109
|
+
--color-gray-700: #616161;
|
|
110
|
+
--color-gray-800: #424242;
|
|
111
|
+
--color-gray-900: #212121;
|
|
112
|
+
--color-gray-1000: #171717;
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
--color-success: #84BE39;
|
|
116
|
+
--color-error: #e12222;
|
|
117
|
+
--color-error-lite: rgba(225, 34, 34, 0.05);
|
|
118
|
+
--color-inprogress: #E9A116;
|
|
119
|
+
|
|
120
|
+
--color-lite:#FFFFFF;
|
|
121
|
+
--color-dark:#000000;
|
|
122
|
+
|
|
123
|
+
--drop-shadow-default: 0px 0px 2px 1px rgba(0, 0, 0, 0.05), 0px 2px 10px 0px rgba(0, 0, 0, 0.15);
|
|
124
|
+
--drop-shadow-md: 0px 4px 4px 0px rgba(21, 19, 28, 0.06);
|
|
125
|
+
--drop-shadow-lg: 0px 8px 12px 0px rgba(21, 19, 28, 0.06);
|
|
126
|
+
--drop-shadow-xl: 0px 16px 24px 0px rgba(21, 19, 28, 0.06);
|
|
127
|
+
--drop-shadow-2xl: 0px 24px 40px 0px rgba(21, 19, 28, 0.06);
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
body {
|
|
133
|
+
font-family: var(--body-font);
|
|
134
|
+
font-size: var(--font-size-body-regular);
|
|
135
|
+
line-height: var(--line-height-body-regular);
|
|
136
|
+
font-weight: var(--font-weight-body-regular);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
* {
|
|
140
|
+
box-sizing: border-box;
|
|
141
|
+
padding: 0;
|
|
142
|
+
margin: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
a {
|
|
146
|
+
color: inherit;
|
|
147
|
+
text-decoration: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.typography {
|
|
151
|
+
h1 {
|
|
152
|
+
font-size: var(--font-size-h1);
|
|
153
|
+
line-height: var(--line-height-h1);
|
|
154
|
+
font-weight: var(--font-weight-h1);
|
|
155
|
+
margin-bottom: calc(var(--font-size-h1) * 0.75);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
h2 {
|
|
159
|
+
font-size: var(--font-size-h2);
|
|
160
|
+
line-height: var(--line-height-h2);
|
|
161
|
+
font-weight: var(--font-weight-h2);
|
|
162
|
+
margin-bottom: calc(var(--font-size-h2) * 0.75);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
h3 {
|
|
166
|
+
font-size: var(--font-size-h3);
|
|
167
|
+
line-height: var(--line-height-h3);
|
|
168
|
+
font-weight: var(--font-weight-h3);
|
|
169
|
+
margin-bottom: calc(var(--font-size-h3) * 0.75);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
h4 {
|
|
173
|
+
font-size: var(--font-size-h4);
|
|
174
|
+
line-height: var(--line-height-h4);
|
|
175
|
+
font-weight: var(--font-weight-h4);
|
|
176
|
+
margin-bottom: calc(var(--font-size-h4) * 0.75);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
h5 {
|
|
180
|
+
font-size: var(--font-size-h5);
|
|
181
|
+
line-height: var(--line-height-h5);
|
|
182
|
+
font-weight: var(--font-weight-h5);
|
|
183
|
+
margin-bottom: calc(var(--font-size-h5) * 0.75);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
p {
|
|
187
|
+
margin-bottom: calc(var(--font-size-body-regular) * 0.75);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
small {
|
|
191
|
+
font-size: var(--font-size-body-sm);
|
|
192
|
+
line-height: var(--line-height-body-sm);
|
|
193
|
+
color: var(--color-gray-600);
|
|
194
|
+
margin-top: calc(var(--font-size-body) * 0.75);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
ul,
|
|
198
|
+
ol {
|
|
199
|
+
margin-left: calc(var(--spacing) * 5);
|
|
200
|
+
margin-bottom: calc(var(--font-size-body) * 0.75);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.large {
|
|
204
|
+
font-size: var(--font-size-large);
|
|
205
|
+
|
|
206
|
+
p {
|
|
207
|
+
margin-bottom: calc(var(--font-size-large) * 1.25);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
ol,
|
|
211
|
+
ul {
|
|
212
|
+
margin-bottom: calc(var(--font-size-large) * 1.25);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
@media (prefers-color-scheme: light) {
|
|
221
|
+
:root {
|
|
222
|
+
color: #213547;
|
|
223
|
+
background-color: #ffffff;
|
|
224
|
+
}
|
|
225
|
+
a:hover {
|
|
226
|
+
color: #747bff;
|
|
227
|
+
}
|
|
228
|
+
button {
|
|
229
|
+
background-color: #f9f9f9;
|
|
230
|
+
}
|
|
231
|
+
}
|