1
- import NextImage from "next/image" ;
2
1
import type { Image } from "sanity" ;
3
2
import {
4
3
Bleed ,
@@ -11,6 +10,7 @@ import {
11
10
} from "@navikt/ds-react" ;
12
11
import { DESIGNSYSTEM_OVERVIEW_BY_CATEGORY_QUERYResult } from "@/app/_sanity/query-types" ;
13
12
import { urlForImage } from "@/app/_sanity/utils" ;
13
+ import { ImageAsThemedSvg } from "@/app/_ui/image-as-svg/ImageAsSvg" ;
14
14
import { getStatusTag } from "@/app/_ui/theming/theme-config" ;
15
15
import { MarkdownText } from "@/app/_ui/typography/MarkdownText" ;
16
16
import {
@@ -79,77 +79,37 @@ function DesignsystemetOverviewCard({
79
79
return (
80
80
< LinkCard data-color-role = { statusTag ?. colorRole } autoLayout = { false } >
81
81
< VStack gap = "space-16" >
82
- < Bleed marginInline = "space-20" marginBlock = "space-16 0" >
83
- < span className = { styles . overviewImageWrapper } >
84
- { imageUrl ? (
85
- < NextImage
86
- src = { imageUrl }
87
- width = { 200 }
88
- height = { 200 }
89
- alt = { page ?. heading + " thumbnail" }
90
- aria-hidden
91
- />
92
- ) : (
93
- < FallbackSvg />
94
- ) }
95
- </ span >
96
- </ Bleed >
97
-
98
- < LinkCardTitle as = "h2" >
99
- < LinkCardAnchor href = { `/${ page ?. slug } ` } >
100
- < HStack as = "span" gap = "space-8" align = "center" >
101
- < span > { page ?. heading } </ span >
102
- { statusTagWithoutStable && (
82
+ < Box position = "relative" asChild >
83
+ < Bleed marginInline = "space-20" marginBlock = "space-16 0" >
84
+ < span className = { styles . overviewImageWrapper } >
85
+ < ImageAsThemedSvg url = { imageUrl } size = { 200 } />
86
+ </ span >
87
+ { statusTagWithoutStable && (
88
+ < Box asChild position = "absolute" bottom = "space-8" left = "space-8" >
103
89
< Tag
104
90
size = "small"
105
- variant = "success "
91
+ variant = "alt1-filled "
106
92
data-color-role = { statusTag ?. colorRole }
107
93
>
108
- { /* TODO: Remove underline from tag */ }
109
94
{ statusTagWithoutStable . text }
110
95
</ Tag >
111
- ) }
112
- </ HStack >
113
- </ LinkCardAnchor >
96
+ </ Box >
97
+ ) }
98
+ </ Bleed >
99
+ </ Box >
100
+
101
+ < LinkCardTitle as = "h2" >
102
+ < HStack as = "span" gap = "space-8" align = "center" >
103
+ < LinkCardAnchor href = { `/${ page ?. slug } ` } >
104
+ { page ?. heading }
105
+ </ LinkCardAnchor >
106
+ </ HStack >
114
107
</ LinkCardTitle >
115
108
</ VStack >
116
109
</ LinkCard >
117
110
) ;
118
111
}
119
112
120
- function FallbackSvg ( ) {
121
- return (
122
- < svg
123
- width = "200"
124
- height = "200"
125
- viewBox = "0 0 200 200"
126
- fill = "none"
127
- xmlns = "http://www.w3.org/2000/svg"
128
- aria-hidden
129
- >
130
- < path
131
- fillRule = "evenodd"
132
- clipRule = "evenodd"
133
- d = "M100 153C129.271 153 153 129.271 153 100C153 70.7289 129.271 47 100 47C70.7289 47 47 70.7289 47 100C47 129.271 70.7289 153 100 153ZM100 165C135.899 165 165 135.899 165 100C165 64.1015 135.899 35 100 35C64.1015 35 35 64.1015 35 100C35 135.899 64.1015 165 100 165Z"
134
- fill = "#001630"
135
- fillOpacity = "0.188235"
136
- />
137
- < path
138
- d = "M96.768 67C97.5378 65.6667 99.4622 65.6667 100.232 67L112.789 88.75C113.559 90.0833 112.597 91.75 111.057 91.75H85.9426C84.403 91.75 83.4408 90.0833 84.2106 88.75L96.768 67Z"
139
- fill = "#5D6573"
140
- />
141
- < path
142
- d = "M96 114.5C96 121.956 89.9558 128 82.5 128C75.0442 128 69 121.956 69 114.5C69 107.044 75.0442 101 82.5 101C89.9558 101 96 107.044 96 114.5Z"
143
- fill = "#5D6573"
144
- />
145
- < path
146
- d = "M105 104C105 102.895 105.895 102 107 102H129C130.105 102 131 102.895 131 104V126C131 127.105 130.105 128 129 128H107C105.895 128 105 127.105 105 126V104Z"
147
- fill = "#5D6573"
148
- />
149
- </ svg >
150
- ) ;
151
- }
152
-
153
113
function sortDesignsystemetOverviewList (
154
114
list : DESIGNSYSTEM_OVERVIEW_BY_CATEGORY_QUERYResult ,
155
115
) {
0 commit comments