@dnanpm/styleguide 3.12.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/build/cjs/components/Button/Button.d.ts +1 -7
  2. package/build/cjs/components/Button/Button.js +3 -3
  3. package/build/cjs/components/ButtonArrow/ButtonArrow.d.ts +1 -7
  4. package/build/cjs/components/ButtonArrow/ButtonArrow.js +2 -2
  5. package/build/cjs/components/ButtonIcon/ButtonIcon.js +3 -3
  6. package/build/cjs/components/Chip/Chip.d.ts +2 -18
  7. package/build/cjs/components/Chip/Chip.js +2 -2
  8. package/build/cjs/components/Drawer/Drawer.d.ts +0 -7
  9. package/build/cjs/components/Drawer/Drawer.js +1 -1
  10. package/build/cjs/components/Footer/Components/FooterComponents.js +0 -1
  11. package/build/cjs/components/Hero/Hero.js +3 -2
  12. package/build/cjs/components/Icon/Icon.d.ts +2 -8
  13. package/build/cjs/components/Icon/Icon.js +3 -10
  14. package/build/cjs/components/Input/Input.d.ts +1 -10
  15. package/build/cjs/components/LabelText/LabelText.d.ts +1 -6
  16. package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +1 -1
  17. package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +2 -2
  18. package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +1 -7
  19. package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +1 -3
  20. package/build/cjs/components/MainHeaderNavigation/context/NavContext.d.ts +0 -1
  21. package/build/cjs/components/MainHeaderNavigation/context/NavContext.js +0 -1
  22. package/build/cjs/components/Modal/Modal.d.ts +0 -5
  23. package/build/cjs/components/ReadMore/ReadMore.d.ts +0 -20
  24. package/build/cjs/components/ReadMore/ReadMore.js +2 -8
  25. package/build/cjs/components/Tab/Tab.d.ts +2 -30
  26. package/build/cjs/components/Tab/Tab.js +2 -33
  27. package/build/cjs/components/Tabs/Tabs.d.ts +1 -9
  28. package/build/cjs/components/Tabs/Tabs.js +9 -17
  29. package/build/cjs/components/index.d.ts +0 -4
  30. package/build/cjs/hooks/useCloseOutsideOrElementClicked.js +1 -1
  31. package/build/cjs/index.js +0 -8
  32. package/build/cjs/themes/themeComponents/navigation.js +0 -4
  33. package/build/es/components/Button/Button.d.ts +1 -7
  34. package/build/es/components/Button/Button.js +3 -3
  35. package/build/es/components/ButtonArrow/ButtonArrow.d.ts +1 -7
  36. package/build/es/components/ButtonArrow/ButtonArrow.js +2 -2
  37. package/build/es/components/ButtonIcon/ButtonIcon.js +3 -3
  38. package/build/es/components/Chip/Chip.d.ts +2 -18
  39. package/build/es/components/Chip/Chip.js +2 -2
  40. package/build/es/components/Drawer/Drawer.d.ts +0 -7
  41. package/build/es/components/Drawer/Drawer.js +1 -1
  42. package/build/es/components/Footer/Components/FooterComponents.js +0 -1
  43. package/build/es/components/Hero/Hero.js +3 -2
  44. package/build/es/components/Icon/Icon.d.ts +2 -8
  45. package/build/es/components/Icon/Icon.js +3 -10
  46. package/build/es/components/Input/Input.d.ts +1 -10
  47. package/build/es/components/LabelText/LabelText.d.ts +1 -6
  48. package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +1 -1
  49. package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +2 -2
  50. package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +1 -7
  51. package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +1 -3
  52. package/build/es/components/MainHeaderNavigation/context/NavContext.d.ts +0 -1
  53. package/build/es/components/MainHeaderNavigation/context/NavContext.js +0 -1
  54. package/build/es/components/Modal/Modal.d.ts +0 -5
  55. package/build/es/components/ReadMore/ReadMore.d.ts +0 -20
  56. package/build/es/components/ReadMore/ReadMore.js +2 -8
  57. package/build/es/components/Tab/Tab.d.ts +2 -30
  58. package/build/es/components/Tab/Tab.js +2 -33
  59. package/build/es/components/Tabs/Tabs.d.ts +1 -9
  60. package/build/es/components/Tabs/Tabs.js +9 -17
  61. package/build/es/components/index.d.ts +0 -4
  62. package/build/es/hooks/useCloseOutsideOrElementClicked.js +1 -1
  63. package/build/es/index.js +0 -4
  64. package/build/es/themes/themeComponents/navigation.js +1 -3
  65. package/package.json +12 -12
  66. package/build/cjs/components/ButtonRound/ButtonRound.d.ts +0 -10
  67. package/build/cjs/components/ButtonRound/ButtonRound.js +0 -37
  68. package/build/cjs/components/Icons/index.js +0 -224
  69. package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.d.ts +0 -3
  70. package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +0 -59
  71. package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.d.ts +0 -3
  72. package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +0 -259
  73. package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +0 -10
  74. package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +0 -168
  75. package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.d.ts +0 -4
  76. package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +0 -38
  77. package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.d.ts +0 -9
  78. package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +0 -38
  79. package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.d.ts +0 -6
  80. package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.js +0 -23
  81. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.d.ts +0 -24
  82. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +0 -104
  83. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +0 -6
  84. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +0 -62
  85. package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.d.ts +0 -7
  86. package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.js +0 -26
  87. package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.d.ts +0 -3
  88. package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +0 -193
  89. package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.d.ts +0 -6
  90. package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.js +0 -23
  91. package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.d.ts +0 -13
  92. package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +0 -74
  93. package/build/cjs/components/MainNavigation/MainNavigation.d.ts +0 -38
  94. package/build/cjs/components/MainNavigation/MainNavigation.js +0 -319
  95. package/build/cjs/components/MainNavigation/context/MobileMenuContext.d.ts +0 -6
  96. package/build/cjs/components/MainNavigation/context/MobileMenuContext.js +0 -11
  97. package/build/cjs/components/MainNavigation/context/NavContext.d.ts +0 -29
  98. package/build/cjs/components/MainNavigation/context/NavContext.js +0 -46
  99. package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +0 -13
  100. package/build/cjs/components/MainNavigation/globalNavStyles.js +0 -94
  101. package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.d.ts +0 -90
  102. package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +0 -207
  103. package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +0 -10
  104. package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +0 -34
  105. package/build/cjs/components/TooltipMenu/TooltipMenu.d.ts +0 -45
  106. package/build/cjs/components/TooltipMenu/TooltipMenu.js +0 -76
  107. package/build/es/components/ButtonRound/ButtonRound.d.ts +0 -10
  108. package/build/es/components/ButtonRound/ButtonRound.js +0 -29
  109. package/build/es/components/Icons/index.js +0 -109
  110. package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.d.ts +0 -3
  111. package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +0 -51
  112. package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.d.ts +0 -3
  113. package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +0 -251
  114. package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +0 -10
  115. package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +0 -159
  116. package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.d.ts +0 -4
  117. package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +0 -30
  118. package/build/es/components/MainNavigation/ChildComponents/LinkModifier.d.ts +0 -9
  119. package/build/es/components/MainNavigation/ChildComponents/LinkModifier.js +0 -29
  120. package/build/es/components/MainNavigation/ChildComponents/LoginTooltip.d.ts +0 -6
  121. package/build/es/components/MainNavigation/ChildComponents/LoginTooltip.js +0 -15
  122. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.d.ts +0 -24
  123. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +0 -96
  124. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +0 -6
  125. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +0 -57
  126. package/build/es/components/MainNavigation/ChildComponents/MinicartTooltip.d.ts +0 -7
  127. package/build/es/components/MainNavigation/ChildComponents/MinicartTooltip.js +0 -18
  128. package/build/es/components/MainNavigation/ChildComponents/MobileMenu.d.ts +0 -3
  129. package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +0 -185
  130. package/build/es/components/MainNavigation/ChildComponents/PageSearch.d.ts +0 -6
  131. package/build/es/components/MainNavigation/ChildComponents/PageSearch.js +0 -15
  132. package/build/es/components/MainNavigation/ChildComponents/Ribbon.d.ts +0 -13
  133. package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +0 -66
  134. package/build/es/components/MainNavigation/MainNavigation.d.ts +0 -38
  135. package/build/es/components/MainNavigation/MainNavigation.js +0 -311
  136. package/build/es/components/MainNavigation/context/MobileMenuContext.d.ts +0 -6
  137. package/build/es/components/MainNavigation/context/MobileMenuContext.js +0 -7
  138. package/build/es/components/MainNavigation/context/NavContext.d.ts +0 -29
  139. package/build/es/components/MainNavigation/context/NavContext.js +0 -42
  140. package/build/es/components/MainNavigation/globalNavStyles.d.ts +0 -13
  141. package/build/es/components/MainNavigation/globalNavStyles.js +0 -89
  142. package/build/es/components/SecondaryNavigation/SecondaryNavigation.d.ts +0 -90
  143. package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +0 -199
  144. package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +0 -10
  145. package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +0 -31
  146. package/build/es/components/TooltipMenu/TooltipMenu.d.ts +0 -45
  147. package/build/es/components/TooltipMenu/TooltipMenu.js +0 -68
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- const MobileMenuContext = React.createContext({
8
- mobileMenuRef: null,
9
- });
10
-
11
- exports.default = MobileMenuContext;
@@ -1,29 +0,0 @@
1
- import type { Dispatch, ReactNode, SetStateAction } from 'react';
2
- import type { GlobalNavItems, MenuLevelItem, MenuStates, MenuTooltipItems, MobileMenuLevel } from '../types/globalNavProps';
3
- export interface NavContextProps {
4
- collapseSize: number;
5
- currentUrl: string;
6
- getBackLink: (menuElements: MenuLevelItem[], i: number) => MenuLevelItem;
7
- handleNavMenuClick: (id: string | null, level: string) => void;
8
- handleToggleClick: () => void;
9
- isLoggedIn: boolean;
10
- isMobileMenu: boolean;
11
- isMobileMenuOpen: boolean;
12
- items: GlobalNavItems;
13
- level1Items: MobileMenuLevel;
14
- level2Items: MobileMenuLevel;
15
- lang: string;
16
- loginComponent?: ReactNode | boolean | undefined;
17
- menuLevel: MenuStates;
18
- minicartComponent?: ReactNode | boolean | undefined;
19
- navZIndex: number;
20
- nextJSLinkComponent: ReactNode | boolean;
21
- resetMenuEvents: () => void;
22
- searchComponent?: ReactNode | boolean | undefined;
23
- setTooltipItems: Dispatch<SetStateAction<MenuTooltipItems>>;
24
- showLoginTooltip: boolean;
25
- showMinicart: boolean;
26
- tooltipItems: MenuTooltipItems;
27
- }
28
- declare const NavContext: import("react").Context<NavContextProps>;
29
- export default NavContext;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- const NavContext = React.createContext({
8
- collapseSize: 767,
9
- currentUrl: '',
10
- getBackLink: () => ({ id: '', pages: [], titles: {}, urls: {} }),
11
- handleNavMenuClick: () => { },
12
- handleToggleClick: () => { },
13
- isLoggedIn: false,
14
- isMobileMenu: false,
15
- isMobileMenuOpen: false,
16
- items: {},
17
- lang: 'fi',
18
- level1Items: { level1: { id: '', pages: [], titles: {}, urls: {} } },
19
- level2Items: { level2: { id: '', pages: [], titles: {}, urls: {} } },
20
- loginComponent: false,
21
- menuLevel: {
22
- level1: null,
23
- animate1: true,
24
- level2: null,
25
- animate2: true,
26
- level1Mobile: null,
27
- level2Mobile: null,
28
- scrollPosition: 0,
29
- hideOnScroll: false,
30
- },
31
- minicartComponent: undefined,
32
- navZIndex: 1030,
33
- nextJSLinkComponent: false,
34
- resetMenuEvents: () => { },
35
- searchComponent: false,
36
- setTooltipItems: () => { },
37
- showLoginTooltip: false,
38
- showMinicart: true,
39
- tooltipItems: {
40
- minicart: false,
41
- login: false,
42
- search: false,
43
- },
44
- });
45
-
46
- exports.default = NavContext;
@@ -1,13 +0,0 @@
1
- export declare const MenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {
2
- isActive?: boolean;
3
- }>> & string;
4
- export declare const MenuLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
5
- isActive?: boolean;
6
- }>> & string;
7
- export declare const MenuLinkWithChildren: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
8
- isActive?: boolean;
9
- isHighlighted?: boolean;
10
- }>> & string;
11
- export declare const MenuList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {
12
- isInView?: boolean;
13
- }>> & string;
@@ -1,94 +0,0 @@
1
- 'use strict';
2
-
3
- var styledComponents = require('styled-components');
4
- var theme = require('../../themes/theme.js');
5
-
6
- const MenuItem = styledComponents.styled.li `
7
- position: relative;
8
- padding: 0;
9
- margin: 0;
10
- height: 100%;
11
- color: ${theme.default.color.text.black};
12
- & > a {
13
- color: ${p => (p.isActive ? theme.default.color.text.pink : theme.default.color.text.black)};
14
- }
15
- `;
16
- const MenuLink = styledComponents.styled.a `
17
- border: none;
18
- margin: 0;
19
- padding: 0;
20
- width: 100%;
21
- overflow: visible;
22
- background: transparent;
23
- color: inherit;
24
- font: inherit;
25
- line-height: normal;
26
- -webkit-font-smoothing: inherit;
27
- -moz-osx-font-smoothing: inherit;
28
- -webkit-appearance: none;
29
- line-height: 1rem;
30
- display: block;
31
- text-decoration: none;
32
- text-align: left;
33
- color: ${p => (p.isActive ? theme.default.color.text.pink : theme.default.color.text.black)};
34
- padding: 0.5em 1em;
35
- white-space: normal;
36
- &:hover,
37
- &:focus {
38
- text-decoration: none;
39
- color: ${theme.default.color.text.pink};
40
- cursor: pointer;
41
- outline: none;
42
- border-bottom: none;
43
- }
44
- `;
45
- const MenuLinkWithChildren = styledComponents.styled.button `
46
- line-height: 1rem;
47
- text-align: left;
48
- display: block;
49
- text-decoration: none;
50
- border: none;
51
- background: none;
52
- outline: none;
53
- font-size: inherit;
54
- font-family: inherit;
55
- white-space: normal;
56
- color: ${p => p && (p.isActive || p.isHighlighted) ? theme.default.color.text.pink : theme.default.color.default.black};
57
- padding: 0.5em 1em;
58
- span {
59
- position: relative;
60
- &:first-child:after {
61
- position: absolute;
62
- content: '';
63
- width: 100%;
64
- bottom: -6px;
65
- left: 0;
66
- border-bottom: 1px solid
67
- ${p => (p.isHighlighted ? theme.default.color.default.pink : 'transparent')};
68
- }
69
- }
70
- &:hover,
71
- &:focus {
72
- text-decoration: none;
73
- color: ${theme.default.color.text.pink};
74
- cursor: pointer;
75
- outline: none;
76
- }
77
- `;
78
- const MenuList = styledComponents.styled.ul `
79
- display: inline-flex;
80
- max-height: ${p => (typeof p.isInView !== 'boolean' || p.isInView ? 'auto' : '5px')};
81
- overflow: ${p => (typeof p.isInView === 'boolean' ? 'hidden' : 'unset')};
82
- align-items: center;
83
- position: relative;
84
- list-style: none;
85
- margin: 0;
86
- padding: 0;
87
- background-color: ${theme.default.color.default.white};
88
- transition: all 300ms ease-in-out;
89
- `;
90
-
91
- exports.MenuItem = MenuItem;
92
- exports.MenuLink = MenuLink;
93
- exports.MenuLinkWithChildren = MenuLinkWithChildren;
94
- exports.MenuList = MenuList;
@@ -1,90 +0,0 @@
1
- import type { ComponentType, ReactNode } from 'react';
2
- import React from 'react';
3
- import type { LangProps } from '../../types/language';
4
- interface MenuItem {
5
- id: string;
6
- titles: LangProps;
7
- urls: LangProps;
8
- icon?: string;
9
- target?: string;
10
- }
11
- interface SecondaryNavigationData {
12
- name?: string;
13
- categoryId?: string;
14
- pages?: MenuItem[] | null;
15
- }
16
- interface NextJSLink {
17
- linkUrl: string;
18
- linkTitle: string;
19
- iconName: string;
20
- showNotification: boolean;
21
- collapseSize: number;
22
- children?: ReactNode;
23
- }
24
- interface Props {
25
- /**
26
- * Component data in JSON format
27
- */
28
- data: SecondaryNavigationData;
29
- /**
30
- * Highlight active item
31
- */
32
- currentUrl: string;
33
- /**
34
- * Allows to use nextJS component instead of HTML Anchor
35
- */
36
- nextJSSecondaryNavLink?: ComponentType<NextJSLink>;
37
- /**
38
- * Allows to change language of component
39
- *
40
- * @default 'fi'
41
- */
42
- lang?: string;
43
- /**
44
- * Allows to set threshold in px, when desktop style changes to mobile style
45
- *
46
- * @default 767
47
- */
48
- collapseSize?: number;
49
- /**
50
- * Allows to set maximum width of component
51
- */
52
- 'max-width'?: number;
53
- /**
54
- * Defines how active item is determined relative to `currentUrl` property
55
- *
56
- * @default true
57
- */
58
- matchFullUrl?: boolean;
59
- /**
60
- * Allows to hide component in desktop mode
61
- *
62
- * @default false
63
- */
64
- mobileOnly?: boolean;
65
- /**
66
- * Allows to highlight component items
67
- */
68
- highlightIds?: string[];
69
- /**
70
- * Allows to set Secondary navigation background to white
71
- *
72
- * @default false
73
- */
74
- whiteBg?: boolean;
75
- /**
76
- * Allows to pass a custom className
77
- */
78
- className?: string;
79
- /**
80
- * Allows to pass testid string for testing purposes
81
- */
82
- 'data-testid'?: string;
83
- }
84
- /**
85
- * @visibleName Secondary Navigation
86
- * @deprecated Use `PriorityNavigation` component
87
- */
88
- declare const SecondaryNavigation: ({ currentUrl, lang, nextJSSecondaryNavLink: NextJSSecondaryNavLink, collapseSize, "max-width": maxWidth, matchFullUrl, highlightIds, className, "data-testid": dataTestId, ...props }: Props) => React.JSX.Element;
89
- /** @component */
90
- export default SecondaryNavigation;
@@ -1,207 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tslib = require('tslib');
6
- var icons = require('@dnanpm/icons');
7
- var React = require('react');
8
- var useOutsideClick = require('../../hooks/useOutsideClick.js');
9
- var styledComponents = require('styled-components');
10
- var theme = require('../../themes/theme.js');
11
- var styledUtils = require('../../utils/styledUtils.js');
12
- var Icon = require('../Icon/Icon.js');
13
-
14
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
15
-
16
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
17
-
18
- const SecondaryNavigationWrapper = styledComponents.styled.nav `
19
- font-size: ${theme.default.fontSize.default};
20
- padding: 0;
21
- background-color: ${({ $whiteBg }) => $whiteBg ? theme.default.color.background.white.default : 'transparent'};
22
-
23
- ${({ $mobileOnly }) => styledUtils.media.sm `
24
- display: ${$mobileOnly ? 'none' : 'inherit'};
25
- `};
26
-
27
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
28
- border-bottom: 1px solid ${theme.default.color.line.L03};
29
- }
30
- `;
31
- const MobileSelector = styledComponents.styled.button `
32
- display: flex;
33
- align-items: center;
34
- justify-content: space-between;
35
- line-height: ${theme.default.lineHeight.default};
36
- color: ${theme.default.color.text.pink};
37
- padding: 1rem ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
38
- background: transparent;
39
- border: 0;
40
- border-bottom: 1px solid ${theme.default.color.default.pink};
41
- width: 100%;
42
- font-size: ${theme.default.fontSize.default};
43
-
44
- &:hover {
45
- cursor: pointer;
46
- }
47
-
48
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
49
- display: none;
50
- }
51
- `;
52
- const MobileSelectorTitleWrapper = styledComponents.styled.div `
53
- display: flex;
54
- `;
55
- const MobileSelectorArrow = styledComponents.styled.span `
56
- display: flex;
57
-
58
- .dnasg-icon svg {
59
- transition: transform 0.15s ease-in-out;
60
- transform: rotate(${({ $isOpen }) => ($isOpen ? '180deg' : '0deg')});
61
- }
62
- `;
63
- const MobileSelectorCheck = styledComponents.styled.span `
64
- margin-left: auto;
65
-
66
- .dnasg-icon {
67
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
68
- display: none;
69
- }
70
- }
71
- `;
72
- const SecondaryNavigationList = styledComponents.styled.ul `
73
- padding: 0;
74
- list-style-type: none;
75
- margin: 0;
76
- overflow: hidden;
77
- display: flex;
78
- flex-direction: column;
79
- transition:
80
- max-height 0.2s ease-in-out,
81
- border-bottom 0.2s linear;
82
- background-color: ${({ $isOpen }) => $isOpen ? theme.default.color.background.white.default : 'transparent'};
83
- max-height: ${({ $isOpen }) => ($isOpen ? '500vh' : '0')};
84
- border-bottom: ${({ $isOpen }) => ($isOpen ? `1px solid ${theme.default.color.line.L03}` : 'none')};
85
-
86
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
87
- padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
88
- max-height: none;
89
- position: static;
90
- flex-direction: row;
91
- overflow: auto;
92
- height: auto;
93
- border-bottom: none;
94
- max-width: ${({ 'max-width': maxWidth }) => (maxWidth ? `${maxWidth}px` : 'none')};
95
- }
96
- `;
97
- const SecondaryNavigationListElement = styledComponents.styled.li `
98
- margin: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
99
-
100
- a {
101
- text-decoration: none;
102
- padding: 1rem 0;
103
- justify-content: start;
104
- color: ${({ $isActive }) => ($isActive ? theme.default.color.text.pink : theme.default.color.text.black)};
105
- font-weight: ${({ $isActive }) => $isActive ? theme.default.fontWeight.bold : theme.default.fontWeight.book};
106
- display: flex;
107
- align-items: center;
108
-
109
- &:hover {
110
- color: ${theme.default.color.text.pink};
111
- text-decoration: none;
112
- cursor: ${({ $isActive }) => ($isActive ? 'auto' : 'pointer')};
113
- }
114
-
115
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
116
- padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.5)} 0;
117
- font-weight: ${theme.default.fontWeight.book};
118
- }
119
- }
120
-
121
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
122
- margin: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.5)};
123
- white-space: nowrap;
124
- transition: border-bottom 0.2s linear;
125
- border-bottom: ${({ $isActive }) => $isActive ? `1px solid ${theme.default.color.default.pink}` : 'none'};
126
-
127
- &:first-of-type {
128
- margin-left: 0;
129
- }
130
- }
131
- `;
132
- const IconWrapper = styledComponents.styled.span `
133
- position: relative;
134
- display: flex;
135
- margin-right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
136
-
137
- &:after {
138
- display: ${({ $showNotification }) => ($showNotification ? 'inline' : 'none')};
139
- content: '';
140
- position: absolute;
141
- border-radius: ${theme.default.radius.circle};
142
- width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
143
- height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)};
144
- right: -${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 0.2)};
145
- top: -${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.2)};
146
- border: 1px solid ${theme.default.color.default.white};
147
- background-color: ${theme.default.color.default.pink};
148
- }
149
-
150
- @media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
151
- display: none;
152
- }
153
- `;
154
- /**
155
- * @visibleName Secondary Navigation
156
- * @deprecated Use `PriorityNavigation` component
157
- */
158
- const SecondaryNavigation = (_a) => {
159
- var _b, _c, _d, _e;
160
- var { currentUrl = '', lang = 'fi', nextJSSecondaryNavLink: NextJSSecondaryNavLink, collapseSize = 767, 'max-width': maxWidth, matchFullUrl = true, highlightIds = [], className, 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["currentUrl", "lang", "nextJSSecondaryNavLink", "collapseSize", 'max-width', "matchFullUrl", "highlightIds", "className", 'data-testid']);
161
- const [isSecondaryNavOpen, setIsSecondaryNavOpen] = React.useState(false);
162
- const toggleNav = () => {
163
- setIsSecondaryNavOpen(!isSecondaryNavOpen);
164
- };
165
- const closeNav = () => {
166
- if (isSecondaryNavOpen) {
167
- setIsSecondaryNavOpen(false);
168
- }
169
- };
170
- const ref = React.useRef(null);
171
- useOutsideClick.default(ref, () => {
172
- if (isSecondaryNavOpen) {
173
- setIsSecondaryNavOpen(false);
174
- }
175
- });
176
- const selectedElement = (_b = props.data.pages) === null || _b === void 0 ? void 0 : _b.find(listElement => currentUrl === listElement.urls[lang]);
177
- const shouldHighlightSelectedElement = (_c = (selectedElement && highlightIds.some(el => el === selectedElement.id))) !== null && _c !== void 0 ? _c : false;
178
- const checkIsMenuItemLinkAbsolute = (menuItemLink) => menuItemLink.includes('http');
179
- return (React__default.default.createElement(SecondaryNavigationWrapper, { ref: ref, "data-testid": dataTestId, className: className, "$collapseSize": collapseSize, "$mobileOnly": props.mobileOnly, "$whiteBg": props.whiteBg },
180
- selectedElement && (React__default.default.createElement(MobileSelector, { onClick: toggleNav, "$collapseSize": collapseSize, "data-testid": "secondary-navigation-dropdown-selector" },
181
- React__default.default.createElement(MobileSelectorTitleWrapper, null,
182
- (selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.icon) && (React__default.default.createElement(IconWrapper, { "$showNotification": shouldHighlightSelectedElement, "$collapseSize": collapseSize },
183
- React__default.default.createElement(Icon.default, { name: selectedElement.icon }))),
184
- React__default.default.createElement("span", null, selectedElement.titles[lang])),
185
- React__default.default.createElement(MobileSelectorArrow, { "$isOpen": isSecondaryNavOpen },
186
- React__default.default.createElement(Icon.default, { icon: icons.ChevronDown })))),
187
- React__default.default.createElement(SecondaryNavigationList, { id: props.data.name ||
188
- `secondary-navigation-category-${(_d = props.data.categoryId) !== null && _d !== void 0 ? _d : ''}`, "$isOpen": isSecondaryNavOpen, "$collapseSize": collapseSize, "max-width": maxWidth, "data-testid": "secondary-nav-menu-ul" }, (_e = props.data.pages) === null || _e === void 0 ? void 0 : _e.map((listElement, index) => {
189
- const linkUrl = listElement.urls[lang];
190
- const linkTitle = listElement.titles[lang];
191
- const iconName = listElement.icon || '';
192
- const isActive = matchFullUrl
193
- ? currentUrl === linkUrl
194
- : currentUrl.indexOf(linkUrl) > -1;
195
- const showNotification = highlightIds.some(el => el === listElement.id);
196
- const isMenuItemLinkAbsolute = checkIsMenuItemLinkAbsolute(linkUrl);
197
- return (React__default.default.createElement(SecondaryNavigationListElement, { key: listElement.id, onClick: closeNav, "$isActive": isActive, "$collapseSize": collapseSize }, NextJSSecondaryNavLink && !isMenuItemLinkAbsolute ? (React__default.default.createElement(NextJSSecondaryNavLink, { linkUrl: linkUrl, linkTitle: linkTitle, iconName: iconName, showNotification: showNotification, collapseSize: collapseSize, "data-testid": `secondary-nav-item-link-${index + 1}` }, isActive && (React__default.default.createElement(MobileSelectorCheck, { "$collapseSize": collapseSize },
198
- React__default.default.createElement(Icon.default, { icon: icons.Check }))))) : (React__default.default.createElement("a", { href: linkUrl, "data-testid": `secondary-nav-item-link-${index + 1}` },
199
- iconName && (React__default.default.createElement(IconWrapper, { "$showNotification": showNotification, "$collapseSize": collapseSize },
200
- React__default.default.createElement(Icon.default, { name: iconName }))),
201
- React__default.default.createElement("span", null, linkTitle),
202
- isActive && (React__default.default.createElement(MobileSelectorCheck, { "$collapseSize": collapseSize },
203
- React__default.default.createElement(Icon.default, { icon: icons.Check })))))));
204
- }))));
205
- };
206
-
207
- exports.default = SecondaryNavigation;
@@ -1,10 +0,0 @@
1
- export declare const Tail: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
- tooltipTop: string;
3
- zIndex: string;
4
- arrowPosition: string;
5
- }>> & string;
6
- export declare const TailShadow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
7
- tooltipTop: string;
8
- zIndex: string;
9
- arrowPosition: string;
10
- }>> & string;
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- var styledComponents = require('styled-components');
4
- var theme = require('../../../themes/theme.js');
5
-
6
- // Tooltip corner tail
7
- const Tail = styledComponents.styled.div `
8
- position: absolute;
9
- width: 0;
10
- height: 0;
11
- right: ${p => p.arrowPosition};
12
- margin-top: -17.5px;
13
- top: ${p => p.tooltipTop};
14
- z-index: ${p => Number(p.zIndex) + 1};
15
- border: 10px solid transparent;
16
- border-right-color: white;
17
- transform: rotate(90deg);
18
- `;
19
- // Box shadow of the tooltip tail
20
- const TailShadow = styledComponents.styled.div `
21
- position: absolute;
22
- width: 0.25rem;
23
- height: 0.25rem;
24
- margin-top: -5px;
25
- margin-right: 8.5px;
26
- top: ${p => p.tooltipTop};
27
- z-index: ${p => Number(p.zIndex) + 1};
28
- right: ${p => p.arrowPosition};
29
- background-color: transparent;
30
- box-shadow: 0 0 5px 0 ${theme.default.color.default.black};
31
- `;
32
-
33
- exports.Tail = Tail;
34
- exports.TailShadow = TailShadow;
@@ -1,45 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import React from 'react';
3
- import type { Props as IconProps } from '../Icon/Icon';
4
- export interface TooltipMenuProps {
5
- /** Text selector */
6
- selector: string;
7
- /** Allows to pass a custom className */
8
- className?: string;
9
- /** Tooltip menu content */
10
- children: ReactNode;
11
- /** Text selector color.Default: #121212 */
12
- color?: string;
13
- /** Text selector active color. Default: #121212 */
14
- activeColor?: string;
15
- /** Size of chevron icon. Default: 1.5rem */
16
- iconSize?: string;
17
- /** Overlap other elements */
18
- zIndex?: string;
19
- /** Tooltip position from top. Default: 2rem */
20
- tooltipTop?: string;
21
- /** Tooltip position from right. Default: 1.25rem */
22
- tooltipRight?: string;
23
- /**
24
- * Tooltip icon for selector. Default: ''
25
- *
26
- * @deprecated Use property `tooltipIcon`
27
- */
28
- tooltipIconName?: string;
29
- /**
30
- * Tooltip icon for selector
31
- */
32
- tooltipIcon?: IconProps['icon'];
33
- /** Tooltip icon size for selector. Default: '1.5rem' */
34
- tooltipIconSize?: string;
35
- /** Show hide animated chevron. Default: '' */
36
- tooltipChevron?: boolean;
37
- /** Arrow position if needed some adjust. Defaul: -0.25rem. */
38
- arrowPosition?: string;
39
- }
40
- /**
41
- * @visibleName Tooltip Menu
42
- * @deprecated Use `Tooltip` component
43
- */
44
- declare const TooltipMenu: ({ selector, className, color, children, iconSize, zIndex, tooltipTop, tooltipRight, activeColor, tooltipIconName, tooltipIcon, tooltipIconSize, tooltipChevron, arrowPosition, }: TooltipMenuProps) => React.JSX.Element;
45
- export default TooltipMenu;
@@ -1,76 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var icons = require('@dnanpm/icons');
6
- var React = require('react');
7
- var useOutsideClick = require('../../hooks/useOutsideClick.js');
8
- var styledComponents = require('styled-components');
9
- var theme = require('../../themes/theme.js');
10
- var Icon = require('../Icon/Icon.js');
11
- var TooltipMenuExportedStyles = require('./ChildComponents/TooltipMenuExportedStyles.js');
12
-
13
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
-
15
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
-
17
- const Selector = styledComponents.styled.div `
18
- display: flex;
19
- align-items: center;
20
- justify-content: flex-end;
21
- color: ${p => p.color || theme.default.color.text.white};
22
- cursor: pointer;
23
-
24
- span + span.dnasg-icon > svg {
25
- transform: ${p => (p.showDropdown ? 'rotate(180deg)' : 'rotate(0deg)')};
26
- transition: transform 0.15s linear;
27
- }
28
- `;
29
- const Container = styledComponents.styled.div `
30
- position: relative;
31
- `;
32
- const Tooltip = styledComponents.styled.div `
33
- background-color: ${theme.default.color.background.white.default};
34
- padding: 0.5rem;
35
- min-height: 3rem;
36
- min-width: 4rem;
37
- position: absolute;
38
- right: ${p => p.tooltipRight};
39
- top: ${p => p.tooltipTop};
40
- box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.48);
41
- z-index: ${p => p.zIndex};
42
- `;
43
- const ChildrenWrapper = styledComponents.styled.span `
44
- > * {
45
- white-space: nowrap;
46
- }
47
- `;
48
- /**
49
- * @visibleName Tooltip Menu
50
- * @deprecated Use `Tooltip` component
51
- */
52
- const TooltipMenu = ({ selector, className, color = theme.default.color.text.black, children, iconSize = '1.5rem', zIndex = '1', tooltipTop = '2rem', tooltipRight = '-1.25rem', activeColor = color, tooltipIconName, tooltipIcon, tooltipIconSize = '1.5rem', tooltipChevron = true, arrowPosition = '-0.25rem', }) => {
53
- const [showDropdown, setShowDropdown] = React.useState(false);
54
- const ref = React.useRef(null);
55
- const toggleState = () => {
56
- setShowDropdown(!showDropdown);
57
- };
58
- useOutsideClick.default(ref, () => {
59
- if (showDropdown) {
60
- setShowDropdown(false);
61
- }
62
- });
63
- return (React__default.default.createElement(Container, { className: className, ref: ref },
64
- React__default.default.createElement(Selector, { color: showDropdown ? activeColor : color, onClick: toggleState, showDropdown: showDropdown },
65
- tooltipIcon && React__default.default.createElement(Icon.default, { icon: tooltipIcon, size: tooltipIconSize, position: "left" }),
66
- tooltipIconName && (React__default.default.createElement(Icon.default, { name: tooltipIconName, size: tooltipIconSize, position: "left" })),
67
- React__default.default.createElement("span", null, selector),
68
- tooltipChevron && React__default.default.createElement(Icon.default, { icon: icons.ChevronDown, size: iconSize, position: "right" })),
69
- showDropdown && (React__default.default.createElement(React__default.default.Fragment, null,
70
- React__default.default.createElement(TooltipMenuExportedStyles.TailShadow, { zIndex: zIndex, tooltipTop: tooltipTop, arrowPosition: arrowPosition }),
71
- React__default.default.createElement(TooltipMenuExportedStyles.Tail, { zIndex: zIndex, tooltipTop: tooltipTop, arrowPosition: arrowPosition }))),
72
- showDropdown && (React__default.default.createElement(Tooltip, { zIndex: zIndex, tooltipTop: tooltipTop, tooltipRight: tooltipRight },
73
- React__default.default.createElement(ChildrenWrapper, null, children)))));
74
- };
75
-
76
- exports.default = TooltipMenu;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { Props as ButtonProps } from '../Button/Button';
3
- type Props = Omit<ButtonProps, 'small' | 'fullWidth' | 'loading'>;
4
- /**
5
- * @visibleName Button Round
6
- * @deprecated Use `ButtonArrow` component
7
- */
8
- declare const ButtonRound: ({ "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, ...props }: Props) => React.JSX.Element;
9
- /** @component */
10
- export default ButtonRound;