@datagouv/components-next 1.4.1-dev.1372.g3970bd3c → 1.4.1-dev.1374.g4dfe0257

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.
Files changed (54) hide show
  1. package/assets/main.css +4 -0
  2. package/dist/{Datafair.client-Ci2WOgAS.js → Datafair.client-LChXlMI3.js} +1 -1
  3. package/dist/{ImagePreview.client-B4RtxuiJ.js → ImagePreview.client-DWNGZghK.js} +1 -1
  4. package/dist/{JsonPreview.client-r7swv2fp.js → JsonPreview.client-DCklbUyJ.js} +2 -2
  5. package/dist/{MapContainer.client-CxH1a8Tn.js → MapContainer.client-B-aQhH35.js} +6 -6
  6. package/dist/{PdfPreview.client-BjeMcqcy.js → PdfPreview.client-1WFiBcXh.js} +3 -3
  7. package/dist/{PdfSkeleton-CVZxJaeL.js → PdfSkeleton-BvU7ERD1.js} +1 -1
  8. package/dist/{Pmtiles.client-D8idR2l7.js → Pmtiles.client-BlbOlwyy.js} +2 -2
  9. package/dist/{PreviewError-Cx7CItT_.js → PreviewError-BfBCBDEx.js} +6873 -6871
  10. package/dist/{PreviewWrapper-Cd1RSmS-.js → PreviewWrapper-DvycGC7l.js} +1 -1
  11. package/dist/{XmlPreview.client-cSebx8br.js → XmlPreview.client-ClFD8R3a.js} +2 -2
  12. package/dist/components-next.css +1 -1
  13. package/dist/components-next.js +11925 -11678
  14. package/dist/components.css +1 -1
  15. package/dist/{france-DPcdJc84.js → france-JfC0dOuE.js} +1 -1
  16. package/package.json +1 -1
  17. package/src/components/CardMedia.vue +42 -0
  18. package/src/components/ChartCard.vue +53 -59
  19. package/src/components/DataserviceCard.vue +69 -85
  20. package/src/components/DataserviceQualityInline.vue +4 -20
  21. package/src/components/DataserviceQualityTooltipContent.vue +57 -65
  22. package/src/components/DatasetCard.vue +80 -93
  23. package/src/components/DatasetQualityInline.vue +4 -20
  24. package/src/components/DatasetQualityTooltipContent.vue +60 -62
  25. package/src/components/DiscussionMessageCard.vue +19 -22
  26. package/src/components/Form/SearchableSelect.vue +4 -0
  27. package/src/components/ObjectCard.vue +89 -18
  28. package/src/components/ObjectCardBadge.vue +27 -16
  29. package/src/components/ObjectCardMeta.vue +15 -0
  30. package/src/components/ObjectCardMetric.vue +23 -0
  31. package/src/components/ObjectCardMetrics.vue +6 -0
  32. package/src/components/ObjectCardOwner.vue +170 -17
  33. package/src/components/ObjectCardQuality.vue +32 -0
  34. package/src/components/ObjectCardShortDescription.vue +1 -1
  35. package/src/components/OrganizationCard.vue +101 -69
  36. package/src/components/OrganizationNameInline.vue +49 -0
  37. package/src/components/OrganizationTypeBadge.vue +21 -0
  38. package/src/components/OwnerType.vue +1 -1
  39. package/src/components/OwnerTypeIcon.vue +7 -3
  40. package/src/components/PostCard.vue +31 -35
  41. package/src/components/ProgressBar.vue +6 -3
  42. package/src/components/QualityItem.vue +9 -18
  43. package/src/components/QualityScore.vue +7 -1
  44. package/src/components/ReuseCard.vue +114 -95
  45. package/src/components/ReuseDetails.vue +19 -29
  46. package/src/components/SchemaCard.vue +30 -27
  47. package/src/components/Search/GlobalSearch.vue +7 -4
  48. package/src/components/Toggletip.vue +24 -12
  49. package/src/components/Tooltip.vue +113 -29
  50. package/src/components/TopicCard.vue +69 -78
  51. package/src/main.ts +0 -4
  52. package/src/components/ObjectCardHeader.vue +0 -42
  53. package/src/components/OrganizationHorizontalCard.vue +0 -87
  54. package/src/components/ReuseHorizontalCard.vue +0 -81
@@ -1,43 +1,39 @@
1
1
  <template>
2
- <ObjectCard media-size="lg">
2
+ <ObjectCard
3
+ :url="postUrl || post.page || '#'"
4
+ :icon="RiArticleLine"
5
+ media-size="lg"
6
+ >
3
7
  <template #media>
4
- <img
5
- v-if="post.image"
8
+ <CardMedia
6
9
  :src="post.image"
7
- class="w-full h-full object-cover"
8
10
  :alt="post.name"
9
- >
10
- <Placeholder
11
- v-else
12
- type="Dataset"
13
- class="w-full h-full"
11
+ kind="post"
14
12
  />
15
13
  </template>
16
-
17
- <ObjectCardHeader
18
- :icon="RiArticleLine"
19
- :url="postUrl || post.page || '#'"
20
- >
14
+ <template #title>
21
15
  {{ post.name }}
22
- </ObjectCardHeader>
23
-
24
- <ObjectCardShortDescription :text="post.headline || post.content" />
25
-
26
- <TranslationT
27
- v-if="post.published || post.created_at"
28
- tag="div"
29
- class="text-sm text-gray-medium mt-1"
30
- keypath="Publié {date}"
31
- >
32
- <template #date>
33
- <FormattedDate
34
- :date="post.published || post.created_at"
35
- format="relative"
36
- :options="{ dateStyle: 'long', timeStyle: 'short' }"
37
- />
38
- </template>
39
- </TranslationT>
16
+ </template>
40
17
 
18
+ <ObjectCardMeta v-if="post.published || post.created_at">
19
+ <TranslationT
20
+ tag="span"
21
+ class="tabular-nums"
22
+ keypath="Publié {date}"
23
+ >
24
+ <template #date>
25
+ <FormattedDate
26
+ :date="post.published || post.created_at"
27
+ format="relative"
28
+ :options="{ dateStyle: 'long', timeStyle: 'short' }"
29
+ />
30
+ </template>
31
+ </TranslationT>
32
+ </ObjectCardMeta>
33
+ <ObjectCardShortDescription
34
+ :text="post.headline || post.content"
35
+ class="max-md:hidden"
36
+ />
41
37
  <slot />
42
38
  </ObjectCard>
43
39
  </template>
@@ -46,11 +42,11 @@
46
42
  import { RiArticleLine } from '@remixicon/vue'
47
43
  import type { RouteLocationRaw } from 'vue-router'
48
44
  import type { Post } from '../types/posts'
49
- import Placeholder from './Placeholder.vue'
45
+ import CardMedia from './CardMedia.vue'
46
+ import FormattedDate from './FormattedDate.vue'
50
47
  import ObjectCard from './ObjectCard.vue'
51
- import ObjectCardHeader from './ObjectCardHeader.vue'
48
+ import ObjectCardMeta from './ObjectCardMeta.vue'
52
49
  import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
53
- import FormattedDate from './FormattedDate.vue'
54
50
  import TranslationT from './TranslationT.vue'
55
51
 
56
52
  defineProps<{
@@ -4,11 +4,12 @@
4
4
  :aria-valuenow="value"
5
5
  aria-valuemin="0"
6
6
  :aria-valuemax="max"
7
- class="min-w-20 h-2.5 rounded-lg border border-gray-default bg-[#f5f5f5] overflow-hidden"
7
+ class="overflow-hidden"
8
+ :class="compact ? 'w-16 h-1.5 rounded bg-gray-default' : 'min-w-20 h-2.5 rounded-lg border border-gray-default bg-[#f5f5f5]'"
8
9
  >
9
10
  <div
10
- class="h-full rounded-lg"
11
- :class="barClass"
11
+ class="h-full"
12
+ :class="[barClass, compact ? 'rounded' : 'rounded-lg']"
12
13
  :style="{ width: percentage + '%' }"
13
14
  />
14
15
  <slot />
@@ -22,6 +23,8 @@ const props = withDefaults(defineProps<{
22
23
  value: number
23
24
  max?: number
24
25
  barClass?: string
26
+ // Thin variant used inline in a line of text
27
+ compact?: boolean
25
28
  }>(), {
26
29
  max: 1,
27
30
  barClass: '',
@@ -1,29 +1,20 @@
1
1
  <template>
2
- <li>
3
- <p
4
- v-if="passed"
5
- class="fr-my-0 text-sm"
6
- >
7
- <span
8
- class="fr-icon-check-line"
2
+ <li class="p-0 m-0">
3
+ <p class="flex items-start gap-2 m-0 text-sm/[22px] text-gray-title">
4
+ <component
5
+ :is="passed ? RiCheckLine : RiAlertLine"
6
+ class="size-4 mt-[3px] flex-none"
7
+ :class="passed ? 'text-new-success' : 'text-new-warning'"
9
8
  aria-hidden="true"
10
9
  />
11
- {{ messagePassed }}
12
- </p>
13
- <p
14
- v-else
15
- class="my-0 text-gray-medium text-sm"
16
- >
17
- <span
18
- class="fr-icon-warning-line"
19
- aria-hidden="true"
20
- />
21
- {{ messageFailed }}
10
+ <span class="min-w-0 [overflow-wrap:anywhere]">{{ passed ? messagePassed : messageFailed }}</span>
22
11
  </p>
23
12
  </li>
24
13
  </template>
25
14
 
26
15
  <script setup lang="ts">
16
+ import { RiAlertLine, RiCheckLine } from '@remixicon/vue'
17
+
27
18
  defineProps<{
28
19
  passed?: boolean | null
29
20
  messagePassed: string
@@ -3,7 +3,8 @@
3
3
  :value="score"
4
4
  :max="quality_max_score"
5
5
  :aria-label="score >= high ? t('Bon') : t('À améliorer')"
6
- :bar-class="score >= high ? 'bg-success-dark' : 'bg-gray-low'"
6
+ :bar-class="barClass"
7
+ :compact
7
8
  :class="props.class"
8
9
  >
9
10
  <span class="sr-only">
@@ -22,6 +23,7 @@ import ProgressBar from './ProgressBar.vue'
22
23
  const props = withDefaults(defineProps<{
23
24
  score: number
24
25
  class?: string
26
+ compact?: boolean
25
27
  }>(), {
26
28
  class: '',
27
29
  })
@@ -29,4 +31,8 @@ const quality_max_score = 1
29
31
  const high = quality_max_score * 2 / 3
30
32
  const { t, locale } = useTranslation()
31
33
  const calculatedScore = computed(() => new Intl.NumberFormat(locale, { style: 'percent' }).format(props.score))
34
+ const barClass = computed(() => {
35
+ if (props.score >= high) return props.compact ? 'bg-new-success' : 'bg-success-dark'
36
+ return props.compact ? 'bg-new-gray-medium-clic' : 'bg-gray-low'
37
+ })
32
38
  </script>
@@ -1,115 +1,134 @@
1
1
  <template>
2
- <article class="fr-enlarge-link group/reuse-card bg-white border border-gray-default hover:bg-gray-some flex flex-col relative">
3
- <div class="flex flex-col h-full flex-1 order-2 px-8">
4
- <div class="order-1 flex flex-col px-4 py-1 h-full -mx-8">
5
- <component
6
- :is="titleTag"
7
- class="font-bold text-base mt-1 mb-0 truncate"
8
- >
9
- <AppLink
10
- class="text-gray-title overflow-hidden"
11
- :to="reuseUrl"
12
- >
13
- {{ reuse.title }}
14
- </AppLink>
15
- </component>
16
- <div class="order-3 text-sm m-0 text-gray-medium">
17
- <div class="text-sm mb-0 flex items-center">
18
- <ObjectCardOwner
19
- :organization="reuse.organization"
20
- :owner="reuse.owner"
21
- :organization-url="organizationUrl"
22
- />
23
- <RiSubtractLine class="size-4 flex-none fill-gray-medium" />
24
- <TranslationT
25
- class="block flex-none"
26
- keypath="publié {date}"
27
- >
28
- <template #date>
29
- <FormattedDate
30
- :date="reuse.created_at"
31
- format="relative"
32
- :options="{ dateStyle: 'medium' }"
33
- />
34
- </template>
35
- </TranslationT>
36
- </div>
37
- <ReuseDetails :reuse />
38
- </div>
39
- </div>
40
- </div>
41
- <div class="order-1 relative flex-auto">
42
- <div class="group-hover/reuse-card:brightness-90">
43
- <div class="object-cover block w-full h-auto aspect-[1.4]">
44
- <img
45
- v-if="reuse.image"
46
- :src="reuse.image"
47
- class="size-full object-cover"
48
- >
49
- <Placeholder
50
- v-else
51
- type="Reuse"
52
- class="w-full"
53
- />
54
- </div>
2
+ <ObjectCard
3
+ :url="reuseUrl || reuse.page"
4
+ :icon="horizontal ? RiLineChartLine : undefined"
5
+ :title-tag
6
+ :media-size="horizontal ? 'lg' : undefined"
7
+ >
8
+ <template
9
+ v-if="!horizontal"
10
+ #cover
11
+ >
12
+ <div class="relative aspect-video border-b border-gray-default">
13
+ <CardMedia
14
+ :src="reuse.image"
15
+ :alt="reuse.title"
16
+ kind="reuse"
17
+ class="absolute inset-0"
18
+ />
55
19
  </div>
56
- <ul
57
- v-if="reuse.private || reuse.archived"
58
- class="list-none m-0 p-0 mt-4 px-4 -mb-2"
20
+ </template>
21
+ <template
22
+ v-if="horizontal"
23
+ #media
24
+ >
25
+ <CardMedia
26
+ :src="reuse.image"
27
+ :alt="reuse.title"
28
+ kind="reuse"
29
+ />
30
+ </template>
31
+ <template #title>
32
+ {{ reuse.title }}
33
+ </template>
34
+ <template
35
+ v-if="reuse.private || reuse.archived"
36
+ #badge
37
+ >
38
+ <span class="flex flex-wrap gap-1">
39
+ <ObjectCardBadge
40
+ v-if="reuse.private"
41
+ :icon="RiLockLine"
42
+ >
43
+ {{ t('Brouillon') }}
44
+ </ObjectCardBadge>
45
+ <ObjectCardBadge
46
+ v-if="reuse.archived"
47
+ :icon="RiArchiveLine"
48
+ >
49
+ {{ t('Archivé') }}
50
+ </ObjectCardBadge>
51
+ </span>
52
+ </template>
53
+
54
+ <ObjectCardOwner
55
+ show-details
56
+ :organization="reuse.organization"
57
+ :owner="reuse.owner"
58
+ :organization-url="organizationUrl"
59
+ />
60
+ <ObjectCardMeta>
61
+ <TranslationT
62
+ tag="span"
63
+ class="tabular-nums"
64
+ keypath="Publié {date}"
59
65
  >
60
- <li v-if="reuse.private">
61
- <p class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium">
62
- <RiLockLine class="size-3.5 mr-0.5" />
63
- {{ t('Brouillon') }}
64
- </p>
65
- </li>
66
- <li v-if="reuse.archived">
67
- <p class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium">
68
- <RiLockLine class="size-3.5 mr-0.5" />
69
- {{ t('Archivé') }}
70
- </p>
71
- </li>
72
- </ul>
73
- </div>
74
- </article>
66
+ <template #date>
67
+ <FormattedDate
68
+ :date="reuse.created_at"
69
+ format="relative"
70
+ :options="{ dateStyle: 'medium' }"
71
+ />
72
+ </template>
73
+ </TranslationT>
74
+ </ObjectCardMeta>
75
+ <ReuseDetails
76
+ :reuse
77
+ class="max-[480px]:hidden"
78
+ />
79
+ <ObjectCardShortDescription
80
+ :text="reuse.description"
81
+ class="max-md:hidden"
82
+ />
83
+ <slot />
84
+ </ObjectCard>
75
85
  </template>
76
86
 
77
87
  <script setup lang="ts">
78
- import { RiLockLine, RiSubtractLine } from '@remixicon/vue'
79
- import { computed } from 'vue'
88
+ import { RiArchiveLine, RiLineChartLine, RiLockLine } from '@remixicon/vue'
80
89
  import type { RouteLocationRaw } from 'vue-router'
81
90
  import type { Reuse, ReuseV2 } from '../types/reuses'
82
91
  import type { TitleTag } from '../types/ui'
83
92
  import { useTranslation } from '../composables/useTranslation'
84
- import AppLink from './AppLink.vue'
93
+ import CardMedia from './CardMedia.vue'
94
+ import FormattedDate from './FormattedDate.vue'
95
+ import ObjectCard from './ObjectCard.vue'
96
+ import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
97
+ import ObjectCardBadge from './ObjectCardBadge.vue'
98
+ import ObjectCardMeta from './ObjectCardMeta.vue'
85
99
  import ObjectCardOwner from './ObjectCardOwner.vue'
86
100
  import ReuseDetails from './ReuseDetails.vue'
87
- import Placeholder from './Placeholder.vue'
88
- import FormattedDate from './FormattedDate.vue'
89
101
  import TranslationT from './TranslationT.vue'
90
102
 
91
- const props = withDefaults(defineProps<{
92
- reuse: Reuse | ReuseV2
103
+ withDefaults(
104
+ defineProps<{
105
+ reuse: Reuse | ReuseV2
93
106
 
94
- /**
95
- * The reuseUrl is a route location object to allow Vue Router to navigate to the details of a reuse.
96
- * It is used as a separate prop to allow other sites using the package to define their own reuse pages.
97
- */
98
- reuseUrl?: RouteLocationRaw
107
+ /**
108
+ * The reuseUrl is a route location object to allow Vue Router to navigate to the details of a reuse.
109
+ * It is used as a separate prop to allow other sites using the package to define their own reuse pages.
110
+ */
111
+ reuseUrl?: RouteLocationRaw
99
112
 
100
- /**
101
- * The organizationUrl is an optional route location object to allow Vue Router to navigate to the details of the organization linked to tha reuse.
102
- * It is used as a separate prop to allow other sites using the package to define their own organization pages.
103
- * Pass null instead of a route to render the organization name as plain, non-linked text.
104
- */
105
- organizationUrl?: RouteLocationRaw | null
113
+ /**
114
+ * The organizationUrl is an optional route location object to allow Vue Router to navigate to the details of the organization linked to tha reuse.
115
+ * It is used as a separate prop to allow other sites using the package to define their own organization pages.
116
+ * Pass null instead of a route to render the organization name as plain, non-linked text.
117
+ */
118
+ organizationUrl?: RouteLocationRaw | null
106
119
 
107
- titleTag?: TitleTag
108
- }>(), {
109
- titleTag: 'h3',
110
- })
120
+ titleTag?: TitleTag
111
121
 
112
- const { t } = useTranslation()
122
+ /**
123
+ * Puts the illustration beside the content instead of above it, for full-width lists.
124
+ * The card falls back to the vertical layout when it gets too narrow.
125
+ */
126
+ horizontal?: boolean
127
+ }>(),
128
+ {
129
+ titleTag: 'h3',
130
+ },
131
+ )
113
132
 
114
- const reuseUrl = computed(() => props.reuseUrl || props.reuse.page)
133
+ const { t } = useTranslation()
115
134
  </script>
@@ -1,39 +1,29 @@
1
1
  <template>
2
- <div class="flex flex-wrap items-center gap-1">
3
- <p class="text-sm mb-0">
4
- {{ reuseType }}
5
- </p>
6
- <RiSubtractLine
7
- aria-hidden="true"
8
- class="size-4 fill-gray-medium"
9
- />
10
- <p
11
- class="text-sm mb-0 flex items-center gap-0.5"
12
- :aria-label="t('{n} vues | {n} vue | {n} vues', reuse.metrics.views)"
13
- >
14
- <RiEyeLine
15
- aria-hidden="true"
16
- class="size-3.5"
17
- />{{ summarize(reuse.metrics.views) }}
18
- </p>
19
- <p
20
- class="text-sm mb-0 flex items-center gap-0.5"
21
- :aria-label="t('{n} abonnés | {n} abonné | {n} abonnés', reuse.metrics.followers)"
22
- >
23
- <RiStarLine
24
- aria-hidden="true"
25
- class="size-3.5"
26
- />{{ summarize(reuse.metrics.followers) }}
27
- </p>
28
- </div>
2
+ <ObjectCardMeta>
3
+ <span v-if="reuseType">{{ reuseType }}</span>
4
+ <ObjectCardMetrics>
5
+ <ObjectCardMetric
6
+ :icon="RiEyeLine"
7
+ :value="reuse.metrics.views"
8
+ :label="t('{n} vues | {n} vue | {n} vues', reuse.metrics.views)"
9
+ />
10
+ <ObjectCardMetric
11
+ :icon="RiStarLine"
12
+ :value="reuse.metrics.followers"
13
+ :label="t('{n} abonnés | {n} abonné | {n} abonnés', reuse.metrics.followers)"
14
+ />
15
+ </ObjectCardMetrics>
16
+ </ObjectCardMeta>
29
17
  </template>
30
18
 
31
19
  <script setup lang="ts">
32
- import { RiEyeLine, RiStarLine, RiSubtractLine } from '@remixicon/vue'
20
+ import { RiEyeLine, RiStarLine } from '@remixicon/vue'
33
21
  import { useReuseType } from '../composables/useReuseType'
34
- import { summarize } from '../functions/helpers'
35
22
  import type { Reuse, ReuseV2 } from '../types/reuses'
36
23
  import { useTranslation } from '../composables/useTranslation'
24
+ import ObjectCardMeta from './ObjectCardMeta.vue'
25
+ import ObjectCardMetric from './ObjectCardMetric.vue'
26
+ import ObjectCardMetrics from './ObjectCardMetrics.vue'
37
27
 
38
28
  const props = defineProps<{
39
29
  reuse: Reuse | ReuseV2
@@ -1,37 +1,38 @@
1
1
  <template>
2
2
  <div
3
3
  :id
4
- class="p-4 relative border bg-white hover:bg-gray-some"
5
- :class="{
6
- 'border-gray-default': !selected && !active,
7
- 'border-datagouv': selected && !active,
8
- 'border-blue-outline': active,
9
- }"
4
+ class="relative p-4 rounded border text-sm/[22px] text-gray-title [overflow-wrap:anywhere]"
5
+ :class="[
6
+ selectable && selected ? 'border-new-primary ring-1 ring-inset ring-new-primary bg-new-info-light' : 'border-gray-default bg-white',
7
+ { 'outline-2 outline-new-focus outline-offset-3': active },
8
+ ]"
10
9
  :role="selectable ? 'option' : undefined"
11
10
  :tabindex="selectable ? -1 : undefined"
12
11
  :aria-selected="selectable && selected"
13
12
  >
14
- <h3 class="text-base font-bold mb-0 flex items-center gap-1">
15
- <RiNodeTree class="size-4" />
13
+ <h3 class="m-0 flex items-start gap-2 pr-8 text-base/6 font-semibold">
14
+ <RiNodeTree
15
+ aria-hidden="true"
16
+ class="size-4 shrink-0 mt-1"
17
+ />
16
18
  {{ schema.title }}
17
19
  </h3>
18
- <p
19
- v-for="label in schema.labels"
20
- :key="label"
21
- class="flex items-center gap-1 text-sm mb-0"
22
- >
23
- <span class="flex items-center gap-1 text-gray-medium">
24
- <RiInformationLine class="size-3" /> {{ t('Label :') }}
25
- </span>
26
- <span>{{ label }}</span>
27
- </p>
28
- <p class="flex items-center gap-1 text-sm mb-0">
29
- <span class="flex items-center gap-1 text-gray-medium">
30
- <RiInformationLine class="size-3" /> {{ t('Standard :') }}
31
- </span>
32
- <span>{{ schema.schema_type }}</span>
33
- </p>
34
- <p class="text-sm mt-4 mb-0">
20
+ <div class="flex flex-wrap gap-1 my-2">
21
+ <Tag
22
+ v-for="label in schema.labels"
23
+ :key="label"
24
+ type="secondary"
25
+ >
26
+ {{ t('Label :') }} {{ label }}
27
+ </Tag>
28
+ <Tag
29
+ v-if="schema.schema_type"
30
+ type="secondary"
31
+ >
32
+ {{ t('Standard :') }} {{ schema.schema_type }}
33
+ </Tag>
34
+ </div>
35
+ <p class="text-sm mt-2 mb-0 text-gray-medium">
35
36
  {{ schema.description }}
36
37
  </p>
37
38
  <p
@@ -64,13 +65,15 @@
64
65
  </p>
65
66
  <RiCheckLine
66
67
  v-if="selected"
67
- class="size-6 fill-datagouv absolute top-4 right-4"
68
+ aria-hidden="true"
69
+ class="absolute top-4 right-4 size-5"
68
70
  />
69
71
  </div>
70
72
  </template>
71
73
 
72
74
  <script setup lang="ts">
73
- import { RiCheckLine, RiInformationLine, RiNodeTree } from '@remixicon/vue'
75
+ import Tag from './Tag.vue'
76
+ import { RiCheckLine, RiNodeTree } from '@remixicon/vue'
74
77
  import AppLink from './AppLink.vue'
75
78
  import { useTranslation } from '../composables/useTranslation'
76
79
  import { useGetSchemaDocumentation } from '../functions/schemas'
@@ -266,7 +266,10 @@
266
266
  name="reuse"
267
267
  :reuse="result"
268
268
  >
269
- <ReuseHorizontalCard :reuse="(result as ReuseV2)" />
269
+ <ReuseCard
270
+ :reuse="(result as ReuseV2)"
271
+ horizontal
272
+ />
270
273
  </slot>
271
274
  </template>
272
275
  <template v-else-if="currentTypeConfig?.class === 'organizations'">
@@ -274,7 +277,7 @@
274
277
  name="organization"
275
278
  :organization="result"
276
279
  >
277
- <OrganizationHorizontalCard :organization="(result as Organization)" />
280
+ <OrganizationCard :organization="(result as Organization)" />
278
281
  </slot>
279
282
  </template>
280
283
  <template v-else-if="currentTypeConfig?.class === 'topics'">
@@ -382,8 +385,8 @@ import RadioGroup from '../RadioGroup.vue'
382
385
  import RadioInput from '../RadioInput.vue'
383
386
  import DatasetCard from '../DatasetCard.vue'
384
387
  import DataserviceCard from '../DataserviceCard.vue'
385
- import OrganizationHorizontalCard from '../OrganizationHorizontalCard.vue'
386
- import ReuseHorizontalCard from '../ReuseHorizontalCard.vue'
388
+ import OrganizationCard from '../OrganizationCard.vue'
389
+ import ReuseCard from '../ReuseCard.vue'
387
390
  import TopicCard from '../TopicCard.vue'
388
391
  import SearchInput from './SearchInput.vue'
389
392
  import Sidemenu from './Sidemenu.vue'
@@ -10,6 +10,7 @@
10
10
  -->
11
11
  <ValueWatcher
12
12
  :value="open"
13
+ @changed="onOpenChanged"
13
14
  />
14
15
  <PopoverButton
15
16
  v-bind="buttonProps"
@@ -31,11 +32,8 @@
31
32
  <PopoverPanel
32
33
  v-show="open"
33
34
  ref="panel"
34
- class="drop-shadow bg-white rounded-sm w-96 absolute z-[800]"
35
- :class="{
36
- 'p-0': noMargin,
37
- 'p-3': !noMargin,
38
- }"
35
+ class="absolute z-[800] w-[min(24rem,calc(100vw-2rem))] max-h-[70vh] overflow-auto rounded border border-gray-default bg-white shadow-overlay"
36
+ :class="noMargin ? 'p-0' : 'p-4'"
39
37
  :style="floatingStyles"
40
38
  static
41
39
  >
@@ -50,9 +48,9 @@
50
48
  </template>
51
49
 
52
50
  <script setup lang="ts">
53
- import { autoPlacement, autoUpdate, useFloating } from '@floating-ui/vue'
51
+ import { autoPlacement, autoUpdate, offset, shift, useFloating } from '@floating-ui/vue'
54
52
  import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
55
- import { useTemplateRef } from 'vue'
53
+ import { nextTick, useTemplateRef } from 'vue'
56
54
  import { RiInformationLine } from '@remixicon/vue'
57
55
  import ClientOnly from './ClientOnly.vue'
58
56
  import ValueWatcher from './ValueWatcher.vue'
@@ -66,14 +64,28 @@ withDefaults(defineProps<{
66
64
  styledButton: true,
67
65
  })
68
66
 
67
+ const emit = defineEmits<{
68
+ opened: []
69
+ }>()
70
+
69
71
  const popoverRef = useTemplateRef<InstanceType<typeof Popover>>('popover')
70
72
  const panelRef = useTemplateRef<InstanceType<typeof PopoverPanel>>('panel')
71
73
 
72
- const { floatingStyles } = useFloating(popoverRef, panelRef, {
73
- middleware: [autoPlacement({
74
- alignment: 'end',
75
- crossAxis: true,
76
- })],
74
+ const { floatingStyles, update } = useFloating(popoverRef, panelRef, {
75
+ middleware: [
76
+ offset(8),
77
+ autoPlacement({
78
+ alignment: 'end',
79
+ crossAxis: true,
80
+ }),
81
+ shift({ padding: 16 }),
82
+ ],
77
83
  whileElementsMounted: autoUpdate,
78
84
  })
85
+
86
+ async function onOpenChanged(open: boolean) {
87
+ if (open) emit('opened')
88
+ await nextTick()
89
+ update()
90
+ }
79
91
  </script>