@hellobetterdigitalnz/betterui 0.0.0 → 0.0.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/README.md +23 -30
- package/package.json +48 -45
- package/src/App.tsx +30 -30
- package/src/Components/DataDisplay/Accordion/Accordion.stories.tsx +57 -57
- package/src/Components/DataDisplay/Accordion/Accordion.tsx +14 -14
- package/src/Components/DataDisplay/Accordion/AccordionContext.tsx +11 -11
- package/src/Components/DataDisplay/Accordion/AccordionContextInterface.tsx +8 -8
- package/src/Components/DataDisplay/Accordion/AccordionItem.tsx +62 -62
- package/src/Components/DataDisplay/Accordion/AccordionItemProps.tsx +12 -12
- package/src/Components/DataDisplay/Accordion/AccordionProps.tsx +8 -8
- package/src/Components/DataDisplay/Accordion/AccordionProvider.tsx +65 -65
- package/src/Components/DataDisplay/Accordion/AccordionProviderInterface.tsx +8 -8
- package/src/Components/DataDisplay/Accordion/accordion.module.scss +56 -56
- package/src/Components/DataDisplay/Badge/Badge.stories.tsx +44 -44
- package/src/Components/DataDisplay/Badge/Badge.tsx +32 -32
- package/src/Components/DataDisplay/Badge/BadgeProps.tsx +6 -6
- package/src/Components/DataDisplay/Badge/badge.module.scss +42 -42
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCard.stories.tsx +26 -26
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCard.tsx +47 -47
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCardInterface.tsx +15 -15
- package/src/Components/DataDisplay/Cards/BannerCard/banner-card.scss +54 -54
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCard.stories.tsx +31 -31
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCard.tsx +53 -53
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCardInterface.tsx +17 -17
- package/src/Components/DataDisplay/Cards/PathwayCard/pathway-card-stories.scss +3 -3
- package/src/Components/DataDisplay/Cards/PathwayCard/pathway-card.scss +62 -62
- package/src/Components/DataDisplay/Media/Media.stories.tsx +30 -0
- package/src/Components/DataDisplay/Media/Media.tsx +28 -7
- package/src/Components/DataDisplay/Media/media.module.scss +8 -0
- package/src/Components/DataDisplay/Modal/Modal.stories.tsx +27 -0
- package/src/Components/DataDisplay/Modal/Modal.tsx +16 -5
- package/src/Components/DataDisplay/Modal/ModalActions.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalActionsLeft.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalActionsRight.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalBody.tsx +15 -5
- package/src/Components/DataDisplay/Modal/ModalBodyProps.tsx +7 -0
- package/src/Components/DataDisplay/Modal/ModalCurtain.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalHeader.tsx +32 -5
- package/src/Components/DataDisplay/Modal/ModalHeaderProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/modal.module.scss +58 -0
- package/src/Components/DataDisplay/NotificationsBell/NotificationBell.stories.tsx +27 -27
- package/src/Components/DataDisplay/NotificationsBell/NotificationsBell.tsx +51 -51
- package/src/Components/DataDisplay/NotificationsBell/notificationBell.module.scss +47 -47
- package/src/Components/DataDisplay/NotificationsPanel/Notification.stories.tsx +128 -128
- package/src/Components/DataDisplay/NotificationsPanel/Notification.tsx +59 -59
- package/src/Components/DataDisplay/NotificationsPanel/NotificationProps.tsx +11 -11
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroup.tsx +17 -17
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroupProps.tsx +8 -8
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroups.tsx +42 -42
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroupsProps.tsx +7 -7
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsHeader.tsx +27 -27
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsHeaderProps.tsx +7 -9
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsNone.tsx +11 -11
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsPanel.tsx +8 -8
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsPanelProps.tsx +6 -6
- package/src/Components/DataDisplay/NotificationsPanel/notificationPanel.module.scss +196 -196
- package/src/Components/DataDisplay/Tab/Tab.stories.tsx +72 -72
- package/src/Components/DataDisplay/Tab/Tab.tsx +20 -20
- package/src/Components/DataDisplay/Tab/TabBody.tsx +6 -6
- package/src/Components/DataDisplay/Tab/TabBodyContent.tsx +15 -15
- package/src/Components/DataDisplay/Tab/TabBodyContentProps.tsx +9 -9
- package/src/Components/DataDisplay/Tab/TabBodyProps.tsx +8 -8
- package/src/Components/DataDisplay/Tab/TabContext.tsx +9 -9
- package/src/Components/DataDisplay/Tab/TabContextProps.tsx +6 -6
- package/src/Components/DataDisplay/Tab/TabNav.tsx +6 -6
- package/src/Components/DataDisplay/Tab/TabNavItem.tsx +49 -49
- package/src/Components/DataDisplay/Tab/TabNavItemProps.tsx +9 -9
- package/src/Components/DataDisplay/Tab/TabNavProps.tsx +8 -8
- package/src/Components/DataDisplay/Tab/TabProps.tsx +8 -8
- package/src/Components/DataDisplay/Tab/tab.module.scss +35 -35
- package/src/Components/DataDisplay/Tab/tab.stories.scss +3 -3
- package/src/Components/DataDisplay/Table/Table.stories.tsx +64 -64
- package/src/Components/DataDisplay/Table/Table.tsx +10 -10
- package/src/Components/DataDisplay/Table/TableBody.tsx +13 -13
- package/src/Components/DataDisplay/Table/TableBodyProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/TableCell.tsx +30 -30
- package/src/Components/DataDisplay/Table/TableCellAction.tsx +27 -27
- package/src/Components/DataDisplay/Table/TableCellActionProps.tsx +11 -11
- package/src/Components/DataDisplay/Table/TableCellProps.tsx +11 -11
- package/src/Components/DataDisplay/Table/TableCellWithDesc.tsx +21 -21
- package/src/Components/DataDisplay/Table/TableCellWithDescProps.tsx +9 -9
- package/src/Components/DataDisplay/Table/TableCellWithImage.tsx +39 -39
- package/src/Components/DataDisplay/Table/TableCellWithImageProps.tsx +10 -10
- package/src/Components/DataDisplay/Table/TableFooter.tsx +5 -5
- package/src/Components/DataDisplay/Table/TableHead.tsx +11 -11
- package/src/Components/DataDisplay/Table/TableHeadProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/TableHeaderCell.tsx +17 -17
- package/src/Components/DataDisplay/Table/TableHeaderCellProps.tsx +10 -10
- package/src/Components/DataDisplay/Table/TableProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/TableRow.tsx +9 -9
- package/src/Components/DataDisplay/Table/TableRowProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/table.module.scss +103 -103
- package/src/Components/Form/Button/Button.stories.tsx +66 -66
- package/src/Components/Form/Button/Button.tsx +64 -64
- package/src/Components/Form/Button/ButtonProps.tsx +18 -18
- package/src/Components/Form/Button/button.module.scss +142 -142
- package/src/Components/Form/Checkbox/Checkbox.stories.tsx +49 -49
- package/src/Components/Form/Checkbox/Checkbox.tsx +85 -85
- package/src/Components/Form/Checkbox/CheckboxProps.tsx +22 -22
- package/src/Components/Form/Checkbox/checkbox.module.scss +63 -63
- package/src/Components/Form/CheckboxSelect/CheckboxSelect.tsx +5 -5
- package/src/Components/Form/CheckboxSelect/CheckboxSelectItem.tsx +5 -5
- package/src/Components/Form/CheckboxSet/CheckboxSet.stories.tsx +93 -93
- package/src/Components/Form/CheckboxSet/CheckboxSet.tsx +14 -14
- package/src/Components/Form/CheckboxSet/CheckboxSetItem.tsx +88 -88
- package/src/Components/Form/CheckboxSet/CheckboxSetProps.tsx +9 -9
- package/src/Components/Form/CheckboxSet/checkboxSet.module.scss +13 -13
- package/src/Components/Form/CurrencyField/CurrenctField.stories.tsx +22 -22
- package/src/Components/Form/CurrencyField/CurrencyField.tsx +59 -59
- package/src/Components/Form/CurrencyField/CurrencyFieldProps.tsx +8 -8
- package/src/Components/Form/DateField/DateField.stories.tsx +22 -22
- package/src/Components/Form/DateField/DateField.tsx +58 -58
- package/src/Components/Form/DropdownBadge/DropdownBadge.stories.tsx +49 -49
- package/src/Components/Form/DropdownBadge/DropdownBadge.tsx +160 -160
- package/src/Components/Form/DropdownBadge/DropdownBadgeItem.tsx +40 -40
- package/src/Components/Form/DropdownBadge/DropdownBadgeItemProps.tsx +10 -10
- package/src/Components/Form/DropdownBadge/DropdownBadgeProps.tsx +31 -31
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelector.tsx +11 -11
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelectorProps.tsx +7 -7
- package/src/Components/Form/DropdownBadge/dropdownBadge.module.scss +105 -105
- package/src/Components/Form/DropdownField/DropdownField.stories.tsx +50 -50
- package/src/Components/Form/DropdownField/DropdownField.tsx +118 -118
- package/src/Components/Form/DropdownField/DropdownFieldItem.tsx +26 -26
- package/src/Components/Form/DropdownField/DropdownFieldItemProps.tsx +9 -9
- package/src/Components/Form/DropdownField/DropdownFieldProps.tsx +33 -33
- package/src/Components/Form/DropdownField/DropdownFieldSelector.tsx +15 -15
- package/src/Components/Form/DropdownField/DropdownFieldSelectorProps.tsx +7 -7
- package/src/Components/Form/DropdownField/dropdown.module.scss +79 -79
- package/src/Components/Form/EmailField/EmailField.stories.ts +23 -23
- package/src/Components/Form/EmailField/EmailField.tsx +51 -51
- package/src/Components/Form/ErrorMessage/ErrorMessage.tsx +5 -5
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.stories.tsx +30 -0
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.tsx +40 -5
- package/src/Components/Form/FormFieldHolder/FormFieldHolderProps.tsx +12 -0
- package/src/Components/Form/FormFieldHolder/formHolder.module.scss +56 -0
- package/src/Components/Form/IconButton/IconButton.stories.tsx +45 -45
- package/src/Components/Form/IconButton/IconButton.tsx +58 -58
- package/src/Components/Form/IconButton/IconButtonProps.tsx +15 -15
- package/src/Components/Form/IconButton/iconButton.module.scss +111 -111
- package/src/Components/Form/InputProps.tsx +25 -25
- package/src/Components/Form/MultiSelectField/MultiSelectField.tsx +5 -5
- package/src/Components/Form/MultiSelectField/MultiSelectFieldItem.tsx +5 -5
- package/src/Components/Form/MultiSelectField/MultiSelectFieldTag.tsx +5 -5
- package/src/Components/Form/PasswordField/PasswordField.stories.tsx +22 -22
- package/src/Components/Form/PasswordField/PasswordField.tsx +70 -70
- package/src/Components/Form/RadioButtons/RadioButton.tsx +70 -70
- package/src/Components/Form/RadioButtons/RadioButtonProps.tsx +22 -22
- package/src/Components/Form/RadioButtons/RadioButtons.stories.tsx +64 -64
- package/src/Components/Form/RadioButtons/RadioButtons.tsx +18 -18
- package/src/Components/Form/RadioButtons/RadioButtonsProps.tsx +10 -10
- package/src/Components/Form/RadioButtons/radioButton.stories.scss +3 -3
- package/src/Components/Form/RadioButtons/radiobutton.module.scss +63 -63
- package/src/Components/Form/TextField/TextField.stories.ts +22 -23
- package/src/Components/Form/TextField/TextField.tsx +56 -52
- package/src/Components/Form/TextField/TextFieldProps.tsx +8 -0
- package/src/Components/Form/Textarea/Textarea.stories.ts +31 -31
- package/src/Components/Form/Textarea/Textarea.tsx +71 -71
- package/src/Components/Form/Textarea/TextareaProps.tsx +27 -27
- package/src/Components/Form/Textarea/textarea.module.scss +49 -49
- package/src/Components/Form/TimeField/TimeField.stories.tsx +22 -22
- package/src/Components/Form/TimeField/TimeField.tsx +58 -58
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.stories.tsx +49 -49
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.tsx +87 -87
- package/src/Components/Form/ToggleSwitch/ToggleSwitchProps.tsx +22 -22
- package/src/Components/Form/ToggleSwitch/toggleSwitch.module.scss +82 -82
- package/src/Components/Form/inputs.module.scss +129 -121
- package/src/Components/Icons/Arrows/CaretDown/CaretDown.tsx +49 -49
- package/src/Components/Icons/Arrows/CaretLeft/CaretLeft.tsx +102 -0
- package/src/Components/Icons/Arrows/CaretRight/CaretRight.tsx +102 -0
- package/src/Components/Icons/Arrows/CaretUp/CaretUp.tsx +49 -49
- package/src/Components/Icons/Brand/WindowLogo/WindowLogo.tsx +105 -0
- package/src/Components/Icons/Commerce/CurrencyDollarSimple/CurrencyDollarSimple.tsx +105 -105
- package/src/Components/Icons/Communication/AddressBook/AddressBook.stories.ts +28 -28
- package/src/Components/Icons/Communication/AddressBook/AddressBook.tsx +50 -50
- package/src/Components/Icons/Communication/Asterick/Asterisk.stories.ts +28 -28
- package/src/Components/Icons/Communication/Asterick/Asterisk.tsx +50 -50
- package/src/Components/Icons/Communication/AsterickSimple/AsteriskSimple.stories.ts +28 -28
- package/src/Components/Icons/Communication/AsterickSimple/AsteriskSimple.tsx +49 -49
- package/src/Components/Icons/Communication/At/At.stories.ts +28 -28
- package/src/Components/Icons/Communication/At/At.tsx +49 -49
- package/src/Components/Icons/Communication/Broadcast/Broadcast.stories.ts +27 -27
- package/src/Components/Icons/Communication/Broadcast/Broadcast.tsx +49 -49
- package/src/Components/Icons/Communication/Chat/Chat.stories.ts +28 -28
- package/src/Components/Icons/Communication/Chat/Chat.tsx +49 -49
- package/src/Components/Icons/Design/Eye/Eye.tsx +105 -105
- package/src/Components/Icons/Design/EyeSlash/EyeSlash.tsx +105 -105
- package/src/Components/Icons/IconProps.tsx +5 -5
- package/src/Components/Icons/SecurityAndWarnings/WarningCircle/WarningCircle.tsx +105 -0
- package/src/Components/Icons/SystemAndDevice/Bell/Bell.tsx +49 -49
- package/src/Components/Icons/SystemAndDevice/MagnifyingGlass/MagnifyingGlass.tsx +105 -0
- package/src/Components/Icons/Time/CalendarBank/CalendarBank.tsx +105 -105
- package/src/Components/Icons/Time/Clock/Clock.tsx +105 -105
- package/src/Components/Layout/CalloutPopup/CalloutPopup.tsx +5 -5
- package/src/Components/Layout/Header/Header.tsx +5 -5
- package/src/Components/Layout/Header/HeaderLeft.tsx +5 -5
- package/src/Components/Layout/Header/HeaderRight.tsx +5 -5
- package/src/Components/Layout/Pagination/Pagination.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationFirst.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationLast.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationNext.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationNumber.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationPrevious.tsx +5 -5
- package/src/Components/Layout/ProfileAvatar/ProfileAvatar.stories.tsx +22 -0
- package/src/Components/Layout/ProfileAvatar/ProfileAvatar.tsx +31 -5
- package/src/Components/Layout/ProfileAvatar/ProfileAvatarProps.tsx +10 -4
- package/src/Components/Layout/ProfileAvatar/profileAvatar.module.scss +35 -0
- package/src/Components/Layout/ProfileDropdown/ProfileDropdown.stories.tsx +67 -0
- package/src/Components/Layout/ProfileDropdown/ProfileDropdown.tsx +12 -5
- package/src/Components/Layout/ProfileDropdown/ProfileDropdownProps.tsx +8 -0
- package/src/Components/Layout/ProfileDropdown/ProfileHeader.tsx +24 -5
- package/src/Components/Layout/ProfileDropdown/ProfileHeaderProps.tsx +8 -0
- package/src/Components/Layout/ProfileDropdown/ProfileLink.tsx +10 -5
- package/src/Components/Layout/ProfileDropdown/ProfileLinkProps.tsx +7 -0
- package/src/Components/Layout/ProfileDropdown/ProfileLinks.tsx +14 -5
- package/src/Components/Layout/ProfileDropdown/ProfileLinksProps.tsx +7 -0
- package/src/Components/Layout/ProfileDropdown/ProfileNavigationItem.tsx +29 -5
- package/src/Components/Layout/ProfileDropdown/ProfileNavigationItemProps.tsx +10 -0
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchPanel.tsx +79 -5
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchPanelProps.tsx +10 -0
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchUser.tsx +22 -5
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchUserProps.tsx +7 -0
- package/src/Components/Layout/ProfileDropdown/profileDropdown.module.scss +207 -0
- package/src/Components/Layout/Sidebar/Sidebar.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarChevron.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarNavigation.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarNavigationItem.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarSubNavigation.tsx +5 -5
- package/src/Notification/Notification.tsx +83 -83
- package/src/Notification/NotificationList.tsx +47 -22
- package/src/global.scss +224 -231
- package/src/main.tsx +10 -9
- package/src/variables.scss +2 -2
- package/.editorconfig +0 -17
- package/.eslintrc.cjs +0 -14
- package/.storybook/main.ts +0 -23
- package/.storybook/preview.ts +0 -17
- package/index.html +0 -13
- package/public/image/table-image.png +0 -0
- package/public/vite.svg +0 -1
- package/src/Components/DataDisplay/Media/media.scss +0 -0
- package/tokens/color/color.mdx +0 -82
- package/tokens/shadow/shadow-panel.scss +0 -12
- package/tokens/shadow/shadow.mdx +0 -34
- package/tokens/typography/typography.mdx +0 -31
- package/tsconfig.json +0 -25
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const PaginationFirst = () => {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default PaginationFirst;
|
|
1
|
+
const PaginationFirst = () => {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default PaginationFirst;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const PaginationLast = () => {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default PaginationLast;
|
|
1
|
+
const PaginationLast = () => {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default PaginationLast;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const PaginationNext = () => {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default PaginationNext;
|
|
1
|
+
const PaginationNext = () => {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default PaginationNext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const PaginationNumber = () => {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default PaginationNumber;
|
|
1
|
+
const PaginationNumber = () => {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default PaginationNumber;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const PaginationPrevious = () => {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default PaginationPrevious;
|
|
1
|
+
const PaginationPrevious = () => {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default PaginationPrevious;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import ProfileAvatar from "./ProfileAvatar";
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Layout / Profile / ProfileAvatar",
|
|
8
|
+
component: ProfileAvatar,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
} satisfies Meta<typeof ProfileAvatar>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof ProfileAvatar>;
|
|
17
|
+
|
|
18
|
+
export const Example: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
initials: "AB",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import ProfileAvatarProps from "./ProfileAvatarProps";
|
|
2
|
+
import styles from "./profileAvatar.module.scss";
|
|
3
|
+
|
|
4
|
+
const ProfileAvatar = (props: ProfileAvatarProps) => {
|
|
5
|
+
const { initials, children, extraClass, onClick } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className={`${styles.profile} ${extraClass}`}
|
|
10
|
+
onClick={(e) => {
|
|
11
|
+
if (onClick) {
|
|
12
|
+
onClick(e);
|
|
13
|
+
}
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<div className={`${styles.profileInner}`}>
|
|
17
|
+
{!!initials && (
|
|
18
|
+
<span className={`${styles.avatar}`}>
|
|
19
|
+
<h3>{initials}</h3>
|
|
20
|
+
</span>
|
|
21
|
+
)}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
{children && onClick && (
|
|
25
|
+
<div className={`${styles.dropdown}`}>{children}</div>
|
|
26
|
+
)}
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default ProfileAvatar;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
interface ProfileAvatarProps {
|
|
4
|
+
initials?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
extraClass?: string;
|
|
7
|
+
onClick?: (e: any) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default ProfileAvatarProps;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.profile {
|
|
2
|
+
position: relative;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.profileInner {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
min-height: 48px;
|
|
11
|
+
min-width: 48px;
|
|
12
|
+
border-radius: 100%;
|
|
13
|
+
background: var(--color-primary-500);
|
|
14
|
+
color: var(--color-white);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.avatar {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
|
|
22
|
+
h5 {
|
|
23
|
+
font-size: var(--font-size-body-xsm);
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
line-height: 2.33;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dropdown {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 100%;
|
|
32
|
+
right: 0;
|
|
33
|
+
min-width: 100%;
|
|
34
|
+
padding-top: 12px;
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import ProfileDropdown from "./ProfileDropdown";
|
|
3
|
+
import ProfileHeader from "./ProfileHeader";
|
|
4
|
+
import ProfileNavigationItem from "./ProfileNavigationItem";
|
|
5
|
+
import ProfileLinks from "./ProfileLinks";
|
|
6
|
+
import ProfileLink from "./ProfileLink";
|
|
7
|
+
import AddressBook from "../../Icons/Communication/AddressBook/AddressBook";
|
|
8
|
+
import ProfileSwitchPanel from "./ProfileSwitchPanel";
|
|
9
|
+
import ProfileSwitchUser from "./ProfileSwitchUser";
|
|
10
|
+
|
|
11
|
+
const meta: Meta = {
|
|
12
|
+
title: "Layout / Profile / ProfileDropdown",
|
|
13
|
+
component: ProfileDropdown,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: "centered",
|
|
16
|
+
},
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
const ProfileDropdownTemplate: Story = {
|
|
25
|
+
render: () => {
|
|
26
|
+
return (
|
|
27
|
+
<ProfileDropdown>
|
|
28
|
+
<ProfileHeader initials="AB" username="Lorem Ipsum" role="Position" />
|
|
29
|
+
<ProfileNavigationItem title={"Hello"} icon={<AddressBook />} />
|
|
30
|
+
<ProfileNavigationItem
|
|
31
|
+
title={"Hello"}
|
|
32
|
+
icon={<AddressBook />}
|
|
33
|
+
openSubDropdown={true}
|
|
34
|
+
/>
|
|
35
|
+
<ProfileNavigationItem title={"Hello"} icon={<AddressBook />} />
|
|
36
|
+
<ProfileLinks>
|
|
37
|
+
<ProfileLink>
|
|
38
|
+
<h5>hey</h5>
|
|
39
|
+
</ProfileLink>
|
|
40
|
+
<ProfileLink>hey</ProfileLink>
|
|
41
|
+
</ProfileLinks>
|
|
42
|
+
</ProfileDropdown>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const ProfileSwitchUsersTemplate: Story = {
|
|
48
|
+
render: () => {
|
|
49
|
+
return (
|
|
50
|
+
<ProfileSwitchPanel>
|
|
51
|
+
<ProfileSwitchUser initials="AB" userName="Username" role="Role" />
|
|
52
|
+
<ProfileSwitchUser initials="AB" userName="Username" role="Role" />
|
|
53
|
+
<ProfileSwitchUser initials="AB" userName="Username" role="Role" />
|
|
54
|
+
<ProfileSwitchUser initials="AB" userName="Username" role="Role" />
|
|
55
|
+
<ProfileSwitchUser initials="AB" userName="Username" role="Role" />
|
|
56
|
+
</ProfileSwitchPanel>
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const ProfileDropdownComponent = {
|
|
62
|
+
...ProfileDropdownTemplate,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const ProfileSwitchUserPanelComponent = {
|
|
66
|
+
...ProfileSwitchUsersTemplate,
|
|
67
|
+
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import ProfileDropdownProps from "./ProfileDropdownProps";
|
|
2
|
+
import styles from "./profileDropdown.module.scss";
|
|
3
|
+
|
|
4
|
+
const ProfileDropdown = (props: ProfileDropdownProps) => {
|
|
5
|
+
const { children, extraClass } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className={`${styles.profileDropdown} ${extraClass}`}>{children}</div>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default ProfileDropdown;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import ProfileHeaderProps from "./ProfileHeaderProps";
|
|
2
|
+
import styles from "./profileDropdown.module.scss";
|
|
3
|
+
|
|
4
|
+
const ProfileHeader = (props: ProfileHeaderProps) => {
|
|
5
|
+
const { initials, username, role, extraClass } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className={`${styles.profileHeader} ${extraClass}`}>
|
|
9
|
+
<div className={`${styles.profileHeaderWrapper}`}>
|
|
10
|
+
{!!initials && (
|
|
11
|
+
<span className={`${styles.avatar}`}>
|
|
12
|
+
<h3>{initials}</h3>
|
|
13
|
+
</span>
|
|
14
|
+
)}
|
|
15
|
+
<div className={`${styles.content}`}>
|
|
16
|
+
<h5 className={`${styles.name}`}>{username}</h5>
|
|
17
|
+
{!!role && <p className={`${styles.role}`}>{role}</p>}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default ProfileHeader;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import ProfileLinkProps from "./ProfileLinkProps";
|
|
2
|
+
import styles from "./profileDropdown.module.scss";
|
|
3
|
+
|
|
4
|
+
const ProfileLink = (props: ProfileLinkProps) => {
|
|
5
|
+
const { children } = props;
|
|
6
|
+
|
|
7
|
+
return <li className={styles.profileLink}>{children}</li>;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default ProfileLink;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import ProfileLinksProps from "./ProfileLinksProps";
|
|
2
|
+
import styles from "./profileDropdown.module.scss";
|
|
3
|
+
|
|
4
|
+
const ProfileLinks = (props: ProfileLinksProps) => {
|
|
5
|
+
const { children } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className={`${styles.profileLinks}`}>
|
|
9
|
+
<ul>{children}</ul>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default ProfileLinks;
|
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import CaretRight from "../../Icons/Arrows/CaretRight/CaretRight";
|
|
2
|
+
import ProfileNavigationItemProps from "./ProfileNavigationItemProps";
|
|
3
|
+
import styles from "./profileDropdown.module.scss";
|
|
4
|
+
|
|
5
|
+
const ProfileNavigationItem = (props: ProfileNavigationItemProps) => {
|
|
6
|
+
const { icon, openSubDropdown, title } = props;
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<div className={`${styles.profileNavigationItem}`}>
|
|
10
|
+
<div className={`${styles.profileNavigationItemWrapper}`}>
|
|
11
|
+
<div className={`${styles.profileNavigationItemLeft}`}>
|
|
12
|
+
{!!icon && (
|
|
13
|
+
<div className={`${styles.profileNavigationItemIcon}`}>{icon}</div>
|
|
14
|
+
)}
|
|
15
|
+
<div className={styles.profileNavigationItemContent}>
|
|
16
|
+
<h5>{title}</h5>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
{!!openSubDropdown && (
|
|
20
|
+
<div className={`${styles.profileNavigationItemRight}`}>
|
|
21
|
+
<CaretRight />
|
|
22
|
+
</div>
|
|
23
|
+
)}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default ProfileNavigationItem;
|
|
@@ -1,5 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import cx from "classnames";
|
|
2
|
+
import ProfileSwitchPanelProps from "./ProfileSwitchPanelProps";
|
|
3
|
+
import style from "./profileDropdown.module.scss";
|
|
4
|
+
import styles from "../../Form/inputs.module.scss";
|
|
5
|
+
import CaretLeft from "../../Icons/Arrows/CaretLeft/CaretLeft";
|
|
6
|
+
import XIcon from "../../Icons/MathAndFinance/XIcon/XIcon";
|
|
7
|
+
import MagnifyingGlass from "../../Icons/SystemAndDevice/MagnifyingGlass/MagnifyingGlass";
|
|
8
|
+
|
|
9
|
+
const ProfileSwitchPanel = (props: ProfileSwitchPanelProps) => {
|
|
10
|
+
const {
|
|
11
|
+
name,
|
|
12
|
+
id,
|
|
13
|
+
value,
|
|
14
|
+
placeholder,
|
|
15
|
+
extraClass,
|
|
16
|
+
disabled,
|
|
17
|
+
error,
|
|
18
|
+
ariaLabel,
|
|
19
|
+
required,
|
|
20
|
+
readonly,
|
|
21
|
+
autoComplete,
|
|
22
|
+
children,
|
|
23
|
+
goBackOnClick,
|
|
24
|
+
closeOnClick,
|
|
25
|
+
...args
|
|
26
|
+
} = props;
|
|
27
|
+
|
|
28
|
+
const classes = [styles.input];
|
|
29
|
+
if (error) {
|
|
30
|
+
classes.push(styles.error);
|
|
31
|
+
}
|
|
32
|
+
if (extraClass) {
|
|
33
|
+
classes.push(extraClass);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div className={style.profileSwitchPanel}>
|
|
38
|
+
<div className={style.profileSwitchPanelHeader}>
|
|
39
|
+
<div onClick={goBackOnClick} className={style.caretLeft}>
|
|
40
|
+
<CaretLeft type="bold" />
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
<h5 className={style.headerTitle}>Switch user</h5>
|
|
44
|
+
</div>
|
|
45
|
+
<div className={style.closeIcon}>
|
|
46
|
+
<XIcon type="bold" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div className={style.fieldWrapper}>
|
|
50
|
+
<div className={styles.textField}>
|
|
51
|
+
<input
|
|
52
|
+
className={cx(classes)}
|
|
53
|
+
id={id}
|
|
54
|
+
name={name}
|
|
55
|
+
type="text"
|
|
56
|
+
value={value}
|
|
57
|
+
placeholder={placeholder}
|
|
58
|
+
disabled={disabled}
|
|
59
|
+
readOnly={readonly}
|
|
60
|
+
required={required}
|
|
61
|
+
autoComplete={autoComplete ? "on" : "off"}
|
|
62
|
+
aria-label={ariaLabel ? ariaLabel : name}
|
|
63
|
+
aria-required={required ? "true" : "false"}
|
|
64
|
+
aria-invalid={error ? "true" : "false"}
|
|
65
|
+
aria-disabled={disabled ? "true" : "false"}
|
|
66
|
+
aria-readonly={readonly ? "true" : "false"}
|
|
67
|
+
{...args}
|
|
68
|
+
/>
|
|
69
|
+
<div className={styles.textFieldIcon}>
|
|
70
|
+
<MagnifyingGlass />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<div className={style.usersHolder}>{children}</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default ProfileSwitchPanel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import InputProps from "../../Form/InputProps";
|
|
3
|
+
|
|
4
|
+
interface ProfileSwitchPanelProps extends InputProps {
|
|
5
|
+
goBackOnClick?: (e: any) => void;
|
|
6
|
+
closeOnClick?: (e: any) => void;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default ProfileSwitchPanelProps;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import ProfileSwitchUserProps from "./ProfileSwitchUserProps";
|
|
2
|
+
import styles from "./profileDropdown.module.scss";
|
|
3
|
+
|
|
4
|
+
const ProfileSwitchUser = (props: ProfileSwitchUserProps) => {
|
|
5
|
+
const { initials, userName, role } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className={styles.profileSwitchUser}>
|
|
9
|
+
<div className={styles.profileSwitchUserWrapper}>
|
|
10
|
+
<div className={`${styles.profileSwitchUserAvatar} ${styles.avatar}`}>
|
|
11
|
+
<h5 className={styles.initialsTile}>{initials}</h5>
|
|
12
|
+
</div>
|
|
13
|
+
<div className={styles.profileSwitchUserContent}>
|
|
14
|
+
<h5 className={styles.name}>{userName}</h5>
|
|
15
|
+
<p className={styles.role}>{role}</p>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default ProfileSwitchUser;
|