diff --git a/src/komponenter/header/header-regular/common/sok/Sok.scss b/src/komponenter/header/header-regular/common/sok/Sok.scss
index dd8096d5b..6a7369cf7 100644
--- a/src/komponenter/header/header-regular/common/sok/Sok.scss
+++ b/src/komponenter/header/header-regular/common/sok/Sok.scss
@@ -1,29 +1,11 @@
@use 'src/styling-variabler.scss' as sv;
.header-linje {
- .sok-container {
- position: relative;
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: center;
- }
-
- .sok-input-resultat {
- position: relative;
- width: 100%;
- }
-
@media #{sv.$screen-mobile} {
.sok-container {
margin-bottom: 1rem;
margin-top: 0.5rem;
z-index: 101;
- }
-
- .sok-input-resultat {
- position: relative;
- width: 100%;
- }
+ }
}
}
diff --git a/src/komponenter/header/header-regular/common/sok/Sok.tsx b/src/komponenter/header/header-regular/common/sok/Sok.tsx
index 029c466f8..7bf679023 100644
--- a/src/komponenter/header/header-regular/common/sok/Sok.tsx
+++ b/src/komponenter/header/header-regular/common/sok/Sok.tsx
@@ -101,47 +101,45 @@ const Sok = (props: Props) => {
onSubmit={onSubmit}
>
-
- {
- setSearchInput(value);
- if (value.length > 2) {
- setLoading(true);
- fetchSearchDebounced({
- value,
- audience,
- language,
- environment,
- setLoading,
- setError,
- setResult,
- });
- } else {
- setLoading(false);
- }
- }}
- className={klassenavn}
- language={language}
- audience={audience}
- writtenInput={searchInput}
- onReset={onReset}
- id={props.id}
- />
- {loading ? (
-
- ) : (
- result &&
- searchInput.length > 2 && (
-
- )
- )}
-
+
{
+ setSearchInput(value);
+ if (value.length > 2) {
+ setLoading(true);
+ fetchSearchDebounced({
+ value,
+ audience,
+ language,
+ environment,
+ setLoading,
+ setError,
+ setResult,
+ });
+ } else {
+ setLoading(false);
+ }
+ }}
+ className={klassenavn}
+ language={language}
+ audience={audience}
+ writtenInput={searchInput}
+ onReset={onReset}
+ id={props.id}
+ />
+ {loading ? (
+
+ ) : (
+ result &&
+ searchInput.length > 2 && (
+
+ )
+ )}
);
diff --git a/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.scss b/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.scss
index 5c4700d54..e4e2fbc8b 100644
--- a/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.scss
+++ b/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.scss
@@ -1,64 +1,16 @@
@use 'src/styling-variabler.scss' as sv;
-.sok-input-resultat {
- .sok-input-container {
- position: relative;
- display: flex;
- }
- .sok-input {
- margin: 0;
- width: 100%;
-
- input {
- margin-top: 0;
- }
- }
- @media #{sv.$screen-desktop} {
- .sok-input {
- input {
- padding: 0.75rem;
- border: 2px solid var(--a-blue-500);
- &::-ms-clear {
- display: none;
- }
- }
-
- .skjemaelement__input {
- padding-right: 12rem;
- }
- }
- .sok .sok-container {
- width: auto;
- justify-content: center;
- align-items: flex-start;
- z-index: initial;
+.sok-input {
+ margin: 0;
+ width: 100%;
- .sok-ikon {
- position: relative;
- top: 0.35rem;
- right: 2.75rem;
- pointer-events: none;
- }
- }
+ input {
+ margin-top: 0;
}
- @media #{sv.$screen-mobile} {
- .sok-input__tittel {
- margin-bottom: 1rem;
- }
- .sok-input {
- input {
- padding: 0.7rem 1rem;
- background-color: white;
- border: 2px solid var(--a-blue-500);
- &:focus,
- &:active {
- border: 2px solid var(--a-blue-500);
- }
- }
- .skjemaelement__input {
- padding-right: 8.5rem;
- }
- }
+ .navds-search__button-search {
+ border-radius: 0;
+ border-top-right-radius: var(--a-border-radius-medium);
+ border-bottom-right-radius: var(--a-border-radius-medium);
}
}
diff --git a/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.tsx b/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.tsx
index 353ab4cb5..2c1ed4191 100644
--- a/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.tsx
+++ b/src/komponenter/header/header-regular/common/sok/sok-innhold/SokInput.tsx
@@ -1,10 +1,10 @@
import { finnTekst } from 'tekster/finn-tekst';
import { Locale } from 'store/reducers/language-duck';
-import SokKnapper from './SokKnapper';
import React from 'react';
import { verifyWindowObj } from 'utils/Environment';
-import { TextField } from '@navikt/ds-react';
-import 'komponenter/header/header-regular/common/sok/sok-innhold/SokInput.scss';
+import { Search } from '@navikt/ds-react';
+import './SokInput.scss';
+
type Props = {
className: string;
writtenInput: string;
@@ -21,20 +21,19 @@ export const SokInput = (props: Props) => {
const inputValue = verifyWindowObj() ? writtenInput || '' : undefined;
return (
- <>
-
- onChange(e.target.value)}
- className={className}
- value={inputValue}
- type="text"
- label={finnTekst('sok-knapp-sokefelt', language, audience)}
- autoComplete="off"
- />
-
-
- >
+ onChange(value)}
+ onClear={onReset}
+ className={className}
+ value={inputValue}
+ maxLength={100}
+ type="text"
+ hideLabel={false}
+ label={finnTekst('sok-knapp-sokefelt', language, audience)}
+ autoComplete="off"
+ />
);
};
export default SokInput;
diff --git a/src/komponenter/header/header-regular/common/sok/sok-innhold/SokResultater.scss b/src/komponenter/header/header-regular/common/sok/sok-innhold/SokResultater.scss
index a6f085856..26d52a7e0 100644
--- a/src/komponenter/header/header-regular/common/sok/sok-innhold/SokResultater.scss
+++ b/src/komponenter/header/header-regular/common/sok/sok-innhold/SokResultater.scss
@@ -1,45 +1,92 @@
@use 'src/styling-variabler.scss' as sv;
@keyframes animateIn {
- 0% {
- opacity: 0;
- transform: scale(0.6) translateY(-8px);
- }
+0% {
+ opacity: 0;
+ transform: scale(0.6) translateY(-8px);
+}
- 100% {
- opacity: 1;
- }
+100% {
+ opacity: 1;
+}
+}
+.sokeresultat-feil {
+ margin-top: 1rem;
}
-.sok-input-resultat {
- .sokeresultat-feil {
- margin-top: 1rem;
+.sokeresultat-lenke {
+ width: 100%;
+ color: black;
+ cursor: pointer;
+ padding: 1rem 1rem 1rem 0;
+ font-weight: normal;
+ text-align: left;
+ text-decoration: none;
+
+ &:focus {
+ outline: none;
+ color: white;
+ text-decoration: none;
+ background-color: var(--a-deepblue-500);
+ box-shadow: 0 0 0 2px var(--a-deepblue-500);
}
+}
- .sokeresultat-lenke {
- width: 100%;
- color: black;
- cursor: pointer;
- padding: 1rem 1rem 1rem 0;
- font-weight: normal;
- text-align: left;
- text-decoration: none;
+.sokeresultat-container {
+ list-style: none;
+ flex-direction: column;
+ display: flex;
+ margin: 0;
+ padding: 1rem 0 0 0;
- &:focus {
- outline: none;
- color: white;
- text-decoration: none;
- background-color: var(--a-deepblue-500);
- box-shadow: 0 0 0 2px var(--a-deepblue-500);
+ li {
+ display: flex;
+ animation-name: animateIn;
+ animation-duration: 150ms;
+ animation-delay: calc(var(--index) * 50ms);
+ animation-fill-mode: both;
+ animation-timing-function: ease-in-out;
+ border-bottom: 1px solid var(--a-gray-400);
+ margin: 0 -0.5rem;
+ padding: 0 0.5rem;
+
+ &:focus,
+ &:hover {
+ background-color: var(--a-gray-300);
+ font-weight: bold;
}
}
- .sokeresultat-container {
+ li[aria-selected='true'] {
+ background-color: var(--a-gray-300);
+ font-weight: bold;
+ }
+
+ .sok-resultat-listItem-text {
+ padding-left: 0;
+ }
+}
+
+.sokeresultat-treff {
+ padding: 1rem 0;
+ word-break: break-word;
+}
+
+.sokeresultat-liste {
+ margin: 0.25rem 0 0 0;
+ padding: 0;
+}
+
+@media #{sv.$screen-mobile} {
+ .sokeresultat-liste {
list-style: none;
+ padding: 0;
+ z-index: 1020;
flex-direction: column;
display: flex;
- margin: 0;
- padding: 1rem 0 0 0;
+ width: 100%;
+ overflow: hidden;
+ margin: 0.25rem 0 0 0;
li {
display: flex;
@@ -48,15 +95,7 @@
animation-delay: calc(var(--index) * 50ms);
animation-fill-mode: both;
animation-timing-function: ease-in-out;
- border-bottom: 1px solid var(--a-gray-400);
- margin: 0 -0.5rem;
- padding: 0 0.5rem;
-
- &:focus,
- &:hover {
- background-color: var(--a-gray-300);
- font-weight: bold;
- }
+ border: none;
}
li[aria-selected='true'] {
@@ -64,68 +103,27 @@
font-weight: bold;
}
- .sok-resultat-listItem-text {
- padding-left: 0;
- }
- }
-
- .sokeresultat-treff {
- padding: 1rem 0;
- word-break: break-word;
- }
-
- .sokeresultat-liste {
- margin: 0.25rem 0 0 0;
- padding: 0;
- }
-
- @media #{sv.$screen-mobile} {
- .sokeresultat-liste {
- list-style: none;
+ .sokeresultat-liste ul {
padding: 0;
- z-index: 1020;
- flex-direction: column;
- display: flex;
- width: 100%;
- overflow: hidden;
- margin: 0.25rem 0 0 0;
-
- li {
- display: flex;
- animation-name: animateIn;
- animation-duration: 150ms;
- animation-delay: calc(var(--index) * 50ms);
- animation-fill-mode: both;
- animation-timing-function: ease-in-out;
- border: none;
- }
-
- li[aria-selected='true'] {
- background-color: var(--a-gray-300);
- font-weight: bold;
- }
-
- .sokeresultat-liste ul {
- padding: 0;
- }
-
- .sok-resultat-listItem {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
-
- .sok-resultat-chevron {
- padding: 0 1rem 0 0;
- }
-
- .sok-resultat-listItem-text {
- padding-left: 2.25rem;
- }
}
.sok-resultat-listItem {
display: flex;
+ flex-direction: row;
+ align-items: center;
+ }
+
+ .sok-resultat-chevron {
+ padding: 0 1rem 0 0;
+ }
+
+ .sok-resultat-listItem-text {
+ padding-left: 2.25rem;
}
}
+
+ .sok-resultat-listItem {
+ display: flex;
+ }
}
+