@dnanpm/styleguide 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/Accordion/Accordion.d.ts +27 -15
- package/build/cjs/components/Accordion/Accordion.js +29 -12
- package/build/cjs/components/Accordion/AccordionItem.d.ts +14 -29
- package/build/cjs/components/Accordion/AccordionItem.js +29 -52
- package/build/cjs/components/AmountSelector/AmountSelector.js +3 -4
- package/build/cjs/components/Buttons/ButtonBasicStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonBasicStyles.js +10 -14
- package/build/cjs/components/Buttons/ButtonDefault.js +6 -2
- package/build/cjs/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonIconStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonPrimary.js +6 -2
- package/build/cjs/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonSecondary.js +7 -3
- package/build/cjs/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonTertiary.js +7 -3
- package/build/cjs/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/CloseButton.d.ts +37 -30
- package/build/cjs/components/Card/Card.js +4 -2
- package/build/cjs/components/Card/CardRow.js +3 -3
- package/build/cjs/components/Checkbox/Checkbox.d.ts +38 -12
- package/build/cjs/components/Checkbox/Checkbox.js +37 -70
- package/build/cjs/components/DnaLogo/DnaLogo.d.ts +37 -40
- package/build/cjs/components/Footer/Components/FooterComponents.js +3 -2
- package/build/cjs/components/Helper/Helper.js +2 -1
- package/build/cjs/components/Icon/Icon.d.ts +39 -30
- package/build/cjs/components/Icon/Icons.d.ts +1 -4
- package/build/cjs/components/Icon/Icons.js +3 -7
- package/build/cjs/components/Input/Input.d.ts +102 -13
- package/build/cjs/components/Input/Input.js +57 -58
- package/build/cjs/components/Label/Label.js +2 -3
- package/build/cjs/components/LabelText/LabelText.d.ts +38 -30
- package/build/cjs/components/LabelText/LabelText.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +10 -4
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -4
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
- package/build/cjs/components/MainNavigation/MainNavigation.js +1 -1
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +148 -120
- package/build/cjs/components/Notification/Notification.d.ts +1 -5
- package/build/cjs/components/Notification/Notification.js +1 -4
- package/build/cjs/components/NotificationBadge/NotificationBadge.d.ts +37 -30
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +1 -1
- package/build/cjs/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +3 -3
- package/build/cjs/components/RadioButton/RadioButton.d.ts +33 -17
- package/build/cjs/components/RadioButton/RadioButton.js +12 -57
- package/build/cjs/components/ReadMore/ReadMore.js +2 -7
- package/build/cjs/components/Ribbon/Ribbon.js +2 -2
- package/build/cjs/components/Search/Search.js +2 -1
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
- package/build/cjs/components/Selectbox/Selectbox.d.ts +102 -13
- package/build/cjs/components/Selectbox/Selectbox.js +40 -49
- package/build/cjs/components/Tabs/Tab.d.ts +37 -30
- package/build/cjs/components/Tabs/Tab.js +3 -2
- package/build/cjs/components/Tabs/Tabs.d.ts +40 -30
- package/build/cjs/components/Textarea/Textarea.js +4 -3
- package/build/cjs/components/Tooltip/Tooltip.d.ts +37 -30
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
- package/build/cjs/components/index.d.ts +3 -2
- package/build/cjs/index.js +2 -2
- package/build/cjs/themes/globalStyles.d.ts +174 -60
- package/build/cjs/themes/globalStyles.js +132 -142
- package/build/cjs/themes/styled.d.ts +259 -210
- package/build/cjs/themes/theme.d.ts +37 -30
- package/build/cjs/themes/themeComponents/buttons.d.ts +1 -6
- package/build/cjs/themes/themeComponents/buttons.js +1 -6
- package/build/cjs/themes/themeComponents/fontFamily.d.ts +3 -1
- package/build/cjs/themes/themeComponents/fontFamily.js +3 -1
- package/build/cjs/themes/themeComponents/fontSize.d.ts +18 -15
- package/build/cjs/themes/themeComponents/fontSize.js +20 -14
- package/build/cjs/themes/themeComponents/lineHeight.d.ts +19 -12
- package/build/cjs/themes/themeComponents/lineHeight.js +21 -11
- package/build/es/components/Accordion/Accordion.d.ts +27 -15
- package/build/es/components/Accordion/Accordion.js +29 -12
- package/build/es/components/Accordion/AccordionItem.d.ts +14 -29
- package/build/es/components/Accordion/AccordionItem.js +31 -54
- package/build/es/components/AmountSelector/AmountSelector.js +3 -4
- package/build/es/components/Buttons/ButtonBasicStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonBasicStyles.js +10 -14
- package/build/es/components/Buttons/ButtonDefault.js +6 -2
- package/build/es/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonIconStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonPrimary.js +6 -2
- package/build/es/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonSecondary.js +7 -3
- package/build/es/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonTertiary.js +7 -3
- package/build/es/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/CloseButton.d.ts +37 -30
- package/build/es/components/Card/Card.js +4 -2
- package/build/es/components/Card/CardRow.js +3 -3
- package/build/es/components/Checkbox/Checkbox.d.ts +38 -12
- package/build/es/components/Checkbox/Checkbox.js +39 -72
- package/build/es/components/DnaLogo/DnaLogo.d.ts +37 -40
- package/build/es/components/Footer/Components/FooterComponents.js +3 -2
- package/build/es/components/Helper/Helper.js +2 -1
- package/build/es/components/Icon/Icon.d.ts +39 -30
- package/build/es/components/Icon/Icons.d.ts +1 -4
- package/build/es/components/Icon/Icons.js +3 -7
- package/build/es/components/Input/Input.d.ts +102 -13
- package/build/es/components/Input/Input.js +57 -58
- package/build/es/components/Label/Label.js +2 -3
- package/build/es/components/LabelText/LabelText.d.ts +38 -30
- package/build/es/components/LabelText/LabelText.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +10 -4
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -5
- 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 +148 -120
- package/build/es/components/Notification/Notification.d.ts +1 -5
- package/build/es/components/Notification/Notification.js +1 -4
- package/build/es/components/NotificationBadge/NotificationBadge.d.ts +37 -30
- package/build/es/components/NotificationBadge/NotificationBadge.js +1 -1
- package/build/es/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
- package/build/es/components/ProgressIndicator/ProgressIndicator.js +3 -3
- package/build/es/components/RadioButton/RadioButton.d.ts +33 -17
- package/build/es/components/RadioButton/RadioButton.js +12 -57
- package/build/es/components/ReadMore/ReadMore.js +2 -7
- package/build/es/components/Ribbon/Ribbon.js +2 -2
- package/build/es/components/Search/Search.js +2 -1
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
- package/build/es/components/Selectbox/Selectbox.d.ts +102 -13
- package/build/es/components/Selectbox/Selectbox.js +40 -49
- package/build/es/components/Tabs/Tab.d.ts +37 -30
- package/build/es/components/Tabs/Tab.js +3 -2
- package/build/es/components/Tabs/Tabs.d.ts +40 -30
- package/build/es/components/Textarea/Textarea.js +4 -3
- package/build/es/components/Tooltip/Tooltip.d.ts +37 -30
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
- package/build/es/components/index.d.ts +3 -2
- package/build/es/index.js +1 -1
- package/build/es/themes/globalStyles.d.ts +174 -60
- package/build/es/themes/globalStyles.js +134 -145
- package/build/es/themes/styled.d.ts +259 -210
- package/build/es/themes/theme.d.ts +37 -30
- package/build/es/themes/themeComponents/buttons.d.ts +1 -6
- package/build/es/themes/themeComponents/buttons.js +1 -6
- package/build/es/themes/themeComponents/fontFamily.d.ts +3 -1
- package/build/es/themes/themeComponents/fontFamily.js +3 -1
- package/build/es/themes/themeComponents/fontSize.d.ts +18 -15
- package/build/es/themes/themeComponents/fontSize.js +20 -14
- package/build/es/themes/themeComponents/lineHeight.d.ts +19 -12
- package/build/es/themes/themeComponents/lineHeight.js +21 -11
- package/package.json +2 -2
- package/build/cjs/components/Accordion/index.d.ts +0 -2
- package/build/es/components/Accordion/index.d.ts +0 -2
|
@@ -12,12 +12,7 @@ declare const LoaderWrapper: import("styled-components").StyledComponent<"div",
|
|
|
12
12
|
};
|
|
13
13
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
14
14
|
button: {
|
|
15
|
-
|
|
16
|
-
buttonPadding: string;
|
|
17
|
-
smallButtonPadding: string;
|
|
18
|
-
buttonLineHeight: string;
|
|
19
|
-
buttonWidth: string;
|
|
20
|
-
buttonSmallWidth: string;
|
|
15
|
+
border: string;
|
|
21
16
|
};
|
|
22
17
|
color: {
|
|
23
18
|
black: string;
|
|
@@ -48,22 +43,27 @@ declare const LoaderWrapper: import("styled-components").StyledComponent<"div",
|
|
|
48
43
|
gray5: string;
|
|
49
44
|
};
|
|
50
45
|
fontFamily: {
|
|
51
|
-
|
|
46
|
+
default: string;
|
|
47
|
+
heading: string;
|
|
48
|
+
numerals: string;
|
|
52
49
|
};
|
|
53
50
|
fontSize: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
default: string;
|
|
52
|
+
xl: string;
|
|
53
|
+
l: string;
|
|
54
|
+
s: string;
|
|
55
|
+
xs: string;
|
|
56
|
+
h1XL: string;
|
|
57
|
+
h1L: string;
|
|
58
|
+
h1M: string;
|
|
59
|
+
h1S: string;
|
|
60
|
+
h2M: string;
|
|
61
|
+
h2S: string;
|
|
62
|
+
h3: string;
|
|
63
|
+
h4: string;
|
|
64
|
+
h5: string;
|
|
65
|
+
h1: string;
|
|
66
|
+
h2: string;
|
|
67
67
|
};
|
|
68
68
|
fontWeight: {
|
|
69
69
|
book: number;
|
|
@@ -79,16 +79,23 @@ declare const LoaderWrapper: import("styled-components").StyledComponent<"div",
|
|
|
79
79
|
gutter: string;
|
|
80
80
|
};
|
|
81
81
|
lineHeight: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
default: string;
|
|
83
|
+
xl: string;
|
|
84
|
+
s: string;
|
|
85
|
+
xs: string;
|
|
86
|
+
xxs: string;
|
|
87
|
+
auto: string;
|
|
88
|
+
h1XL: string;
|
|
89
|
+
h1L: string;
|
|
90
|
+
h1M: string;
|
|
91
|
+
h1S: string;
|
|
92
|
+
h2M: string;
|
|
93
|
+
h2S: string;
|
|
94
|
+
h3: string;
|
|
95
|
+
h4: string;
|
|
96
|
+
h5: string;
|
|
97
|
+
h1: string;
|
|
98
|
+
h2: string;
|
|
92
99
|
};
|
|
93
100
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
94
101
|
}, {}, never>;
|
|
@@ -105,12 +112,7 @@ declare const Pixel: import("styled-components").StyledComponent<"div", {
|
|
|
105
112
|
};
|
|
106
113
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
107
114
|
button: {
|
|
108
|
-
|
|
109
|
-
buttonPadding: string;
|
|
110
|
-
smallButtonPadding: string;
|
|
111
|
-
buttonLineHeight: string;
|
|
112
|
-
buttonWidth: string;
|
|
113
|
-
buttonSmallWidth: string;
|
|
115
|
+
border: string;
|
|
114
116
|
};
|
|
115
117
|
color: {
|
|
116
118
|
black: string;
|
|
@@ -141,22 +143,27 @@ declare const Pixel: import("styled-components").StyledComponent<"div", {
|
|
|
141
143
|
gray5: string;
|
|
142
144
|
};
|
|
143
145
|
fontFamily: {
|
|
144
|
-
|
|
146
|
+
default: string;
|
|
147
|
+
heading: string;
|
|
148
|
+
numerals: string;
|
|
145
149
|
};
|
|
146
150
|
fontSize: {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
default: string;
|
|
152
|
+
xl: string;
|
|
153
|
+
l: string;
|
|
154
|
+
s: string;
|
|
155
|
+
xs: string;
|
|
156
|
+
h1XL: string;
|
|
157
|
+
h1L: string;
|
|
158
|
+
h1M: string;
|
|
159
|
+
h1S: string;
|
|
160
|
+
h2M: string;
|
|
161
|
+
h2S: string;
|
|
162
|
+
h3: string;
|
|
163
|
+
h4: string;
|
|
164
|
+
h5: string;
|
|
165
|
+
h1: string;
|
|
166
|
+
h2: string;
|
|
160
167
|
};
|
|
161
168
|
fontWeight: {
|
|
162
169
|
book: number;
|
|
@@ -172,16 +179,23 @@ declare const Pixel: import("styled-components").StyledComponent<"div", {
|
|
|
172
179
|
gutter: string;
|
|
173
180
|
};
|
|
174
181
|
lineHeight: {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
default: string;
|
|
183
|
+
xl: string;
|
|
184
|
+
s: string;
|
|
185
|
+
xs: string;
|
|
186
|
+
xxs: string;
|
|
187
|
+
auto: string;
|
|
188
|
+
h1XL: string;
|
|
189
|
+
h1L: string;
|
|
190
|
+
h1M: string;
|
|
191
|
+
h1S: string;
|
|
192
|
+
h2M: string;
|
|
193
|
+
h2S: string;
|
|
194
|
+
h3: string;
|
|
195
|
+
h4: string;
|
|
196
|
+
h5: string;
|
|
197
|
+
h1: string;
|
|
198
|
+
h2: string;
|
|
185
199
|
};
|
|
186
200
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
187
201
|
}, LoaderProps, never>;
|
|
@@ -24,7 +24,7 @@ const ProgressBall = styled.span `
|
|
|
24
24
|
${({ theme }) => media.sm `
|
|
25
25
|
width: ${progressBallWidthLarge}rem;
|
|
26
26
|
height: ${progressBallWidthLarge}rem;
|
|
27
|
-
font-size: ${theme.fontSize.
|
|
27
|
+
font-size: ${theme.fontSize.l};
|
|
28
28
|
`};
|
|
29
29
|
|
|
30
30
|
svg {
|
|
@@ -51,7 +51,7 @@ const ProgressLine = styled.span `
|
|
|
51
51
|
`};
|
|
52
52
|
`;
|
|
53
53
|
const ProgressText = styled.span `
|
|
54
|
-
font-size: ${p => p.theme.fontSize.
|
|
54
|
+
font-size: ${p => p.theme.fontSize.s};
|
|
55
55
|
font-weight: ${p => p.theme.fontWeight.bold};
|
|
56
56
|
line-height: 1;
|
|
57
57
|
position: absolute;
|
|
@@ -74,7 +74,7 @@ const Progress = styled.ul `
|
|
|
74
74
|
${ProgressBall} {
|
|
75
75
|
width: ${p => (p && p.small ? progressBallWidthSmall : progressBallWidthLarge)}rem;
|
|
76
76
|
height: ${p => (p && p.small ? progressBallWidthSmall : progressBallWidthLarge)}rem;
|
|
77
|
-
font-size: ${p => p && p.small ? p.theme.fontSize.
|
|
77
|
+
font-size: ${p => (p && p.small ? p.theme.fontSize.s : p.theme.fontSize.l)};
|
|
78
78
|
|
|
79
79
|
svg {
|
|
80
80
|
height: ${p => (p && p.small ? iconSizeSmall : iconSizeLarge)}rem;
|
|
@@ -1,33 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
id
|
|
7
|
-
/**
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Unique ID for the input element
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Name of the input element
|
|
9
|
+
*/
|
|
8
10
|
name?: string;
|
|
9
|
-
/** Is radio selected */
|
|
10
11
|
/**
|
|
12
|
+
* Default value of input element
|
|
13
|
+
*
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
value?: string | number;
|
|
17
|
+
/**
|
|
18
|
+
* Text of the label shown next to radio button
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* On radio button change callback
|
|
23
|
+
*/
|
|
24
|
+
onChange?: (...args: any[]) => any;
|
|
25
|
+
/**
|
|
26
|
+
* Allows to set the radio button as checked
|
|
27
|
+
*
|
|
11
28
|
* @default false
|
|
12
29
|
*/
|
|
13
30
|
checked?: boolean;
|
|
14
|
-
/** Callback called when the radio changes */
|
|
15
|
-
onChange?: (...args: any[]) => any;
|
|
16
|
-
/** The label of the radio */
|
|
17
|
-
label?: string;
|
|
18
|
-
/** Disabled input */
|
|
19
31
|
/**
|
|
32
|
+
* Allows to disable the radio button
|
|
33
|
+
*
|
|
20
34
|
* @default false
|
|
21
35
|
*/
|
|
22
36
|
disabled?: boolean;
|
|
23
|
-
/** Value of the radio button */
|
|
24
37
|
/**
|
|
25
|
-
*
|
|
38
|
+
* Allows to pass a custom className
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Allows to pass testid string for testing purposes
|
|
26
43
|
*/
|
|
27
|
-
value?: string | number;
|
|
28
44
|
'data-testid'?: string;
|
|
29
45
|
}
|
|
30
46
|
/** @visibleName Radio Button */
|
|
31
|
-
declare const RadioButton:
|
|
47
|
+
declare const RadioButton: ({ "data-testid": dataTestId, ...props }: Props) => JSX.Element;
|
|
32
48
|
/** @component */
|
|
33
49
|
export default RadioButton;
|
|
@@ -1,70 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { CheckboxInput_RadioInput } from '../../themes/globalStyles.js';
|
|
2
3
|
import styled from '../../themes/styled.js';
|
|
3
4
|
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
position: relative;
|
|
6
|
+
const Container = styled.div `
|
|
7
7
|
margin-bottom: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
|
|
8
8
|
`;
|
|
9
|
-
const Input = styled(
|
|
10
|
-
|
|
11
|
-
left: -9999rem;
|
|
9
|
+
const Input = styled(CheckboxInput_RadioInput) `
|
|
10
|
+
border-radius: 50%;
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
content: "●";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:disabled {
|
|
21
|
-
pointer-events: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:disabled + label {
|
|
25
|
-
cursor: not-allowed;
|
|
26
|
-
color: ${props => props.theme.color.gray15};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:disabled + label::before {
|
|
30
|
-
border-color: ${props => props.theme.color.gray15};
|
|
31
|
-
background-color: ${props => props.theme.color.white};
|
|
32
|
-
border-color: ${props => props && props.checked ? props.theme.color.pink2 : props.theme.color.gray15};
|
|
33
|
-
color:
|
|
34
|
-
${props => props && props.checked ? props.theme.color.pink2 : props.theme.color.white};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
`;
|
|
40
|
-
const Label = styled('label') `
|
|
41
|
-
display: flex;
|
|
42
|
-
color: ${props => props.theme.color.text};
|
|
43
|
-
padding-left: ${props => getMultipliedSize(props.theme.base.baseWidth, 3)};
|
|
44
|
-
::before {
|
|
45
|
-
position: absolute;
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
box-sizing: border-box;
|
|
50
|
-
top: 0;
|
|
51
|
-
left: 0;
|
|
52
|
-
width: ${props => getMultipliedSize(props.theme.base.baseWidth, 2)};
|
|
53
|
-
height: ${props => getMultipliedSize(props.theme.base.baseHeight, 2)};
|
|
54
|
-
border: solid 2px ${props => props.theme.color.gray25};
|
|
55
|
-
font-size: ${props => props.theme.fontSize.defaultFontSize};
|
|
56
|
-
line-height: 1;
|
|
57
|
-
color: ${props => props.theme.color.white};
|
|
58
|
-
margin-right: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
59
|
-
border-radius: 1rem;
|
|
60
|
-
content: '●';
|
|
12
|
+
&::before {
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
width: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
15
|
+
height: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
61
16
|
}
|
|
62
17
|
`;
|
|
63
18
|
/** @visibleName Radio Button */
|
|
64
|
-
const RadioButton = ({
|
|
65
|
-
return (React.createElement(
|
|
66
|
-
React.createElement(Input, { id: id, type: "radio", name: name, checked: checked, "aria-checked": checked, value: value, disabled: disabled, onChange: onChange, tabIndex: -1, "data-testid": dataTestId && `${dataTestId}-input` }),
|
|
67
|
-
React.createElement(
|
|
19
|
+
const RadioButton = ({ 'data-testid': dataTestId, ...props }) => {
|
|
20
|
+
return (React.createElement(Container, { className: props.className, "data-testid": dataTestId },
|
|
21
|
+
React.createElement(Input, { id: props.id, type: "radio", name: props.name, checked: props.checked, "aria-checked": props.checked, value: props.value, disabled: props.disabled, onChange: props.onChange, tabIndex: -1, "data-testid": dataTestId && `${dataTestId}-input` }),
|
|
22
|
+
React.createElement("label", { htmlFor: props.id, "aria-checked": props.checked, role: "radio", tabIndex: 0, "data-testid": dataTestId && `${dataTestId}-label` }, props.label)));
|
|
68
23
|
};
|
|
69
24
|
|
|
70
25
|
export default RadioButton;
|
|
@@ -15,9 +15,6 @@ const Toggle = styled.div `
|
|
|
15
15
|
bottom: 0;
|
|
16
16
|
left: 0;
|
|
17
17
|
right: 0;
|
|
18
|
-
font-size: ${p => p.theme.fontSize.h4FontSize};
|
|
19
|
-
font-weight: ${p => p.theme.fontWeight.bold};
|
|
20
|
-
text-transform: uppercase;
|
|
21
18
|
cursor: ${p => (p && p.expanded ? 'auto' : 'pointer')};
|
|
22
19
|
background: linear-gradient(0deg, rgba(255, 255, 255, 1) 30%, rgba(255, 255, 255, 0) 100%);
|
|
23
20
|
padding-top: ${p => p && p.expanded
|
|
@@ -28,13 +25,11 @@ const Toggle = styled.div `
|
|
|
28
25
|
margin-right: ${p => getMultipliedSize(p.theme.base.baseWidth, 1)};
|
|
29
26
|
}
|
|
30
27
|
button {
|
|
31
|
-
text-transform: uppercase;
|
|
28
|
+
// text-transform: uppercase;
|
|
32
29
|
cursor: pointer;
|
|
33
30
|
background-color: transparent;
|
|
34
31
|
border: 0;
|
|
35
32
|
color: ${p => p.theme.color.hotPink};
|
|
36
|
-
font-size: ${p => p.theme.fontSize.h4FontSize};
|
|
37
|
-
font-weight: 700;
|
|
38
33
|
:focus {
|
|
39
34
|
outline: none;
|
|
40
35
|
text-decoration: underline;
|
|
@@ -58,7 +53,7 @@ const ReadMore = ({ children, showMoreText, showLessText, className, onClick = (
|
|
|
58
53
|
return (React.createElement(TruncateContainer, { expanded: expanded, className: className },
|
|
59
54
|
children,
|
|
60
55
|
React.createElement(Toggle, { expanded: expanded },
|
|
61
|
-
React.createElement("button", { onClick: toggleTruncate },
|
|
56
|
+
React.createElement("button", { className: "dnasg-label", onClick: toggleTruncate },
|
|
62
57
|
React.createElement(Icon, { name: iconName, size: "0.65em" }),
|
|
63
58
|
buttonText))));
|
|
64
59
|
};
|
|
@@ -41,8 +41,8 @@ const ContentWrapper = styled__default.div `
|
|
|
41
41
|
flex: 1;
|
|
42
42
|
font-weight: ${theme.fontWeight.book};
|
|
43
43
|
overflow: hidden;
|
|
44
|
-
font-size: ${theme.fontSize.
|
|
45
|
-
line-height:
|
|
44
|
+
font-size: ${theme.fontSize.default};
|
|
45
|
+
line-height: ${theme.lineHeight.default};
|
|
46
46
|
position: relative;
|
|
47
47
|
word-wrap: break-word;
|
|
48
48
|
margin-right: ${({ closeButton }) => closeButton ? getMultipliedSize(theme.base.baseWidth, 3) : 0};
|
|
@@ -16,7 +16,8 @@ const Container = styled.div `
|
|
|
16
16
|
const Input = styled.input `
|
|
17
17
|
flex: 1 0 auto;
|
|
18
18
|
border: 0;
|
|
19
|
-
font-size: ${props => props.theme.fontSize.
|
|
19
|
+
font-size: ${props => props.theme.fontSize.default};
|
|
20
|
+
line-height: ${props => props.theme.lineHeight.default};
|
|
20
21
|
color: ${props => props.theme.color.text};
|
|
21
22
|
-webkit-appearance: none;
|
|
22
23
|
&:placeholder {
|
|
@@ -8,7 +8,7 @@ import Icon from '../Icon/Icon.js';
|
|
|
8
8
|
const SecondaryNavigationWrapper = styled.nav `
|
|
9
9
|
line-height: 1.2rem;
|
|
10
10
|
padding: 0;
|
|
11
|
-
font-size: ${theme.fontSize.
|
|
11
|
+
font-size: ${theme.fontSize.s};
|
|
12
12
|
background: ${theme.color.white};
|
|
13
13
|
position: relative;
|
|
14
14
|
z-index: 1000;
|
|
@@ -99,7 +99,7 @@ const SecondaryNavigationListElement = styled.li `
|
|
|
99
99
|
border-bottom: ${p => p.isActive ? `2px solid ${theme.color.hotPink}` : `0px solid ${theme.color.white}`};
|
|
100
100
|
}
|
|
101
101
|
${p => media.xl `
|
|
102
|
-
font-size: ${p.theme.fontSize.
|
|
102
|
+
font-size: ${p.theme.fontSize.default};
|
|
103
103
|
margin: 0 1rem;
|
|
104
104
|
&:first-of-type {
|
|
105
105
|
margin-left: 0;
|
|
@@ -4,31 +4,120 @@ export interface SelectboxItem {
|
|
|
4
4
|
label: string;
|
|
5
5
|
value: any;
|
|
6
6
|
}
|
|
7
|
-
interface DropDownIndicator {
|
|
8
|
-
color?: string;
|
|
9
|
-
iconSize?: string;
|
|
10
|
-
}
|
|
11
7
|
interface Props {
|
|
8
|
+
/**
|
|
9
|
+
* Unique ID for the select element
|
|
10
|
+
*/
|
|
11
|
+
inputId: ReactSelectProps['inputId'];
|
|
12
|
+
/**
|
|
13
|
+
* Array of options that populate the select menu
|
|
14
|
+
*/
|
|
12
15
|
options: ReactSelectProps['options'];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Default value of select menu
|
|
18
|
+
*
|
|
19
|
+
* @default undefined
|
|
20
|
+
*/
|
|
21
|
+
value?: ReactSelectProps['value'];
|
|
22
|
+
/**
|
|
23
|
+
* Text of the select element label
|
|
24
|
+
*/
|
|
17
25
|
label?: string;
|
|
18
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Text of placeholder for the select value
|
|
28
|
+
*/
|
|
19
29
|
placeholder?: ReactSelectProps['placeholder'];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Text to display when there are no options
|
|
32
|
+
*/
|
|
23
33
|
noOptionsText?: string;
|
|
34
|
+
/**
|
|
35
|
+
* On select change callback
|
|
36
|
+
*/
|
|
37
|
+
onChange: (selectedItem: SelectboxItem) => void;
|
|
38
|
+
/**
|
|
39
|
+
* On input change callback
|
|
40
|
+
*/
|
|
41
|
+
onInputChange?: ReactSelectProps['onInputChange'];
|
|
42
|
+
/**
|
|
43
|
+
* Allows to attach selectbox options menu to specific HTML element
|
|
44
|
+
* Useful when used in modals
|
|
45
|
+
*
|
|
46
|
+
* @default selectbox-container
|
|
47
|
+
*/
|
|
48
|
+
menuPortalTarget?: ReactSelectProps['menuPortalTarget'];
|
|
49
|
+
/**
|
|
50
|
+
* Allows to place selectbox options menu above or below the selectbox control
|
|
51
|
+
*
|
|
52
|
+
* @default 'auto'
|
|
53
|
+
* @param {MenuPlacement} top Opens options menu above the control
|
|
54
|
+
* @param {MenuPlacement} bottom Opens options menu below the control
|
|
55
|
+
*/
|
|
56
|
+
menuPlacement?: ReactSelectProps['menuPlacement'];
|
|
57
|
+
/**
|
|
58
|
+
* Allows to define icon color and icon size of dropdown indicator
|
|
59
|
+
*
|
|
60
|
+
* @default color '#000000'
|
|
61
|
+
* @default iconSize '1rem'
|
|
62
|
+
*/
|
|
63
|
+
dropDownIndicator?: {
|
|
64
|
+
color?: string;
|
|
65
|
+
iconSize?: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Displayes loading indicator (PixelLoader) instead of selectbox
|
|
69
|
+
*
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
isLoading?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Allows to enable search functionality
|
|
75
|
+
*
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
24
78
|
isSearchable?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Allows to clear selected value
|
|
81
|
+
*
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
25
84
|
isClearable?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Allows to select multiple options
|
|
87
|
+
*
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
26
90
|
isMulti?: boolean;
|
|
27
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Allows to disable the component functionality
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
28
96
|
isDisabled?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Allows to set selectbox as mandatory
|
|
99
|
+
*
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
29
102
|
isRequired?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Allows to set selectbox to error state
|
|
105
|
+
*
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
30
108
|
error?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Text of the error message when selectbox is in error state
|
|
111
|
+
*/
|
|
31
112
|
errorMessage?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Allows to pass a custom className
|
|
115
|
+
*/
|
|
116
|
+
className?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Allows to pass testid string for testing purposes
|
|
119
|
+
*/
|
|
120
|
+
'data-testid'?: string;
|
|
32
121
|
}
|
|
33
122
|
declare const SelectBox: ({ dropDownIndicator, "data-testid": dataTestId, isSearchable, isClearable, isMulti, noOptionsText, isLoading, isDisabled, isRequired, error, ...props }: Props) => JSX.Element;
|
|
34
123
|
export default SelectBox;
|