@dnanpm/styleguide 3.10.0 → 3.11.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/build/cjs/components/Accordion/Accordion.js +3 -4
- package/build/cjs/components/AccordionItem/AccordionItem.js +17 -16
- package/build/cjs/components/AmountSelector/AmountSelector.d.ts +17 -1
- package/build/cjs/components/AmountSelector/AmountSelector.js +53 -10
- package/build/cjs/components/Box/Box.js +6 -7
- package/build/cjs/components/Button/Button.js +26 -23
- package/build/cjs/components/ButtonArrow/ButtonArrow.js +3 -4
- package/build/cjs/components/ButtonCard/ButtonCard.js +9 -10
- package/build/cjs/components/ButtonClose/ButtonClose.js +2 -2
- package/build/cjs/components/ButtonIcon/ButtonIcon.js +9 -10
- package/build/cjs/components/ButtonPrimary/ButtonPrimary.js +2 -6
- package/build/cjs/components/ButtonRound/ButtonRound.js +2 -3
- package/build/cjs/components/ButtonSecondary/ButtonSecondary.js +2 -6
- package/build/cjs/components/Carousel/Carousel.d.ts +6 -169
- package/build/cjs/components/Carousel/Carousel.js +23 -23
- package/build/cjs/components/Checkbox/Checkbox.js +5 -5
- package/build/cjs/components/Chip/Chip.js +2 -3
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +17 -6
- package/build/cjs/components/Divider/Divider.js +5 -6
- package/build/cjs/components/DnaLogo/DnaLogo.js +4 -4
- package/build/cjs/components/Drawer/Drawer.js +26 -26
- package/build/cjs/components/EmptyState/EmptyState.js +2 -2
- package/build/cjs/components/EnergyLabel/EnergyLabel.js +11 -11
- package/build/cjs/components/Expander/Expander.js +5 -5
- package/build/cjs/components/Floater/Floater.js +5 -6
- package/build/cjs/components/Footer/Components/FooterComponents.d.ts +3 -168
- package/build/cjs/components/Footer/Components/FooterComponents.js +33 -32
- package/build/cjs/components/Footer/Footer.js +5 -5
- package/build/cjs/components/Icon/Icon.js +6 -6
- package/build/cjs/components/InfoDialog/InfoDialog.js +4 -4
- package/build/cjs/components/Input/Input.js +24 -16
- package/build/cjs/components/Label/Label.js +2 -2
- package/build/cjs/components/LabelText/LabelText.js +5 -5
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +8 -8
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +11 -11
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +2 -167
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +5 -5
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -167
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +2 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +4 -4
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +6 -6
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.d.ts +16 -1501
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.js +10 -10
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +4 -4
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +11 -11
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +2 -167
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +9 -9
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +5 -5
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -167
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +5 -5
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +4 -4
- package/build/cjs/components/MainNavigation/MainNavigation.js +6 -6
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +8 -668
- package/build/cjs/components/MainNavigation/globalNavStyles.js +5 -5
- package/build/cjs/components/Modal/Modal.js +16 -16
- package/build/cjs/components/Notification/Notification.js +7 -8
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +7 -7
- package/build/cjs/components/Overlay/Overlay.js +2 -2
- package/build/cjs/components/Pill/Pill.js +11 -12
- package/build/cjs/components/PixelLoader/PixelLoader.js +9 -9
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.js +13 -13
- package/build/cjs/components/PriorityNavigationItem/PriorityNavigationItem.js +7 -7
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +6 -6
- package/build/cjs/components/RadioButton/RadioButton.js +4 -4
- package/build/cjs/components/ReadMore/ReadMore.js +10 -10
- package/build/cjs/components/Search/Search.js +4 -4
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +9 -9
- package/build/cjs/components/Selectbox/Selectbox.js +3 -3
- package/build/cjs/components/Switch/Switch.js +19 -19
- package/build/cjs/components/Tab/Tab.js +10 -10
- package/build/cjs/components/Tabs/Tabs.js +10 -10
- package/build/cjs/components/Textarea/Textarea.d.ts +5 -1
- package/build/cjs/components/Textarea/Textarea.js +12 -9
- package/build/cjs/components/Toaster/Toaster.js +6 -7
- package/build/cjs/components/Tooltip/Tooltip.js +6 -6
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +4 -334
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +5 -4
- package/build/cjs/components/TooltipMenu/TooltipMenu.js +5 -5
- package/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +5 -2
- package/build/cjs/themes/globalStyles.d.ts +2 -332
- package/build/cjs/themes/globalStyles.js +3 -3
- package/build/cjs/themes/styled.d.ts +1 -1158
- package/build/cjs/utils/createStyled.d.ts +140 -7
- package/build/cjs/utils/createStyled.js +3 -3
- package/build/cjs/utils/styledUtils.js +3 -3
- package/build/es/components/Accordion/Accordion.js +2 -2
- package/build/es/components/AccordionItem/AccordionItem.js +15 -13
- package/build/es/components/AmountSelector/AmountSelector.d.ts +17 -1
- package/build/es/components/AmountSelector/AmountSelector.js +50 -7
- package/build/es/components/Box/Box.js +6 -6
- package/build/es/components/Button/Button.js +26 -22
- package/build/es/components/ButtonArrow/ButtonArrow.js +3 -3
- package/build/es/components/ButtonCard/ButtonCard.js +9 -9
- package/build/es/components/ButtonClose/ButtonClose.js +1 -1
- package/build/es/components/ButtonIcon/ButtonIcon.js +8 -8
- package/build/es/components/ButtonPrimary/ButtonPrimary.js +2 -2
- package/build/es/components/ButtonRound/ButtonRound.js +2 -2
- package/build/es/components/ButtonSecondary/ButtonSecondary.js +2 -2
- package/build/es/components/Carousel/Carousel.d.ts +6 -169
- package/build/es/components/Carousel/Carousel.js +9 -9
- package/build/es/components/Checkbox/Checkbox.js +1 -1
- package/build/es/components/Chip/Chip.js +2 -2
- package/build/es/components/DateTimePicker/DateTimePicker.js +17 -5
- package/build/es/components/Divider/Divider.js +5 -5
- package/build/es/components/DnaLogo/DnaLogo.js +3 -3
- package/build/es/components/Drawer/Drawer.js +12 -12
- package/build/es/components/EmptyState/EmptyState.js +1 -1
- package/build/es/components/EnergyLabel/EnergyLabel.js +5 -5
- package/build/es/components/Expander/Expander.js +1 -1
- package/build/es/components/Floater/Floater.js +5 -5
- package/build/es/components/Footer/Components/FooterComponents.d.ts +3 -168
- package/build/es/components/Footer/Components/FooterComponents.js +16 -15
- package/build/es/components/Footer/Footer.js +3 -3
- package/build/es/components/Icon/Icon.js +5 -5
- package/build/es/components/InfoDialog/InfoDialog.js +3 -3
- package/build/es/components/Input/Input.js +17 -9
- package/build/es/components/Label/Label.js +1 -1
- package/build/es/components/LabelText/LabelText.js +3 -3
- package/build/es/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +6 -6
- package/build/es/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +2 -167
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -167
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +2 -2
- package/build/es/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +1 -1
- package/build/es/components/MainHeaderNavigation/globalNavStyles.d.ts +16 -1501
- package/build/es/components/MainHeaderNavigation/globalNavStyles.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +2 -167
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -167
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
- package/build/es/components/MainNavigation/MainNavigation.js +1 -1
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +8 -668
- package/build/es/components/MainNavigation/globalNavStyles.js +1 -1
- package/build/es/components/Modal/Modal.js +6 -6
- package/build/es/components/Notification/Notification.js +6 -6
- package/build/es/components/NotificationBadge/NotificationBadge.js +5 -5
- package/build/es/components/Overlay/Overlay.js +1 -1
- package/build/es/components/Pill/Pill.js +11 -11
- package/build/es/components/PixelLoader/PixelLoader.js +6 -6
- package/build/es/components/PriorityNavigation/PriorityNavigation.js +4 -4
- package/build/es/components/PriorityNavigationItem/PriorityNavigationItem.js +6 -6
- package/build/es/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/build/es/components/RadioButton/RadioButton.js +1 -1
- package/build/es/components/ReadMore/ReadMore.js +6 -6
- package/build/es/components/Search/Search.js +1 -1
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +1 -1
- package/build/es/components/Selectbox/Selectbox.js +1 -1
- package/build/es/components/Switch/Switch.js +14 -14
- package/build/es/components/Tab/Tab.js +7 -7
- package/build/es/components/Tabs/Tabs.js +8 -8
- package/build/es/components/Textarea/Textarea.d.ts +5 -1
- package/build/es/components/Textarea/Textarea.js +8 -5
- package/build/es/components/Toaster/Toaster.js +6 -6
- package/build/es/components/Tooltip/Tooltip.js +4 -4
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +4 -334
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +3 -2
- package/build/es/components/TooltipMenu/TooltipMenu.js +1 -1
- package/build/es/index.d.ts +1 -1
- package/build/es/index.js +1 -1
- package/build/es/themes/globalStyles.d.ts +2 -332
- package/build/es/themes/globalStyles.js +1 -1
- package/build/es/themes/styled.d.ts +1 -1158
- package/build/es/utils/createStyled.d.ts +140 -7
- package/build/es/utils/createStyled.js +3 -3
- package/build/es/utils/styledUtils.js +1 -1
- package/package.json +4 -5
- package/build/cjs/themes/styled.js +0 -14
- package/build/es/themes/styled.js +0 -5
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var icons = require('@dnanpm/icons');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
8
|
+
var styledComponents = require('styled-components');
|
|
9
9
|
var theme = require('../../themes/theme.js');
|
|
10
10
|
var ButtonIcon = require('../ButtonIcon/ButtonIcon.js');
|
|
11
11
|
|
|
@@ -13,23 +13,23 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
15
|
|
|
16
|
-
const Container = styled.
|
|
16
|
+
const Container = styledComponents.styled.div `
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
`;
|
|
20
|
-
const Content = styled.
|
|
21
|
-
${({ isExpanded, collapsedSize }) =>
|
|
20
|
+
const Content = styledComponents.styled.div `
|
|
21
|
+
${({ $isExpanded, $collapsedSize }) => !$isExpanded &&
|
|
22
22
|
`
|
|
23
23
|
overflow: hidden;
|
|
24
|
-
max-height: ${collapsedSize};
|
|
24
|
+
max-height: ${$collapsedSize};
|
|
25
25
|
mask-image: linear-gradient(${theme.default.color.background.white.default}, transparent);
|
|
26
26
|
`}
|
|
27
27
|
`;
|
|
28
|
-
const ButtonWrapper = styled.
|
|
28
|
+
const ButtonWrapper = styledComponents.styled.div `
|
|
29
29
|
margin: 0.625rem 0.313rem;
|
|
30
|
-
align-self: ${({ buttonPosition }) =>
|
|
30
|
+
align-self: ${({ $buttonPosition }) => $buttonPosition === 'right' ? 'flex-end' : 'flex-start'};
|
|
31
31
|
`;
|
|
32
|
-
const StyledButtonIcon = styled
|
|
32
|
+
const StyledButtonIcon = styledComponents.styled(ButtonIcon.default) `
|
|
33
33
|
color: ${theme.default.color.text.pink};
|
|
34
34
|
|
|
35
35
|
&:hover {
|
|
@@ -90,8 +90,8 @@ const ReadMore = (_a) => {
|
|
|
90
90
|
return child;
|
|
91
91
|
};
|
|
92
92
|
return (React__default.default.createElement(Container, { id: props.id, className: props.className, "data-testid": dataTestId, "aria-label": props.ariaLabel, role: "region" },
|
|
93
|
-
React__default.default.createElement(Content, { ref: contentRef, isExpanded: temporaryStateManagement, collapsedSize: collapsedSize, "data-testid": dataTestId && `${dataTestId}-content`, "aria-hidden": temporaryStateManagement ? 'false' : 'true', tabIndex: temporaryStateManagement ? 0 : -1 }, React.Children.map(props.children, forceTabIndexOnTextLinks)),
|
|
94
|
-
React__default.default.createElement(ButtonWrapper, { buttonPosition: props.buttonPosition },
|
|
93
|
+
React__default.default.createElement(Content, { ref: contentRef, "$isExpanded": temporaryStateManagement, "$collapsedSize": collapsedSize, "data-testid": dataTestId && `${dataTestId}-content`, "aria-hidden": temporaryStateManagement ? 'false' : 'true', tabIndex: temporaryStateManagement ? 0 : -1 }, React.Children.map(props.children, forceTabIndexOnTextLinks)),
|
|
94
|
+
React__default.default.createElement(ButtonWrapper, { "$buttonPosition": props.buttonPosition },
|
|
95
95
|
React__default.default.createElement(StyledButtonIcon, { ref: buttonRef, icon: temporaryStateManagement ? icons.ChevronUp : icons.ChevronDown, onClick: handleOnClick, "aria-expanded": temporaryStateManagement }, temporaryButtonLabel || props.buttonLabel))));
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var icons = require('@dnanpm/icons');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
8
|
+
var styledComponents = require('styled-components');
|
|
9
9
|
var theme = require('../../themes/theme.js');
|
|
10
10
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
11
11
|
var ButtonIcon = require('../ButtonIcon/ButtonIcon.js');
|
|
@@ -14,12 +14,12 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
|
|
15
15
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
16
|
|
|
17
|
-
const Container = styled.
|
|
17
|
+
const Container = styledComponents.styled.div `
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
border-bottom: 2px solid ${theme.default.color.default.pink};
|
|
21
21
|
`;
|
|
22
|
-
const Input = styled.
|
|
22
|
+
const Input = styledComponents.styled.input `
|
|
23
23
|
display: inline-block;
|
|
24
24
|
appearance: none;
|
|
25
25
|
border: 0;
|
|
@@ -56,7 +56,7 @@ const Input = styled.default.input `
|
|
|
56
56
|
display: none;
|
|
57
57
|
}
|
|
58
58
|
`;
|
|
59
|
-
const Button = styled
|
|
59
|
+
const Button = styledComponents.styled(ButtonIcon.default) `
|
|
60
60
|
margin: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
61
61
|
`;
|
|
62
62
|
const Search = (_a) => {
|
|
@@ -6,7 +6,7 @@ var tslib = require('tslib');
|
|
|
6
6
|
var icons = require('@dnanpm/icons');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var useOutsideClick = require('../../hooks/useOutsideClick.js');
|
|
9
|
-
var
|
|
9
|
+
var styledComponents = require('styled-components');
|
|
10
10
|
var theme = require('../../themes/theme.js');
|
|
11
11
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
12
12
|
var Icon = require('../Icon/Icon.js');
|
|
@@ -15,7 +15,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
15
|
|
|
16
16
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
17
17
|
|
|
18
|
-
const SecondaryNavigationWrapper = styled.
|
|
18
|
+
const SecondaryNavigationWrapper = styledComponents.styled.nav `
|
|
19
19
|
font-size: ${theme.default.fontSize.default};
|
|
20
20
|
padding: 0;
|
|
21
21
|
background-color: ${({ whiteBg }) => whiteBg ? theme.default.color.background.white.default : 'transparent'};
|
|
@@ -28,7 +28,7 @@ const SecondaryNavigationWrapper = styled.default.nav `
|
|
|
28
28
|
border-bottom: 1px solid ${theme.default.color.line.L03};
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
31
|
-
const MobileSelector = styled.
|
|
31
|
+
const MobileSelector = styledComponents.styled.button `
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
justify-content: space-between;
|
|
@@ -49,10 +49,10 @@ const MobileSelector = styled.default.button `
|
|
|
49
49
|
display: none;
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
|
-
const MobileSelectorTitleWrapper = styled.
|
|
52
|
+
const MobileSelectorTitleWrapper = styledComponents.styled.div `
|
|
53
53
|
display: flex;
|
|
54
54
|
`;
|
|
55
|
-
const MobileSelectorArrow = styled.
|
|
55
|
+
const MobileSelectorArrow = styledComponents.styled.span `
|
|
56
56
|
display: flex;
|
|
57
57
|
|
|
58
58
|
.dnasg-icon svg {
|
|
@@ -60,7 +60,7 @@ const MobileSelectorArrow = styled.default.span `
|
|
|
60
60
|
transform: rotate(${({ isOpen }) => (isOpen ? '180deg' : '0deg')});
|
|
61
61
|
}
|
|
62
62
|
`;
|
|
63
|
-
const MobileSelectorCheck = styled.
|
|
63
|
+
const MobileSelectorCheck = styledComponents.styled.span `
|
|
64
64
|
margin-left: auto;
|
|
65
65
|
|
|
66
66
|
.dnasg-icon {
|
|
@@ -69,7 +69,7 @@ const MobileSelectorCheck = styled.default.span `
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
`;
|
|
72
|
-
const SecondaryNavigationList = styled.
|
|
72
|
+
const SecondaryNavigationList = styledComponents.styled.ul `
|
|
73
73
|
padding: 0;
|
|
74
74
|
list-style-type: none;
|
|
75
75
|
margin: 0;
|
|
@@ -92,7 +92,7 @@ const SecondaryNavigationList = styled.default.ul `
|
|
|
92
92
|
max-width: ${({ 'max-width': maxWidth }) => (maxWidth ? `${maxWidth}px` : 'none')};
|
|
93
93
|
}
|
|
94
94
|
`;
|
|
95
|
-
const SecondaryNavigationListElement = styled.
|
|
95
|
+
const SecondaryNavigationListElement = styledComponents.styled.li `
|
|
96
96
|
margin: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
97
97
|
|
|
98
98
|
a {
|
|
@@ -127,7 +127,7 @@ const SecondaryNavigationListElement = styled.default.li `
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
`;
|
|
130
|
-
const IconWrapper = styled.
|
|
130
|
+
const IconWrapper = styledComponents.styled.span `
|
|
131
131
|
position: relative;
|
|
132
132
|
display: flex;
|
|
133
133
|
margin-right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
@@ -6,7 +6,7 @@ var tslib = require('tslib');
|
|
|
6
6
|
var icons = require('@dnanpm/icons');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var Select = require('react-select');
|
|
9
|
-
var
|
|
9
|
+
var styledComponents = require('styled-components');
|
|
10
10
|
var theme = require('../../themes/theme.js');
|
|
11
11
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
12
12
|
var Icon = require('../Icon/Icon.js');
|
|
@@ -18,11 +18,11 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
19
19
|
var Select__default = /*#__PURE__*/_interopDefaultCompat(Select);
|
|
20
20
|
|
|
21
|
-
const FieldContainer = styled.
|
|
21
|
+
const FieldContainer = styledComponents.styled.div `
|
|
22
22
|
color: ${theme.default.color.text.black};
|
|
23
23
|
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
24
24
|
`;
|
|
25
|
-
const ErrorMessage = styled.
|
|
25
|
+
const ErrorMessage = styledComponents.styled.div `
|
|
26
26
|
font-size: ${theme.default.fontSize.s};
|
|
27
27
|
font-weight: ${theme.default.fontWeight.medium};
|
|
28
28
|
line-height: ${theme.default.lineHeight.s};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var styledComponents = require('styled-components');
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var LabelText = require('../LabelText/LabelText.js');
|
|
@@ -34,74 +34,74 @@ const borderRadius = 1.875; // 30px
|
|
|
34
34
|
const borderSize = 0.125; // 2px
|
|
35
35
|
const railWidth = 3; // 48px
|
|
36
36
|
const railHeight = height + borderSize * 2; // 30px
|
|
37
|
-
const Container = styled.
|
|
37
|
+
const Container = styledComponents.styled.div `
|
|
38
38
|
display: inline-flex;
|
|
39
39
|
min-height: ${railHeight}rem;
|
|
40
40
|
position: relative;
|
|
41
41
|
cursor: pointer;
|
|
42
42
|
user-select: none;
|
|
43
43
|
`;
|
|
44
|
-
const Button = styled.
|
|
44
|
+
const Button = styledComponents.styled.div `
|
|
45
45
|
height: ${height}rem;
|
|
46
46
|
transition: transform 0.3s;
|
|
47
47
|
position: absolute;
|
|
48
48
|
content: ' ';
|
|
49
49
|
width: ${height}rem;
|
|
50
50
|
border-radius: 50%;
|
|
51
|
-
${({ isChecked }) => `
|
|
52
|
-
transform: translate3d(${isChecked ? railWidth - height : 0}rem, 0, 0);
|
|
53
|
-
background-color: ${isChecked ? theme.default.color.default.pink : theme.default.color.line.L01};
|
|
51
|
+
${({ $isChecked }) => `
|
|
52
|
+
transform: translate3d(${$isChecked ? railWidth - height : 0}rem, 0, 0);
|
|
53
|
+
background-color: ${$isChecked ? theme.default.color.default.pink : theme.default.color.line.L01};
|
|
54
54
|
border: ${borderSize}rem solid ${theme.default.color.default.white};
|
|
55
55
|
z-index: 2;
|
|
56
|
-
left: ${isChecked ? -borderSize * 2 : 0}rem;
|
|
56
|
+
left: ${$isChecked ? -borderSize * 2 : 0}rem;
|
|
57
57
|
`};
|
|
58
58
|
`;
|
|
59
|
-
const Checkbox = styled.
|
|
59
|
+
const Checkbox = styledComponents.styled.input `
|
|
60
60
|
opacity: 0;
|
|
61
61
|
position: absolute;
|
|
62
62
|
top: 0;
|
|
63
63
|
left: 0;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
&:disabled {
|
|
66
66
|
cursor: not-allowed;
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
&:disabled + label {
|
|
69
69
|
cursor: not-allowed;
|
|
70
70
|
color: ${theme.default.color.line.L01}${theme.default.color.transparency.T40};
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
&:disabled + label > div {
|
|
73
73
|
cursor: not-allowed;
|
|
74
74
|
border-color: ${({ checked }) => checked ? theme.default.color.default.pink : theme.default.color.line.L01}${theme.default.color.transparency
|
|
75
75
|
.T40};
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
&:disabled + label div div {
|
|
78
78
|
pointer-events: none;
|
|
79
79
|
background-color: ${({ checked }) => checked ? theme.default.color.default.pink : theme.default.color.line.L01}${theme.default.color.transparency
|
|
80
80
|
.T40};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
&:focus-visible + label > div {
|
|
84
84
|
outline: none;
|
|
85
85
|
box-shadow: 0px 0px 0px 2px ${theme.default.color.focus.dark};
|
|
86
86
|
}
|
|
87
87
|
`;
|
|
88
|
-
const LabelWrapper = styled
|
|
88
|
+
const LabelWrapper = styledComponents.styled(LabelText.default) `
|
|
89
89
|
position: relative;
|
|
90
90
|
cursor: pointer;
|
|
91
91
|
padding-top: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.4)};
|
|
92
92
|
padding-left: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 6)};
|
|
93
93
|
user-select: none;
|
|
94
94
|
`;
|
|
95
|
-
const Rail = styled.
|
|
95
|
+
const Rail = styledComponents.styled.div `
|
|
96
96
|
width: ${railWidth}rem;
|
|
97
97
|
position: absolute;
|
|
98
98
|
top: 0;
|
|
99
99
|
left: 0;
|
|
100
100
|
border-radius: ${borderRadius}rem;
|
|
101
101
|
overflow: hidden;
|
|
102
|
-
${({ isChecked }) => `
|
|
102
|
+
${({ $isChecked }) => `
|
|
103
103
|
height: ${railHeight}rem;
|
|
104
|
-
border: ${borderSize}rem solid ${isChecked ? theme.default.color.default.pink : theme.default.color.line.L01};
|
|
104
|
+
border: ${borderSize}rem solid ${$isChecked ? theme.default.color.default.pink : theme.default.color.line.L01};
|
|
105
105
|
background-color: ${theme.default.color.background.white.default};
|
|
106
106
|
z-index: 0;
|
|
107
107
|
`};
|
|
@@ -117,8 +117,8 @@ const Switch = (_a) => {
|
|
|
117
117
|
return (React__namespace.createElement(Container, { className: props.className, "data-testid": dataTestId },
|
|
118
118
|
React__namespace.createElement(Checkbox, { id: props.id, name: props.name, checked: Boolean(props.isChecked), "aria-label": accessibleLabel, disabled: props.disabled, onChange: handleChange, role: "switch", type: "checkbox", "data-checked": Boolean(props.isChecked) }),
|
|
119
119
|
React__namespace.createElement(LabelWrapper, { htmlFor: props.id },
|
|
120
|
-
React__namespace.createElement(Rail, { isChecked: props.isChecked },
|
|
121
|
-
React__namespace.createElement(Button, { isChecked: props.isChecked })),
|
|
120
|
+
React__namespace.createElement(Rail, { "$isChecked": props.isChecked },
|
|
121
|
+
React__namespace.createElement(Button, { "$isChecked": props.isChecked })),
|
|
122
122
|
props.label && props.label)));
|
|
123
123
|
};
|
|
124
124
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var styledComponents = require('styled-components');
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var Box = require('../Box/Box.js');
|
|
@@ -15,13 +15,13 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
15
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
16
|
|
|
17
17
|
// TODO: Change to button HTML element as a part of https://jira.dna.fi/browse/STYLE-622
|
|
18
|
-
const TabLabel = styled.
|
|
18
|
+
const TabLabel = styledComponents.styled.li `
|
|
19
19
|
display: inline-block;
|
|
20
20
|
list-style: none;
|
|
21
21
|
font-size: ${theme.default.fontSize.default};
|
|
22
22
|
line-height: ${theme.default.lineHeight.default};
|
|
23
|
-
font-weight: ${({ isActive }) => (isActive ? theme.default.fontWeight.bold : theme.default.fontWeight.book)};
|
|
24
|
-
background-color: ${({ isActive }) => isActive ? theme.default.color.background.white.default : theme.default.color.background.sand.E01};
|
|
23
|
+
font-weight: ${({ $isActive }) => ($isActive ? theme.default.fontWeight.bold : theme.default.fontWeight.book)};
|
|
24
|
+
background-color: ${({ $isActive }) => $isActive ? theme.default.color.background.white.default : theme.default.color.background.sand.E01};
|
|
25
25
|
border-radius: ${theme.default.radius.default} ${theme.default.radius.default} 0 0;
|
|
26
26
|
border: 1px solid ${theme.default.color.line.L03};
|
|
27
27
|
border-bottom: 0 none;
|
|
@@ -35,7 +35,7 @@ const TabLabel = styled.default.li `
|
|
|
35
35
|
outline: none;
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
|
-
const TabStyle = styled.
|
|
38
|
+
const TabStyle = styledComponents.styled.li `
|
|
39
39
|
display: inline-block;
|
|
40
40
|
list-style: none;
|
|
41
41
|
cursor: pointer;
|
|
@@ -46,7 +46,7 @@ const TabStyle = styled.default.li `
|
|
|
46
46
|
line-height: ${theme.default.lineHeight.default};
|
|
47
47
|
font-weight: ${theme.default.fontWeight.book};
|
|
48
48
|
|
|
49
|
-
${({ isActive }) => isActive &&
|
|
49
|
+
${({ $isActive }) => $isActive &&
|
|
50
50
|
`
|
|
51
51
|
color: ${theme.default.color.text.pink};
|
|
52
52
|
background-color: ${theme.default.color.background.sand.E01};
|
|
@@ -57,14 +57,14 @@ const TabStyle = styled.default.li `
|
|
|
57
57
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)} 0;
|
|
58
58
|
`}
|
|
59
59
|
|
|
60
|
-
${({ isActive, $type }) => isActive &&
|
|
60
|
+
${({ $isActive, $type }) => $isActive &&
|
|
61
61
|
$type === 'underlined' &&
|
|
62
62
|
`
|
|
63
63
|
border-bottom: 2px solid ${theme.default.color.default.pink};
|
|
64
64
|
background-color: transparent;
|
|
65
65
|
`}
|
|
66
66
|
`;
|
|
67
|
-
const ContentContainer = styled.
|
|
67
|
+
const ContentContainer = styledComponents.styled.div `
|
|
68
68
|
${({ $type }) => {
|
|
69
69
|
if ($type === 'box' || $type === 'default') {
|
|
70
70
|
return `
|
|
@@ -94,12 +94,12 @@ const Tab = (_a) => {
|
|
|
94
94
|
};
|
|
95
95
|
const isActive = props.activeTab ? props.activeTab === props.label : props.isActive;
|
|
96
96
|
return type === 'box' || type === 'default' || type === 'panel' ? (React__default.default.createElement(React__default.default.Fragment, null,
|
|
97
|
-
React__default.default.createElement(TabLabel, { role: "tab", id: props.id, "$type": type, "aria-selected": isActive, isActive: isActive, onClick: onClickHandler, tabIndex: isActive ? 0 : -1 }, props.label),
|
|
97
|
+
React__default.default.createElement(TabLabel, { role: "tab", id: props.id, "$type": type, "aria-selected": isActive, "$isActive": isActive, onClick: onClickHandler, tabIndex: isActive ? 0 : -1 }, props.label),
|
|
98
98
|
props.isStateless &&
|
|
99
99
|
(props.children && (props.activeTab === props.label || props.isActive) ? (React__default.default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type, as: (type === 'box' || type === 'default') && !props.tabStyle
|
|
100
100
|
? Box.default
|
|
101
101
|
: undefined }, props.children)) : (React__default.default.createElement(Divider.default, { margin: "0" }))))) : (React__default.default.createElement(React__default.default.Fragment, null,
|
|
102
|
-
React__default.default.createElement(TabStyle, { role: "tab", id: props.id, "$type": props.tabStyle || type, "aria-selected": isActive, isActive: isActive, onClick: onClickHandler, tabIndex: isActive ? 0 : -1 }, props.label),
|
|
102
|
+
React__default.default.createElement(TabStyle, { role: "tab", id: props.id, "$type": props.tabStyle || type, "aria-selected": isActive, "$isActive": isActive, onClick: onClickHandler, tabIndex: isActive ? 0 : -1 }, props.label),
|
|
103
103
|
props.isStateless &&
|
|
104
104
|
props.children &&
|
|
105
105
|
(props.activeTab === props.label || props.isActive) && (React__default.default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type }, props.children))));
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var styledComponents = require('styled-components');
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var Box = require('../Box/Box.js');
|
|
10
10
|
var Tab = require('../Tab/Tab.js');
|
|
@@ -13,12 +13,12 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
15
|
|
|
16
|
-
const Tablist = styled.
|
|
16
|
+
const Tablist = styledComponents.styled.ul `
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-flow: row wrap;
|
|
19
19
|
padding: 0;
|
|
20
20
|
|
|
21
|
-
${({ isFullWidth }) => isFullWidth &&
|
|
21
|
+
${({ $isFullWidth }) => $isFullWidth &&
|
|
22
22
|
`
|
|
23
23
|
align-items: stretch;
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ const Tablist = styled.default.ul `
|
|
|
28
28
|
}
|
|
29
29
|
`}
|
|
30
30
|
|
|
31
|
-
${({ $type, isNarrowUnderlined }) => {
|
|
31
|
+
${({ $type, $isNarrowUnderlined }) => {
|
|
32
32
|
if ($type === 'box' || $type === 'default' || $type === 'panel') {
|
|
33
33
|
return `
|
|
34
34
|
margin: 0;
|
|
@@ -51,7 +51,7 @@ const Tablist = styled.default.ul `
|
|
|
51
51
|
}
|
|
52
52
|
if ($type === 'underlined') {
|
|
53
53
|
return `
|
|
54
|
-
gap: ${isNarrowUnderlined ? '1.25rem' : '2.5rem'};
|
|
54
|
+
gap: ${$isNarrowUnderlined ? '1.25rem' : '2.5rem'};
|
|
55
55
|
border-bottom: 1px solid ${theme.default.color.line.L02};
|
|
56
56
|
`;
|
|
57
57
|
}
|
|
@@ -63,12 +63,12 @@ const Tablist = styled.default.ul `
|
|
|
63
63
|
return '';
|
|
64
64
|
}}
|
|
65
65
|
`;
|
|
66
|
-
const ContentContainer = styled.
|
|
67
|
-
${({ $type, isFullWidth }) => {
|
|
66
|
+
const ContentContainer = styledComponents.styled.div `
|
|
67
|
+
${({ $type, $isFullWidth }) => {
|
|
68
68
|
if ($type === 'box' || $type === 'default') {
|
|
69
69
|
return `
|
|
70
70
|
border-top-left-radius: 0;
|
|
71
|
-
${isFullWidth ? 'border-top-right-radius: 0;' : ''}
|
|
71
|
+
${$isFullWidth ? 'border-top-right-radius: 0;' : ''}
|
|
72
72
|
`;
|
|
73
73
|
}
|
|
74
74
|
if ($type === 'panel') {
|
|
@@ -120,11 +120,11 @@ const Tabs = (_a) => {
|
|
|
120
120
|
setActiveTab((outerActiveTab === null || outerActiveTab === void 0 ? void 0 : outerActiveTab.props.label) || tabs[0].props.label);
|
|
121
121
|
}
|
|
122
122
|
return (React__default.default.createElement("div", { className: props.className ? `tabs ${props.className}` : 'tabs', "data-testid": dataTestId },
|
|
123
|
-
React__default.default.createElement(Tablist, { role: "tablist", "$type": props.tabStyle || type, isFullWidth: props.isFullWidth, isNarrowUnderlined: props.isNarrowUnderlined, onKeyDown: onKeyDown }, React.Children.map(props.children, tab => React.isValidElement(tab) &&
|
|
123
|
+
React__default.default.createElement(Tablist, { role: "tablist", "$type": props.tabStyle || type, "$isFullWidth": props.isFullWidth, "$isNarrowUnderlined": props.isNarrowUnderlined, onKeyDown: onKeyDown }, React.Children.map(props.children, tab => React.isValidElement(tab) &&
|
|
124
124
|
tab.type === Tab.default && (React__default.default.createElement(Tab.default, { id: tab.props.id, key: tab.props.label, label: tab.props.label, type: props.tabStyle || type, isActive: tab.props.isActive
|
|
125
125
|
? tab.props.isActive
|
|
126
126
|
: activeTab === tab.props.label, activeTab: tab.props.activeTab, onClick: onClickTabItem, className: tab.props.className, "data-testid": tab.props['data-testid'] })))),
|
|
127
|
-
React__default.default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type, isFullWidth: props.isFullWidth, as: (type === 'box' || type === 'default') && !props.tabStyle ? Box.default : undefined }, React.Children.map(props.children, tab => React.isValidElement(tab) &&
|
|
127
|
+
React__default.default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type, "$isFullWidth": props.isFullWidth, as: (type === 'box' || type === 'default') && !props.tabStyle ? Box.default : undefined }, React.Children.map(props.children, tab => React.isValidElement(tab) &&
|
|
128
128
|
tab.type === Tab.default &&
|
|
129
129
|
(tab.props.isActive || tab.props.label === activeTab) &&
|
|
130
130
|
tab.props.children))));
|
|
@@ -89,7 +89,11 @@ interface Props {
|
|
|
89
89
|
* Allows to pass testid string for testing purposes
|
|
90
90
|
*/
|
|
91
91
|
'data-testid'?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Accessible label text when no visible label is used
|
|
94
|
+
*/
|
|
95
|
+
ariaLabel?: string;
|
|
92
96
|
}
|
|
93
|
-
declare const Textarea: ({ height, "data-testid": dataTestId, ...props }: Props) => React.JSX.Element;
|
|
97
|
+
declare const Textarea: ({ height, "data-testid": dataTestId, ariaLabel, ...props }: Props) => React.JSX.Element;
|
|
94
98
|
/** @component */
|
|
95
99
|
export default Textarea;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var styledComponents = require('styled-components');
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var LabelText = require('../LabelText/LabelText.js');
|
|
@@ -13,11 +13,11 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
15
|
|
|
16
|
-
const FieldContainer = styled.
|
|
16
|
+
const FieldContainer = styledComponents.styled.div `
|
|
17
17
|
color: ${theme.default.color.text.black};
|
|
18
18
|
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
19
19
|
`;
|
|
20
|
-
const StyledTextarea = styled.
|
|
20
|
+
const StyledTextarea = styledComponents.styled.textarea `
|
|
21
21
|
display: block;
|
|
22
22
|
font-family: ${theme.default.fontFamily.default};
|
|
23
23
|
font-size: ${theme.default.fontSize.default};
|
|
@@ -50,19 +50,19 @@ const StyledTextarea = styled.default.textarea `
|
|
|
50
50
|
color: ${theme.default.color.text.black}${theme.default.color.transparency.T40};
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
|
-
const Message = styled.
|
|
53
|
+
const Message = styledComponents.styled.div `
|
|
54
54
|
font-size: ${theme.default.fontSize.s};
|
|
55
55
|
font-weight: ${theme.default.fontWeight.book};
|
|
56
56
|
line-height: ${theme.default.lineHeight.s};
|
|
57
57
|
color: ${theme.default.color.text.gray};
|
|
58
58
|
margin-top: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
59
59
|
`;
|
|
60
|
-
const ErrorMessage = styled
|
|
60
|
+
const ErrorMessage = styledComponents.styled(Message) `
|
|
61
61
|
font-weight: ${theme.default.fontWeight.medium};
|
|
62
62
|
color: ${theme.default.color.notification.error};
|
|
63
63
|
`;
|
|
64
64
|
const Textarea = (_a) => {
|
|
65
|
-
var { height = 3, 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["height", 'data-testid']);
|
|
65
|
+
var { height = 3, 'data-testid': dataTestId, ariaLabel } = _a, props = tslib.__rest(_a, ["height", 'data-testid', "ariaLabel"]);
|
|
66
66
|
const inputRef = React.useRef(null);
|
|
67
67
|
const handleOnBlur = (e) => {
|
|
68
68
|
if (props.onBlur) {
|
|
@@ -80,11 +80,14 @@ const Textarea = (_a) => {
|
|
|
80
80
|
inputRef.current.focus();
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
+
const errorId = props.status === 'error' && props.errorMessage ? `${props.id}-error` : undefined;
|
|
84
|
+
const commentId = props.commentMessage ? `${props.id}-comment` : undefined;
|
|
85
|
+
const describedBy = [errorId, commentId].filter(Boolean).join(' ') || undefined;
|
|
83
86
|
return (React__default.default.createElement(FieldContainer, { className: props.className },
|
|
84
87
|
props.label && (React__default.default.createElement(LabelText.default, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label`, status: props.status === 'error' ? props.status : undefined, isMandatory: props.required }, props.label)),
|
|
85
|
-
React__default.default.createElement(StyledTextarea, { id: props.id, name: props.name, ref: inputRef, value: props.value, rows: height, placeholder: props.placeholder, tabIndex: props.tabIndex, onChange: handleChange, onBlur: handleOnBlur, onFocus: props.onFocus, onClick: onClick, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, required: props.required, disabled: props.disabled, "aria-
|
|
86
|
-
props.commentMessage && (React__default.default.createElement(Message, { "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage)),
|
|
87
|
-
props.status === 'error' && props.errorMessage && (React__default.default.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
88
|
+
React__default.default.createElement(StyledTextarea, { id: props.id, name: props.name, ref: inputRef, value: props.value, rows: height, placeholder: props.placeholder, tabIndex: props.tabIndex, onChange: handleChange, onBlur: handleOnBlur, onFocus: props.onFocus, onClick: onClick, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, required: props.required, disabled: props.disabled, "aria-label": !props.label ? ariaLabel : undefined, "aria-describedby": describedBy, "data-testid": dataTestId }),
|
|
89
|
+
props.commentMessage && (React__default.default.createElement(Message, { id: commentId, "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage)),
|
|
90
|
+
props.status === 'error' && props.errorMessage && (React__default.default.createElement(ErrorMessage, { id: errorId, "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
88
91
|
};
|
|
89
92
|
|
|
90
93
|
exports.default = Textarea;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var icons = require('@dnanpm/icons');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
8
|
+
var styledComponents = require('styled-components');
|
|
9
9
|
var theme = require('../../themes/theme.js');
|
|
10
10
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
11
11
|
var Box = require('../Box/Box.js');
|
|
@@ -15,7 +15,6 @@ var Icon = require('../Icon/Icon.js');
|
|
|
15
15
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
16
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
-
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
19
18
|
|
|
20
19
|
const iconsMap = {
|
|
21
20
|
info: icons.Info,
|
|
@@ -23,10 +22,10 @@ const iconsMap = {
|
|
|
23
22
|
warning: icons.Warning,
|
|
24
23
|
error: icons.Error,
|
|
25
24
|
};
|
|
26
|
-
const ToasterWrapper =
|
|
25
|
+
const ToasterWrapper = styledComponents.styled.div `
|
|
27
26
|
width: 300px;
|
|
28
27
|
`;
|
|
29
|
-
const StyledBox =
|
|
28
|
+
const StyledBox = styledComponents.styled(Box.default) `
|
|
30
29
|
position: relative;
|
|
31
30
|
font-size: ${theme.default.fontSize.s};
|
|
32
31
|
font-weight: ${theme.default.fontWeight.medium};
|
|
@@ -36,7 +35,7 @@ const StyledBox = styled__default.default(Box.default) `
|
|
|
36
35
|
align-items: center;
|
|
37
36
|
padding-right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4.5)};
|
|
38
37
|
`;
|
|
39
|
-
const IconWrapper =
|
|
38
|
+
const IconWrapper = styledComponents.styled.div `
|
|
40
39
|
display: none;
|
|
41
40
|
align-items: center;
|
|
42
41
|
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)};
|
|
@@ -46,10 +45,10 @@ const IconWrapper = styled__default.default.div `
|
|
|
46
45
|
display: flex;
|
|
47
46
|
`}
|
|
48
47
|
`;
|
|
49
|
-
const ContentWrapper =
|
|
48
|
+
const ContentWrapper = styledComponents.styled.div `
|
|
50
49
|
flex: 1;
|
|
51
50
|
`;
|
|
52
|
-
const ButtonCloseStyled =
|
|
51
|
+
const ButtonCloseStyled = styledComponents.styled(ButtonClose.default) `
|
|
53
52
|
display: flex;
|
|
54
53
|
top: auto;
|
|
55
54
|
`;
|
|
@@ -6,7 +6,7 @@ var tslib = require('tslib');
|
|
|
6
6
|
var icons = require('@dnanpm/icons');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var reactTooltip = require('react-tooltip');
|
|
9
|
-
var
|
|
9
|
+
var styledComponents = require('styled-components');
|
|
10
10
|
var theme = require('../../themes/theme.js');
|
|
11
11
|
var common = require('../../utils/common.js');
|
|
12
12
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
@@ -16,7 +16,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
16
16
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
18
|
|
|
19
|
-
const Helper = styled.
|
|
19
|
+
const Helper = styledComponents.styled.button `
|
|
20
20
|
display: inline-block;
|
|
21
21
|
vertical-align: middle;
|
|
22
22
|
background: transparent;
|
|
@@ -38,7 +38,7 @@ const Helper = styled.default.button `
|
|
|
38
38
|
border-radius: 100%;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
${({ isClickable }) => isClickable && `cursor: pointer`};
|
|
41
|
+
${({ $isClickable }) => $isClickable && `cursor: pointer`};
|
|
42
42
|
`;
|
|
43
43
|
const getArrowOverrides = () => {
|
|
44
44
|
const arrowConfig = {
|
|
@@ -58,7 +58,7 @@ const getArrowOverrides = () => {
|
|
|
58
58
|
`)
|
|
59
59
|
.join('');
|
|
60
60
|
};
|
|
61
|
-
const StyledReactTooltip = styled
|
|
61
|
+
const StyledReactTooltip = styledComponents.styled(reactTooltip.Tooltip) `
|
|
62
62
|
--rt-opacity: 1;
|
|
63
63
|
|
|
64
64
|
border: 1px solid ${theme.default.color.line.L02};
|
|
@@ -107,9 +107,9 @@ const Tooltip = (_a) => {
|
|
|
107
107
|
scroll: true,
|
|
108
108
|
};
|
|
109
109
|
return (React__default.default.createElement(React__default.default.Fragment, null,
|
|
110
|
-
!props.hideTriggerElement && (React__default.default.createElement(Helper, { "data-tooltip-id": props.id, isClickable: isClickable, className: props.className, "data-testid": dataTestId, type: "button", "data-tooltip-delay-hide": 500, "aria-describedby": props.id },
|
|
110
|
+
!props.hideTriggerElement && (React__default.default.createElement(Helper, { "data-tooltip-id": props.id, "$isClickable": isClickable, className: props.className, "data-testid": dataTestId, type: "button", "data-tooltip-delay-hide": 500, "aria-describedby": props.id },
|
|
111
111
|
React__default.default.createElement(Icon.default, { icon: icons.Info, size: "1rem", position: props.position, "aria-hidden": true }))),
|
|
112
|
-
React__default.default.createElement(StyledReactTooltip, { id: props.id, place: props.placement, openOnClick: isClickable, clickable: isHoverable, isMultiline: props.isMultiline, disableStyleInjection: true, role: isHoverable ? 'dialog' : 'tooltip', openEvents: handleReactTooltipOpenEvents, globalCloseEvents: handleReactTooltipGlobalCloseEvents, closeEvents: handleReactTooltipCloseEvents, "data-testid": dataTestId && `${dataTestId}-content` }, props.children)));
|
|
112
|
+
React__default.default.createElement(StyledReactTooltip, { id: props.id, place: props.placement, openOnClick: isClickable, clickable: isHoverable, "$isMultiline": props.isMultiline, disableStyleInjection: true, role: isHoverable ? 'dialog' : 'tooltip', openEvents: handleReactTooltipOpenEvents, globalCloseEvents: handleReactTooltipGlobalCloseEvents, closeEvents: handleReactTooltipCloseEvents, "data-testid": dataTestId && `${dataTestId}-content` }, props.children)));
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
exports.default = Tooltip;
|