@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
|
@@ -2,7 +2,7 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import ReactModal from 'react-modal';
|
|
4
4
|
import { Close } from '@dnanpm/icons';
|
|
5
|
-
import
|
|
5
|
+
import { createGlobalStyle, styled } from 'styled-components';
|
|
6
6
|
import theme from '../../themes/theme.js';
|
|
7
7
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
8
8
|
import Box from '../Box/Box.js';
|
|
@@ -96,7 +96,7 @@ const ContentWrapper = styled.div `
|
|
|
96
96
|
`;
|
|
97
97
|
const Header = styled.div `
|
|
98
98
|
padding: ${getMultipliedSize(theme.base.baseWidth, 2)};
|
|
99
|
-
background-color: ${({ variant }) => variant === 'dark'
|
|
99
|
+
background-color: ${({ $variant }) => $variant === 'dark'
|
|
100
100
|
? theme.color.background.plum.E02
|
|
101
101
|
: theme.color.background.white.default};
|
|
102
102
|
width: 100%;
|
|
@@ -109,7 +109,7 @@ const Header = styled.div `
|
|
|
109
109
|
const Title = styled.h2 `
|
|
110
110
|
font-size: ${theme.fontSize.h2M};
|
|
111
111
|
line-height: ${theme.lineHeight.h2M};
|
|
112
|
-
color: ${({ variant }) => variant === 'light' ? theme.color.default.black : theme.color.default.white};
|
|
112
|
+
color: ${({ $variant }) => $variant === 'light' ? theme.color.default.black : theme.color.default.white};
|
|
113
113
|
|
|
114
114
|
@media (max-width: ${sizeMap.small}) {
|
|
115
115
|
font-size: ${theme.fontSize.h2S};
|
|
@@ -120,7 +120,7 @@ const CloseButton = styled(ButtonClose) `
|
|
|
120
120
|
margin: 0;
|
|
121
121
|
padding: 0.5rem;
|
|
122
122
|
border-radius: 0 ${theme.radius.default} 0 ${theme.radius.default};
|
|
123
|
-
background-color: ${({ variant }) => variant === 'light'
|
|
123
|
+
background-color: ${({ $variant }) => $variant === 'light'
|
|
124
124
|
? theme.color.background.sand.E01
|
|
125
125
|
: theme.color.background.plum.default};
|
|
126
126
|
@media (max-width: ${sizeMap.mobile}) {
|
|
@@ -146,11 +146,11 @@ const Modal = (_a) => {
|
|
|
146
146
|
return (React__default.createElement(React__default.Fragment, null,
|
|
147
147
|
React__default.createElement(StyledReactModal, { id: props.id, size: size, isOpen: props.isOpen, overlayElement: ModalOverlay, contentElement: ModalContent, onRequestClose: props.onRequestClose, portalClassName: props.className, contentLabel: props.contentLabel, shouldCloseOnEsc: isClosable, shouldCloseOnOverlayClick: isClosable },
|
|
148
148
|
React__default.createElement(StyledBox, { elevation: "extraHigh", "data-testid": dataTestId },
|
|
149
|
-
closeButton && isClosable && (React__default.createElement(CloseButton, { onClick: props.onRequestClose, "aria-label": props.closeLabel, "data-testid": dataTestId && `${dataTestId}-close-button`, variant: variant },
|
|
149
|
+
closeButton && isClosable && (React__default.createElement(CloseButton, { onClick: props.onRequestClose, "aria-label": props.closeLabel, "data-testid": dataTestId && `${dataTestId}-close-button`, "$variant": variant },
|
|
150
150
|
React__default.createElement(Close, { color: variant === 'light'
|
|
151
151
|
? theme.color.default.plum
|
|
152
152
|
: theme.color.default.white }))),
|
|
153
|
-
React__default.createElement(Header, { variant: variant, "data-testid": dataTestId && `${dataTestId}-header` }, props.title && (React__default.createElement(Title, { size: size, variant: variant }, props.title))),
|
|
153
|
+
React__default.createElement(Header, { "$variant": variant, "data-testid": dataTestId && `${dataTestId}-header` }, props.title && (React__default.createElement(Title, { "$size": size, "$variant": variant }, props.title))),
|
|
154
154
|
React__default.createElement(ContentWrapper, null, props.children),
|
|
155
155
|
props.footer && (React__default.createElement(Footer, { "data-testid": dataTestId && `${dataTestId}-footer` }, props.footer)))),
|
|
156
156
|
React__default.createElement(GlobalStyle, null)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Close, Info, Check, Warning, Error } from '@dnanpm/icons';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { css, styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import ButtonClose from '../ButtonClose/ButtonClose.js';
|
|
6
6
|
import Icon from '../Icon/Icon.js';
|
|
@@ -20,26 +20,26 @@ const sharedStyles = css `
|
|
|
20
20
|
border-radius: ${theme.radius.s};
|
|
21
21
|
border: 2px solid ${({ $type }) => theme.color.notification[$type]};
|
|
22
22
|
`;
|
|
23
|
-
const NotificationWrapper =
|
|
23
|
+
const NotificationWrapper = styled.div `
|
|
24
24
|
${sharedStyles}
|
|
25
25
|
border-color: ${({ $type }) => theme.color.notification[$type]};
|
|
26
26
|
`;
|
|
27
|
-
const StaticWrapper =
|
|
27
|
+
const StaticWrapper = styled.div `
|
|
28
28
|
${sharedStyles}
|
|
29
29
|
border-color: ${({ $type }) => theme.color.notification[$type]};
|
|
30
30
|
`;
|
|
31
|
-
const IconWrapper =
|
|
31
|
+
const IconWrapper = styled.div `
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
padding: 0.5rem;
|
|
35
35
|
background-color: ${({ $type }) => theme.color.notification[$type]};
|
|
36
36
|
`;
|
|
37
|
-
const ContentWrapper =
|
|
37
|
+
const ContentWrapper = styled.div `
|
|
38
38
|
margin: auto 0;
|
|
39
39
|
padding: 0.5rem 0;
|
|
40
40
|
width: 100%;
|
|
41
41
|
`;
|
|
42
|
-
const ButtonCloseStyled =
|
|
42
|
+
const ButtonCloseStyled = styled(ButtonClose) `
|
|
43
43
|
position: static;
|
|
44
44
|
margin: auto 0.5rem;
|
|
45
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import styled from '
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
|
|
6
6
|
const NotificationBadgeElement = styled.div `
|
|
@@ -9,9 +9,9 @@ const NotificationBadgeElement = styled.div `
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
font-size: ${theme.fontSize.xs};
|
|
11
11
|
font-weight: ${theme.fontWeight.bold};
|
|
12
|
-
position: ${({ position }) => position || 'absolute'};
|
|
13
|
-
top: ${({ top }) => top || '0'};
|
|
14
|
-
right: ${({ right }) => right || '0'};
|
|
12
|
+
position: ${({ $position }) => $position || 'absolute'};
|
|
13
|
+
top: ${({ $top }) => $top || '0'};
|
|
14
|
+
right: ${({ $right }) => $right || '0'};
|
|
15
15
|
width: 1rem;
|
|
16
16
|
height: 1rem;
|
|
17
17
|
color: ${theme.color.text.white};
|
|
@@ -35,7 +35,7 @@ const NotificationBadge = (_a) => {
|
|
|
35
35
|
var { 'data-testid': dataTestId, visuallyHiddenText } = _a, props = __rest(_a, ['data-testid', "visuallyHiddenText"]);
|
|
36
36
|
return (React__default.createElement(React__default.Fragment, null,
|
|
37
37
|
visuallyHiddenText && React__default.createElement(VisuallyHidden, null, visuallyHiddenText),
|
|
38
|
-
React__default.createElement(NotificationBadgeElement, { id: props.id, position: props.position, top: props.top, right: props.right, className: props.className, "data-testid": dataTestId, "aria-hidden": "true" }, props.children)));
|
|
38
|
+
React__default.createElement(NotificationBadgeElement, { id: props.id, "$position": props.position, "$top": props.top, "$right": props.right, className: props.className, "data-testid": dataTestId, "aria-hidden": "true" }, props.children)));
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export { NotificationBadge as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default, { useRef, useEffect } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import styled from '
|
|
4
|
+
import { styled } from 'styled-components';
|
|
5
5
|
import theme from '../../themes/theme.js';
|
|
6
6
|
|
|
7
7
|
const Element = styled.div `
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
6
6
|
import { shade } from '../Button/Button.js';
|
|
@@ -51,7 +51,7 @@ const getDefaultButtonStyles = ({ isChecked, isDisabled, }) => {
|
|
|
51
51
|
: ''}
|
|
52
52
|
`;
|
|
53
53
|
};
|
|
54
|
-
const Label =
|
|
54
|
+
const Label = styled.label `
|
|
55
55
|
all: unset;
|
|
56
56
|
position: relative;
|
|
57
57
|
display: inline-block;
|
|
@@ -60,11 +60,11 @@ const Label = styled__default.label `
|
|
|
60
60
|
text-align: center;
|
|
61
61
|
transition: all 0.2s ease-in-out;
|
|
62
62
|
|
|
63
|
-
${({ isChecked, isDisabled, isDefaultButtonStyle }) => isDefaultButtonStyle
|
|
64
|
-
? getDefaultButtonStyles({ isChecked, isDisabled })
|
|
65
|
-
: getStandardPillStyles({ isChecked, isDisabled })}
|
|
63
|
+
${({ $isChecked, $isDisabled, $isDefaultButtonStyle }) => $isDefaultButtonStyle
|
|
64
|
+
? getDefaultButtonStyles({ isChecked: $isChecked, isDisabled: $isDisabled })
|
|
65
|
+
: getStandardPillStyles({ isChecked: $isChecked, isDisabled: $isDisabled })}
|
|
66
66
|
|
|
67
|
-
${({ isDisabled }) => `cursor: ${isDisabled ? 'not-allowed' : 'pointer'};`}
|
|
67
|
+
${({ $isDisabled }) => `cursor: ${$isDisabled ? 'not-allowed' : 'pointer'};`}
|
|
68
68
|
|
|
69
69
|
&:focus-within, *:focus > & {
|
|
70
70
|
outline: none;
|
|
@@ -72,17 +72,17 @@ const Label = styled__default.label `
|
|
|
72
72
|
0px 0px 0px 4px ${theme.color.focus.dark};
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
${({ position }) => (position === 'right' || position === 'middle') &&
|
|
75
|
+
${({ $position }) => ($position === 'right' || $position === 'middle') &&
|
|
76
76
|
`
|
|
77
77
|
margin-left: ${getMultipliedSize(theme.base.baseWidth, 1)};
|
|
78
78
|
`}
|
|
79
79
|
|
|
80
|
-
${({ position }) => (position === 'left' || position === 'middle') &&
|
|
80
|
+
${({ $position }) => ($position === 'left' || $position === 'middle') &&
|
|
81
81
|
`
|
|
82
82
|
margin-right: ${getMultipliedSize(theme.base.baseWidth, 1)};
|
|
83
83
|
`}
|
|
84
84
|
|
|
85
|
-
${({ position }) => position === 'auto' &&
|
|
85
|
+
${({ $position }) => $position === 'auto' &&
|
|
86
86
|
`
|
|
87
87
|
margin: ${getMultipliedSize(theme.base.baseWidth, 0.5)};
|
|
88
88
|
|
|
@@ -95,7 +95,7 @@ const Label = styled__default.label `
|
|
|
95
95
|
}
|
|
96
96
|
`}
|
|
97
97
|
`;
|
|
98
|
-
const Input =
|
|
98
|
+
const Input = styled.input `
|
|
99
99
|
appearance: none;
|
|
100
100
|
display: block;
|
|
101
101
|
border: 0 none;
|
|
@@ -113,7 +113,7 @@ const Input = styled__default.input `
|
|
|
113
113
|
const Pill = (_a) => {
|
|
114
114
|
var { type = 'none', 'data-testid': dataTestId } = _a, props = __rest(_a, ["type", 'data-testid']);
|
|
115
115
|
const isDefaultType = type === 'none';
|
|
116
|
-
return (React__default.createElement(Label, { as: isDefaultType ? 'button' : 'label', id: isDefaultType ? props.id : undefined, htmlFor: !isDefaultType ? props.id : undefined, type: isDefaultType ? 'button' : undefined, position: props.position, isChecked: props.isChecked || props.isDefaultChecked, isDisabled: props.isDisabled, className: props.className, "data-testid": dataTestId, isDefaultButtonStyle: props.isDefaultButtonStyle, "aria-label": props.ariaLabel, disabled: isDefaultType ? props.isDisabled : undefined, onClick: isDefaultType && !props.isDisabled ? props.onClick : undefined },
|
|
116
|
+
return (React__default.createElement(Label, { as: isDefaultType ? 'button' : 'label', id: isDefaultType ? props.id : undefined, htmlFor: !isDefaultType ? props.id : undefined, type: isDefaultType ? 'button' : undefined, "$position": props.position, "$isChecked": props.isChecked || props.isDefaultChecked, "$isDisabled": props.isDisabled, className: props.className, "data-testid": dataTestId, "$isDefaultButtonStyle": props.isDefaultButtonStyle, "aria-label": props.ariaLabel, disabled: isDefaultType ? props.isDisabled : undefined, onClick: isDefaultType && !props.isDisabled ? props.onClick : undefined },
|
|
117
117
|
props.children,
|
|
118
118
|
!isDefaultType && (React__default.createElement(Input, { id: props.id, name: props.name, type: type, defaultChecked: props.isDefaultChecked, checked: props.isChecked, value: props.value, onChange: props.onChange, disabled: props.isDisabled, readOnly: !props.onChange, "data-testid": dataTestId && `${dataTestId}-input`, "data-checked": props.isChecked }))));
|
|
119
119
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { keyframes, styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
|
|
6
6
|
const loading = keyframes `
|
|
@@ -27,17 +27,17 @@ const Pixel = styled.div `
|
|
|
27
27
|
height: 0.625rem;
|
|
28
28
|
margin: 0.125rem;
|
|
29
29
|
animation: ${loading} 1s ease-in-out infinite;
|
|
30
|
-
animation-delay: ${({ delay }) => delay}s;
|
|
30
|
+
animation-delay: ${({ $delay }) => $delay}s;
|
|
31
31
|
`;
|
|
32
32
|
/** @visibleName Pixel Loader */
|
|
33
33
|
const PixelLoader = (_a) => {
|
|
34
34
|
var { className, 'data-testid': dataTestId } = _a, props = __rest(_a, ["className", 'data-testid']);
|
|
35
35
|
return (React__default.createElement(PixelLoaderWrapper, { className: className, "data-testid": dataTestId },
|
|
36
36
|
props.label && React__default.createElement("span", { className: "visually-hidden" }, props.label),
|
|
37
|
-
React__default.createElement(Pixel, { color: props.color, delay: "-0.27" }),
|
|
38
|
-
React__default.createElement(Pixel, { color: props.color, delay: "-0.18" }),
|
|
39
|
-
React__default.createElement(Pixel, { color: props.color, delay: "-0.09" }),
|
|
40
|
-
React__default.createElement(Pixel, { color: props.color, delay: "0" })));
|
|
37
|
+
React__default.createElement(Pixel, { color: props.color, "$delay": "-0.27" }),
|
|
38
|
+
React__default.createElement(Pixel, { color: props.color, "$delay": "-0.18" }),
|
|
39
|
+
React__default.createElement(Pixel, { color: props.color, "$delay": "-0.09" }),
|
|
40
|
+
React__default.createElement(Pixel, { color: props.color, "$delay": "0" })));
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export { PixelLoader as default };
|
|
@@ -5,7 +5,7 @@ import useDebounce from '../../hooks/useDebounce.js';
|
|
|
5
5
|
import useOutsideClick from '../../hooks/useOutsideClick.js';
|
|
6
6
|
import useResizeObserver from '../../hooks/useResizeObserver.js';
|
|
7
7
|
import useWindowSize from '../../hooks/useWindowSize.js';
|
|
8
|
-
import styled from '
|
|
8
|
+
import { styled } from 'styled-components';
|
|
9
9
|
import theme from '../../themes/theme.js';
|
|
10
10
|
import getElevationShadow from '../../utils/common.js';
|
|
11
11
|
import { media, getMultipliedSize } from '../../utils/styledUtils.js';
|
|
@@ -88,9 +88,9 @@ const NavigationList = styled(CoreULStyles) `
|
|
|
88
88
|
background-color: ${theme.color.background.white.default};
|
|
89
89
|
position: absolute;
|
|
90
90
|
top: ${getMultipliedSize(theme.base.baseHeight, 5.6)};
|
|
91
|
-
visibility: ${({ isMobileNavigationOpen }) =>
|
|
91
|
+
visibility: ${({ $isMobileNavigationOpen }) => $isMobileNavigationOpen ? 'visible' : 'hidden'};
|
|
92
92
|
clip-path: inset(
|
|
93
|
-
0% 0% ${({ isMobileNavigationOpen }) => (isMobileNavigationOpen ? '0%' : '100%')} 0%
|
|
93
|
+
0% 0% ${({ $isMobileNavigationOpen }) => ($isMobileNavigationOpen ? '0%' : '100%')} 0%
|
|
94
94
|
);
|
|
95
95
|
transition: all 0.2s ease-in-out;
|
|
96
96
|
|
|
@@ -324,7 +324,7 @@ const PriorityNavigation = (_a) => {
|
|
|
324
324
|
props.categoryLabel && React__default.createElement(Category, null, props.categoryLabel),
|
|
325
325
|
selectedItem),
|
|
326
326
|
React__default.createElement(Icon, { icon: isMobileNavigationOpen ? OvalChevronUp : OvalChevronDown, size: "2.5rem" }))),
|
|
327
|
-
React__default.createElement(NavigationList, { ref: navigationListRef, isMobileNavigationOpen: isMobileNavigationOpen, onKeyDown: handleNavigationListKeyDown }, Children.map([...state.navigationItems, ...(isMobile ? state.dropdownItems : [])], (navigationItem, index) => {
|
|
327
|
+
React__default.createElement(NavigationList, { ref: navigationListRef, "$isMobileNavigationOpen": isMobileNavigationOpen, onKeyDown: handleNavigationListKeyDown }, Children.map([...state.navigationItems, ...(isMobile ? state.dropdownItems : [])], (navigationItem, index) => {
|
|
328
328
|
if (isValidElement(navigationItem) &&
|
|
329
329
|
navigationItem.type === PriorityNavigationItem) {
|
|
330
330
|
return (React__default.createElement(PriorityNavigationItem, { id: navigationItem.props.id, key: navigationItem.key, onClick: handleItemClick, onKeyDown: navigationItem.props.onKeyDown || props.onKeyDown, isActive: navigationItem.props.isActive, className: navigationItem.props.className, "data-testid": navigationItem.props['data-testid'], ref: instance => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import styled from '
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import { media } from '../../utils/styledUtils.js';
|
|
6
6
|
|
|
@@ -24,12 +24,12 @@ const Element = styled.li `
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
${({ isActive }) => media.md `
|
|
27
|
+
${({ $isActive }) => media.md `
|
|
28
28
|
justify-content: left;
|
|
29
29
|
padding: 1rem 0;
|
|
30
30
|
margin: auto 1rem;
|
|
31
31
|
border-top: 3px solid transparent;
|
|
32
|
-
border-bottom: 3px solid ${isActive ? theme.color.text.pink : 'transparent'};
|
|
32
|
+
border-bottom: 3px solid ${$isActive ? theme.color.text.pink : 'transparent'};
|
|
33
33
|
`}
|
|
34
34
|
|
|
35
35
|
& > a {
|
|
@@ -45,8 +45,8 @@ const Element = styled.li `
|
|
|
45
45
|
|
|
46
46
|
& > * {
|
|
47
47
|
display: block;
|
|
48
|
-
color: ${({ isActive }) => (isActive ? theme.color.text.pink : theme.color.text.black)};
|
|
49
|
-
${({ isActive }) => isActive && `font-weight: ${theme.fontWeight.bold};`}
|
|
48
|
+
color: ${({ $isActive }) => ($isActive ? theme.color.text.pink : theme.color.text.black)};
|
|
49
|
+
${({ $isActive }) => $isActive && `font-weight: ${theme.fontWeight.bold};`}
|
|
50
50
|
border: 2px solid transparent;
|
|
51
51
|
|
|
52
52
|
&:hover {
|
|
@@ -60,7 +60,7 @@ const Element = styled.li `
|
|
|
60
60
|
*/
|
|
61
61
|
const PriorityNavigationItem = React__default.forwardRef((_a, ref) => {
|
|
62
62
|
var { 'data-testid': dataTestId } = _a, props = __rest(_a, ['data-testid']);
|
|
63
|
-
return (React__default.createElement(Element, { id: props.id, ref: ref, onClick: props.onClick, onKeyDown: props.onKeyDown, isActive: props.isActive, className: props.className, "data-testid": dataTestId }, props.children));
|
|
63
|
+
return (React__default.createElement(Element, { id: props.id, ref: ref, onClick: props.onClick, onKeyDown: props.onKeyDown, "$isActive": props.isActive, className: props.className, "data-testid": dataTestId }, props.children));
|
|
64
64
|
});
|
|
65
65
|
PriorityNavigationItem.displayName = 'PriorityNavigationItem';
|
|
66
66
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { Warning, Check } from '@dnanpm/icons';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import styled from '
|
|
4
|
+
import { styled } from 'styled-components';
|
|
5
5
|
import theme from '../../themes/theme.js';
|
|
6
6
|
import { getMultipliedSize, media } from '../../utils/styledUtils.js';
|
|
7
7
|
import Icon from '../Icon/Icon.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import styled from '
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { ChevronUp, ChevronDown } from '@dnanpm/icons';
|
|
3
3
|
import React__default, { useState, useRef, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
4
|
-
import styled from '
|
|
4
|
+
import { styled } from 'styled-components';
|
|
5
5
|
import theme from '../../themes/theme.js';
|
|
6
6
|
import ButtonIcon from '../ButtonIcon/ButtonIcon.js';
|
|
7
7
|
|
|
@@ -10,16 +10,16 @@ const Container = styled.div `
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
`;
|
|
12
12
|
const Content = styled.div `
|
|
13
|
-
${({ isExpanded, collapsedSize }) =>
|
|
13
|
+
${({ $isExpanded, $collapsedSize }) => !$isExpanded &&
|
|
14
14
|
`
|
|
15
15
|
overflow: hidden;
|
|
16
|
-
max-height: ${collapsedSize};
|
|
16
|
+
max-height: ${$collapsedSize};
|
|
17
17
|
mask-image: linear-gradient(${theme.color.background.white.default}, transparent);
|
|
18
18
|
`}
|
|
19
19
|
`;
|
|
20
20
|
const ButtonWrapper = styled.div `
|
|
21
21
|
margin: 0.625rem 0.313rem;
|
|
22
|
-
align-self: ${({ buttonPosition }) =>
|
|
22
|
+
align-self: ${({ $buttonPosition }) => $buttonPosition === 'right' ? 'flex-end' : 'flex-start'};
|
|
23
23
|
`;
|
|
24
24
|
const StyledButtonIcon = styled(ButtonIcon) `
|
|
25
25
|
color: ${theme.color.text.pink};
|
|
@@ -82,8 +82,8 @@ const ReadMore = (_a) => {
|
|
|
82
82
|
return child;
|
|
83
83
|
};
|
|
84
84
|
return (React__default.createElement(Container, { id: props.id, className: props.className, "data-testid": dataTestId, "aria-label": props.ariaLabel, role: "region" },
|
|
85
|
-
React__default.createElement(Content, { ref: contentRef, isExpanded: temporaryStateManagement, collapsedSize: collapsedSize, "data-testid": dataTestId && `${dataTestId}-content`, "aria-hidden": temporaryStateManagement ? 'false' : 'true', tabIndex: temporaryStateManagement ? 0 : -1 }, Children.map(props.children, forceTabIndexOnTextLinks)),
|
|
86
|
-
React__default.createElement(ButtonWrapper, { buttonPosition: props.buttonPosition },
|
|
85
|
+
React__default.createElement(Content, { ref: contentRef, "$isExpanded": temporaryStateManagement, "$collapsedSize": collapsedSize, "data-testid": dataTestId && `${dataTestId}-content`, "aria-hidden": temporaryStateManagement ? 'false' : 'true', tabIndex: temporaryStateManagement ? 0 : -1 }, Children.map(props.children, forceTabIndexOnTextLinks)),
|
|
86
|
+
React__default.createElement(ButtonWrapper, { "$buttonPosition": props.buttonPosition },
|
|
87
87
|
React__default.createElement(StyledButtonIcon, { ref: buttonRef, icon: temporaryStateManagement ? ChevronUp : ChevronDown, onClick: handleOnClick, "aria-expanded": temporaryStateManagement }, temporaryButtonLabel || props.buttonLabel))));
|
|
88
88
|
};
|
|
89
89
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { Close, Search as Search$1 } from '@dnanpm/icons';
|
|
3
3
|
import React__default, { useRef } from 'react';
|
|
4
|
-
import styled from '
|
|
4
|
+
import { styled } from 'styled-components';
|
|
5
5
|
import theme from '../../themes/theme.js';
|
|
6
6
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
7
7
|
import ButtonIcon from '../ButtonIcon/ButtonIcon.js';
|
|
@@ -2,7 +2,7 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import { ChevronDown, Check } from '@dnanpm/icons';
|
|
3
3
|
import React__default, { useState, useRef } from 'react';
|
|
4
4
|
import useOutsideClick from '../../hooks/useOutsideClick.js';
|
|
5
|
-
import styled from '
|
|
5
|
+
import { styled } from 'styled-components';
|
|
6
6
|
import theme from '../../themes/theme.js';
|
|
7
7
|
import { media, getMultipliedSize } from '../../utils/styledUtils.js';
|
|
8
8
|
import Icon from '../Icon/Icon.js';
|
|
@@ -2,7 +2,7 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import { Close, Error, Lock, Search, ChevronUp, ChevronDown } from '@dnanpm/icons';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import Select, { defaultTheme, components } from 'react-select';
|
|
5
|
-
import styled from '
|
|
5
|
+
import { styled } from 'styled-components';
|
|
6
6
|
import theme from '../../themes/theme.js';
|
|
7
7
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
8
8
|
import Icon from '../Icon/Icon.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import styled from '
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
6
6
|
import LabelText from '../LabelText/LabelText.js';
|
|
@@ -24,12 +24,12 @@ const Button = styled.div `
|
|
|
24
24
|
content: ' ';
|
|
25
25
|
width: ${height}rem;
|
|
26
26
|
border-radius: 50%;
|
|
27
|
-
${({ isChecked }) => `
|
|
28
|
-
transform: translate3d(${isChecked ? railWidth - height : 0}rem, 0, 0);
|
|
29
|
-
background-color: ${isChecked ? theme.color.default.pink : theme.color.line.L01};
|
|
27
|
+
${({ $isChecked }) => `
|
|
28
|
+
transform: translate3d(${$isChecked ? railWidth - height : 0}rem, 0, 0);
|
|
29
|
+
background-color: ${$isChecked ? theme.color.default.pink : theme.color.line.L01};
|
|
30
30
|
border: ${borderSize}rem solid ${theme.color.default.white};
|
|
31
31
|
z-index: 2;
|
|
32
|
-
left: ${isChecked ? -borderSize * 2 : 0}rem;
|
|
32
|
+
left: ${$isChecked ? -borderSize * 2 : 0}rem;
|
|
33
33
|
`};
|
|
34
34
|
`;
|
|
35
35
|
const Checkbox = styled.input `
|
|
@@ -38,25 +38,25 @@ const Checkbox = styled.input `
|
|
|
38
38
|
top: 0;
|
|
39
39
|
left: 0;
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
&:disabled {
|
|
42
42
|
cursor: not-allowed;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
&:disabled + label {
|
|
45
45
|
cursor: not-allowed;
|
|
46
46
|
color: ${theme.color.line.L01}${theme.color.transparency.T40};
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
&:disabled + label > div {
|
|
49
49
|
cursor: not-allowed;
|
|
50
50
|
border-color: ${({ checked }) => checked ? theme.color.default.pink : theme.color.line.L01}${theme.color.transparency
|
|
51
51
|
.T40};
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
&:disabled + label div div {
|
|
54
54
|
pointer-events: none;
|
|
55
55
|
background-color: ${({ checked }) => checked ? theme.color.default.pink : theme.color.line.L01}${theme.color.transparency
|
|
56
56
|
.T40};
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
&:focus-visible + label > div {
|
|
60
60
|
outline: none;
|
|
61
61
|
box-shadow: 0px 0px 0px 2px ${theme.color.focus.dark};
|
|
62
62
|
}
|
|
@@ -75,9 +75,9 @@ const Rail = styled.div `
|
|
|
75
75
|
left: 0;
|
|
76
76
|
border-radius: ${borderRadius}rem;
|
|
77
77
|
overflow: hidden;
|
|
78
|
-
${({ isChecked }) => `
|
|
78
|
+
${({ $isChecked }) => `
|
|
79
79
|
height: ${railHeight}rem;
|
|
80
|
-
border: ${borderSize}rem solid ${isChecked ? theme.color.default.pink : theme.color.line.L01};
|
|
80
|
+
border: ${borderSize}rem solid ${$isChecked ? theme.color.default.pink : theme.color.line.L01};
|
|
81
81
|
background-color: ${theme.color.background.white.default};
|
|
82
82
|
z-index: 0;
|
|
83
83
|
`};
|
|
@@ -93,8 +93,8 @@ const Switch = (_a) => {
|
|
|
93
93
|
return (React.createElement(Container, { className: props.className, "data-testid": dataTestId },
|
|
94
94
|
React.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) }),
|
|
95
95
|
React.createElement(LabelWrapper, { htmlFor: props.id },
|
|
96
|
-
React.createElement(Rail, { isChecked: props.isChecked },
|
|
97
|
-
React.createElement(Button, { isChecked: props.isChecked })),
|
|
96
|
+
React.createElement(Rail, { "$isChecked": props.isChecked },
|
|
97
|
+
React.createElement(Button, { "$isChecked": props.isChecked })),
|
|
98
98
|
props.label && props.label)));
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import styled from '
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
6
6
|
import Box from '../Box/Box.js';
|
|
@@ -12,8 +12,8 @@ const TabLabel = styled.li `
|
|
|
12
12
|
list-style: none;
|
|
13
13
|
font-size: ${theme.fontSize.default};
|
|
14
14
|
line-height: ${theme.lineHeight.default};
|
|
15
|
-
font-weight: ${({ isActive }) => (isActive ? theme.fontWeight.bold : theme.fontWeight.book)};
|
|
16
|
-
background-color: ${({ isActive }) => isActive ? theme.color.background.white.default : theme.color.background.sand.E01};
|
|
15
|
+
font-weight: ${({ $isActive }) => ($isActive ? theme.fontWeight.bold : theme.fontWeight.book)};
|
|
16
|
+
background-color: ${({ $isActive }) => $isActive ? theme.color.background.white.default : theme.color.background.sand.E01};
|
|
17
17
|
border-radius: ${theme.radius.default} ${theme.radius.default} 0 0;
|
|
18
18
|
border: 1px solid ${theme.color.line.L03};
|
|
19
19
|
border-bottom: 0 none;
|
|
@@ -38,7 +38,7 @@ const TabStyle = styled.li `
|
|
|
38
38
|
line-height: ${theme.lineHeight.default};
|
|
39
39
|
font-weight: ${theme.fontWeight.book};
|
|
40
40
|
|
|
41
|
-
${({ isActive }) => isActive &&
|
|
41
|
+
${({ $isActive }) => $isActive &&
|
|
42
42
|
`
|
|
43
43
|
color: ${theme.color.text.pink};
|
|
44
44
|
background-color: ${theme.color.background.sand.E01};
|
|
@@ -49,7 +49,7 @@ const TabStyle = styled.li `
|
|
|
49
49
|
padding: ${getMultipliedSize(theme.base.baseHeight, 1.6)} 0;
|
|
50
50
|
`}
|
|
51
51
|
|
|
52
|
-
${({ isActive, $type }) => isActive &&
|
|
52
|
+
${({ $isActive, $type }) => $isActive &&
|
|
53
53
|
$type === 'underlined' &&
|
|
54
54
|
`
|
|
55
55
|
border-bottom: 2px solid ${theme.color.default.pink};
|
|
@@ -86,12 +86,12 @@ const Tab = (_a) => {
|
|
|
86
86
|
};
|
|
87
87
|
const isActive = props.activeTab ? props.activeTab === props.label : props.isActive;
|
|
88
88
|
return type === 'box' || type === 'default' || type === 'panel' ? (React__default.createElement(React__default.Fragment, null,
|
|
89
|
-
React__default.createElement(TabLabel, { role: "tab", id: props.id, "$type": type, "aria-selected": isActive, isActive: isActive, onClick: onClickHandler, tabIndex: isActive ? 0 : -1 }, props.label),
|
|
89
|
+
React__default.createElement(TabLabel, { role: "tab", id: props.id, "$type": type, "aria-selected": isActive, "$isActive": isActive, onClick: onClickHandler, tabIndex: isActive ? 0 : -1 }, props.label),
|
|
90
90
|
props.isStateless &&
|
|
91
91
|
(props.children && (props.activeTab === props.label || props.isActive) ? (React__default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type, as: (type === 'box' || type === 'default') && !props.tabStyle
|
|
92
92
|
? Box
|
|
93
93
|
: undefined }, props.children)) : (React__default.createElement(Divider, { margin: "0" }))))) : (React__default.createElement(React__default.Fragment, null,
|
|
94
|
-
React__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),
|
|
94
|
+
React__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),
|
|
95
95
|
props.isStateless &&
|
|
96
96
|
props.children &&
|
|
97
97
|
(props.activeTab === props.label || props.isActive) && (React__default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type }, props.children))));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import React__default, { useState, Children, isValidElement } from 'react';
|
|
3
|
-
import styled from '
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
5
|
import Box from '../Box/Box.js';
|
|
6
6
|
import Tab from '../Tab/Tab.js';
|
|
@@ -10,7 +10,7 @@ const Tablist = styled.ul `
|
|
|
10
10
|
flex-flow: row wrap;
|
|
11
11
|
padding: 0;
|
|
12
12
|
|
|
13
|
-
${({ isFullWidth }) => isFullWidth &&
|
|
13
|
+
${({ $isFullWidth }) => $isFullWidth &&
|
|
14
14
|
`
|
|
15
15
|
align-items: stretch;
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ const Tablist = styled.ul `
|
|
|
20
20
|
}
|
|
21
21
|
`}
|
|
22
22
|
|
|
23
|
-
${({ $type, isNarrowUnderlined }) => {
|
|
23
|
+
${({ $type, $isNarrowUnderlined }) => {
|
|
24
24
|
if ($type === 'box' || $type === 'default' || $type === 'panel') {
|
|
25
25
|
return `
|
|
26
26
|
margin: 0;
|
|
@@ -43,7 +43,7 @@ const Tablist = styled.ul `
|
|
|
43
43
|
}
|
|
44
44
|
if ($type === 'underlined') {
|
|
45
45
|
return `
|
|
46
|
-
gap: ${isNarrowUnderlined ? '1.25rem' : '2.5rem'};
|
|
46
|
+
gap: ${$isNarrowUnderlined ? '1.25rem' : '2.5rem'};
|
|
47
47
|
border-bottom: 1px solid ${theme.color.line.L02};
|
|
48
48
|
`;
|
|
49
49
|
}
|
|
@@ -56,11 +56,11 @@ const Tablist = styled.ul `
|
|
|
56
56
|
}}
|
|
57
57
|
`;
|
|
58
58
|
const ContentContainer = styled.div `
|
|
59
|
-
${({ $type, isFullWidth }) => {
|
|
59
|
+
${({ $type, $isFullWidth }) => {
|
|
60
60
|
if ($type === 'box' || $type === 'default') {
|
|
61
61
|
return `
|
|
62
62
|
border-top-left-radius: 0;
|
|
63
|
-
${isFullWidth ? 'border-top-right-radius: 0;' : ''}
|
|
63
|
+
${$isFullWidth ? 'border-top-right-radius: 0;' : ''}
|
|
64
64
|
`;
|
|
65
65
|
}
|
|
66
66
|
if ($type === 'panel') {
|
|
@@ -112,11 +112,11 @@ const Tabs = (_a) => {
|
|
|
112
112
|
setActiveTab((outerActiveTab === null || outerActiveTab === void 0 ? void 0 : outerActiveTab.props.label) || tabs[0].props.label);
|
|
113
113
|
}
|
|
114
114
|
return (React__default.createElement("div", { className: props.className ? `tabs ${props.className}` : 'tabs', "data-testid": dataTestId },
|
|
115
|
-
React__default.createElement(Tablist, { role: "tablist", "$type": props.tabStyle || type, isFullWidth: props.isFullWidth, isNarrowUnderlined: props.isNarrowUnderlined, onKeyDown: onKeyDown }, Children.map(props.children, tab => isValidElement(tab) &&
|
|
115
|
+
React__default.createElement(Tablist, { role: "tablist", "$type": props.tabStyle || type, "$isFullWidth": props.isFullWidth, "$isNarrowUnderlined": props.isNarrowUnderlined, onKeyDown: onKeyDown }, Children.map(props.children, tab => isValidElement(tab) &&
|
|
116
116
|
tab.type === Tab && (React__default.createElement(Tab, { id: tab.props.id, key: tab.props.label, label: tab.props.label, type: props.tabStyle || type, isActive: tab.props.isActive
|
|
117
117
|
? tab.props.isActive
|
|
118
118
|
: activeTab === tab.props.label, activeTab: tab.props.activeTab, onClick: onClickTabItem, className: tab.props.className, "data-testid": tab.props['data-testid'] })))),
|
|
119
|
-
React__default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type, isFullWidth: props.isFullWidth, as: (type === 'box' || type === 'default') && !props.tabStyle ? Box : undefined }, Children.map(props.children, tab => isValidElement(tab) &&
|
|
119
|
+
React__default.createElement(ContentContainer, { role: "tabpanel", "$type": props.tabStyle || type, "$isFullWidth": props.isFullWidth, as: (type === 'box' || type === 'default') && !props.tabStyle ? Box : undefined }, Children.map(props.children, tab => isValidElement(tab) &&
|
|
120
120
|
tab.type === Tab &&
|
|
121
121
|
(tab.props.isActive || tab.props.label === activeTab) &&
|
|
122
122
|
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;
|