@laerdal/life-react-components 1.8.0-dev.8.full → 1.9.0-dev.1
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/Button/Button.cjs +4 -4
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +4 -4
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/DualFunctionButton.cjs +1 -1
- package/dist/Button/DualFunctionButton.cjs.map +1 -1
- package/dist/Button/DualFunctionButton.js +1 -1
- package/dist/Button/DualFunctionButton.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +8 -2
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +3 -0
- package/dist/Button/Iconbutton.js +8 -2
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Chips/ChipStyles.cjs +1 -1
- package/dist/Chips/ChipStyles.cjs.map +1 -1
- package/dist/Chips/ChipStyles.js +1 -1
- package/dist/Chips/ChipStyles.js.map +1 -1
- package/dist/Chips/ChipTypes.d.ts +3 -3
- package/dist/Chips/ChoiceChips.cjs +1 -1
- package/dist/Chips/ChoiceChips.cjs.map +1 -1
- package/dist/Chips/ChoiceChips.js +1 -1
- package/dist/Chips/ChoiceChips.js.map +1 -1
- package/dist/Chips/FilterChip.cjs +2 -2
- package/dist/Chips/FilterChip.cjs.map +1 -1
- package/dist/Chips/FilterChip.js +2 -2
- package/dist/Chips/FilterChip.js.map +1 -1
- package/dist/Chips/InputChip.cjs.map +1 -1
- package/dist/Chips/InputChip.js +1 -1
- package/dist/Chips/InputChip.js.map +1 -1
- package/dist/ChipsInput/ChipDropdownInput.cjs +1 -3
- package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -1
- package/dist/ChipsInput/ChipDropdownInput.js +2 -4
- package/dist/ChipsInput/ChipDropdownInput.js.map +1 -1
- package/dist/ChipsInput/ChipInput.cjs +0 -2
- package/dist/ChipsInput/ChipInput.cjs.map +1 -1
- package/dist/ChipsInput/ChipInput.js +0 -2
- package/dist/ChipsInput/ChipInput.js.map +1 -1
- package/dist/ChipsInput/ChipInputField.cjs +5 -15
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.d.ts +0 -1
- package/dist/ChipsInput/ChipInputField.js +7 -17
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/ChipsInput/ChipInputTypes.d.ts +0 -1
- package/dist/Dropdown/BasicDropdown.cjs +9 -11
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +2 -2
- package/dist/Dropdown/BasicDropdown.js +10 -12
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +4 -4
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +3 -6
- package/dist/Dropdown/CommonStyling.js +4 -4
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +23 -21
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +3 -3
- package/dist/Dropdown/DropdownFilter.js +24 -22
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +107 -176
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +13 -27
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js +106 -176
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
- package/dist/GlobalNavigationBar/Logo.cjs +3 -5
- package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Logo.js +1 -1
- package/dist/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/GlobalNavigationBar/NavigationHelper.cjs +38 -0
- package/dist/GlobalNavigationBar/NavigationHelper.cjs.map +1 -0
- package/dist/GlobalNavigationBar/NavigationHelper.d.ts +4 -0
- package/dist/GlobalNavigationBar/NavigationHelper.js +27 -0
- package/dist/GlobalNavigationBar/NavigationHelper.js.map +1 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +129 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.d.ts +15 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js +99 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -0
- package/dist/GlobalNavigationBar/{ExtendedMainMenu.cjs → desktop/ExtendedMainMenu.cjs} +7 -9
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -0
- package/dist/GlobalNavigationBar/{ExtendedMainMenu.d.ts → desktop/ExtendedMainMenu.d.ts} +2 -2
- package/dist/GlobalNavigationBar/{ExtendedMainMenu.js → desktop/ExtendedMainMenu.js} +6 -6
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -0
- package/dist/GlobalNavigationBar/{MainMenu.cjs → desktop/MainMenu.cjs} +17 -21
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -0
- package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +8 -0
- package/dist/GlobalNavigationBar/{MainMenu.js → desktop/MainMenu.js} +17 -21
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -0
- package/dist/GlobalNavigationBar/{RightSideNav.cjs → desktop/RightSideNav.cjs} +22 -26
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -0
- package/dist/GlobalNavigationBar/desktop/RightSideNav.d.ts +8 -0
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js +59 -0
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +204 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.d.ts +7 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +163 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -0
- package/dist/GlobalNavigationBar/index.cjs +15 -18
- package/dist/GlobalNavigationBar/index.cjs.map +1 -1
- package/dist/GlobalNavigationBar/index.d.ts +2 -2
- package/dist/GlobalNavigationBar/index.js +2 -2
- package/dist/GlobalNavigationBar/index.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs +15 -21
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.d.ts +3 -6
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js +14 -15
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +117 -221
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +6 -25
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js +116 -216
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs +221 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.d.ts +11 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js +184 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +160 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.d.ts +12 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +139 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -0
- package/dist/GlobalNavigationBar/types.cjs +6 -0
- package/dist/GlobalNavigationBar/types.cjs.map +1 -0
- package/dist/GlobalNavigationBar/types.d.ts +120 -0
- package/dist/GlobalNavigationBar/types.js +2 -0
- package/dist/GlobalNavigationBar/types.js.map +1 -0
- package/dist/InputFields/Checkbox.cjs +10 -10
- package/dist/InputFields/Checkbox.cjs.map +1 -1
- package/dist/InputFields/Checkbox.d.ts +3 -3
- package/dist/InputFields/Checkbox.js +10 -10
- package/dist/InputFields/Checkbox.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +26 -38
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +3 -3
- package/dist/InputFields/DatepickerField.js +26 -42
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/Label.cjs +24 -14
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.js +24 -16
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +20 -8
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.js +21 -9
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs +23 -18
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.d.ts +2 -3
- package/dist/InputFields/PasswordField.js +21 -16
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +2 -3
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +2 -3
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +5 -7
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.d.ts +1 -1
- package/dist/InputFields/RadioButton.js +5 -5
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs +2 -2
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.js +3 -3
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +35 -40
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +6 -6
- package/dist/InputFields/TextField.js +35 -41
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +26 -31
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.d.ts +1 -12
- package/dist/InputFields/Textarea.js +31 -33
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +1 -1
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +1 -3
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.js +1 -2
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/styling.cjs +22 -28
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +7 -7
- package/dist/InputFields/styling.js +19 -23
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/InputFields/types.cjs +6 -0
- package/dist/InputFields/types.cjs.map +1 -0
- package/dist/InputFields/types.d.ts +38 -0
- package/dist/InputFields/types.js +2 -0
- package/dist/InputFields/types.js.map +1 -0
- package/dist/MenuItem/MenuItem.cjs +26 -11
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.d.ts +6 -4
- package/dist/MenuItem/MenuItem.js +26 -11
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/MenuItem/index.cjs.map +1 -1
- package/dist/MenuItem/index.js.map +1 -1
- package/dist/Modals/ModalNote.cjs +1 -1
- package/dist/Modals/ModalNote.cjs.map +1 -1
- package/dist/Modals/ModalNote.js +2 -2
- package/dist/Modals/ModalNote.js.map +1 -1
- package/dist/Popover/Popover.cjs +267 -0
- package/dist/Popover/Popover.cjs.map +1 -0
- package/dist/Popover/Popover.d.ts +26 -0
- package/dist/Popover/Popover.js +231 -0
- package/dist/Popover/Popover.js.map +1 -0
- package/dist/Popover/index.cjs +16 -0
- package/dist/Popover/index.cjs.map +1 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/Popover/index.js +2 -0
- package/dist/Popover/index.js.map +1 -0
- package/dist/ProfileButton/ProfileButton.cjs +105 -0
- package/dist/ProfileButton/ProfileButton.cjs.map +1 -0
- package/dist/ProfileButton/ProfileButton.d.ts +14 -0
- package/dist/ProfileButton/ProfileButton.js +79 -0
- package/dist/ProfileButton/ProfileButton.js.map +1 -0
- package/dist/ProfileButton/index.cjs +16 -0
- package/dist/ProfileButton/index.cjs.map +1 -0
- package/dist/ProfileButton/index.d.ts +1 -0
- package/dist/ProfileButton/index.js +2 -0
- package/dist/ProfileButton/index.js.map +1 -0
- package/dist/QuizButton/QuizButton.cjs +1 -1
- package/dist/QuizButton/QuizButton.cjs.map +1 -1
- package/dist/QuizButton/QuizButton.js +1 -1
- package/dist/QuizButton/QuizButton.js.map +1 -1
- package/dist/Switcher/MobileSwitcherMenu.cjs +24 -78
- package/dist/Switcher/MobileSwitcherMenu.cjs.map +1 -1
- package/dist/Switcher/MobileSwitcherMenu.d.ts +6 -5
- package/dist/Switcher/MobileSwitcherMenu.js +26 -70
- package/dist/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/Table/Table.cjs +22 -22
- package/dist/Table/Table.cjs.map +1 -1
- package/dist/Table/Table.js +22 -22
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.cjs +1 -1
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Tabs/TabLink.cjs +2 -3
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.d.ts +1 -2
- package/dist/Tabs/TabLink.js +2 -3
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tile/TileBody.cjs +1 -1
- package/dist/Tile/TileBody.cjs.map +1 -1
- package/dist/Tile/TileBody.js +1 -1
- package/dist/Tile/TileBody.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +1 -1
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.js +1 -1
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Tile/TileFooter.cjs +1 -1
- package/dist/Tile/TileFooter.cjs.map +1 -1
- package/dist/Tile/TileFooter.js +1 -1
- package/dist/Tile/TileFooter.js.map +1 -1
- package/dist/Tile/TileHeader.cjs +1 -1
- package/dist/Tile/TileHeader.cjs.map +1 -1
- package/dist/Tile/TileHeader.js +2 -2
- package/dist/Tile/TileHeader.js.map +1 -1
- package/dist/common/StackState.cjs +47 -0
- package/dist/common/StackState.cjs.map +1 -0
- package/dist/common/StackState.d.ts +7 -0
- package/dist/common/StackState.js +30 -0
- package/dist/common/StackState.js.map +1 -0
- package/dist/hooks/useClickOutside.cjs +6 -2
- package/dist/hooks/useClickOutside.cjs.map +1 -1
- package/dist/hooks/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside.js +6 -2
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/icons/contenticons/ContentIcons.cjs +3214 -3182
- package/dist/icons/contenticons/ContentIcons.cjs.map +1 -1
- package/dist/icons/contenticons/ContentIcons.d.ts +17 -0
- package/dist/icons/contenticons/ContentIcons.js +3341 -3365
- package/dist/icons/contenticons/ContentIcons.js.map +1 -1
- package/dist/icons/index.cjs +22 -69
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.d.ts +1 -4
- package/dist/icons/index.js +19 -64
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/systemicons/SystemIcons.cjs +3216 -2433
- package/dist/icons/systemicons/SystemIcons.cjs.map +1 -1
- package/dist/icons/systemicons/SystemIcons.d.ts +12 -2
- package/dist/icons/systemicons/SystemIcons.js +3016 -2267
- package/dist/icons/systemicons/SystemIcons.js.map +1 -1
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/colors.cjs +1 -0
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +1 -0
- package/dist/styles/colors.js +1 -0
- package/dist/styles/colors.js.map +1 -1
- package/dist/styles/z-indexes.cjs +2 -1
- package/dist/styles/z-indexes.cjs.map +1 -1
- package/dist/styles/z-indexes.d.ts +1 -0
- package/dist/styles/z-indexes.js +2 -1
- package/dist/styles/z-indexes.js.map +1 -1
- package/dist/types.cjs +20 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +10 -31
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -1
- package/package.json +13 -9
- package/dist/GlobalNavigationBar/Actions.cjs +0 -185
- package/dist/GlobalNavigationBar/Actions.cjs.map +0 -1
- package/dist/GlobalNavigationBar/Actions.d.ts +0 -13
- package/dist/GlobalNavigationBar/Actions.js +0 -160
- package/dist/GlobalNavigationBar/Actions.js.map +0 -1
- package/dist/GlobalNavigationBar/Avatar.cjs +0 -104
- package/dist/GlobalNavigationBar/Avatar.cjs.map +0 -1
- package/dist/GlobalNavigationBar/Avatar.d.ts +0 -15
- package/dist/GlobalNavigationBar/Avatar.js +0 -77
- package/dist/GlobalNavigationBar/Avatar.js.map +0 -1
- package/dist/GlobalNavigationBar/ExtendedMainMenu.cjs.map +0 -1
- package/dist/GlobalNavigationBar/ExtendedMainMenu.js.map +0 -1
- package/dist/GlobalNavigationBar/MainMenu.cjs.map +0 -1
- package/dist/GlobalNavigationBar/MainMenu.d.ts +0 -8
- package/dist/GlobalNavigationBar/MainMenu.js.map +0 -1
- package/dist/GlobalNavigationBar/RightSideNav.cjs.map +0 -1
- package/dist/GlobalNavigationBar/RightSideNav.d.ts +0 -8
- package/dist/GlobalNavigationBar/RightSideNav.js +0 -61
- package/dist/GlobalNavigationBar/RightSideNav.js.map +0 -1
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.cjs +0 -112
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.cjs.map +0 -1
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.d.ts +0 -11
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.js +0 -86
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.js.map +0 -1
- package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.cjs +0 -178
- package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.cjs.map +0 -1
- package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.d.ts +0 -16
- package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.js +0 -146
- package/dist/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +0 -1
- package/dist/GlobalNavigationBar/UserMenu/UserMenu.cjs +0 -168
- package/dist/GlobalNavigationBar/UserMenu/UserMenu.cjs.map +0 -1
- package/dist/GlobalNavigationBar/UserMenu/UserMenu.d.ts +0 -15
- package/dist/GlobalNavigationBar/UserMenu/UserMenu.js +0 -135
- package/dist/GlobalNavigationBar/UserMenu/UserMenu.js.map +0 -1
- package/dist/GlobalNavigationBar/mobile/ExitMenuButton.cjs +0 -49
- package/dist/GlobalNavigationBar/mobile/ExitMenuButton.cjs.map +0 -1
- package/dist/GlobalNavigationBar/mobile/ExitMenuButton.d.ts +0 -6
- package/dist/GlobalNavigationBar/mobile/ExitMenuButton.js +0 -27
- package/dist/GlobalNavigationBar/mobile/ExitMenuButton.js.map +0 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionMenu.cjs +0 -91
- package/dist/GlobalNavigationBar/mobile/MobileActionMenu.cjs.map +0 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionMenu.d.ts +0 -13
- package/dist/GlobalNavigationBar/mobile/MobileActionMenu.js +0 -70
- package/dist/GlobalNavigationBar/mobile/MobileActionMenu.js.map +0 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
import _pt from "prop-types";
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
6
|
+
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';
|
|
10
|
+
import { Button, IconButton } from '../Button';
|
|
11
|
+
import { SystemIcons } from '../icons';
|
|
12
|
+
import { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';
|
|
13
|
+
import { Position, Size } from '../types';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n border-radius: 4px;\n background: ", ";\n cursor: default;\n box-shadow: ", ";\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ", ";\n\n ", "\n ", "\n\n ", "\n ", "\n"])), function (props) {
|
|
17
|
+
return props.size === Size.Small ? '240px' : props.size === Size.Large ? '480px' : '360px';
|
|
18
|
+
}, function (props) {
|
|
19
|
+
return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
|
|
20
|
+
}, COLORS.white, BOXSHADOWS.BOXSHADOW_CENTERED, Z_INDEXES.popover, function (props) {
|
|
21
|
+
return props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '';
|
|
22
|
+
}, function (props) {
|
|
23
|
+
return props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '';
|
|
24
|
+
}, function (props) {
|
|
25
|
+
return props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '';
|
|
26
|
+
}, function (props) {
|
|
27
|
+
return props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '';
|
|
28
|
+
}, COLORS.white, function (props) {
|
|
29
|
+
return props.position == Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '';
|
|
30
|
+
}, function (props) {
|
|
31
|
+
return props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '';
|
|
32
|
+
}, function (props) {
|
|
33
|
+
return props.position == Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '';
|
|
34
|
+
}, function (props) {
|
|
35
|
+
return props.position == Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '';
|
|
36
|
+
});
|
|
37
|
+
var TopContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
|
|
38
|
+
return props.size === Size.Small ? '56px' : props.size === Size.Large ? '72px' : '64px';
|
|
39
|
+
}, function (props) {
|
|
40
|
+
return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
|
|
41
|
+
});
|
|
42
|
+
var MainContentWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", ";\n"])), function (props) {
|
|
43
|
+
return props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px';
|
|
44
|
+
});
|
|
45
|
+
var MiddleContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n padding-right: ", ";\n overflow-y: auto;\n ", "\n"])), function (props) {
|
|
46
|
+
return props.size === Size.Small ? '104px' : props.size === Size.Large ? '304px' : '208px';
|
|
47
|
+
}, function (props) {
|
|
48
|
+
return props.size === Size.Small ? '312px' : props.size === Size.Large ? '576px' : '424px';
|
|
49
|
+
}, function (props) {
|
|
50
|
+
return props.size === Size.Small ? '6px' : props.size === Size.Large ? '14px' : '10px';
|
|
51
|
+
}, scrollBarStyling(Size.Small));
|
|
52
|
+
var BottomContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n"])), function (props) {
|
|
53
|
+
return props.size === Size.Small ? '64px' : props.size === Size.Large ? '88px' : '72px';
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return props.size === Size.Small ? '344px' : props.size === Size.Large ? '624px' : '464px';
|
|
56
|
+
});
|
|
57
|
+
var TextContainer = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n flex-grow: 1;\n"])), function (props) {
|
|
58
|
+
return renderMargins(props.note, props.size);
|
|
59
|
+
});
|
|
60
|
+
var NoteContainer = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
61
|
+
return props.size === Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : props.size === Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600);
|
|
62
|
+
});
|
|
63
|
+
var LabelContainer = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
64
|
+
return props.size === Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : props.size === Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null);
|
|
65
|
+
});
|
|
66
|
+
var CloseButtonContainer = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: ", ";\n"])), function (props) {
|
|
67
|
+
return props.size === Size.Small ? '4px 16px 4px 0' : props.size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0';
|
|
68
|
+
});
|
|
69
|
+
var TextButtonContainer = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin: ", ";\n"])), function (props) {
|
|
70
|
+
return props.size === Size.Small ? '8px 0 8px 16px' : props.size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px';
|
|
71
|
+
});
|
|
72
|
+
var IconButtonContainer = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin: ", ";\n display: flex;\n"])), function (props) {
|
|
73
|
+
return props.size === Size.Small ? '8px 16px 8px 0' : props.size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0';
|
|
74
|
+
});
|
|
75
|
+
var Wrapper = styled.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: relative;\n\n .pointer-space {\n height: ", ";\n width: ", ";\n position: absolute;\n\n ", ";\n ", ";\n\n ", ";\n ", ";\n }\n\n ", "\n"])), function (props) {
|
|
76
|
+
return props.position === Position.Top || props.position === Position.Bottom ? '8px' : '100%';
|
|
77
|
+
}, function (props) {
|
|
78
|
+
return props.position === Position.Left || props.position === Position.Right ? '8px' : '100%';
|
|
79
|
+
}, function (props) {
|
|
80
|
+
return props.position === Position.Left ? 'right:100%; bottom: 0%' : '';
|
|
81
|
+
}, function (props) {
|
|
82
|
+
return props.position === Position.Right ? 'left:100%; bottom: 0%' : '';
|
|
83
|
+
}, function (props) {
|
|
84
|
+
return props.position === Position.Top ? 'bottom: 100%' : '';
|
|
85
|
+
}, function (props) {
|
|
86
|
+
return props.position === Position.Bottom ? 'top: 100%' : '';
|
|
87
|
+
}, function (props) {
|
|
88
|
+
return props.showOnClick ? "".concat(Container, " {\n visibility: ").concat(props.showPopover ? 'visible' : 'hidden', ";\n opacity: ").concat(props.showPopover ? '1' : '0', ";\n }\n cursor: pointer;") : "&:hover {\n ".concat(Container, " {\n visibility: visible;\n opacity: 1;\n }\n }");
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
var renderMargins = function renderMargins(isNotePresent, size) {
|
|
92
|
+
if (isNotePresent) {
|
|
93
|
+
return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';
|
|
94
|
+
} else {
|
|
95
|
+
return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
var Popover = function Popover(_ref) {
|
|
100
|
+
var _bottomSectionProps$t, _bottomSectionProps$i;
|
|
101
|
+
|
|
102
|
+
var _ref$size = _ref.size,
|
|
103
|
+
size = _ref$size === void 0 ? Size.Medium : _ref$size,
|
|
104
|
+
topSectionProps = _ref.topSectionProps,
|
|
105
|
+
bottomSectionProps = _ref.bottomSectionProps,
|
|
106
|
+
mainContent = _ref.mainContent,
|
|
107
|
+
children = _ref.children,
|
|
108
|
+
position = _ref.position,
|
|
109
|
+
_ref$showOnClick = _ref.showOnClick,
|
|
110
|
+
showOnClick = _ref$showOnClick === void 0 ? false : _ref$showOnClick;
|
|
111
|
+
|
|
112
|
+
var _React$useState = React.useState(false),
|
|
113
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
114
|
+
showPopover = _React$useState2[0],
|
|
115
|
+
setShowPopover = _React$useState2[1];
|
|
116
|
+
|
|
117
|
+
var popoverRef = React.useRef();
|
|
118
|
+
React.useEffect(function () {
|
|
119
|
+
var checkIfClickedOutside = function checkIfClickedOutside(e) {
|
|
120
|
+
if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {
|
|
121
|
+
setShowPopover(false);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
document.addEventListener("mousedown", checkIfClickedOutside);
|
|
126
|
+
return function () {
|
|
127
|
+
document.removeEventListener("mousedown", checkIfClickedOutside);
|
|
128
|
+
};
|
|
129
|
+
}, [showPopover]);
|
|
130
|
+
return /*#__PURE__*/_jsxs(Wrapper, {
|
|
131
|
+
position: position,
|
|
132
|
+
showOnClick: showOnClick,
|
|
133
|
+
showPopover: showPopover,
|
|
134
|
+
children: [/*#__PURE__*/_jsxs(Container, {
|
|
135
|
+
size: size,
|
|
136
|
+
position: position,
|
|
137
|
+
ref: popoverRef,
|
|
138
|
+
children: [!!topSectionProps && /*#__PURE__*/_jsxs(TopContainer, {
|
|
139
|
+
size: size,
|
|
140
|
+
children: [/*#__PURE__*/_jsxs(TextContainer, {
|
|
141
|
+
note: !!(topSectionProps !== null && topSectionProps !== void 0 && topSectionProps.note),
|
|
142
|
+
size: size,
|
|
143
|
+
children: [(topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.note) && /*#__PURE__*/_jsx(NoteContainer, {
|
|
144
|
+
size: size,
|
|
145
|
+
children: topSectionProps.note
|
|
146
|
+
}), /*#__PURE__*/_jsx(LabelContainer, {
|
|
147
|
+
size: size,
|
|
148
|
+
children: topSectionProps === null || topSectionProps === void 0 ? void 0 : topSectionProps.text
|
|
149
|
+
})]
|
|
150
|
+
}), showOnClick && /*#__PURE__*/_jsx(CloseButtonContainer, {
|
|
151
|
+
size: size,
|
|
152
|
+
"data-testid": 'closeBtn',
|
|
153
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
154
|
+
action: function action() {
|
|
155
|
+
return setShowPopover(false);
|
|
156
|
+
},
|
|
157
|
+
useTransparentBackground: true,
|
|
158
|
+
iconColor: COLORS.neutral_600,
|
|
159
|
+
variant: "secondary",
|
|
160
|
+
shape: "circular",
|
|
161
|
+
children: /*#__PURE__*/_jsx(SystemIcons.Close, {})
|
|
162
|
+
})
|
|
163
|
+
})]
|
|
164
|
+
}), /*#__PURE__*/_jsx(MainContentWrapper, {
|
|
165
|
+
size: size,
|
|
166
|
+
children: /*#__PURE__*/_jsx(MiddleContainer, {
|
|
167
|
+
size: size,
|
|
168
|
+
children: mainContent
|
|
169
|
+
})
|
|
170
|
+
}), !!bottomSectionProps && /*#__PURE__*/_jsxs(BottomContainer, {
|
|
171
|
+
size: size,
|
|
172
|
+
children: [!!(bottomSectionProps !== null && bottomSectionProps !== void 0 && (_bottomSectionProps$t = bottomSectionProps.textButton) !== null && _bottomSectionProps$t !== void 0 && _bottomSectionProps$t.icon) && /*#__PURE__*/_jsx(TextButtonContainer, {
|
|
173
|
+
size: size,
|
|
174
|
+
"data-testid": 'textBtn',
|
|
175
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
176
|
+
size: size,
|
|
177
|
+
variant: "secondary",
|
|
178
|
+
icon: bottomSectionProps.textButton.icon,
|
|
179
|
+
onClick: bottomSectionProps.textButton.action,
|
|
180
|
+
children: bottomSectionProps.textButton.label
|
|
181
|
+
})
|
|
182
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
183
|
+
className: "bottom-flex"
|
|
184
|
+
}), /*#__PURE__*/_jsx(IconButtonContainer, {
|
|
185
|
+
size: size,
|
|
186
|
+
"data-testid": 'iconBtn',
|
|
187
|
+
children: bottomSectionProps === null || bottomSectionProps === void 0 ? void 0 : (_bottomSectionProps$i = bottomSectionProps.iconButtons) === null || _bottomSectionProps$i === void 0 ? void 0 : _bottomSectionProps$i.map(function (iconButton) {
|
|
188
|
+
return /*#__PURE__*/_jsx(IconButton, {
|
|
189
|
+
action: iconButton.action,
|
|
190
|
+
variant: "secondary",
|
|
191
|
+
shape: "circular",
|
|
192
|
+
useTransparentBackground: true,
|
|
193
|
+
children: iconButton.icon
|
|
194
|
+
});
|
|
195
|
+
})
|
|
196
|
+
})]
|
|
197
|
+
})]
|
|
198
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
199
|
+
onClick: function onClick() {
|
|
200
|
+
return showOnClick && setShowPopover(!showPopover);
|
|
201
|
+
},
|
|
202
|
+
children: [children, /*#__PURE__*/_jsx("div", {
|
|
203
|
+
className: "pointer-space"
|
|
204
|
+
})]
|
|
205
|
+
})]
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
Popover.propTypes = {
|
|
210
|
+
topSectionProps: _pt.shape({
|
|
211
|
+
text: _pt.string.isRequired,
|
|
212
|
+
note: _pt.string
|
|
213
|
+
}),
|
|
214
|
+
bottomSectionProps: _pt.shape({
|
|
215
|
+
iconButtons: _pt.arrayOf(_pt.shape({
|
|
216
|
+
icon: _pt.node.isRequired,
|
|
217
|
+
action: _pt.func.isRequired,
|
|
218
|
+
label: _pt.string
|
|
219
|
+
})),
|
|
220
|
+
textButton: _pt.shape({
|
|
221
|
+
icon: _pt.node.isRequired,
|
|
222
|
+
action: _pt.func.isRequired,
|
|
223
|
+
label: _pt.string
|
|
224
|
+
})
|
|
225
|
+
}),
|
|
226
|
+
mainContent: _pt.node.isRequired,
|
|
227
|
+
children: _pt.node.isRequired,
|
|
228
|
+
showOnClick: _pt.bool.isRequired
|
|
229
|
+
};
|
|
230
|
+
export default Popover;
|
|
231
|
+
//# sourceMappingURL=Popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Popover/Popover.tsx"],"names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Button","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","Container","div","props","size","Small","Large","white","BOXSHADOW_CENTERED","popover","position","Bottom","Top","Left","Right","TopContainer","MainContentWrapper","MiddleContainer","BottomContainer","TextContainer","renderMargins","note","NoteContainer","Regular","neutral_600","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","Wrapper","showOnClick","showPopover","isNotePresent","Popover","Medium","topSectionProps","bottomSectionProps","mainContent","children","useState","setShowPopover","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","text","textButton","icon","action","label","iconButtons","map","iconButton"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,MAAT,EAAiBC,kBAAjB,EAAqCC,kBAArC,QAA+D,IAA/D;AACA,SAASC,MAAT,EAAiBC,UAAjB,QAAmC,WAAnC;AACA,SAASC,WAAT,QAA4B,UAA5B;AACA,SAASC,UAAT,EAAqBC,iBAArB,EAAwCC,iBAAxC,EAA2DC,iBAA3D,EAA8EC,mBAA9E,EAAmGC,gBAAnG,EAAqHC,SAArH,QAAsI,WAAtI;AACA,SAASC,QAAT,EAAmBC,IAAnB,QAA+B,UAA/B;;;AAEA,IAAMC,SAAS,GAAGhB,MAAM,CAACiB,GAAV,0dACH,UAAAC,KAAK;AAAA,SAAEA,KAAK,CAACC,IAAN,KAAaJ,IAAI,CAACK,KAAlB,GAA0B,OAA1B,GAAqCF,KAAK,CAACC,IAAN,KAAaJ,IAAI,CAACM,KAAlB,GAA0B,OAA1B,GAAoC,OAA3E;AAAA,CADF,EAEJ,UAAAH,KAAK;AAAA,SAAEA,KAAK,CAACC,IAAN,KAAaJ,IAAI,CAACK,KAAlB,GAA0B,OAA1B,GAAqCF,KAAK,CAACC,IAAN,KAAaJ,IAAI,CAACM,KAAlB,GAA0B,OAA1B,GAAoC,OAA3E;AAAA,CAFD,EAICpB,MAAM,CAACqB,KAJR,EAMCf,UAAU,CAACgB,kBANZ,EAWFV,SAAS,CAACW,OAXR,EAaX,UAAAN,KAAK;AAAA,SAAKA,KAAK,CAACO,QAAN,IAAkBX,QAAQ,CAACY,MAA3B,GAAoC,gEAApC,GAAuG,EAA5G;AAAA,CAbM,EAcX,UAAAR,KAAK;AAAA,SAAKA,KAAK,CAACO,QAAN,IAAkBX,QAAQ,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CAA8BE,MAAzH;AAAA,sBACGnB,kBAAkB,CAACiB,UAAnB,CAA8BG;AADjC;AADF,UAFJ,eASE;AAAK,UAAA,SAAS,EAAC;AAAf,UATF,eAWE,KAAC,mBAAD;AAAqB,UAAA,IAAI,EAAErD,IAA3B;AAAiC,yBAAa,SAA9C;AAAA,oBACGiC,kBADH,aACGA,kBADH,gDACGA,kBAAkB,CAAEqB,WADvB,0DACG,sBAAiCC,GAAjC,CAAqC,UAACC,UAAD;AAAA,gCAElC,KAAC,UAAD;AAAY,cAAA,MAAM,EAAEA,UAAU,CAACJ,MAA/B;AAAuC,cAAA,OAAO,EAAC,WAA/C;AAA2D,cAAA,KAAK,EAAC,UAAjE;AAA4E,cAAA,wBAAwB,MAApG;AAAA,wBACGI,UAAU,CAACL;AADd,cAFkC;AAAA,WAArC;AADH,UAXF;AAAA,QA/BJ;AAAA,MADF,eAuDE;AAAK,MAAA,OAAO,EAAE;AAAA,eAAIxB,WAAW,IAAIU,cAAc,CAAC,CAACT,WAAF,CAAjC;AAAA,OAAd;AAAA,iBACGO,QADH,eAGE;AAAK,QAAA,SAAS,EAAC;AAAf,QAHF;AAAA,MAvDF;AAAA,IADF;AAgED,CA5FD;;;AAREH,EAAAA,e;AAjBAiB,IAAAA,I;AACAhC,IAAAA,I;;AAiBAgB,EAAAA,kB;AAPAqB,IAAAA,W;AANAH,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;AAKAH,IAAAA,U;AAPAC,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,K;;;AAYAnB,EAAAA,W;AACAC,EAAAA,Q;AAEAR,EAAAA,W;;AAiGF,eAAeG,OAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\nimport { Button, IconButton } from '../Button';\nimport { SystemIcons } from '../icons';\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\nimport { Position, Size } from '../types';\n\nconst Container = styled.div<{size: Size, position: Position}>`\n height: ${props=>props.size===Size.Small ? '240px' : (props.size===Size.Large ? '480px' : '360px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n border-radius: 4px;\n background: ${COLORS.white};\n cursor: default;\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\n\n position: absolute; \n visibility: hidden;\n opacity: 0;\n z-index: ${Z_INDEXES.popover};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; top: calc(100% + 8px); transform: translateX(50%);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; bottom: calc(100% + 8px); transform: translateX(50%);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; right: calc(100% + 8px); transform: translateY(50%);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);' : '')}\n\n &::after {\n height: 16px;\n width: 16px;\n content: \"\";\n position: absolute;\n background: ${COLORS.white};\n\n ${props => (props.position == Position.Bottom ? 'right: 50%; bottom: 100%; transform: translateY(50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Top ? 'right: 50%; top: 100%; transform: translateY(-50%) rotate(45deg);' : '')}\n\n ${props => (props.position == Position.Left ? 'bottom: 50%; left: 100%; transform: translateX(-50%) rotate(45deg);' : '')}\n ${props => (props.position == Position.Right ? 'bottom: 50%; right: 100%; transform: translateX(50%) rotate(45deg);' : '')}\n`;\n\nconst TopContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '56px' : (props.size===Size.Large ? '72px' : '64px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n`;\n\nconst MainContentWrapper = styled.div<{size: Size}>`\n padding: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '8px 0 8px 24px' : '8px 0 8px 20px')};\n`;\n\nconst MiddleContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '104px' : (props.size===Size.Large ? '304px' : '208px')};\n width: ${props=>props.size===Size.Small ? '312px' : (props.size===Size.Large ? '576px' : '424px')};\n padding-right: ${props=>props.size===Size.Small ? '6px' : (props.size===Size.Large ? '14px' : '10px')};\n overflow-y: auto;\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst BottomContainer = styled.div<{size: Size}>`\n height: ${props=>props.size===Size.Small ? '64px' : (props.size===Size.Large ? '88px' : '72px')};\n width: ${props=>props.size===Size.Small ? '344px' : (props.size===Size.Large ? '624px' : '464px')};\n display: flex;\n\n .bottom-flex {\n flex: 1;\n }\n`;\n\nconst TextContainer = styled.div<{note: boolean, size: Size}>`\n display: flex;\n flex-direction: column;\n margin: ${props=>renderMargins(props.note, props.size)};\n flex-grow: 1;\n`;\n\nconst NoteContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : (props.size===Size.Large ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600) : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.neutral_600))}\n`;\n\nconst LabelContainer = styled.div<{size: Size}>`\n ${props=>props.size===Size.Small ? ComponentSStyling(ComponentTextStyle.Bold, null) : (props.size===Size.Large ? ComponentLStyling(ComponentTextStyle.Bold, null) : ComponentMStyling(ComponentTextStyle.Bold, null))}\n`;\n\nconst CloseButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '4px 16px 4px 0' : (props.size===Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\n`;\n\nconst TextButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 0 8px 16px' : (props.size===Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\n`;\n\nconst IconButtonContainer = styled.div<{size: Size}>`\n margin: ${props=>props.size===Size.Small ? '8px 16px 8px 0' : (props.size===Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\n display: flex;\n`;\n\nconst Wrapper = styled.div<{position: Position, showOnClick: boolean, showPopover: boolean}>`\n position: relative;\n\n .pointer-space {\n height: ${props=>props.position===Position.Top || props.position===Position.Bottom ? '8px' : '100%'};\n width: ${props=>props.position===Position.Left || props.position===Position.Right ? '8px' : '100%'};\n position: absolute;\n\n ${props=>props.position===Position.Left ? 'right:100%; bottom: 0%' : ''};\n ${props=>props.position===Position.Right ? 'left:100%; bottom: 0%' : ''};\n\n ${props=>props.position===Position.Top ? 'bottom: 100%' : ''};\n ${props=>props.position===Position.Bottom ? 'top: 100%' : ''};\n }\n\n ${props=>props.showOnClick ? \n `${Container} {\n visibility: ${props.showPopover ? 'visible' : 'hidden'};\n opacity: ${props.showPopover ? '1' : '0'};\n }\n cursor: pointer;` \n : \n `&:hover {\n ${Container} {\n visibility: visible;\n opacity: 1;\n }\n }`\n }\n`;\n\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\n if(isNotePresent){\n return (size===Size.Small ? '10px 16px' : (size===Size.Large ? '14px 24px' : '12px 20px'));\n }\n else{\n return (size===Size.Small ? '18px 16px' : (size===Size.Large ? '24px' : '20px'));\n }\n}\n\ntype topSectionProps = {\n text: string;\n note?: string;\n}\n\ntype actionButtonProps = {\n icon: React.ReactNode;\n action: ()=>void;\n label?: string;\n}\n\ntype bottomSectionProps = {\n iconButtons?: actionButtonProps[];\n textButton?: actionButtonProps;\n}\n\ntype PopoverProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n topSectionProps?: topSectionProps;\n bottomSectionProps?: bottomSectionProps;\n mainContent: React.ReactNode;\n children: React.ReactNode;\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\n showOnClick: boolean;\n}\n\nconst Popover: React.FunctionComponent<PopoverProps> = \n({\n size=Size.Medium,\n topSectionProps,\n bottomSectionProps,\n mainContent,\n children,\n position,\n showOnClick=false\n}) => {\n\n const [showPopover, setShowPopover] = React.useState(false);\n const popoverRef = React.useRef<any>();\n\n React.useEffect(()=>{\n const checkIfClickedOutside = (e: { target: any; }) => {\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\n setShowPopover(false);\n }\n }\n\n document.addEventListener(\"mousedown\", checkIfClickedOutside)\n\n return () => {\n document.removeEventListener(\"mousedown\", checkIfClickedOutside)\n }\n },[showPopover]);\n\n return (\n <Wrapper position={position} showOnClick={showOnClick} showPopover={showPopover}>\n <Container size={size} position={position} ref={popoverRef}>\n {!!topSectionProps && \n <TopContainer size={size}>\n <TextContainer note={!!topSectionProps?.note} size={size}>\n {topSectionProps?.note && \n <NoteContainer size={size}>\n {topSectionProps.note}\n </NoteContainer>\n }\n <LabelContainer size={size}>\n {topSectionProps?.text}\n </LabelContainer>\n </TextContainer>\n\n {showOnClick && \n <CloseButtonContainer size={size} data-testid={'closeBtn'}>\n <IconButton action={()=>setShowPopover(false)} useTransparentBackground iconColor={COLORS.neutral_600} variant='secondary' shape='circular'>\n <SystemIcons.Close />\n </IconButton>\n </CloseButtonContainer>\n }\n </TopContainer>\n }\n\n <MainContentWrapper size={size}>\n <MiddleContainer size={size}>\n {mainContent}\n </MiddleContainer>\n </MainContentWrapper>\n\n {!!bottomSectionProps && \n <BottomContainer size={size}>\n {!!bottomSectionProps?.textButton?.icon && \n <TextButtonContainer size={size} data-testid={'textBtn'}>\n <Button size={size} variant='secondary' icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\n {bottomSectionProps.textButton.label}\n </Button>\n </TextButtonContainer>\n }\n\n <div className='bottom-flex'/>\n \n <IconButtonContainer size={size} data-testid={'iconBtn'}>\n {bottomSectionProps?.iconButtons?.map((iconButton) =>\n \n <IconButton action={iconButton.action} variant='secondary' shape='circular' useTransparentBackground>\n {iconButton.icon}\n </IconButton> \n )}\n </IconButtonContainer>\n </BottomContainer>\n }\n </Container>\n\n <div onClick={()=>showOnClick && setShowPopover(!showPopover)}>\n {children}\n\n <div className='pointer-space'/>\n </div>\n\n </Wrapper>\n );\n};\n\nexport default Popover;"],"file":"Popover.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "Popover", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _Popover.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _Popover = _interopRequireDefault(require("./Popover"));
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Popover/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Popover } from './Popover';"],"file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Popover } from './Popover';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Popover/index.ts"],"names":["default","Popover"],"mappings":"AAAA,SAASA,OAAO,IAAIC,OAApB,QAAmC,WAAnC","sourcesContent":["export { default as Popover } from './Popover';"],"file":"index.js"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var React = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
|
|
20
|
+
var _ = require("..");
|
|
21
|
+
|
|
22
|
+
var _Iconbutton = require("../Button/Iconbutton");
|
|
23
|
+
|
|
24
|
+
var _NotificationDot = require("../NotificationDot");
|
|
25
|
+
|
|
26
|
+
var _styles = require("../styles");
|
|
27
|
+
|
|
28
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
+
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
36
|
+
var PortraitOverlay = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ", ";\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n"])), _.COLORS.black);
|
|
37
|
+
|
|
38
|
+
var Container = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ", " {\n display: ", ";\n\n ", " {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ", " {\n background-color: ", ";\n\n svg, svg path {\n fill: ", ";\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ", " {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ", " {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n"])), _Iconbutton.StyledPrimaryIconButton, function (props) {
|
|
39
|
+
return props.hideOnLowWidth ? 'none' : 'inline';
|
|
40
|
+
}, _styles.BREAKPOINTS.MEDIUM, _Iconbutton.IconButtonContent, _.COLORS.neutral_100, _.COLORS.neutral_300, PortraitOverlay, PortraitOverlay);
|
|
41
|
+
|
|
42
|
+
var NotificationContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n left: 30px;\n bottom: 30px;\n"])));
|
|
43
|
+
|
|
44
|
+
var ImageWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n"])));
|
|
45
|
+
|
|
46
|
+
var ProfileButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
47
|
+
var portraitSrc = _ref.portraitSrc,
|
|
48
|
+
icon = _ref.icon,
|
|
49
|
+
initials = _ref.initials,
|
|
50
|
+
onClick = _ref.onClick,
|
|
51
|
+
hideOnLowWidth = _ref.hideOnLowWidth,
|
|
52
|
+
disabled = _ref.disabled,
|
|
53
|
+
notificationVariant = _ref.notificationVariant,
|
|
54
|
+
className = _ref.className,
|
|
55
|
+
tabIndex = _ref.tabIndex;
|
|
56
|
+
|
|
57
|
+
var renderIcon = function renderIcon() {
|
|
58
|
+
return portraitSrc && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ImageWrapper, {
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
60
|
+
src: portraitSrc
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PortraitOverlay, {})]
|
|
62
|
+
}) || initials && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ComponentS, {
|
|
63
|
+
className: "initials",
|
|
64
|
+
textStyle: _styles.ComponentTextStyle.Bold,
|
|
65
|
+
color: disabled ? _.COLORS.neutral_300 : _.COLORS.white,
|
|
66
|
+
children: initials
|
|
67
|
+
}) || /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
68
|
+
children: icon
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
73
|
+
hideOnLowWidth: hideOnLowWidth,
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.IconButton, {
|
|
75
|
+
ref: ref,
|
|
76
|
+
className: className,
|
|
77
|
+
disabled: disabled,
|
|
78
|
+
action: onClick,
|
|
79
|
+
variant: "primary",
|
|
80
|
+
tabIndex: tabIndex,
|
|
81
|
+
shape: "circular",
|
|
82
|
+
hideOnLowWidth: hideOnLowWidth,
|
|
83
|
+
children: [renderIcon(), notificationVariant && /*#__PURE__*/(0, _jsxRuntime.jsx)(NotificationContainer, {
|
|
84
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NotificationDot.NotificationDot, {
|
|
85
|
+
size: _.Size.Medium,
|
|
86
|
+
variant: notificationVariant
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
ProfileButton.propTypes = {
|
|
93
|
+
portraitSrc: _propTypes.default.string,
|
|
94
|
+
icon: _propTypes.default.node,
|
|
95
|
+
initials: _propTypes.default.string,
|
|
96
|
+
onClick: _propTypes.default.func.isRequired,
|
|
97
|
+
disabled: _propTypes.default.bool,
|
|
98
|
+
notificationVariant: _propTypes.default.oneOf(['positive', 'critical']),
|
|
99
|
+
className: _propTypes.default.string,
|
|
100
|
+
hideOnLowWidth: _propTypes.default.bool,
|
|
101
|
+
tabIndex: _propTypes.default.number
|
|
102
|
+
};
|
|
103
|
+
var _default = ProfileButton;
|
|
104
|
+
exports.default = _default;
|
|
105
|
+
//# sourceMappingURL=ProfileButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["PortraitOverlay","styled","div","COLORS","black","Container","StyledPrimaryIconButton","props","hideOnLowWidth","BREAKPOINTS","MEDIUM","IconButtonContent","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","React","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","renderIcon","ComponentTextStyle","Bold","white","Size","Medium"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAcA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,0OAICC,SAAOC,KAJR,CAArB;;AAWA,IAAMC,SAAS,GAAGJ,0BAAOC,GAAV,8vBAMXI,mCANW,EAOA,UAAAC,KAAK;AAAA,SAAKA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,QAArC;AAAA,CAPL,EASTC,oBAAYC,MATH,EAkBPC,6BAlBO,EAmBaR,SAAOS,WAnBpB,EAsBGT,SAAOU,WAtBV,EA6BPb,eA7BO,EAqCPA,eArCO,CAAf;;AA6CA,IAAMc,qBAAqB,GAAGb,0BAAOC,GAAV,8IAA3B;;AAMA,IAA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,qBAAC,gCAAD;AAAiB,UAAA,IAAI,EAAEO,OAAKC,MAA5B;AAAoC,UAAA,OAAO,EAAER;AAA7C;AADF,QAVJ;AAAA;AADF,IADF;AAmBD,CA/CqB,CAAtB;;AAtFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,mB,4BAAsB,U,EAAa,U;AACnCC,EAAAA,S;AACAlB,EAAAA,c;AACAmB,EAAAA,Q;;eA+HaX,a","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\ntype ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n disabled?: boolean;\n notificationVariant?: 'positive' | 'critical';\n className?: string;\n hideOnLowWidth?: boolean;\n tabIndex?: number;\n};\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nconst Container = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <Container hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </Container>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.cjs"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type ProfileButtonProps = {
|
|
3
|
+
portraitSrc?: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
initials?: string;
|
|
6
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
notificationVariant?: 'positive' | 'critical';
|
|
9
|
+
className?: string;
|
|
10
|
+
hideOnLowWidth?: boolean;
|
|
11
|
+
tabIndex?: number;
|
|
12
|
+
};
|
|
13
|
+
declare const ProfileButton: React.ForwardRefExoticComponent<ProfileButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export default ProfileButton;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
import _pt from "prop-types";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
|
+
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { COLORS, IconButton, Size } from '..';
|
|
9
|
+
import { IconButtonContent, StyledPrimaryIconButton } from '../Button/Iconbutton';
|
|
10
|
+
import { NotificationDot } from '../NotificationDot';
|
|
11
|
+
import { BREAKPOINTS, ComponentS, ComponentTextStyle } from '../styles';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
var PortraitOverlay = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ", ";\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n"])), COLORS.black);
|
|
16
|
+
var Container = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ", " {\n display: ", ";\n\n ", " {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ", " {\n background-color: ", ";\n\n svg, svg path {\n fill: ", ";\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ", " {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ", " {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n"])), StyledPrimaryIconButton, function (props) {
|
|
17
|
+
return props.hideOnLowWidth ? 'none' : 'inline';
|
|
18
|
+
}, BREAKPOINTS.MEDIUM, IconButtonContent, COLORS.neutral_100, COLORS.neutral_300, PortraitOverlay, PortraitOverlay);
|
|
19
|
+
var NotificationContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n left: 30px;\n bottom: 30px;\n"])));
|
|
20
|
+
var ImageWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n"])));
|
|
21
|
+
var ProfileButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
22
|
+
var portraitSrc = _ref.portraitSrc,
|
|
23
|
+
icon = _ref.icon,
|
|
24
|
+
initials = _ref.initials,
|
|
25
|
+
onClick = _ref.onClick,
|
|
26
|
+
hideOnLowWidth = _ref.hideOnLowWidth,
|
|
27
|
+
disabled = _ref.disabled,
|
|
28
|
+
notificationVariant = _ref.notificationVariant,
|
|
29
|
+
className = _ref.className,
|
|
30
|
+
tabIndex = _ref.tabIndex;
|
|
31
|
+
|
|
32
|
+
var renderIcon = function renderIcon() {
|
|
33
|
+
return portraitSrc && /*#__PURE__*/_jsxs(ImageWrapper, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
35
|
+
src: portraitSrc
|
|
36
|
+
}), /*#__PURE__*/_jsx(PortraitOverlay, {})]
|
|
37
|
+
}) || initials && /*#__PURE__*/_jsx(ComponentS, {
|
|
38
|
+
className: "initials",
|
|
39
|
+
textStyle: ComponentTextStyle.Bold,
|
|
40
|
+
color: disabled ? COLORS.neutral_300 : COLORS.white,
|
|
41
|
+
children: initials
|
|
42
|
+
}) || /*#__PURE__*/_jsx(_Fragment, {
|
|
43
|
+
children: icon
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/_jsx(Container, {
|
|
48
|
+
hideOnLowWidth: hideOnLowWidth,
|
|
49
|
+
children: /*#__PURE__*/_jsxs(IconButton, {
|
|
50
|
+
ref: ref,
|
|
51
|
+
className: className,
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
action: onClick,
|
|
54
|
+
variant: "primary",
|
|
55
|
+
tabIndex: tabIndex,
|
|
56
|
+
shape: "circular",
|
|
57
|
+
hideOnLowWidth: hideOnLowWidth,
|
|
58
|
+
children: [renderIcon(), notificationVariant && /*#__PURE__*/_jsx(NotificationContainer, {
|
|
59
|
+
children: /*#__PURE__*/_jsx(NotificationDot, {
|
|
60
|
+
size: Size.Medium,
|
|
61
|
+
variant: notificationVariant
|
|
62
|
+
})
|
|
63
|
+
})]
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
ProfileButton.propTypes = {
|
|
68
|
+
portraitSrc: _pt.string,
|
|
69
|
+
icon: _pt.node,
|
|
70
|
+
initials: _pt.string,
|
|
71
|
+
onClick: _pt.func.isRequired,
|
|
72
|
+
disabled: _pt.bool,
|
|
73
|
+
notificationVariant: _pt.oneOf(['positive', 'critical']),
|
|
74
|
+
className: _pt.string,
|
|
75
|
+
hideOnLowWidth: _pt.bool,
|
|
76
|
+
tabIndex: _pt.number
|
|
77
|
+
};
|
|
78
|
+
export default ProfileButton;
|
|
79
|
+
//# sourceMappingURL=ProfileButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ProfileButton/ProfileButton.tsx"],"names":["React","styled","COLORS","IconButton","Size","IconButtonContent","StyledPrimaryIconButton","NotificationDot","BREAKPOINTS","ComponentS","ComponentTextStyle","PortraitOverlay","div","black","Container","props","hideOnLowWidth","MEDIUM","neutral_100","neutral_300","NotificationContainer","ImageWrapper","ProfileButton","forwardRef","ref","portraitSrc","icon","initials","onClick","disabled","notificationVariant","className","tabIndex","renderIc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AA,8BACE;AAAK,QAAA,GAAG,EAAEA;AAAV,QADF,eAEE,KAAC,eAAD,KAFF;AAAA,MADF,IAMCE,QAAQ,iBACP,KAAC,UAAD;AAAY,MAAA,SAAS,EAAC,UAAtB;AAAiC,MAAA,SAAS,EAAEjB,kBAAkB,CAACwB,IAA/D;AACY,MAAA,KAAK,EAAEL,QAAQ,GAAG3B,MAAM,CAACiB,WAAV,GAAwBjB,MAAM,CAACiC,KAD1D;AAAA,gBAEGR;AAFH,MAPF,iBAWM;AAAA,gBAAGD;AAAH,MAZR;AAcD,GAfD;;AAiBA,sBACE,KAAC,SAAD;AAAW,IAAA,cAAc,EAAEV,cAA3B;AAAA,2BACE,MAAC,UAAD;AAAY,MAAA,GAAG,EAAEQ,GAAjB;AACY,MAAA,SAAS,EAAEO,SADvB;AAEY,MAAA,QAAQ,EAAEF,QAFtB;AAGY,MAAA,MAAM,EAAED,OAHpB;AAIY,MAAA,OAAO,EAAC,SAJpB;AAKY,MAAA,QAAQ,EAAEI,QALtB;AAMY,MAAA,KAAK,EAAC,UANlB;AAOY,MAAA,cAAc,EAAEhB,cAP5B;AAAA,iBAQGiB,UAAU,EARb,EASGH,mBAAmB,iBAClB,KAAC,qBAAD;AAAA,+BACE,KAAC,eAAD;AAAiB,UAAA,IAAI,EAAE1B,IAAI,CAACgC,MAA5B;AAAoC,UAAA,OAAO,EAAEN;AAA7C;AADF,QAVJ;AAAA;AADF,IADF;AAmBD,CA/CqB,CAAtB;;AAtFEL,EAAAA,W;AACAC,EAAAA,I;AACAC,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,mB,aAAsB,U,EAAa,U;AACnCC,EAAAA,S;AACAf,EAAAA,c;AACAgB,EAAAA,Q;;AA+HF,eAAeV,aAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, IconButton, Size} from '..';\nimport {IconButtonContent, StyledPrimaryIconButton} from '../Button/Iconbutton';\nimport {NotificationDot} from '../NotificationDot';\nimport {BREAKPOINTS, ComponentS, ComponentTextStyle} from '../styles';\n\ntype ProfileButtonProps = {\n portraitSrc?: string;\n icon?: React.ReactNode;\n initials?: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n disabled?: boolean;\n notificationVariant?: 'positive' | 'critical';\n className?: string;\n hideOnLowWidth?: boolean;\n tabIndex?: number;\n};\n\nconst PortraitOverlay = styled.div`\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: ${COLORS.black};\n opacity: 0;\n position: absolute;\n top: 0px;\n left: 0px;\n`;\n\nconst Container = styled.div<{ hideOnLowWidth?: boolean }>`\n width: 48px;\n height: 48px;\n display: inline;\n user-select: none;\n \n ${StyledPrimaryIconButton} {\n display: ${props => (props.hideOnLowWidth ? 'none' : 'inline')};\n\n ${BREAKPOINTS.MEDIUM} {\n display: inline;\n }\n\n :disabled {\n img {\n filter: grayscale(100%);\n }\n\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_100};\n\n svg, svg path {\n fill: ${COLORS.neutral_300};\n }\n }\n }\n\n :hover:not(:disabled):not(:active),\n &.hover-state {\n ${PortraitOverlay} {\n opacity: 0.25;\n transition: opacity 100ms ease-in-out;\n }\n }\n\n :active:not(:disabled),\n &.active-state {\n ${PortraitOverlay} {\n opacity: 0.5;\n transition: opacity 0ms ease-in-out;\n }\n }\n }\n`;\n\nconst NotificationContainer = styled.div`\n position: absolute;\n left: 30px;\n bottom: 30px;\n`;\n\nconst ImageWrapper = styled.div`\n width: 36px;\n height: 36px;\n position: relative;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n object-fit: cover;\n }\n`;\n\nconst ProfileButton = React.forwardRef<HTMLButtonElement, ProfileButtonProps>(({\n portraitSrc,\n icon,\n initials,\n onClick,\n hideOnLowWidth,\n disabled,\n notificationVariant,\n className,\n tabIndex\n }, ref) => {\n const renderIcon = () => {\n return (\n (portraitSrc && (\n <ImageWrapper>\n <img src={portraitSrc}/>\n <PortraitOverlay/>\n </ImageWrapper>\n )) ||\n (initials && (\n <ComponentS className=\"initials\" textStyle={ComponentTextStyle.Bold}\n color={disabled ? COLORS.neutral_300 : COLORS.white}>\n {initials}\n </ComponentS>\n )) || <>{icon}</>\n );\n };\n\n return (\n <Container hideOnLowWidth={hideOnLowWidth}>\n <IconButton ref={ref}\n className={className}\n disabled={disabled}\n action={onClick}\n variant=\"primary\"\n tabIndex={tabIndex}\n shape=\"circular\"\n hideOnLowWidth={hideOnLowWidth}>\n {renderIcon()}\n {notificationVariant && (\n <NotificationContainer>\n <NotificationDot size={Size.Medium} variant={notificationVariant}/>\n </NotificationContainer>\n )}\n </IconButton>\n </Container>\n );\n});\n\nexport default ProfileButton;\n"],"file":"ProfileButton.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "ProfileButton", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _ProfileButton.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _ProfileButton = _interopRequireDefault(require("./ProfileButton"));
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ProfileButton/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as ProfileButton } from './ProfileButton';"],"file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProfileButton } from './ProfileButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ProfileButton/index.tsx"],"names":["default","ProfileButton"],"mappings":"AAAA,SAASA,OAAO,IAAIC,aAApB,QAAyC,iBAAzC","sourcesContent":["export { default as ProfileButton } from './ProfileButton';"],"file":"index.js"}
|
|
@@ -58,7 +58,7 @@ var OptionContainer = _styledComponents.default.div(_templateObject4 || (_templa
|
|
|
58
58
|
var renderResultContent = function renderResultContent(resultType) {
|
|
59
59
|
switch (resultType) {
|
|
60
60
|
case 'correct':
|
|
61
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.SystemIcons.
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.SystemIcons.CheckMark, {
|
|
62
62
|
color: _.COLORS.white,
|
|
63
63
|
className: 'quiz-button-result-icon'
|
|
64
64
|
});
|