@dnanpm/styleguide 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -86
- package/build/cjs/assets/{bundle-8de31ca3.css → bundle-f9dcdcfa.css} +129 -129
- package/build/cjs/components/Accordion/Accordion.d.ts +2 -1
- package/build/cjs/components/Accordion/Accordion.js +4 -4
- package/build/cjs/components/AccordionItem/AccordionItem.d.ts +4 -3
- package/build/cjs/components/AccordionItem/AccordionItem.js +2 -2
- package/build/cjs/components/Box/Box.d.ts +2 -1
- package/build/cjs/components/Box/Box.js +1 -1
- package/build/cjs/components/Button/Button.d.ts +4 -3
- package/build/cjs/components/Button/ButtonArrow.d.ts +2 -1
- package/build/cjs/components/Button/ButtonArrow.js +1 -3
- package/build/cjs/components/Checkbox/Checkbox.js +1 -1
- package/build/cjs/components/Chip/Chip.d.ts +3 -2
- package/build/cjs/components/DateTimePicker/DateTimePicker.d.ts +102 -0
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +282 -0
- package/build/cjs/components/Divider/Divider.d.ts +2 -1
- package/build/cjs/components/DnaLogo/DnaLogo.d.ts +2 -1
- package/build/cjs/components/Drawer/Drawer.d.ts +2 -1
- package/build/cjs/components/EmptyState/EmptyState.d.ts +2 -1
- package/build/cjs/components/Floater/Floater.d.ts +2 -1
- package/build/cjs/components/Footer/Components/FooterComponents.d.ts +2 -67
- package/build/cjs/components/Footer/Components/FooterComponents.js +17 -67
- package/build/cjs/components/Footer/Footer.d.ts +4 -13
- package/build/cjs/components/Footer/Footer.js +2 -5
- package/build/cjs/components/Footer/context/FooterContext.d.ts +5 -4
- package/build/cjs/components/Footer/context/FooterContext.js +1 -5
- package/build/cjs/components/Icon/Icon.d.ts +3 -2
- package/build/cjs/components/Icons/hlLink.d.ts +4 -0
- package/build/cjs/components/Icons/hlLink.js +19 -0
- package/build/cjs/components/Icons/index.d.ts +1 -0
- package/build/cjs/components/Icons/index.js +2 -0
- package/build/cjs/components/Input/Input.d.ts +28 -11
- package/build/cjs/components/Input/Input.js +56 -29
- package/build/cjs/components/Label/Label.d.ts +2 -1
- package/build/cjs/components/LabelText/LabelText.d.ts +2 -1
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.d.ts +6 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +70 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.d.ts +3 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +207 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LanguageSelector.d.ts +4 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +40 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LinkModifier.d.ts +10 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LinkModifier.js +44 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LoginTooltip.d.ts +7 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LoginTooltip.js +24 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +193 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +120 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +169 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +68 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.d.ts +7 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +27 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.d.ts +3 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +196 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/PageSearch.d.ts +6 -0
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/PageSearch.js +24 -0
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +36 -0
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +322 -0
- package/build/cjs/components/MainHeaderNavigation/context/MobileMenuContext.d.ts +6 -0
- package/build/cjs/components/MainHeaderNavigation/context/MobileMenuContext.js +11 -0
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.d.ts +29 -0
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.js +56 -0
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.d.ts +1482 -0
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.js +189 -0
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.d.ts +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +33 -33
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +11 -14
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +9 -9
- package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.js +3 -5
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.d.ts +5 -4
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +10 -10
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +4 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.js +4 -6
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +21 -17
- package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.js +3 -5
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.d.ts +2 -2
- package/build/cjs/components/MainNavigation/MainNavigation.d.ts +5 -5
- package/build/cjs/components/MainNavigation/MainNavigation.js +100 -74
- package/build/cjs/components/MainNavigation/context/MobileMenuContext.d.ts +3 -3
- package/build/cjs/components/MainNavigation/context/MobileMenuContext.js +1 -5
- package/build/cjs/components/MainNavigation/context/NavContext.d.ts +14 -15
- package/build/cjs/components/MainNavigation/context/NavContext.js +6 -5
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +4 -4
- package/build/cjs/components/Modal/Modal.d.ts +2 -1
- package/build/cjs/components/Notification/Notification.d.ts +3 -2
- package/build/cjs/components/NotificationBadge/NotificationBadge.d.ts +2 -1
- package/build/cjs/components/Pill/Pill.d.ts +3 -2
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/build/cjs/components/RadioButton/RadioButton.d.ts +2 -1
- package/build/cjs/components/ReadMore/ReadMore.d.ts +4 -4
- package/build/cjs/components/Search/Search.d.ts +7 -6
- package/build/cjs/components/Search/Search.js +1 -1
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.d.ts +19 -2
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +23 -29
- package/build/cjs/components/Selectbox/Selectbox.js +2 -2
- package/build/cjs/components/Selectbox/__tests__/Selectbox.spec.d.ts +1 -0
- package/build/cjs/components/Tabs/Tab.d.ts +5 -3
- package/build/cjs/components/Tabs/Tab.js +1 -1
- package/build/cjs/components/Tabs/Tabs.d.ts +18 -19
- package/build/cjs/components/Tabs/Tabs.js +3 -3
- package/build/cjs/components/Textarea/Textarea.d.ts +6 -5
- package/build/cjs/components/Toaster/Toaster.d.ts +3 -2
- package/build/cjs/components/Tooltip/Tooltip.d.ts +2 -1
- package/build/cjs/components/Tooltip/Tooltip.js +1 -1
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +2 -2
- package/build/cjs/components/TooltipMenu/TooltipMenu.d.ts +2 -1
- package/build/cjs/components/index.d.ts +3 -1
- package/build/cjs/hooks/useCloseOutsideOrElementClicked.js +3 -2
- package/build/cjs/hooks/useDebounce.d.ts +2 -0
- package/build/cjs/hooks/useDebounce.js +23 -0
- package/build/cjs/hooks/useDocHeight.d.ts +2 -1
- package/build/cjs/hooks/useDocHeight.js +5 -25
- package/build/cjs/hooks/useResizeObserver.d.ts +6 -0
- package/build/cjs/hooks/{useElementDimensions.js → useResizeObserver.js} +5 -5
- package/build/cjs/hooks/useScrollPosition.d.ts +2 -3
- package/build/cjs/hooks/useScrollPosition.js +8 -14
- package/build/cjs/index.js +6 -0
- package/build/cjs/themes/globalStyles.d.ts +3 -3
- package/build/cjs/themes/styled.d.ts +7 -7
- package/build/cjs/themes/theme.d.ts +1 -1
- package/build/cjs/themes/themeComponents/navigation.d.ts +7 -0
- package/build/cjs/themes/themeComponents/navigation.js +13 -1
- package/build/cjs/utils/common.d.ts +2 -1
- package/build/cjs/utils/common.js +1 -1
- package/build/cjs/utils/createStyled.d.ts +163 -2
- package/build/cjs/utils/createStyled.js +2 -2
- package/build/cjs/utils/styledUtils.d.ts +1 -1
- package/build/es/assets/{bundle-8de31ca3.css → bundle-f9dcdcfa.css} +129 -129
- package/build/es/components/Accordion/Accordion.d.ts +2 -1
- package/build/es/components/Accordion/Accordion.js +5 -5
- package/build/es/components/AccordionItem/AccordionItem.d.ts +4 -3
- package/build/es/components/AccordionItem/AccordionItem.js +1 -1
- package/build/es/components/Box/Box.d.ts +2 -1
- package/build/es/components/Box/Box.js +1 -1
- package/build/es/components/Button/Button.d.ts +4 -3
- package/build/es/components/Button/ButtonArrow.d.ts +2 -1
- package/build/es/components/Button/ButtonArrow.js +2 -4
- package/build/es/components/Checkbox/Checkbox.js +1 -1
- package/build/es/components/Chip/Chip.d.ts +3 -2
- package/build/es/components/DateTimePicker/DateTimePicker.d.ts +102 -0
- package/build/es/components/DateTimePicker/DateTimePicker.js +272 -0
- package/build/es/components/Divider/Divider.d.ts +2 -1
- package/build/es/components/DnaLogo/DnaLogo.d.ts +2 -1
- package/build/es/components/Drawer/Drawer.d.ts +2 -1
- package/build/es/components/EmptyState/EmptyState.d.ts +2 -1
- package/build/es/components/Floater/Floater.d.ts +2 -1
- package/build/es/components/Footer/Components/FooterComponents.d.ts +2 -67
- package/build/es/components/Footer/Components/FooterComponents.js +18 -68
- package/build/es/components/Footer/Footer.d.ts +4 -13
- package/build/es/components/Footer/Footer.js +3 -6
- package/build/es/components/Footer/context/FooterContext.d.ts +5 -4
- package/build/es/components/Footer/context/FooterContext.js +2 -2
- package/build/es/components/Icon/Icon.d.ts +3 -2
- package/build/es/components/Icons/hlLink.d.ts +4 -0
- package/build/es/components/Icons/hlLink.js +11 -0
- package/build/es/components/Icons/index.d.ts +1 -0
- package/build/es/components/Icons/index.js +1 -0
- package/build/es/components/Input/Input.d.ts +28 -11
- package/build/es/components/Input/Input.js +56 -29
- package/build/es/components/Label/Label.d.ts +2 -1
- package/build/es/components/LabelText/LabelText.d.ts +2 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/BusinessMenu.d.ts +6 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +62 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/DesktopMenu.d.ts +3 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +199 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/LanguageSelector.d.ts +4 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +32 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/LinkModifier.d.ts +10 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/LinkModifier.js +35 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/LoginTooltip.d.ts +7 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/LoginTooltip.js +16 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +193 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +111 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +169 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +63 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.d.ts +7 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +19 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MobileMenu.d.ts +3 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +188 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/PageSearch.d.ts +6 -0
- package/build/es/components/MainHeaderNavigation/ChildComponents/PageSearch.js +16 -0
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +36 -0
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +314 -0
- package/build/es/components/MainHeaderNavigation/context/MobileMenuContext.d.ts +6 -0
- package/build/es/components/MainHeaderNavigation/context/MobileMenuContext.js +7 -0
- package/build/es/components/MainHeaderNavigation/context/NavContext.d.ts +29 -0
- package/build/es/components/MainHeaderNavigation/context/NavContext.js +52 -0
- package/build/es/components/MainHeaderNavigation/globalNavStyles.d.ts +1482 -0
- package/build/es/components/MainHeaderNavigation/globalNavStyles.js +177 -0
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.d.ts +2 -2
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +33 -33
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +2 -2
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.d.ts +1 -1
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +12 -15
- package/build/es/components/MainNavigation/ChildComponents/LinkModifier.d.ts +1 -1
- package/build/es/components/MainNavigation/ChildComponents/LinkModifier.js +9 -9
- package/build/es/components/MainNavigation/ChildComponents/LoginTooltip.js +4 -6
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.d.ts +5 -4
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +11 -11
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +4 -2
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -3
- package/build/es/components/MainNavigation/ChildComponents/MinicartTooltip.js +5 -7
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.d.ts +1 -1
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +22 -18
- package/build/es/components/MainNavigation/ChildComponents/PageSearch.js +4 -6
- package/build/es/components/MainNavigation/ChildComponents/Ribbon.d.ts +2 -2
- package/build/es/components/MainNavigation/MainNavigation.d.ts +5 -5
- package/build/es/components/MainNavigation/MainNavigation.js +101 -75
- package/build/es/components/MainNavigation/context/MobileMenuContext.d.ts +3 -3
- package/build/es/components/MainNavigation/context/MobileMenuContext.js +2 -2
- package/build/es/components/MainNavigation/context/NavContext.d.ts +14 -15
- package/build/es/components/MainNavigation/context/NavContext.js +7 -2
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +4 -4
- package/build/es/components/Modal/Modal.d.ts +2 -1
- package/build/es/components/Notification/Notification.d.ts +3 -2
- package/build/es/components/NotificationBadge/NotificationBadge.d.ts +2 -1
- package/build/es/components/Pill/Pill.d.ts +3 -2
- package/build/es/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/build/es/components/RadioButton/RadioButton.d.ts +2 -1
- package/build/es/components/ReadMore/ReadMore.d.ts +4 -4
- package/build/es/components/Search/Search.d.ts +7 -6
- package/build/es/components/Search/Search.js +2 -2
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.d.ts +19 -2
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +23 -29
- package/build/es/components/Selectbox/Selectbox.js +2 -2
- package/build/es/components/Selectbox/__tests__/Selectbox.spec.d.ts +1 -0
- package/build/es/components/Tabs/Tab.d.ts +5 -3
- package/build/es/components/Tabs/Tab.js +2 -2
- package/build/es/components/Tabs/Tabs.d.ts +18 -19
- package/build/es/components/Tabs/Tabs.js +4 -4
- package/build/es/components/Textarea/Textarea.d.ts +6 -5
- package/build/es/components/Toaster/Toaster.d.ts +3 -2
- package/build/es/components/Tooltip/Tooltip.d.ts +2 -1
- package/build/es/components/Tooltip/Tooltip.js +1 -1
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +2 -2
- package/build/es/components/TooltipMenu/TooltipMenu.d.ts +2 -1
- package/build/es/components/index.d.ts +3 -1
- package/build/es/hooks/useCloseOutsideOrElementClicked.js +3 -2
- package/build/es/hooks/useDebounce.d.ts +2 -0
- package/build/es/hooks/useDebounce.js +19 -0
- package/build/es/hooks/useDocHeight.d.ts +2 -1
- package/build/es/hooks/useDocHeight.js +6 -6
- package/build/es/hooks/useResizeObserver.d.ts +6 -0
- package/build/es/hooks/{useElementDimensions.js → useResizeObserver.js} +5 -5
- package/build/es/hooks/useScrollPosition.d.ts +2 -3
- package/build/es/hooks/useScrollPosition.js +9 -11
- package/build/es/index.js +3 -0
- package/build/es/themes/globalStyles.d.ts +3 -3
- package/build/es/themes/styled.d.ts +7 -7
- package/build/es/themes/theme.d.ts +1 -1
- package/build/es/themes/themeComponents/navigation.d.ts +7 -0
- package/build/es/themes/themeComponents/navigation.js +9 -2
- package/build/es/utils/common.d.ts +2 -1
- package/build/es/utils/common.js +1 -1
- package/build/es/utils/createStyled.d.ts +163 -2
- package/build/es/utils/createStyled.js +2 -2
- package/build/es/utils/styledUtils.d.ts +1 -1
- package/package.json +22 -11
- package/build/cjs/hooks/modifyBodyClass.d.ts +0 -1
- package/build/cjs/hooks/modifyBodyClass.js +0 -20
- package/build/cjs/hooks/useDebounceFunc.d.ts +0 -1
- package/build/cjs/hooks/useDebounceFunc.js +0 -39
- package/build/cjs/hooks/useElementDimensions.d.ts +0 -5
- package/build/es/hooks/modifyBodyClass.d.ts +0 -1
- package/build/es/hooks/modifyBodyClass.js +0 -16
- package/build/es/hooks/useDebounceFunc.d.ts +0 -1
- package/build/es/hooks/useDebounceFunc.js +0 -15
- package/build/es/hooks/useElementDimensions.d.ts +0 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
type ProgressIndicatorStatus = 'error';
|
|
3
4
|
interface Props {
|
|
@@ -14,7 +15,7 @@ interface Props {
|
|
|
14
15
|
* On Progress Indicator Item label or number click callback
|
|
15
16
|
* Use `e.currentTarget.parentElement` to get Progress Indicator Item element
|
|
16
17
|
*/
|
|
17
|
-
onStepClick?: (stepIndex: number, e:
|
|
18
|
+
onStepClick?: (stepIndex: number, e: MouseEvent<HTMLElement>) => void;
|
|
18
19
|
/**
|
|
19
20
|
* Allows to change version of component to small
|
|
20
21
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
interface Props {
|
|
3
4
|
/**
|
|
@@ -21,7 +22,7 @@ interface Props {
|
|
|
21
22
|
/**
|
|
22
23
|
* On radio button change callback
|
|
23
24
|
*/
|
|
24
|
-
onChange?: (e:
|
|
25
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
25
26
|
/**
|
|
26
27
|
* Allows to set the radio button as checked
|
|
27
28
|
*
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FunctionComponent, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
interface ReadMoreProps {
|
|
3
3
|
/** The label for show more link */
|
|
4
4
|
showMoreText?: string;
|
|
5
5
|
/** The label for show less link */
|
|
6
6
|
showLessText?: string;
|
|
7
7
|
/** Text content for component */
|
|
8
|
-
children:
|
|
8
|
+
children: ReactNode;
|
|
9
9
|
/** Allows to pass a custom className */
|
|
10
10
|
className?: string;
|
|
11
11
|
/** Allows to pass custom onClick */
|
|
12
|
-
onClick?: (event:
|
|
12
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
13
|
/** Init in expanded state and immediately close on client for better SEO */
|
|
14
14
|
seoInitExpanded?: boolean;
|
|
15
15
|
}
|
|
16
16
|
/** @visibleName Read More */
|
|
17
|
-
declare const ReadMore:
|
|
17
|
+
declare const ReadMore: FunctionComponent<ReadMoreProps>;
|
|
18
18
|
export default ReadMore;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
interface Props {
|
|
3
4
|
/**
|
|
@@ -19,27 +20,27 @@ interface Props {
|
|
|
19
20
|
/**
|
|
20
21
|
* On search input change callback
|
|
21
22
|
*/
|
|
22
|
-
onChange?: (e:
|
|
23
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
23
24
|
/**
|
|
24
25
|
* On search input blur callback
|
|
25
26
|
*/
|
|
26
|
-
onBlur?: (e:
|
|
27
|
+
onBlur?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
27
28
|
/**
|
|
28
29
|
* On search input focus callback
|
|
29
30
|
*/
|
|
30
|
-
onFocus?: (e:
|
|
31
|
+
onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
31
32
|
/**
|
|
32
33
|
* On search input key press callback
|
|
33
34
|
*/
|
|
34
|
-
onKeyPress?: (e:
|
|
35
|
+
onKeyPress?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
35
36
|
/**
|
|
36
37
|
* On search input key down callback
|
|
37
38
|
*/
|
|
38
|
-
onKeyDown?: (e:
|
|
39
|
+
onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
39
40
|
/**
|
|
40
41
|
* On button click callback
|
|
41
42
|
*/
|
|
42
|
-
onButtonClick?: (e:
|
|
43
|
+
onButtonClick?: (e: MouseEvent<HTMLElement>) => void;
|
|
43
44
|
/**
|
|
44
45
|
* Allow to set search input element focus on page load
|
|
45
46
|
*/
|
|
@@ -63,7 +63,7 @@ const Button = styled["default"](ButtonIcon["default"]) `
|
|
|
63
63
|
const Search = (_a) => {
|
|
64
64
|
var _b;
|
|
65
65
|
var { 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ['data-testid']);
|
|
66
|
-
const inputRef =
|
|
66
|
+
const inputRef = React.useRef(null);
|
|
67
67
|
const handleButtonClick = (e) => {
|
|
68
68
|
if (inputRef && inputRef.current) {
|
|
69
69
|
inputRef.current.focus();
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import type { LangProps } from '../../types/language';
|
|
4
|
+
interface MenuItem {
|
|
5
|
+
id: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
target?: string;
|
|
8
|
+
titles: LangProps;
|
|
9
|
+
urls: LangProps;
|
|
10
|
+
}
|
|
2
11
|
interface SNDataProps {
|
|
3
12
|
name?: string;
|
|
4
13
|
categoryId?: string;
|
|
5
|
-
pages?:
|
|
14
|
+
pages?: MenuItem[] | null;
|
|
15
|
+
}
|
|
16
|
+
interface NextJSSecondaryNavLinkProps {
|
|
17
|
+
linkUrl: string;
|
|
18
|
+
linkTitle: string;
|
|
19
|
+
iconName: string;
|
|
20
|
+
showNotification: boolean;
|
|
21
|
+
collapseSize: number;
|
|
22
|
+
children?: ReactNode;
|
|
6
23
|
}
|
|
7
24
|
interface Props {
|
|
8
25
|
/**
|
|
@@ -21,7 +38,7 @@ interface Props {
|
|
|
21
38
|
/**
|
|
22
39
|
* pass nextJS component for enabling nextJS routing
|
|
23
40
|
*/
|
|
24
|
-
nextJSSecondaryNavLink?:
|
|
41
|
+
nextJSSecondaryNavLink?: ComponentType<NextJSSecondaryNavLinkProps>;
|
|
25
42
|
/**
|
|
26
43
|
* width in pixels where navigation collapses to a dropdown
|
|
27
44
|
*
|
|
@@ -140,10 +140,9 @@ const IconWrapper = styled["default"].span `
|
|
|
140
140
|
background-color: ${theme["default"].color.default.pink};
|
|
141
141
|
}
|
|
142
142
|
`;
|
|
143
|
-
const isMenuItemLinkAbsolute = (menuItemLink) => menuItemLink.includes('http');
|
|
144
143
|
/** @visibleName Secondary Navigation */
|
|
145
|
-
const SecondaryNavigation = ({ currentUrl = '', data, lang = 'fi', nextJSSecondaryNavLink: NextJSSecondaryNavLink
|
|
146
|
-
var _a;
|
|
144
|
+
const SecondaryNavigation = ({ currentUrl = '', data, lang = 'fi', nextJSSecondaryNavLink: NextJSSecondaryNavLink, collapseSize = 767, 'data-testid': dataTestId, 'max-width': componentMaxWidth, className, matchFullUrl = true, mobileOnly = false, highlightIds = [], whiteBg = false, }) => {
|
|
145
|
+
var _a, _b, _c, _d;
|
|
147
146
|
const [isSecondaryNavOpen, setIsSecondaryNavOpen] = React.useState(false);
|
|
148
147
|
const toggleNav = () => {
|
|
149
148
|
setIsSecondaryNavOpen(!isSecondaryNavOpen);
|
|
@@ -159,39 +158,34 @@ const SecondaryNavigation = ({ currentUrl = '', data, lang = 'fi', nextJSSeconda
|
|
|
159
158
|
setIsSecondaryNavOpen(false);
|
|
160
159
|
}
|
|
161
160
|
});
|
|
162
|
-
const selectedElement = data.pages
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const shouldHighlightSelectedElement = selectedElement && highlightIds.some((el) => el === selectedElement.id);
|
|
161
|
+
const selectedElement = (_a = data.pages) === null || _a === void 0 ? void 0 : _a.find(listElement => currentUrl === listElement.urls[lang]);
|
|
162
|
+
const shouldHighlightSelectedElement = (_b = (selectedElement && highlightIds.some(el => el === selectedElement.id))) !== null && _b !== void 0 ? _b : false;
|
|
163
|
+
const checkIsMenuItemLinkAbsolute = (menuItemLink) => menuItemLink.includes('http');
|
|
166
164
|
return (React__default["default"].createElement(SecondaryNavigationWrapper, { ref: ref, collapseSize: collapseSize, "data-testid": dataTestId, className: className, mobileOnly: mobileOnly, whiteBg: whiteBg },
|
|
167
165
|
selectedElement && (React__default["default"].createElement(MobileSelector, { onClick: toggleNav, collapseSize: collapseSize, "data-testid": "secondary-navigation-dropdown-selector" },
|
|
168
166
|
React__default["default"].createElement(MobileSelectorTitleWrapper, null,
|
|
169
|
-
(
|
|
167
|
+
(selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.icon) && (React__default["default"].createElement(IconWrapper, { showNotification: shouldHighlightSelectedElement, collapseSize: collapseSize },
|
|
170
168
|
React__default["default"].createElement(Icon["default"], { name: selectedElement.icon }))),
|
|
171
169
|
React__default["default"].createElement("span", null, selectedElement.titles[lang])),
|
|
172
170
|
React__default["default"].createElement(MobileSelectorArrow, { isOpen: isSecondaryNavOpen },
|
|
173
171
|
React__default["default"].createElement(Icon["default"], { icon: hlChevronDown["default"] })))),
|
|
174
|
-
React__default["default"].createElement(SecondaryNavigationList, { id: data.name || `secondary-navigation-category-${data.categoryId}`, isOpen: isSecondaryNavOpen, collapseSize: collapseSize, componentMaxWidth: componentMaxWidth, "data-testid": "secondary-nav-menu-ul" }, data.pages
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
isActive && (React__default["default"].createElement(MobileSelectorCheck, { collapseSize: collapseSize },
|
|
192
|
-
React__default["default"].createElement(Icon["default"], { icon: hlCheck["default"] })))))));
|
|
193
|
-
})
|
|
194
|
-
: null)));
|
|
172
|
+
React__default["default"].createElement(SecondaryNavigationList, { id: data.name || `secondary-navigation-category-${(_c = data.categoryId) !== null && _c !== void 0 ? _c : ''}`, isOpen: isSecondaryNavOpen, collapseSize: collapseSize, componentMaxWidth: componentMaxWidth, "data-testid": "secondary-nav-menu-ul" }, (_d = data.pages) === null || _d === void 0 ? void 0 : _d.map((listElement, index) => {
|
|
173
|
+
const linkUrl = listElement.urls[lang];
|
|
174
|
+
const linkTitle = listElement.titles[lang];
|
|
175
|
+
const iconName = listElement.icon || '';
|
|
176
|
+
const isActive = matchFullUrl
|
|
177
|
+
? currentUrl === linkUrl
|
|
178
|
+
: currentUrl.indexOf(linkUrl) > -1;
|
|
179
|
+
const showNotification = highlightIds.some(el => el === listElement.id);
|
|
180
|
+
const isMenuItemLinkAbsolute = checkIsMenuItemLinkAbsolute(linkUrl);
|
|
181
|
+
return (React__default["default"].createElement(SecondaryNavigationListElement, { key: listElement.id, isActive: isActive, onClick: closeNav, 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 },
|
|
182
|
+
React__default["default"].createElement(Icon["default"], { icon: hlCheck["default"] }))))) : (React__default["default"].createElement("a", { href: linkUrl, "data-testid": `secondary-nav-item-link-${index + 1}` },
|
|
183
|
+
iconName && (React__default["default"].createElement(IconWrapper, { showNotification: showNotification, collapseSize: collapseSize },
|
|
184
|
+
React__default["default"].createElement(Icon["default"], { name: iconName }))),
|
|
185
|
+
React__default["default"].createElement("span", null, linkTitle),
|
|
186
|
+
isActive && (React__default["default"].createElement(MobileSelectorCheck, { collapseSize: collapseSize },
|
|
187
|
+
React__default["default"].createElement(Icon["default"], { icon: hlCheck["default"] })))))));
|
|
188
|
+
}))));
|
|
195
189
|
};
|
|
196
190
|
|
|
197
191
|
exports["default"] = SecondaryNavigation;
|
|
@@ -36,9 +36,9 @@ const ErrorMessage = styled["default"].div `
|
|
|
36
36
|
`;
|
|
37
37
|
const customTheme = Object.assign(Object.assign({}, Select.defaultTheme), { borderRadius: 0, colors: Object.assign(Object.assign({}, Select.defaultTheme.colors), { primary50: theme["default"].color.background.sand.E02, primary25: theme["default"].color.background.sand.E01, primary: theme["default"].color.background.sand.E02 }) });
|
|
38
38
|
const getStyles = () => ({
|
|
39
|
-
control: (_styles, state) => (Object.assign(Object.assign({ position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: `0 ${styledUtils.getMultipliedSize(theme["default"].base.baseWidth, 1)}`, width: '100%',
|
|
39
|
+
control: (_styles, state) => (Object.assign(Object.assign({ position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: `0 ${styledUtils.getMultipliedSize(theme["default"].base.baseWidth, 1)}`, width: '100%', minHeight: styledUtils.getMultipliedSize(theme["default"].base.baseHeight, 4), backgroundColor: state.isDisabled
|
|
40
40
|
? theme["default"].color.background.sand.E01
|
|
41
|
-
: theme["default"].color.background.white.default, borderRadius: theme["default"].radius.s, border: `1px solid ${theme["default"].color.line.L01}
|
|
41
|
+
: theme["default"].color.background.white.default, borderRadius: theme["default"].radius.s, border: `1px solid ${theme["default"].color.line.L01}`, overflow: 'auto' }, (state.selectProps.errorState && {
|
|
42
42
|
borderBottom: `4px solid ${theme["default"].color.notification.error}`,
|
|
43
43
|
})), (!state.menuIsOpen && {
|
|
44
44
|
':focus-within': {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React, { PureComponent } from 'react';
|
|
2
3
|
import type { Type } from './Tabs';
|
|
3
4
|
export interface TabProps {
|
|
4
5
|
activeTab?: string;
|
|
5
6
|
label: string;
|
|
6
7
|
tabStyle?: Type;
|
|
7
8
|
onClick?: (tab: string) => void;
|
|
9
|
+
children?: ReactNode;
|
|
8
10
|
}
|
|
9
11
|
export interface TabStyleProps {
|
|
10
12
|
isActive?: boolean;
|
|
@@ -164,7 +166,7 @@ export declare const TabStyle: import("styled-components").StyledComponent<"li",
|
|
|
164
166
|
h1: string;
|
|
165
167
|
h2: string;
|
|
166
168
|
};
|
|
167
|
-
media: Record<string | number, (l: TemplateStringsArray, ...p:
|
|
169
|
+
media: Record<string | number, (l: TemplateStringsArray, ...p: (string | number)[]) => string>;
|
|
168
170
|
radius: {
|
|
169
171
|
default: string;
|
|
170
172
|
s: string;
|
|
@@ -173,7 +175,7 @@ export declare const TabStyle: import("styled-components").StyledComponent<"li",
|
|
|
173
175
|
pill: string;
|
|
174
176
|
};
|
|
175
177
|
}, TabStyleProps, never>;
|
|
176
|
-
declare class Tab extends
|
|
178
|
+
declare class Tab extends PureComponent<TabProps> {
|
|
177
179
|
onClick: () => void;
|
|
178
180
|
render(): React.JSX.Element;
|
|
179
181
|
}
|
|
@@ -47,7 +47,7 @@ const TabStyle = styled["default"].li `
|
|
|
47
47
|
background-color: transparent;
|
|
48
48
|
`}
|
|
49
49
|
`;
|
|
50
|
-
class Tab extends
|
|
50
|
+
class Tab extends React.PureComponent {
|
|
51
51
|
constructor() {
|
|
52
52
|
super(...arguments);
|
|
53
53
|
this.onClick = () => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export type Type = 'gray' | 'underlined';
|
|
3
4
|
interface TabsProps {
|
|
@@ -17,7 +18,7 @@ interface TabsProps {
|
|
|
17
18
|
/**
|
|
18
19
|
* The actual content
|
|
19
20
|
*/
|
|
20
|
-
children:
|
|
21
|
+
children: ReactNode;
|
|
21
22
|
/**
|
|
22
23
|
* Handles when tab is switched/changed
|
|
23
24
|
*/
|
|
@@ -39,9 +40,7 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
|
|
|
39
40
|
value: number;
|
|
40
41
|
unit: string;
|
|
41
42
|
};
|
|
42
|
-
};
|
|
43
|
-
* The actual content
|
|
44
|
-
*/
|
|
43
|
+
};
|
|
45
44
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
46
45
|
color: {
|
|
47
46
|
default: {
|
|
@@ -53,9 +52,7 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
|
|
|
53
52
|
accent: {
|
|
54
53
|
lemon: string;
|
|
55
54
|
sky: string;
|
|
56
|
-
orange: string;
|
|
57
|
-
* Allows to pass a custom className
|
|
58
|
-
*/
|
|
55
|
+
orange: string;
|
|
59
56
|
};
|
|
60
57
|
hover: {
|
|
61
58
|
pink: string;
|
|
@@ -77,13 +74,15 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
|
|
|
77
74
|
info: string;
|
|
78
75
|
success: string;
|
|
79
76
|
warning: string;
|
|
80
|
-
error: string;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
error: string;
|
|
78
|
+
}; /**
|
|
79
|
+
* The actual content
|
|
80
|
+
*/
|
|
84
81
|
background: {
|
|
85
82
|
sand: {
|
|
86
|
-
default: string;
|
|
83
|
+
default: string; /**
|
|
84
|
+
* Handles when tab is switched/changed
|
|
85
|
+
*/
|
|
87
86
|
E01: string;
|
|
88
87
|
E02: string;
|
|
89
88
|
};
|
|
@@ -162,9 +161,7 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
|
|
|
162
161
|
medium: number;
|
|
163
162
|
bold: number;
|
|
164
163
|
black: number;
|
|
165
|
-
};
|
|
166
|
-
* Handles when tab is switched/changed
|
|
167
|
-
*/
|
|
164
|
+
};
|
|
168
165
|
form: {
|
|
169
166
|
smallSelectWidth: string;
|
|
170
167
|
smallSelectHeight: string;
|
|
@@ -183,6 +180,11 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
|
|
|
183
180
|
h1L: string;
|
|
184
181
|
h1M: string;
|
|
185
182
|
h1S: string; /**
|
|
183
|
+
* Allows to pass a custom className
|
|
184
|
+
*/
|
|
185
|
+
h2M: string;
|
|
186
|
+
h2S: string;
|
|
187
|
+
h3: string; /**
|
|
186
188
|
* Style of the tabs
|
|
187
189
|
*
|
|
188
190
|
* @param {Type} gray Default
|
|
@@ -190,15 +192,12 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
|
|
|
190
192
|
* @default 'gray'
|
|
191
193
|
* @deprecated Underlined is provided only as legacy style
|
|
192
194
|
*/
|
|
193
|
-
h2M: string;
|
|
194
|
-
h2S: string;
|
|
195
|
-
h3: string;
|
|
196
195
|
h4: string;
|
|
197
196
|
h5: string;
|
|
198
197
|
h1: string;
|
|
199
198
|
h2: string;
|
|
200
199
|
};
|
|
201
|
-
media: Record<string | number, (l: TemplateStringsArray, ...p:
|
|
200
|
+
media: Record<string | number, (l: TemplateStringsArray, ...p: (string | number)[]) => string>;
|
|
202
201
|
radius: {
|
|
203
202
|
default: string;
|
|
204
203
|
s: string;
|
|
@@ -22,9 +22,9 @@ const TabContent = styled["default"].div `
|
|
|
22
22
|
`;
|
|
23
23
|
/** @visibleName Tabs */
|
|
24
24
|
const Tabs = ({ children, className, tabStyle = 'gray', onChange, defaultTab }) => {
|
|
25
|
-
const [activeTab, setActiveTab] =
|
|
26
|
-
const tabs =
|
|
27
|
-
if (
|
|
25
|
+
const [activeTab, setActiveTab] = React.useState(defaultTab);
|
|
26
|
+
const tabs = React.Children.map(children, child => {
|
|
27
|
+
if (React.isValidElement(child) && child.type === Tab["default"]) {
|
|
28
28
|
return child;
|
|
29
29
|
}
|
|
30
30
|
return null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeEvent, FocusEvent, KeyboardEvent } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
interface Props {
|
|
3
4
|
/**
|
|
@@ -27,23 +28,23 @@ interface Props {
|
|
|
27
28
|
/**
|
|
28
29
|
* On input change callback
|
|
29
30
|
*/
|
|
30
|
-
onChange?: (val: string, e:
|
|
31
|
+
onChange?: (val: string, e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
31
32
|
/**
|
|
32
33
|
* On input blur callback
|
|
33
34
|
*/
|
|
34
|
-
onBlur?: (val: string, e:
|
|
35
|
+
onBlur?: (val: string, e: FocusEvent<HTMLTextAreaElement>) => void;
|
|
35
36
|
/**
|
|
36
37
|
* On input focus callback
|
|
37
38
|
*/
|
|
38
|
-
onFocus?: (e:
|
|
39
|
+
onFocus?: (e: FocusEvent<HTMLTextAreaElement>) => void;
|
|
39
40
|
/**
|
|
40
41
|
* On input key press callback
|
|
41
42
|
*/
|
|
42
|
-
onKeyPress?: (e:
|
|
43
|
+
onKeyPress?: (e: KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
43
44
|
/**
|
|
44
45
|
* On input key down callback
|
|
45
46
|
*/
|
|
46
|
-
onKeyDown?: (e:
|
|
47
|
+
onKeyDown?: (e: KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
47
48
|
/**
|
|
48
49
|
* Allows to disable the component functionality
|
|
49
50
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
type ToasterType = 'info' | 'success' | 'warning' | 'error';
|
|
3
4
|
interface Props {
|
|
@@ -15,7 +16,7 @@ interface Props {
|
|
|
15
16
|
/**
|
|
16
17
|
* Content of the toaster
|
|
17
18
|
*/
|
|
18
|
-
children?:
|
|
19
|
+
children?: ReactNode;
|
|
19
20
|
/**
|
|
20
21
|
* Allows to pass a custom className
|
|
21
22
|
*/
|
|
@@ -37,7 +38,7 @@ interface Props {
|
|
|
37
38
|
/**
|
|
38
39
|
* On close button click callback
|
|
39
40
|
*/
|
|
40
|
-
onClickCloseButton?: (e:
|
|
41
|
+
onClickCloseButton?: (e: MouseEvent<HTMLElement>) => void;
|
|
41
42
|
}
|
|
42
43
|
declare const Toaster: ({ type, "data-testid": dataTestId, ...props }: Props) => React.JSX.Element | null;
|
|
43
44
|
/** @component */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { ITooltip as ReactTooltipProps } from 'react-tooltip';
|
|
3
4
|
type Position = 'left' | 'right' | 'middle';
|
|
@@ -20,7 +21,7 @@ interface Props {
|
|
|
20
21
|
/**
|
|
21
22
|
* Content of the component
|
|
22
23
|
*/
|
|
23
|
-
children?:
|
|
24
|
+
children?: ReactNode;
|
|
24
25
|
/**
|
|
25
26
|
* Allows to set position of Tooltip icon relative to other content and adds appropriate margins
|
|
26
27
|
*
|
|
@@ -53,7 +53,7 @@ const StyledReactTooltip = styled["default"](reactTooltip.Tooltip) `
|
|
|
53
53
|
background-color: ${theme["default"].color.background.white.default};
|
|
54
54
|
border-radius: ${theme["default"].radius.s};
|
|
55
55
|
|
|
56
|
-
${common
|
|
56
|
+
${common["default"]({ elevation: 'low' })}
|
|
57
57
|
|
|
58
58
|
& .react-tooltip-arrow {
|
|
59
59
|
width: ${styledUtils.getMultipliedSize(theme["default"].base.baseWidth, 1.2)};
|
|
@@ -152,7 +152,7 @@ export declare const Tail: import("styled-components").StyledComponent<"div", {
|
|
|
152
152
|
h1: string;
|
|
153
153
|
h2: string;
|
|
154
154
|
};
|
|
155
|
-
media: Record<string | number, (l: TemplateStringsArray, ...p:
|
|
155
|
+
media: Record<string | number, (l: TemplateStringsArray, ...p: (string | number)[]) => string>;
|
|
156
156
|
radius: {
|
|
157
157
|
default: string;
|
|
158
158
|
s: string;
|
|
@@ -319,7 +319,7 @@ export declare const TailShadow: import("styled-components").StyledComponent<"di
|
|
|
319
319
|
h1: string;
|
|
320
320
|
h2: string;
|
|
321
321
|
};
|
|
322
|
-
media: Record<string | number, (l: TemplateStringsArray, ...p:
|
|
322
|
+
media: Record<string | number, (l: TemplateStringsArray, ...p: (string | number)[]) => string>;
|
|
323
323
|
radius: {
|
|
324
324
|
default: string;
|
|
325
325
|
s: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { Props as IconProps } from '../Icon/Icon';
|
|
3
4
|
export interface TooltipMenuProps {
|
|
@@ -6,7 +7,7 @@ export interface TooltipMenuProps {
|
|
|
6
7
|
/** Allows to pass a custom className */
|
|
7
8
|
className?: string;
|
|
8
9
|
/** Tooltip menu content */
|
|
9
|
-
children:
|
|
10
|
+
children: ReactNode;
|
|
10
11
|
/** Text selector color.Default: #121212 */
|
|
11
12
|
color?: string;
|
|
12
13
|
/** Text selector active color. Default: #121212 */
|
|
@@ -11,6 +11,7 @@ export { default as ButtonRound } from './Button/ButtonRound';
|
|
|
11
11
|
export { default as ButtonSecondary } from './Button/ButtonSecondary';
|
|
12
12
|
export { default as Checkbox } from './Checkbox/Checkbox';
|
|
13
13
|
export { default as Chip } from './Chip/Chip';
|
|
14
|
+
export { default as DateTimePicker } from './DateTimePicker/DateTimePicker';
|
|
14
15
|
export { default as Divider } from './Divider/Divider';
|
|
15
16
|
export { default as DnaLogo } from './DnaLogo/DnaLogo';
|
|
16
17
|
export { default as Drawer } from './Drawer/Drawer';
|
|
@@ -22,6 +23,7 @@ export * from './Icons';
|
|
|
22
23
|
export { default as Input } from './Input/Input';
|
|
23
24
|
export { default as Label } from './Label/Label';
|
|
24
25
|
export { default as LabelText } from './LabelText/LabelText';
|
|
26
|
+
export { default as MainHeaderNavigation } from './MainHeaderNavigation/MainHeaderNavigation';
|
|
25
27
|
export { default as MainNavigation } from './MainNavigation/MainNavigation';
|
|
26
28
|
export { default as Modal } from './Modal/Modal';
|
|
27
29
|
export { default as Notification } from './Notification/Notification';
|
|
@@ -36,7 +38,7 @@ export { default as SecondaryNavigation } from './SecondaryNavigation/SecondaryN
|
|
|
36
38
|
export { default as Selectbox } from './Selectbox/Selectbox';
|
|
37
39
|
export { default as Switch } from './Switch/Switch';
|
|
38
40
|
export { default as Tab, TabStyle } from './Tabs/Tab';
|
|
39
|
-
export {
|
|
41
|
+
export { default as Tabs, Tablist } from './Tabs/Tabs';
|
|
40
42
|
export { default as Textarea } from './Textarea/Textarea';
|
|
41
43
|
export { default as Toaster } from './Toaster/Toaster';
|
|
42
44
|
export { default as Tooltip } from './Tooltip/Tooltip';
|
|
@@ -16,10 +16,11 @@ const useCloseOutsideOrElementClicked = ({ ref, closeWhenTagClicked }, callback)
|
|
|
16
16
|
const target = e.target;
|
|
17
17
|
const parent = target.parentNode;
|
|
18
18
|
const isElementInList = closeWhenTagClicked.some(tag => {
|
|
19
|
+
var _a, _b, _c;
|
|
19
20
|
if (!target.parentNode) {
|
|
20
|
-
return tag === target.tagName.toLowerCase();
|
|
21
|
+
return tag === ((_a = target.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
21
22
|
}
|
|
22
|
-
return tag === target.tagName.toLowerCase() || tag === parent.tagName.toLowerCase();
|
|
23
|
+
return tag === ((_b = target.tagName) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || tag === ((_c = parent.tagName) === null || _c === void 0 ? void 0 : _c.toLowerCase());
|
|
23
24
|
});
|
|
24
25
|
if ((ref.current && !ref.current.contains(target)) ||
|
|
25
26
|
(isElementInList && !target.dataset.noClose)) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_DELAY = 400;
|
|
8
|
+
const useDebounce = (
|
|
9
|
+
// TODO: Eventually define generic type for function arguments if needed
|
|
10
|
+
// callback: <T extends (...args: Parameters<T>) => void>(...args: T[]) => void,
|
|
11
|
+
callback, delay = DEFAULT_DELAY) => {
|
|
12
|
+
const debounce = React.useRef();
|
|
13
|
+
return React.useCallback(() => {
|
|
14
|
+
if (debounce.current) {
|
|
15
|
+
clearTimeout(debounce.current);
|
|
16
|
+
}
|
|
17
|
+
debounce.current = setTimeout(() => {
|
|
18
|
+
callback();
|
|
19
|
+
}, delay);
|
|
20
|
+
}, [callback, delay]);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports["default"] = useDebounce;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const useDocHeight: () => void;
|
|
2
|
+
export default useDocHeight;
|
|
@@ -3,35 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n["default"] = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
6
|
+
var useDebounce = require('./useDebounce.js');
|
|
27
7
|
|
|
28
8
|
const DEBOUNCE_DELAY = 100;
|
|
29
9
|
const useDocHeight = () => {
|
|
30
|
-
const setDocHeight =
|
|
10
|
+
const setDocHeight = React.useCallback(() => {
|
|
31
11
|
document.documentElement.style.setProperty('--vh100', `${window.innerHeight}px`);
|
|
32
12
|
}, []);
|
|
33
|
-
const debounceSetDocHeight =
|
|
34
|
-
|
|
13
|
+
const debounceSetDocHeight = useDebounce["default"](setDocHeight, DEBOUNCE_DELAY);
|
|
14
|
+
React.useEffect(() => {
|
|
35
15
|
setDocHeight();
|
|
36
16
|
window.addEventListener('resize', debounceSetDocHeight);
|
|
37
17
|
window.addEventListener('orientationchange', debounceSetDocHeight);
|
|
@@ -42,4 +22,4 @@ const useDocHeight = () => {
|
|
|
42
22
|
}, [debounceSetDocHeight, setDocHeight]);
|
|
43
23
|
};
|
|
44
24
|
|
|
45
|
-
exports
|
|
25
|
+
exports["default"] = useDocHeight;
|