@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
|
@@ -126,12 +126,6 @@ const digibox = ({ size, color, ...props }) => (React.createElement("svg", Objec
|
|
|
126
126
|
React.createElement("path", { d: "M.714 39.5h114.901V0H.715v39.5zM7.257 6.6h101.914V33H7.257V6.6zm88.53 8.8c-2.379 0-4.362 2-4.362 4.4 0 2.5 1.884 4.5 4.363 4.5 2.478 0 4.46-1.9 4.46-4.4v-.1c-.098-2.4-2.081-4.4-4.46-4.4z", fillRule: "evenodd" })));
|
|
127
127
|
const digiboxRec = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 116 40", fill: color, width: size, height: size }, props),
|
|
128
128
|
React.createElement("path", { d: "M.286 39.5h114.9V0H.287v39.5zm6.444-33h102.112v26.4H6.73V6.5zm88.629 8.7c-2.38 0-4.362 2-4.362 4.4 0 2.4 1.884 4.4 4.263 4.4h.198c2.38 0 4.362-2 4.362-4.4-.099-2.4-2.082-4.3-4.461-4.4zm-69.297 1.4c0-2.4-1.884-4.3-4.263-4.3h-5.651v13.9h3.073V21h1.09l2.479 5.2h3.47l-2.875-5.6c1.685-.6 2.776-2.2 2.677-4zm-5.056 1.8H19.22V15h1.785c1.288 0 1.982.6 1.982 1.7 0 1-.793 1.7-1.784 1.7h-.198zm9.814 2.1h5.155v-2.6H30.82v-2.6h5.552v-3h-8.724v13.9h8.823v-3h-5.75c.1 0 .1-2.7.1-2.7zm14.078 2.9c-2.28 0-4.164-1.8-4.263-4.1-.1-2.3 1.784-4.2 4.065-4.3 1.685-.2 3.172.9 3.568 2.5l2.875-.8c-.495-2-2.28-4.7-6.443-4.7-3.966 0-7.138 3.3-7.04 7.3.1 4 3.272 7.2 7.238 7.1 3.073.2 5.75-1.8 6.543-4.8l-2.974-.8a3.447 3.447 0 0 1-3.57 2.6z", fillRule: "evenodd" })));
|
|
129
|
-
/**
|
|
130
|
-
* @deprecated
|
|
131
|
-
*/
|
|
132
|
-
const dna = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "-185 277 240 240", fill: color, width: size, height: size }, props),
|
|
133
|
-
React.createElement("path", { d: "M-185.2 277v240H55V277h-240.2zm81.6 136.6c0 14.3-11.4 25.7-25.4 25.7h-25.4v-85h25.4c14 0 25.4 11.4 25.4 25.7v33.6zm63.6 25.7h-15.2v-59.6c0-5.8-4.4-10.2-10.2-10.2h-10.5v69.8h-14.9v-85h25.4c14 0 25.4 11.4 25.4 25.4v59.6zm64.6 0H9.4V409h-20.7v30.4h-15.2v-60.1c0-14 11.4-25.4 25.4-25.4h.3c14 0 25.4 11.4 25.4 25.4v60z" }),
|
|
134
|
-
React.createElement("path", { d: "M-.8 369h-.3c-5.8 0-10.2 4.7-10.2 10.2v15.5H9.4v-15.5c0-5.6-4.7-10.2-10.2-10.2zm-128 .6h-10.8v54.6h10.8c5.6 0 10.2-4.7 10.2-10.2v-34.2c.1-5.9-4.6-10.2-10.2-10.2z" })));
|
|
135
129
|
const dnaTurvapaketti = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 78 102", fill: color, width: size, height: size }, props),
|
|
136
130
|
React.createElement("path", { d: "M65.9 11.4V0H0v90.2h11.5v11.4h66V11.4H65.9zM11.5 84.5H5.6V5.8h54.5v5.6H11.5v73.1zM45.2 78l-.7.2-.7-.2C26 71 26.5 60.5 26.5 59.4V38.6H29c2.4.1 4.8-.3 7.1-1.1 2.8-1 5.2-2.8 6.8-5.2l.5-.6h2l.5.6c1.8 2.4 4.2 4.2 7 5.2 2.3.8 4.7 1.1 7.1 1.1h2.5v20.8c0 1.1.5 11.6-17.3 18.6z", fillRule: "evenodd" })));
|
|
137
131
|
const dnaTv = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 105 72", fill: color, width: size, height: size }, props),
|
|
@@ -424,6 +418,8 @@ const thumbUp = ({ size, color, ...props }) => (React.createElement("svg", Objec
|
|
|
424
418
|
React.createElement("path", { d: "M30.642 36.214v48.335H0V36.214h30.642zM5.572 78.978H25.07V41.785H5.57v37.193zm82.5-49.435c7.692 0 13.928 6.236 13.928 13.928 0 1.42-.217 2.833-.645 4.189L90.123 83.279a11.143 11.143 0 0 1-10.626 7.792H63.744l-30.316-9.406V37.877l17.715-16.439a8.357 8.357 0 0 0 2.673-6.126v-4.17C53.816 4.99 58.804 0 64.958 0h.342c6.154 0 11.143 4.989 11.143 11.143v18.4h11.629zM38.999 77.56l25.59 7.94h14.908a5.571 5.571 0 0 0 5.313-3.896l11.232-35.62a8.357 8.357 0 0 0-7.97-10.87h-17.2V11.143A5.571 5.571 0 0 0 65.3 5.57h-.342a5.571 5.571 0 0 0-5.571 5.572v4.17c0 3.874-1.614 7.573-4.454 10.209L38.999 40.307V77.56zm-23.678-5.133a4.178 4.178 0 1 1 0-8.357 4.178 4.178 0 0 1 0 8.357z" })));
|
|
425
419
|
const tickets = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 99 100", fill: color, width: size, height: size }, props),
|
|
426
420
|
React.createElement("path", { d: "M76.329 5.9L49.005 7.3 46.233 0 0 18.2l29.898 77.4 10.197-4.1 43.56 7.9 14.652-81.7-21.483-4-.495-7.8zm-68.013 16l18.81-7.4 3.564 65L8.316 21.9zm28.71 56.7L33.66 14.7l11.187-.6 3.762-.2-1.188 7-10.395 57.7zM90.882 23L82.17 71.5l-2.277-.4-1.881-.4-1.188 6.5 3.465.6.693.1-.594 3.4-1.287 7.6-.594 3-12.375-2.3L51.678 87l-9.306-1.7.099-1 .198-.8 2.178-12.1 3.069.6 1.089-6.5-2.97-.6 5.841-32.4 2.178-12.2.693-3.8 15.939 2.9 6.534 1.2L90.882 23zM50.688 72.5l5.94 1.1 1.188-6.5-5.94-1.1-1.188 6.5zm9.9-4.8L59.4 74l4.95 1 1.089.1.099-.6.693-4.6.198-1.2-.693-.2-5.148-.8zm7.623 7.9l5.544 1.1h.396l.594-3.1.594-3.2-1.881-.4h-.198l-3.96-.7-1.089 6.3z", fillRule: "evenodd" })));
|
|
421
|
+
const tiktok = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: color, width: size, height: size }, props),
|
|
422
|
+
React.createElement("path", { d: "M22.4442 5.93598C16.3531 5.35403 16.4695 0 16.4695 0H12.5419V16.9081C12.4429 18.7164 10.9478 20.1319 9.13677 20.1319C7.25334 20.1319 5.72652 18.6051 5.72652 16.7216C5.72652 14.8382 7.25334 13.3114 9.13677 13.3114C9.53425 13.3114 9.92868 13.3809 10.3022 13.5167L10.3408 9.05258C9.92504 8.98209 9.50412 8.94665 9.08246 8.94665C4.92559 8.94665 1.55579 12.3165 1.55579 16.4733C1.55579 20.6302 4.92559 24 9.08246 24C13.0974 24 16.4055 20.8487 16.6003 16.8385V8.03104C16.6003 8.03104 18.7585 9.89331 22.4442 9.97091V5.93598Z" })));
|
|
427
423
|
const top10 = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 72 73", fill: color, width: size, height: size }, props),
|
|
428
424
|
React.createElement("path", { d: "M.6 72.1h71.112V0H.6v72.1zM7.11 6.6h58.093v59H7.11v-59zm21.402 13.7H15.69v3.2h4.735v12.1h3.353V23.5h4.734v-3.2zM36.205 36c4.34 0 7.89-3.6 7.89-8s-3.55-8-7.89-8-7.89 3.6-7.89 8c-.099 4.3 3.255 7.9 7.496 8h.394zm0-12.7c2.565-.1 4.735 1.8 4.833 4.4.099 2.6-1.775 4.8-4.34 4.9-2.564.1-4.734-1.8-4.832-4.4V28c-.198-2.4 1.578-4.5 3.945-4.7h.394zm15.09-3h-5.818v15.4h3.452v-5.5h2.367c3.057 0 5.227-2 5.227-4.9 0-2.9-2.17-5-5.227-5zm-.394 6.8H48.93v-3.8h1.97c1.085-.1 1.973.6 2.072 1.7.098 1.1-.592 2-1.677 2.1H50.9zM24.863 42.2v2.3h3.353v9.2h3.452V39.6H28.71c-.296 1.4-1.677 2.6-3.847 2.6zm13.71-3c-1.874-.1-3.748.9-4.735 2.5a8.61 8.61 0 0 0-1.183 4.9c-.099 1.8.296 3.5 1.183 5a5.86 5.86 0 0 0 4.735 2.4c1.874.1 3.649-.8 4.734-2.4.986-1.5 1.38-3.3 1.282-5 .099-1.7-.394-3.5-1.282-4.9a5.233 5.233 0 0 0-4.734-2.5zm2.17 10.6c-.395.8-1.283 1.3-2.17 1.3-.888 0-1.677-.5-1.973-1.3-.395-1-.493-2.1-.493-3.1s.098-2 .493-3c.296-.8 1.085-1.4 1.973-1.3.887 0 1.775.5 2.17 1.3.394 1 .493 2 .493 3s-.198 2.1-.494 3.1z", fillRule: "evenodd" })));
|
|
429
425
|
const top50 = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 72 73", fill: color, width: size, height: size }, props),
|
|
@@ -779,4 +775,4 @@ const hlWifi = ({ size, color, ...props }) => (React.createElement("svg", Object
|
|
|
779
775
|
const hlX = ({ size, color, ...props }) => (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: color, width: size, height: size }, props),
|
|
780
776
|
React.createElement("path", { d: "M12.85 12l7.38-7.38a.6.6 0 0 0-.85-.85L12 11.15 4.62 3.78a.6.6 0 0 0-.85.85L11.15 12l-7.37 7.38a.6.6 0 1 0 .85.85L12 12.85l7.38 7.38a.6.6 0 0 0 .85-.85z" })));
|
|
781
777
|
|
|
782
|
-
export { action, airplane, anime, antenna, apartmentBuilding1, apartmentBuilding2, apartmentBuilding3, arrows, backward, balloon, basket, book, briefcase, broadbandHome, broadbandHousing, broadbandMobile, browser, bus, cableTv, calculator, calendar1, calendar2, camera, channelPackageL, channelPackageM, channelPackageMix, channelPackageMix4, channelPackageMix8, channelPackageMixPlus, channelPackageNorra, channelPackageRossija, channelPackageS, channelPackageTurk, check, chevronDown, chevronLeft, chevronRight, chevronUp, clapperboard, clipboard, cloud1, cloud2, cogwheel, comedy, cultFilms, culture, curvedArrowLeft, curvedArrowRight, cycle, desktopComputer, devices, diamond, digibox, digiboxRec,
|
|
778
|
+
export { action, airplane, anime, antenna, apartmentBuilding1, apartmentBuilding2, apartmentBuilding3, arrows, backward, balloon, basket, book, briefcase, broadbandHome, broadbandHousing, broadbandMobile, browser, bus, cableTv, calculator, calendar1, calendar2, camera, channelPackageL, channelPackageM, channelPackageMix, channelPackageMix4, channelPackageMix8, channelPackageMixPlus, channelPackageNorra, channelPackageRossija, channelPackageS, channelPackageTurk, check, chevronDown, chevronLeft, chevronRight, chevronUp, clapperboard, clipboard, cloud1, cloud2, cogwheel, comedy, cultFilms, culture, curvedArrowLeft, curvedArrowRight, cycle, desktopComputer, devices, diamond, digibox, digiboxRec, dnaTurvapaketti, dnaTv, document1, document2, document3, documentaries, documents1, documents2, door, download, drama, dvbC, dvbT2, dwr, envelope1, envelope2, epg, error, ethernet, eu, euro, exclamationMark, eyeClosed, eyeOpen, facebook, favorites, finland, finnish, folder1, folder2, folder3, forward, fourG, gameConsole, gift, gift2, globe, google, graduation, graph, hardDrive, hd, hdmiCable, headset1, headset2, hl404, hl4gSim, hl5gSim, hlArrowBack, hlArrowForward, hlArrowSmallLeft, hlArrowSmallRight, hlArrowSmallUnder, hlBattery, hlBell, hlCalendar, hlCalendarSmall, hlCall, hlCameraBack, hlCameraFront, hlCart, hlCartEmpty, hlChat, hlCheck, hlChevronDown, hlChevronLeft, hlChevronRight, hlChevronUp, hlClockSmall, hlCompensation, hlCookie, hlCopy, hlCoupon, hlDisplaySize, hlDocument, hlDownload, hlDownloadSmall, hlEnvelope, hlError, hlEuro, hlExpand, hlExternal, hlEyeClosed, hlEyeOpen, hlFaceId, hlFingerprint, hlGlobe, hlHeadphones, hlHeadset, hlHeart, hlHome, hlImage, hlInfo, hlInstallment, hlIotSim, hlLock, hlMagnifyingGlass, hlMarker, hlMemory, hlMenu, hlMinimize, hlMinus, hlMobileData, hlMobilePayment, hlModem, hlMore, hlOs, hlPackage, hlPaperclip, hlPaytime, hlPen, hlPerson, hlPhone, hlPlus, hlPrepaid, hlProcessor, hlServices, hlSettings, hlShield, hlSim, hlSimSimple, hlSmile, hlSpeechBubble, hlSquaretrade, hlStar, hlStarFilled, hlTrash, hlTv, hlUnlock, hlUpload, hlUploadSmall, hlWarning, hlWifi, hlX, hobbies, hotdog, house, hub, idCard, info, instagram, iot1, iot2, iot3, ip, key, kids, laptop, leaf, linkedin, magnifyingGlass, man1, man2, man3, man4, man5, marker, maximize, megaphone, minimize, minus, modem, molecule, money1, money2, mouse, mp3, music, newspaper, next, paperclip, pause, pdf, pen, person, person2, persons1, persons2, persons3, pg18, phone1, phone2, phonePrepaid, phonePrepaid4g, phoneWifiPrepaid, play, plus, power, previous, projector, radioMast, rec, rec2, remoteControl, romantic, router, rss, scale, shield, simCard1, simCard2, simCard4g, simCard4gWifi, simCardInfinity, simCardInfinity4g, simCardWifi, soda, speaker, speechBubble1, speechBubble2, speechBubble3, sports, star, stop, swedish, tablet, target, terrestialTv, thriller, thumbDown, thumbUp, tickets, tiktok, top10, top50, trademark, trafficCone, trafficLights, train, tv1, tv2, tvCard, tvWithRecording, tvWithRemote1, tvWithRemote2, tvWithRemote3, tvWithRemote4, twitter, upgrade, upload, usb, usbCable, usbModem, van, videocamera, wall, warning, whatsapp, wifi1, wifi2, wifiAccessPoint, woman1, woman2, woman3, world, wrench1, wrench2, x, youtube };
|
|
@@ -1,34 +1,123 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type ComponentStatus = 'none' | 'success' | 'error' | 'comment';
|
|
3
|
+
declare type InputType = 'date' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'range' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
4
|
+
interface Props {
|
|
5
|
+
/**
|
|
6
|
+
* Unique ID for the input element
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Name of the input element
|
|
11
|
+
*/
|
|
4
12
|
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Type of input element
|
|
15
|
+
*
|
|
16
|
+
* @default 'text'
|
|
17
|
+
* @param {InputType} date Used for entering a date (year, month and day)
|
|
18
|
+
* @param {InputType} email Used for entering an email address and supported with browser validation
|
|
19
|
+
* @param {InputType} hidden Input element is not displayed but its value is submitted with form regardless
|
|
20
|
+
* @param {InputType} month Used for entering a month and year, with no time zone
|
|
21
|
+
* @param {InputType} number Used for entering a number, it displays arrows and might have browser validation
|
|
22
|
+
* @param {InputType} password Used for entering value which is obscured for view
|
|
23
|
+
* @param {InputType} range Used for entering a not number by displaying a range widget
|
|
24
|
+
* @param {InputType} search Used for entering search strings
|
|
25
|
+
* @param {InputType} tel Used for entering a telephone number
|
|
26
|
+
* @param {InputType} text Single-line text field
|
|
27
|
+
* @param {InputType} time Used for entering a time value with no time zone
|
|
28
|
+
* @param {InputType} url Used for entering a URL and supported with browser validation
|
|
29
|
+
* @param {InputType} week Used for entering a week (week-year number and a week number with no time zone)
|
|
30
|
+
*/
|
|
31
|
+
type?: InputType;
|
|
32
|
+
/**
|
|
33
|
+
* Default value of input element
|
|
34
|
+
*/
|
|
5
35
|
value?: string | number;
|
|
36
|
+
/**
|
|
37
|
+
* Text of the input element label
|
|
38
|
+
*/
|
|
39
|
+
label?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Text of placeholder for the input value
|
|
42
|
+
*/
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Integer attribute indicating the sequence of keyboard navigation
|
|
46
|
+
*/
|
|
47
|
+
tabIndex?: number;
|
|
48
|
+
/**
|
|
49
|
+
* On input change callback
|
|
50
|
+
*/
|
|
51
|
+
onChange?: (...args: any[]) => any;
|
|
52
|
+
/**
|
|
53
|
+
* On input blur callback
|
|
54
|
+
*/
|
|
6
55
|
onBlur?: (...args: any[]) => any;
|
|
56
|
+
/**
|
|
57
|
+
* On input focus callback
|
|
58
|
+
*/
|
|
7
59
|
onFocus?: (...args: any[]) => any;
|
|
8
|
-
|
|
60
|
+
/**
|
|
61
|
+
* On input key press callback
|
|
62
|
+
*/
|
|
9
63
|
onKeyPress?: (...args: any[]) => any;
|
|
64
|
+
/**
|
|
65
|
+
* On input key down callback
|
|
66
|
+
*/
|
|
10
67
|
onKeyDown?: (...args: any[]) => any;
|
|
11
68
|
/**
|
|
12
|
-
*
|
|
69
|
+
* Allows user to change type of input between "password" and "text"
|
|
70
|
+
* When set to true, value of type property is ignored
|
|
71
|
+
*
|
|
72
|
+
* @default false
|
|
13
73
|
*/
|
|
14
|
-
|
|
74
|
+
showPasswordToggle?: boolean;
|
|
15
75
|
/**
|
|
16
|
-
*
|
|
76
|
+
* Allows to define space separated string to describe type of autocomplete functionality the input should provide
|
|
77
|
+
* Use "off" to disable built-in browser autocomplete functionality
|
|
78
|
+
*
|
|
79
|
+
* For possible values refer to e.g.: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
80
|
+
*/
|
|
81
|
+
autocomplete?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Allows to disable the component functionality
|
|
84
|
+
*
|
|
85
|
+
* @default false
|
|
17
86
|
*/
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
id?: string;
|
|
20
|
-
required?: boolean;
|
|
21
87
|
disabled?: boolean;
|
|
22
|
-
showPasswordToggle?: boolean;
|
|
23
|
-
tabIndex?: number;
|
|
24
88
|
/**
|
|
89
|
+
* Allows to set input as mandatory
|
|
90
|
+
*
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
required?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Depending on the passed status, the styling and additional elements are shown
|
|
96
|
+
*
|
|
25
97
|
* @default 'none'
|
|
98
|
+
* @param {ComponentStatus} none No specific styling
|
|
99
|
+
* @param {ComponentStatus} success Displays #e80c0c color code as bottom line color of input
|
|
100
|
+
* @param {ComponentStatus} error Displays #ff7800 color code as bottom line color of input and error message underneath the input
|
|
101
|
+
* @param {ComponentStatus} comment Displays comment message underneath the input
|
|
102
|
+
*/
|
|
103
|
+
status?: ComponentStatus;
|
|
104
|
+
/**
|
|
105
|
+
* Text of the error message when input is in error state
|
|
26
106
|
*/
|
|
27
|
-
status?: string;
|
|
28
107
|
errorMessage?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Text of the comment message when input is in comment state
|
|
110
|
+
*/
|
|
29
111
|
commentMessage?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Allows to pass a custom className
|
|
114
|
+
*/
|
|
115
|
+
className?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Allows to pass testid string for testing purposes
|
|
118
|
+
*/
|
|
30
119
|
'data-testid'?: string;
|
|
31
120
|
}
|
|
32
|
-
declare const Input: React.FunctionComponent<
|
|
121
|
+
declare const Input: React.FunctionComponent<Props>;
|
|
33
122
|
/** @component */
|
|
34
123
|
export default Input;
|
|
@@ -4,101 +4,101 @@ import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
|
4
4
|
import Icon from '../Icon/Icon.js';
|
|
5
5
|
import { LabelText } from '../LabelText/LabelText.js';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const FieldContainer = styled.div `
|
|
8
|
+
color: ${props => (props.disabled ? props.theme.color.gray40 : props.theme.color.text)};
|
|
9
|
+
margin-bottom: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
10
|
+
|
|
11
|
+
${LabelText} {
|
|
12
|
+
color: ${props => {
|
|
13
|
+
if (props.status === 'error') {
|
|
14
|
+
return props.theme.color[props.status];
|
|
15
|
+
}
|
|
16
|
+
}};
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
const FieldWrapper = styled.div `
|
|
20
|
+
position: relative;
|
|
21
|
+
border-bottom: 3px solid
|
|
22
|
+
${props => props.status === 'success' || props.status === 'error'
|
|
23
|
+
? props.theme.color[props.status]
|
|
24
|
+
: 'transparent'};
|
|
25
|
+
|
|
26
|
+
& svg {
|
|
27
|
+
color: ${props => props.theme.color.gray55};
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: 1;
|
|
30
|
+
top: 0;
|
|
31
|
+
right: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
32
|
+
height: ${props => getMultipliedSize(props.theme.base.baseHeight, 4)};
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const Mandatory = styled.span `
|
|
36
|
+
color: ${props => props.theme.color.hotPink};
|
|
37
|
+
`;
|
|
38
|
+
const StyledInput = styled.input `
|
|
8
39
|
position: relative;
|
|
9
40
|
display: inline-block;
|
|
10
41
|
vertical-align: middle;
|
|
11
42
|
padding: 0 ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
12
|
-
font-size: ${props => props.theme.fontSize.
|
|
43
|
+
font-size: ${props => props.theme.fontSize.default};
|
|
13
44
|
width: 100%;
|
|
14
45
|
height: ${props => getMultipliedSize(props.theme.base.baseHeight, 4)};
|
|
15
46
|
border: 1px solid ${props => props.theme.color.gray15};
|
|
47
|
+
|
|
16
48
|
&::-ms-clear,
|
|
17
49
|
&::-ms-reveal {
|
|
18
50
|
display: none;
|
|
19
51
|
}
|
|
52
|
+
|
|
20
53
|
&:disabled,
|
|
21
54
|
&[disabled] {
|
|
22
55
|
background-color: ${props => props.theme.color.gray5};
|
|
23
56
|
color: ${props => props.theme.color.gray40};
|
|
24
57
|
}
|
|
58
|
+
|
|
25
59
|
&:focus {
|
|
26
60
|
outline: 0;
|
|
27
61
|
box-shadow: 0 0 5px ${props => props.theme.color.gray25};
|
|
28
62
|
}
|
|
63
|
+
|
|
29
64
|
&:invalid {
|
|
30
65
|
box-shadow: none;
|
|
31
66
|
}
|
|
67
|
+
|
|
32
68
|
&:placeholder {
|
|
33
69
|
color: ${props => props.theme.color.gray25};
|
|
34
70
|
}
|
|
35
71
|
`;
|
|
36
|
-
const Mandatory = styled.span `
|
|
37
|
-
color: ${props => props.theme.color.hotPink};
|
|
38
|
-
`;
|
|
39
|
-
const FieldWrapper = styled.div `
|
|
40
|
-
position: relative;
|
|
41
|
-
svg {
|
|
42
|
-
color: ${props => props.theme.color.gray55};
|
|
43
|
-
position: absolute;
|
|
44
|
-
z-index: 1;
|
|
45
|
-
top: 0;
|
|
46
|
-
right: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
47
|
-
height: ${props => getMultipliedSize(props.theme.base.baseHeight, 4)};
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
const FieldContainer = styled.div `
|
|
51
|
-
color: ${props => props && props.disabled ? props.theme.color.gray40 : props.theme.color.text};
|
|
52
|
-
margin-bottom: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
|
|
53
|
-
|
|
54
|
-
${FieldWrapper} {
|
|
55
|
-
border-bottom: 3px solid;
|
|
56
|
-
border-color: ${props => {
|
|
57
|
-
if (props.status === 'success' || props.status === 'error') {
|
|
58
|
-
return props.theme.color[props.status];
|
|
59
|
-
}
|
|
60
|
-
return 'transparent';
|
|
61
|
-
}};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
${LabelText} {
|
|
65
|
-
color: ${props => {
|
|
66
|
-
if (props.status === 'error') {
|
|
67
|
-
return props.theme.color[props.status];
|
|
68
|
-
}
|
|
69
|
-
}}
|
|
70
|
-
`;
|
|
71
72
|
const ErrorMessage = styled.div `
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
font-size: ${props => props.theme.fontSize.s};
|
|
74
|
+
line-height: ${props => props.theme.lineHeight.s};
|
|
74
75
|
color: ${props => props.theme.color.error};
|
|
75
76
|
margin-top: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
|
|
76
77
|
`;
|
|
77
78
|
const CommentMessage = styled(ErrorMessage) `
|
|
78
79
|
color: ${props => props.theme.color.gray40};
|
|
79
80
|
`;
|
|
80
|
-
const Input = ({
|
|
81
|
-
const inputId = id || name;
|
|
81
|
+
const Input = ({ type = 'text', status = 'none', 'data-testid': dataTestId, ...props }) => {
|
|
82
82
|
const inputRef = React.useRef(null);
|
|
83
83
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
84
84
|
React.useEffect(() => {
|
|
85
|
-
if (showPasswordToggle && inputRef && inputRef.current) {
|
|
85
|
+
if (props.showPasswordToggle && inputRef && inputRef.current) {
|
|
86
86
|
inputRef.current.type = showPassword ? 'text' : 'password';
|
|
87
87
|
}
|
|
88
|
-
}, [showPassword, showPasswordToggle]);
|
|
88
|
+
}, [showPassword, props.showPasswordToggle]);
|
|
89
89
|
const togglePasswordVisibility = () => {
|
|
90
|
-
if (showPasswordToggle) {
|
|
90
|
+
if (props.showPasswordToggle) {
|
|
91
91
|
setShowPassword(!showPassword);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
const handleOnBlur = (e) => {
|
|
95
|
-
if (onBlur) {
|
|
96
|
-
onBlur(e.target.value, e);
|
|
95
|
+
if (props.onBlur) {
|
|
96
|
+
props.onBlur(e.target.value, e);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
const handleChange = (e) => {
|
|
100
|
-
if (onChange) {
|
|
101
|
-
onChange(e.target.value, e);
|
|
100
|
+
if (props.onChange) {
|
|
101
|
+
props.onChange(e.target.value, e);
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
const onClick = (e) => {
|
|
@@ -107,17 +107,16 @@ const Input = ({ id, label, name, required, disabled = false, type, onBlur, onFo
|
|
|
107
107
|
inputRef.current.focus();
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
label,
|
|
110
|
+
return (React.createElement(FieldContainer, { className: props.className, disabled: props.disabled, status: status },
|
|
111
|
+
props.label && (React.createElement(LabelText, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label` },
|
|
112
|
+
props.label,
|
|
114
113
|
" ",
|
|
115
|
-
required && React.createElement(Mandatory, null, "*"))),
|
|
116
|
-
React.createElement(FieldWrapper,
|
|
117
|
-
|
|
118
|
-
showPasswordToggle && (React.createElement(Icon, { onClick: togglePasswordVisibility, name: showPassword ? 'hlEyeOpen' : 'hlEyeClosed', size: "1.6em" }))),
|
|
119
|
-
status === 'error' && errorMessage && (React.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, errorMessage)),
|
|
120
|
-
status === 'comment' && commentMessage && (React.createElement(CommentMessage, { "data-testid": dataTestId && `${dataTestId}-comment` }, commentMessage))));
|
|
114
|
+
props.required && React.createElement(Mandatory, null, "*"))),
|
|
115
|
+
React.createElement(FieldWrapper, { status: status },
|
|
116
|
+
React.createElement(StyledInput, { id: props.id, name: props.name, type: type, value: props.value, placeholder: props.placeholder, onChange: handleChange, onBlur: handleOnBlur, onFocus: props.onFocus, onClick: onClick, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, required: props.required, disabled: props.disabled, autoComplete: props.autocomplete, "aria-disabled": props.disabled, "aria-label": props.id, ref: inputRef, tabIndex: props.tabIndex, "data-testid": dataTestId }),
|
|
117
|
+
props.showPasswordToggle && (React.createElement(Icon, { onClick: togglePasswordVisibility, name: showPassword ? 'hlEyeOpen' : 'hlEyeClosed', size: "1.6em" }))),
|
|
118
|
+
status === 'error' && props.errorMessage && (React.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage)),
|
|
119
|
+
status === 'comment' && props.commentMessage && (React.createElement(CommentMessage, { "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage))));
|
|
121
120
|
};
|
|
122
121
|
|
|
123
122
|
export default Input;
|
|
@@ -7,9 +7,8 @@ const LabelStyle = styled.span `
|
|
|
7
7
|
min-width: 4.375rem;
|
|
8
8
|
text-align: center;
|
|
9
9
|
font-weight: ${props => props.theme.fontWeight.bold};
|
|
10
|
-
font-size: ${props => props.smallerFont
|
|
11
|
-
|
|
12
|
-
: props.theme.fontSize.extraSmallFontSize};
|
|
10
|
+
font-size: ${props => (props.smallerFont ? props.theme.fontSize.xs : '0.8125rem')};
|
|
11
|
+
line-height: ${props => props.theme.lineHeight.xxs};
|
|
13
12
|
text-transform: uppercase;
|
|
14
13
|
color: ${props => props && props.color === 'white' ? props.theme.color.black : props.theme.color.white};
|
|
15
14
|
background: ${props => props.theme.color[props.color]};
|
|
@@ -12,12 +12,7 @@ export declare const LabelText: import("styled-components").StyledComponent<"lab
|
|
|
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 @@ export declare const LabelText: import("styled-components").StyledComponent<"lab
|
|
|
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,24 @@ export declare const LabelText: import("styled-components").StyledComponent<"lab
|
|
|
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
|
+
/** @visibleName Label Text */
|
|
86
|
+
xs: string;
|
|
87
|
+
xxs: string;
|
|
88
|
+
auto: string;
|
|
89
|
+
h1XL: string;
|
|
90
|
+
h1L: string;
|
|
91
|
+
h1M: string;
|
|
92
|
+
h1S: string;
|
|
93
|
+
h2M: string;
|
|
94
|
+
h2S: string;
|
|
95
|
+
h3: string;
|
|
96
|
+
h4: string;
|
|
97
|
+
h5: string;
|
|
98
|
+
h1: string;
|
|
99
|
+
h2: string;
|
|
92
100
|
};
|
|
93
101
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
94
102
|
}, {}, never>;
|
|
@@ -3,7 +3,7 @@ import { getDividedSize } from '../../utils/styledUtils.js';
|
|
|
3
3
|
|
|
4
4
|
/** @visibleName Label Text */
|
|
5
5
|
const LabelText = styled.label(({ theme, htmlFor }) => ({
|
|
6
|
-
fontSize: theme.fontSize.
|
|
6
|
+
fontSize: theme.fontSize.default,
|
|
7
7
|
display: 'block',
|
|
8
8
|
marginBottom: getDividedSize(theme.base.baseWidth, 2),
|
|
9
9
|
cursor: htmlFor ? 'pointer' : 'default',
|
|
@@ -27,7 +27,7 @@ const BusinessMenuList = styled.ul `
|
|
|
27
27
|
margin: ${({ isMobileMenu }) => (isMobileMenu ? '1rem 0' : '0 0.325rem')};
|
|
28
28
|
padding: 0;
|
|
29
29
|
background-color: ${p => p.theme.color.white};
|
|
30
|
-
font-size: ${p => p.theme.fontSize.
|
|
30
|
+
font-size: ${p => p.theme.fontSize.s};
|
|
31
31
|
height: 100%;
|
|
32
32
|
`;
|
|
33
33
|
const BusinessMenu = () => {
|
|
@@ -87,9 +87,9 @@ const DesktopMenuList = styled(MenuList) `
|
|
|
87
87
|
}
|
|
88
88
|
a,
|
|
89
89
|
button {
|
|
90
|
-
font-size: ${theme.fontSize.
|
|
90
|
+
font-size: ${theme.fontSize.s};
|
|
91
91
|
${() => media.xl `
|
|
92
|
-
font-size: ${theme.fontSize.
|
|
92
|
+
font-size: ${theme.fontSize.default};
|
|
93
93
|
`};
|
|
94
94
|
}
|
|
95
95
|
margin-top: -2px;
|
|
@@ -109,6 +109,7 @@ const DesktopMenuItem = styled(MenuItem) `
|
|
|
109
109
|
}
|
|
110
110
|
> a,
|
|
111
111
|
> button {
|
|
112
|
+
width: auto;
|
|
112
113
|
display: flex;
|
|
113
114
|
line-height: 1rem;
|
|
114
115
|
padding: 0.75rem 0;
|
|
@@ -127,6 +128,10 @@ const DesktopMenuItem = styled(MenuItem) `
|
|
|
127
128
|
border-bottom: 1px solid
|
|
128
129
|
${p => (p && p.isActive ? p.theme.color.hotPink : 'transparent')};
|
|
129
130
|
}
|
|
131
|
+
&:hover,
|
|
132
|
+
&:focus {
|
|
133
|
+
border-bottom: 3px solid ${p => p.theme.color.white};
|
|
134
|
+
}
|
|
130
135
|
}
|
|
131
136
|
&:hover,
|
|
132
137
|
&:focus {
|
|
@@ -224,7 +229,7 @@ const MenuItemWithChildren = ({ menuItem, currentLevel }) => {
|
|
|
224
229
|
React.createElement(SubMenuLevel1, { menuItem: menuItem })));
|
|
225
230
|
};
|
|
226
231
|
const DesktopMenu = () => {
|
|
227
|
-
const { items: data, resetMenuEvents, menuLevel } = useContext(NavContext);
|
|
232
|
+
const { items: data, lang: language, resetMenuEvents, menuLevel, currentUrl } = useContext(NavContext);
|
|
228
233
|
const mainNavigation = data.mainNavigation && data.mainNavigation.pages ? data.mainNavigation.pages : [];
|
|
229
234
|
const ref = useRef(null);
|
|
230
235
|
useOutsideClick(ref, () => {
|
|
@@ -240,7 +245,8 @@ const DesktopMenu = () => {
|
|
|
240
245
|
if (menuHasChildren) {
|
|
241
246
|
return (React.createElement(MenuItemWithChildren, { menuItem: navElement, key: navElement.id, currentLevel: index }));
|
|
242
247
|
}
|
|
243
|
-
return (React.createElement(
|
|
248
|
+
return (React.createElement(DesktopMenuItem, { key: navElement.id, role: "none", "data-testid": `desktop-nav-item-level-1-link-${index + 1}`, isActive: menuLevel.level1 === navElement.id ||
|
|
249
|
+
isSelected(currentUrl, navElement.urls[language]) },
|
|
244
250
|
React.createElement(LinkModifier, { menuItem: navElement, tabIndex: false })));
|
|
245
251
|
})));
|
|
246
252
|
};
|
|
@@ -12,12 +12,7 @@ export declare const IconContainer: import("styled-components").StyledComponent<
|
|
|
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 @@ export declare const IconContainer: import("styled-components").StyledComponent<
|
|
|
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 @@ export declare const IconContainer: import("styled-components").StyledComponent<
|
|
|
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
|
}, {
|
|
@@ -8,7 +8,7 @@ import { MenuLink } from '../globalNavStyles.js';
|
|
|
8
8
|
|
|
9
9
|
const TooltipWrapper = styled.div `
|
|
10
10
|
font-weight: ${p => p.theme.fontWeight.bold};
|
|
11
|
-
font-size: ${p => p.theme.fontSize.
|
|
11
|
+
font-size: ${p => p.theme.fontSize.l};
|
|
12
12
|
margin: 0 ${p => getMultipliedSize(p.theme.base.baseHeight, 1)};
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
@@ -39,7 +39,7 @@ const TooltipWrapper = styled.div `
|
|
|
39
39
|
}
|
|
40
40
|
${MenuLink} {
|
|
41
41
|
font-weight: ${p => p.theme.fontWeight.bold};
|
|
42
|
-
font-size: ${p => p.theme.fontSize.
|
|
42
|
+
font-size: ${p => p.theme.fontSize.default};
|
|
43
43
|
margin: 0rem 1.5rem;
|
|
44
44
|
padding: 0.5rem 0;
|
|
45
45
|
width: 1.5rem;
|