@datagouv/components-next 1.4.1-dev.1373.g379aceb6 → 1.4.1-dev.1375.ge1f9e509

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 (81) hide show
  1. package/assets/main.css +4 -0
  2. package/dist/{Control-CeBb5PEu.js → Control-DPuXeUqi.js} +3 -12
  3. package/dist/{Datafair.client-Ci2WOgAS.js → Datafair.client-LlEgG7WU.js} +2 -3
  4. package/dist/{Image-CBQwYbQB.js → Image-DVWRoLLI.js} +7 -22
  5. package/dist/{ImagePreview.client-B4RtxuiJ.js → ImagePreview.client-Db5dmxMP.js} +2 -3
  6. package/dist/{JsonPreview.client-r7swv2fp.js → JsonPreview.client-DKy2AexC.js} +4 -6
  7. package/dist/{Layer-BPuffNS-.js → Layer-D_5tYbVm.js} +7 -9
  8. package/dist/{Map-QeL96qbQ.js → Map-CTBJEae_.js} +937 -967
  9. package/dist/{MapContainer.client-CxH1a8Tn.js → MapContainer.client-Clk9_bbS.js} +13 -15
  10. package/dist/{OSM-DT4I7v8A.js → OSM-B5Zc3qAf.js} +2 -3
  11. package/dist/{PdfPreview.client-BjeMcqcy.js → PdfPreview.client-D3wHTDb9.js} +130 -378
  12. package/dist/{PdfSkeleton-CVZxJaeL.js → PdfSkeleton-nas5Pmia.js} +2 -3
  13. package/dist/{Pmtiles.client-D8idR2l7.js → Pmtiles.client-NGYdeSJY.js} +151 -350
  14. package/dist/{PreviewError-Cx7CItT_.js → PreviewError-EeaGx3SL.js} +399 -392
  15. package/dist/{PreviewWrapper-Cd1RSmS-.js → PreviewWrapper-BhldDdXK.js} +2 -3
  16. package/dist/{ScaleLine-Cwwk9wJo.js → ScaleLine-C_tuJ6VG.js} +3 -4
  17. package/dist/Tile-8nHSuqcv.js +571 -0
  18. package/dist/{Tile-4WpHaLOZ.js → Tile-Bu5lF4M5.js} +8 -13
  19. package/dist/{TileImage-CZZ4lgsm.js → TileImage-CgO5alXc.js} +105 -113
  20. package/dist/{View-DWqx4Jqr.js → View-Dad8DfSD.js} +25 -51
  21. package/dist/{XmlPreview.client-cSebx8br.js → XmlPreview.client-CmGbc3c3.js} +5 -7
  22. package/dist/assets/maplibre-gl-worker-CEzvAyZY.js +10 -0
  23. package/dist/components-next.css +1 -1
  24. package/dist/components-next.js +15585 -15914
  25. package/dist/components.css +1 -1
  26. package/dist/{en-C_qOt4Jn.js → en-OIaJCts4.js} +1 -2
  27. package/dist/{france-DPcdJc84.js → france-BtSQqcqV.js} +5 -9
  28. package/dist/{hvd-ZlsiTVFh.js → hvd-CTia2VCz.js} +1 -2
  29. package/dist/{inspire-DZQ-yA5f.js → inspire-Cc-Kc4K-.js} +1 -2
  30. package/dist/{leaflet-src-lLkzhpcP.js → leaflet-src-BY_Zq0V0.js} +77 -126
  31. package/dist/{proj-DM6GW1n3.js → proj-COhZ08DR.js} +19 -37
  32. package/dist/{purify.es-D6pPunDo.js → purify.es-CGAWnSTR.js} +4 -27
  33. package/dist/{rolldown-runtime-CEFd7nDs.js → rolldown-runtime-DsPmjQRF.js} +2 -3
  34. package/dist/{sl-BxQ_ZY_w.js → sl-CKkMwQhf.js} +1 -2
  35. package/dist/{spd-Cs37HjuR.js → spd-Djcs02gw.js} +1 -2
  36. package/dist/{sr-JDtennFO.js → sr-DabGmchD.js} +1 -2
  37. package/dist/{src-D_UE0st7.js → src-D_o-aUzl.js} +1612 -2428
  38. package/dist/{text-clamp.esm-DRvX2Gzm.js → text-clamp.esm-DE3022VR.js} +3 -5
  39. package/dist/{transform-Ct1GejD-.js → transform-CNeEnSK9.js} +7 -13
  40. package/dist/{vue3-json-viewer-BJgUfh-l.js → vue3-json-viewer-CUx5EFVA.js} +1 -2
  41. package/dist/{vue3-xml-viewer.common-DbJwzvCC.js → vue3-xml-viewer.common-C0bbtsGT.js} +2 -3
  42. package/package.json +2 -2
  43. package/src/components/CardMedia.vue +42 -0
  44. package/src/components/ChartCard.vue +53 -59
  45. package/src/components/DataserviceCard.vue +69 -85
  46. package/src/components/DataserviceQualityInline.vue +4 -20
  47. package/src/components/DataserviceQualityTooltipContent.vue +57 -65
  48. package/src/components/DatasetCard.vue +80 -93
  49. package/src/components/DatasetQualityInline.vue +4 -20
  50. package/src/components/DatasetQualityTooltipContent.vue +60 -62
  51. package/src/components/DiscussionMessageCard.vue +19 -22
  52. package/src/components/ObjectCard.vue +89 -18
  53. package/src/components/ObjectCardBadge.vue +27 -16
  54. package/src/components/ObjectCardMeta.vue +15 -0
  55. package/src/components/ObjectCardMetric.vue +23 -0
  56. package/src/components/ObjectCardMetrics.vue +6 -0
  57. package/src/components/ObjectCardOwner.vue +170 -17
  58. package/src/components/ObjectCardQuality.vue +32 -0
  59. package/src/components/ObjectCardShortDescription.vue +1 -1
  60. package/src/components/OrganizationCard.vue +101 -69
  61. package/src/components/OrganizationNameInline.vue +49 -0
  62. package/src/components/OrganizationTypeBadge.vue +21 -0
  63. package/src/components/OwnerType.vue +1 -1
  64. package/src/components/OwnerTypeIcon.vue +7 -3
  65. package/src/components/PostCard.vue +31 -35
  66. package/src/components/ProgressBar.vue +6 -3
  67. package/src/components/QualityItem.vue +9 -18
  68. package/src/components/QualityScore.vue +7 -1
  69. package/src/components/ReuseCard.vue +114 -95
  70. package/src/components/ReuseDetails.vue +19 -29
  71. package/src/components/SchemaCard.vue +30 -27
  72. package/src/components/Search/GlobalSearch.vue +7 -4
  73. package/src/components/Toggletip.vue +24 -12
  74. package/src/components/Tooltip.vue +113 -29
  75. package/src/components/TopicCard.vue +69 -78
  76. package/src/main.ts +0 -4
  77. package/dist/Tile-BV44yf69.js +0 -574
  78. package/dist/assets/maplibre-gl-worker-C24SsKwV.js +0 -10
  79. package/src/components/ObjectCardHeader.vue +0 -42
  80. package/src/components/OrganizationHorizontalCard.vue +0 -87
  81. package/src/components/ReuseHorizontalCard.vue +0 -81
@@ -1,5 +1,5 @@
1
1
  import { computed as e, createElementBlock as t, createElementVNode as n, defineComponent as r, nextTick as i, normalizeStyle as a, onMounted as o, onUnmounted as s, openBlock as c, reactive as l, ref as u, renderSlot as d, unref as f, watch as p } from "vue";
2
- //#region ../node_modules/resize-detector/esm/index.js
2
+ // ../node_modules/resize-detector/esm/index.js
3
3
  var m = null;
4
4
  function h(e) {
5
5
  return m ||= (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(e) {
@@ -104,7 +104,7 @@ function A(e) {
104
104
  }
105
105
  function j(e) {
106
106
  var t = b(e, "position");
107
- (!t || t === "static") && (e.style.position = "relative"), e.__resize_old_position__ = t, e.__resize_last__ = {};
107
+ t && t !== "static" || (e.style.position = "relative"), e.__resize_old_position__ = t, e.__resize_last__ = {};
108
108
  var n = y("div", { className: "resize-triggers" }), r = y("div", { className: "resize-expand-trigger" }), i = y("div"), a = y("div", { className: "resize-contract-trigger" });
109
109
  r.appendChild(i), n.appendChild(r), n.appendChild(a), e.appendChild(n), e.__resize_triggers__ = {
110
110
  triggers: n,
@@ -120,8 +120,7 @@ function M(e) {
120
120
  var t = e.__resize_triggers__, n = t.expand, r = t.expandChild, i = t.contract, a = i.scrollWidth, o = i.scrollHeight, s = n.offsetWidth, c = n.offsetHeight, l = n.scrollWidth, u = n.scrollHeight;
121
121
  i.scrollLeft = a, i.scrollTop = o, r.style.width = s + 1 + "px", r.style.height = c + 1 + "px", n.scrollLeft = l, n.scrollTop = u;
122
122
  }
123
- //#endregion
124
- //#region ../node_modules/vue3-text-clamp/lib/text-clamp.esm.js
123
+ // ../node_modules/vue3-text-clamp/lib/text-clamp.esm.js
125
124
  var N = ["aria-label"], P = r({
126
125
  __name: "text-clamp",
127
126
  props: {
@@ -274,5 +273,4 @@ P.__file = "package/text-clamp.vue";
274
273
  var F = ((e) => (e.install = function(t) {
275
274
  t.component(e.__name, e);
276
275
  }, e))(P);
277
- //#endregion
278
276
  export { F as default };
@@ -1,5 +1,5 @@
1
- import { At as e, ht as t, kt as n, mt as r, ot as i } from "./proj-DM6GW1n3.js";
2
- //#region ../node_modules/ol/easing.js
1
+ import { At as e, ht as t, kt as n, mt as r, ot as i } from "./proj-COhZ08DR.js";
2
+ // ../node_modules/ol/easing.js
3
3
  function a(e) {
4
4
  return e ** 3;
5
5
  }
@@ -12,13 +12,11 @@ function s(e) {
12
12
  function c(e) {
13
13
  return e;
14
14
  }
15
- //#endregion
16
- //#region ../node_modules/ol/asserts.js
15
+ // ../node_modules/ol/asserts.js
17
16
  function l(e, t) {
18
17
  if (!e) throw Error(t);
19
18
  }
20
- //#endregion
21
- //#region ../node_modules/ol/geom/flat/contains.js
19
+ // ../node_modules/ol/geom/flat/contains.js
22
20
  function u(e, n, r, i, a) {
23
21
  return !t(a, function(t) {
24
22
  return !d(e, n, r, i, t[0], t[1]);
@@ -46,15 +44,13 @@ function p(e, t, n, r, i, a) {
46
44
  }
47
45
  return !1;
48
46
  }
49
- //#endregion
50
- //#region ../node_modules/ol/geom/flat/segments.js
47
+ // ../node_modules/ol/geom/flat/segments.js
51
48
  function m(e, t, n, r, i) {
52
49
  let a;
53
50
  for (t += r; t < n; t += r) if (a = i(e.slice(t - r, t), e.slice(t, t + r)), a) return a;
54
51
  return !1;
55
52
  }
56
- //#endregion
57
- //#region ../node_modules/ol/geom/flat/intersectsextent.js
53
+ // ../node_modules/ol/geom/flat/intersectsextent.js
58
54
  function h(t, a, o, s, c, l) {
59
55
  return l ??= r(i(), t, a, o, s), n(c, l) ? l[0] >= c[0] && l[2] <= c[2] || l[1] >= c[1] && l[3] <= c[3] || m(t, a, o, s, function(t, n) {
60
56
  return e(c, t, n);
@@ -84,8 +80,7 @@ function y(e, t, n, r, i) {
84
80
  }
85
81
  return !1;
86
82
  }
87
- //#endregion
88
- //#region ../node_modules/ol/transform.js
83
+ // ../node_modules/ol/transform.js
89
84
  var b = [
90
85
  1,
91
86
  0,
@@ -159,5 +154,4 @@ function I(e, t) {
159
154
  for (let e = 0; e < 6; ++e) if (Math.round((n[e] - r[e]) * N[e]) !== 0) return !1;
160
155
  return !0;
161
156
  }
162
- //#endregion
163
157
  export { a as C, c as E, l as S, s as T, v as _, I as a, f as b, w as c, E as d, P as f, _ as g, g as h, S as i, C as l, h as m, D as n, F as o, k as p, A as r, j as s, b as t, O as u, y as v, o as w, p as x, m as y };
@@ -1,5 +1,5 @@
1
1
  import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, h as s, inject as c, nextTick as l, normalizeClass as u, onMounted as d, openBlock as f, provide as p, ref as m, renderSlot as h, resolveComponent as g, toDisplayString as _, watch as v } from "vue";
2
- //#region ../node_modules/vue3-json-viewer/dist/vue3-json-viewer.mjs
2
+ // ../node_modules/vue3-json-viewer/dist/vue3-json-viewer.mjs
3
3
  var y = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/, b = o({
4
4
  name: "JsonString",
5
5
  props: { jsonValue: {
@@ -863,5 +863,4 @@ function W(e, o, s, c, l, d) {
863
863
  ], 2);
864
864
  }
865
865
  var G = /* @__PURE__ */ U(H, [["render", W]]);
866
- //#endregion
867
866
  export { G as JsonViewer };
@@ -1,5 +1,5 @@
1
- import { i as e, t } from "./rolldown-runtime-CEFd7nDs.js";
2
- //#region ../node_modules/vue3-xml-viewer/dist/vue3-xml-viewer.common.js
1
+ import { i as e, t } from "./rolldown-runtime-DsPmjQRF.js";
2
+ // ../node_modules/vue3-xml-viewer/dist/vue3-xml-viewer.common.js
3
3
  var n = /* @__PURE__ */ t(((t, n) => {
4
4
  (function() {
5
5
  var t = {
@@ -659,5 +659,4 @@ var n = /* @__PURE__ */ t(((t, n) => {
659
659
  })(), n.exports = a;
660
660
  })();
661
661
  }));
662
- //#endregion
663
662
  export default n();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datagouv/components-next",
3
- "version": "1.4.1-dev.1373.g379aceb6",
3
+ "version": "1.4.1-dev.1375.ge1f9e509",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -83,7 +83,7 @@
83
83
  "prettier": "^3.9.6",
84
84
  "tailwindcss": "^4.3.3",
85
85
  "typescript": "^5.9.3",
86
- "vite": "^8.3.1",
86
+ "vite": "^8.3.5",
87
87
  "vite-plugin-vue-devtools": "^8.2.1",
88
88
  "vue": "^3.5.42",
89
89
  "vue-router": "^5.3.1",
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <!-- Without an image, the placeholder stands for it: it carries the same text alternative. -->
3
+ <div
4
+ class="grid place-items-center size-full min-w-0 overflow-hidden bg-gray-some text-gray-secondary"
5
+ :role="hasImage ? undefined : 'img'"
6
+ :aria-label="hasImage ? undefined : alt"
7
+ >
8
+ <img
9
+ v-if="hasImage"
10
+ :src="src!"
11
+ :alt="alt || ''"
12
+ loading="lazy"
13
+ class="block size-full object-cover"
14
+ @error="failed = true"
15
+ >
16
+ <component
17
+ :is="icon"
18
+ v-else
19
+ class="size-12 flex-none pointer-events-none"
20
+ aria-hidden="true"
21
+ />
22
+ </div>
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import { computed, ref, watch } from 'vue'
27
+ import { RiArticleLine, RiBarChartBoxLine, RiLineChartLine } from '@remixicon/vue'
28
+
29
+ const props = defineProps<{
30
+ src?: string | null
31
+ alt?: string
32
+ kind: 'post' | 'reuse' | 'chart'
33
+ }>()
34
+
35
+ // A broken image falls back to the placeholder instead of the browser's broken image icon.
36
+ const failed = ref(false)
37
+ watch(() => props.src, () => {
38
+ failed.value = false
39
+ })
40
+ const hasImage = computed(() => !!props.src?.trim() && !failed.value)
41
+ const icon = computed(() => ({ post: RiArticleLine, reuse: RiLineChartLine, chart: RiBarChartBoxLine })[props.kind])
42
+ </script>
@@ -1,57 +1,49 @@
1
1
  <template>
2
- <ObjectCard media-size="xl">
3
- <template #badge>
2
+ <ObjectCard
3
+ :url="chartUrl || chart.page"
4
+ :icon="chartIcon"
5
+ media-size="xl"
6
+ >
7
+ <template #media>
8
+ <CardMedia
9
+ :src="chart.image"
10
+ :alt="chart.title"
11
+ kind="chart"
12
+ />
13
+ </template>
14
+ <template #title>
15
+ {{ chart.title }}
16
+ </template>
17
+ <template
18
+ v-if="chart.deleted_at || chart.private"
19
+ #badge
20
+ >
4
21
  <ObjectCardBadge
5
22
  v-if="chart.deleted_at"
6
23
  :icon="RiDeleteBinLine"
24
+ tone="danger"
7
25
  >
8
26
  {{ t('Supprimé') }}
9
27
  </ObjectCardBadge>
10
28
  <ObjectCardBadge
11
- v-else-if="chart.private"
29
+ v-else
12
30
  :icon="RiLockLine"
13
31
  >
14
32
  {{ t('Brouillon') }}
15
33
  </ObjectCardBadge>
16
34
  </template>
17
35
 
18
- <template #media>
19
- <img
20
- v-if="chart.image"
21
- :src="chart.image"
22
- class="w-full h-full object-cover"
23
- :alt="chart.title"
24
- >
25
- <Placeholder
26
- v-else
27
- type="Chart"
28
- class="w-full h-full"
29
- />
30
- </template>
31
-
32
- <ObjectCardHeader
33
- :icon="chartIcon"
34
- :url="chartUrl || chart.page"
35
- >
36
- {{ chart.title }}
37
- </ObjectCardHeader>
38
-
39
- <div
36
+ <ObjectCardOwner
40
37
  v-if="chart.organization || chart.owner"
41
- class="text-sm flex flex-wrap gap-y-1 items-center truncate"
42
- >
43
- <ObjectCardOwner
44
- :organization="chart.organization"
45
- :owner="chart.owner"
46
- :organization-url="organizationUrl"
47
- />
48
- <RiSubtractLine
49
- aria-hidden="true"
50
- class="size-4 flex-none fill-gray-medium"
51
- />
38
+ show-details
39
+ :organization="chart.organization"
40
+ :owner="chart.owner"
41
+ :organization-url="organizationUrl"
42
+ />
43
+ <ObjectCardMeta>
52
44
  <TranslationT
53
- tag="p"
54
- class="text-sm whitespace-nowrap mb-0 text-gray-medium"
45
+ tag="span"
46
+ class="tabular-nums"
55
47
  keypath="Mis à jour {date}"
56
48
  >
57
49
  <template #date>
@@ -62,40 +54,42 @@
62
54
  />
63
55
  </template>
64
56
  </TranslationT>
65
- </div>
66
-
67
- <div class="mx-0 -mb-1 flex flex-wrap items-center text-sm text-gray-medium mt-1">
68
- <p
69
- class="text-sm mb-0 flex items-center gap-0.5"
70
- :aria-label="t('{n} vues | {n} vue | {n} vues', chart.metrics.views)"
71
- >
72
- <RiEyeLine
73
- aria-hidden="true"
74
- class="size-3.5"
75
- />{{ summarize(chart.metrics.views) }}
76
- </p>
77
- </div>
78
-
79
- <ObjectCardShortDescription :text="chart.description" />
80
-
57
+ </ObjectCardMeta>
58
+ <ObjectCardMeta class="mt-1 max-[480px]:hidden">
59
+ <ObjectCardMetric
60
+ :icon="RiEyeLine"
61
+ :value="chart.metrics.views"
62
+ :label="t('{n} vues | {n} vue | {n} vues', chart.metrics.views)"
63
+ />
64
+ </ObjectCardMeta>
65
+ <ObjectCardShortDescription
66
+ :text="chart.description"
67
+ class="max-md:hidden"
68
+ />
81
69
  <slot />
82
70
  </ObjectCard>
83
71
  </template>
84
72
 
85
73
  <script setup lang="ts">
86
74
  import { computed } from 'vue'
87
- import { RiBarChartBoxLine, RiDeleteBinLine, RiEyeLine, RiLineChartLine, RiLockLine, RiSubtractLine } from '@remixicon/vue'
75
+ import {
76
+ RiBarChartBoxLine,
77
+ RiDeleteBinLine,
78
+ RiEyeLine,
79
+ RiLineChartLine,
80
+ RiLockLine,
81
+ } from '@remixicon/vue'
88
82
  import type { RouteLocationRaw } from 'vue-router'
89
83
  import type { Chart } from '../types/visualizations'
90
- import { summarize } from '../functions/helpers'
91
84
  import { useTranslation } from '../composables/useTranslation'
92
- import Placeholder from './Placeholder.vue'
85
+ import CardMedia from './CardMedia.vue'
93
86
  import FormattedDate from './FormattedDate.vue'
94
87
  import ObjectCard from './ObjectCard.vue'
95
88
  import ObjectCardBadge from './ObjectCardBadge.vue'
96
- import ObjectCardHeader from './ObjectCardHeader.vue'
97
- import ObjectCardOwner from './ObjectCardOwner.vue'
98
89
  import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
90
+ import ObjectCardMeta from './ObjectCardMeta.vue'
91
+ import ObjectCardMetric from './ObjectCardMetric.vue'
92
+ import ObjectCardOwner from './ObjectCardOwner.vue'
99
93
  import TranslationT from './TranslationT.vue'
100
94
 
101
95
  const props = defineProps<{
@@ -1,11 +1,34 @@
1
1
  <template>
2
2
  <ObjectCard
3
- :article-class="{
4
- 'border-tabular-api': isTabularApi,
5
- 'border-gray-default': !isTabularApi,
6
- }"
3
+ :url="dataserviceUrl || dataservice.self_web_url"
4
+ :icon="isTabularApi ? RiSparklingLine : RiTerminalLine"
5
+ :title-tag
6
+ :highlighted="isTabularApi"
7
7
  >
8
- <template #badge>
8
+ <template #media>
9
+ <OrganizationLogo
10
+ v-if="dataservice.organization"
11
+ :organization="dataservice.organization"
12
+ size-class="size-12 p-1"
13
+ />
14
+ <Avatar
15
+ v-else-if="dataservice.owner"
16
+ :user="dataservice.owner"
17
+ :size="48"
18
+ />
19
+ <Placeholder
20
+ v-else
21
+ type="Dataservice"
22
+ class="size-12"
23
+ />
24
+ </template>
25
+ <template #title>
26
+ {{ dataservice.title }}
27
+ </template>
28
+ <template
29
+ v-if="dataservice.private || dataservice.archived_at || dataservice.access_type === 'restricted' || dataservice.access_type === 'open_with_account'"
30
+ #badge
31
+ >
9
32
  <ObjectCardBadge
10
33
  v-if="dataservice.private"
11
34
  :icon="RiLockLine"
@@ -21,59 +44,29 @@
21
44
  <ObjectCardBadge
22
45
  v-else-if="dataservice.access_type === 'restricted'"
23
46
  :icon="RiLockLine"
47
+ tone="warning"
24
48
  >
25
49
  {{ t('Accès restreint') }}
26
50
  </ObjectCardBadge>
27
51
  <ObjectCardBadge
28
52
  v-else-if="dataservice.access_type === 'open_with_account'"
29
53
  :icon="RiPassValidLine"
54
+ tone="yellow"
30
55
  >
31
56
  {{ t('Ouvert avec un compte') }}
32
57
  </ObjectCardBadge>
33
58
  </template>
34
59
 
35
- <template #media>
36
- <OrganizationLogo
37
- v-if="dataservice.organization"
38
- :organization="dataservice.organization"
39
- size-class="size-12"
40
- />
41
- <Avatar
42
- v-else-if="dataservice.owner"
43
- :user="dataservice.owner"
44
- :size="48"
45
- />
46
- <Placeholder
47
- v-else
48
- type="Dataservice"
49
- class="size-12"
50
- />
51
- </template>
52
-
53
- <ObjectCardHeader
54
- :icon="isTabularApi ? RiSparklingLine : RiTerminalLine"
55
- :url="dataserviceUrl || dataservice.self_web_url"
56
- :title-tag="titleTag"
57
- >
58
- {{ dataservice.title }}
59
- </ObjectCardHeader>
60
- <div
61
- v-if="dataservice.organization || dataservice.owner"
62
- class="text-sm flex flex-wrap md:flex-nowrap gap-y-1 items-center truncate"
63
- >
64
- <ObjectCardOwner
65
- :organization="dataservice.organization"
66
- :owner="dataservice.owner"
67
- :organization-url="organizationUrl"
68
- />
69
- <RiSubtractLine
70
- aria-hidden="true"
71
- class="size-4 flex-none fill-gray-medium"
72
- />
73
- <!-- https://github.com/datagouv/cdata/issues/653 -->
60
+ <ObjectCardOwner
61
+ show-details
62
+ :organization="dataservice.organization"
63
+ :owner="dataservice.owner"
64
+ :organization-url="organizationUrl"
65
+ />
66
+ <ObjectCardMeta>
74
67
  <TranslationT
75
- tag="p"
76
- class="text-sm whitespace-nowrap mb-0 text-gray-medium"
68
+ tag="span"
69
+ class="tabular-nums"
77
70
  keypath="Mis à jour {date}"
78
71
  >
79
72
  <template #date>
@@ -84,41 +77,29 @@
84
77
  />
85
78
  </template>
86
79
  </TranslationT>
87
- <RiSubtractLine
88
- aria-hidden="true"
89
- class="size-4 flex-none fill-gray-medium"
80
+ <DataserviceQualityInline
81
+ v-if="dataservice.quality"
82
+ :quality="dataservice.quality"
83
+ class="max-[480px]:hidden"
90
84
  />
91
- <div class="flex items-center gap-1 text-gray-medium">
92
- <p
93
- class="text-sm mb-0 flex items-center gap-0.5"
94
- :aria-label="t('{n} vues | {n} vue | {n} vues', dataservice.metrics.views)"
95
- >
96
- <RiEyeLine
97
- aria-hidden="true"
98
- class="size-3.5"
99
- />{{ summarize(dataservice.metrics.views) }}
100
- </p>
101
- <p
102
- class="text-sm mb-0 flex items-center gap-0.5"
103
- :aria-label="t('{n} abonnés | {n} abonné | {n} abonnés', dataservice.metrics.followers)"
104
- >
105
- <RiStarLine
106
- aria-hidden="true"
107
- class="size-3.5"
108
- />{{ summarize(dataservice.metrics.followers) }}
109
- </p>
110
- </div>
111
- </div>
112
- <DataserviceQualityInline
113
- v-if="dataservice.quality"
114
- :quality="dataservice.quality"
115
- />
116
-
85
+ <ObjectCardMetrics class="max-[480px]:hidden">
86
+ <ObjectCardMetric
87
+ :icon="RiEyeLine"
88
+ :value="dataservice.metrics.views"
89
+ :label="t('{n} vues | {n} vue | {n} vues', dataservice.metrics.views)"
90
+ />
91
+ <ObjectCardMetric
92
+ :icon="RiStarLine"
93
+ :value="dataservice.metrics.followers"
94
+ :label="t('{n} abonnés | {n} abonné | {n} abonnés', dataservice.metrics.followers)"
95
+ />
96
+ </ObjectCardMetrics>
97
+ </ObjectCardMeta>
117
98
  <ObjectCardShortDescription
118
99
  v-if="showDescription"
119
100
  :text="dataservice.description"
101
+ class="max-md:hidden"
120
102
  />
121
-
122
103
  <slot />
123
104
  </ObjectCard>
124
105
  </template>
@@ -126,9 +107,16 @@
126
107
  <script setup lang="ts">
127
108
  import { computed } from 'vue'
128
109
  import type { RouteLocationRaw } from 'vue-router'
129
- import { RiArchiveLine, RiEyeLine, RiLockLine, RiPassValidLine, RiSparklingLine, RiStarLine, RiSubtractLine, RiTerminalLine } from '@remixicon/vue'
110
+ import {
111
+ RiArchiveLine,
112
+ RiEyeLine,
113
+ RiLockLine,
114
+ RiPassValidLine,
115
+ RiSparklingLine,
116
+ RiStarLine,
117
+ RiTerminalLine,
118
+ } from '@remixicon/vue'
130
119
  import { useComponentsConfig } from '../config'
131
- import { summarize } from '../functions/helpers'
132
120
  import type { Dataservice } from '../types/dataservices'
133
121
  import type { TitleTag } from '../types/ui'
134
122
  import { useTranslation } from '../composables/useTranslation'
@@ -137,7 +125,9 @@ import Avatar from './Avatar.vue'
137
125
  import Placeholder from './Placeholder.vue'
138
126
  import ObjectCard from './ObjectCard.vue'
139
127
  import ObjectCardBadge from './ObjectCardBadge.vue'
140
- import ObjectCardHeader from './ObjectCardHeader.vue'
128
+ import ObjectCardMeta from './ObjectCardMeta.vue'
129
+ import ObjectCardMetric from './ObjectCardMetric.vue'
130
+ import ObjectCardMetrics from './ObjectCardMetrics.vue'
141
131
  import ObjectCardOwner from './ObjectCardOwner.vue'
142
132
  import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
143
133
  import DataserviceQualityInline from './DataserviceQualityInline.vue'
@@ -164,9 +154,3 @@ const isTabularApi = computed(() => {
164
154
  return config.tabularApiDataserviceId === props.dataservice.id
165
155
  })
166
156
  </script>
167
-
168
- <style scoped>
169
- .border-tabular-api {
170
- border-color: #373C42 !important;
171
- }
172
- </style>
@@ -1,31 +1,15 @@
1
1
  <template>
2
- <div class="m-0 text-sm text-gray-medium">
3
- <Toggletip
4
- :styled-button="false"
5
- button-class="border-transparent -outline-offset-2 inline-flex items-center justify-center hover:bg-gray-lower transition-colors"
6
- :button-props="{ class: 'relative z-2 gap-1 rounded-sm px-1 -mx-1 group/quality', title: t('Qualité des métadonnées') }"
7
- >
8
- <RiInformationLine class="size-3.5 shrink-0" />
9
- <span class="text-gray-medium text-sm group-hover/quality:underline">{{ t('Métadonnées :') }}</span>
10
- <QualityScore :score="quality.score" />
11
- <template #toggletip>
12
- <DataserviceQualityTooltipContent :quality />
13
- </template>
14
- </Toggletip>
15
- </div>
2
+ <ObjectCardQuality :score="quality.score">
3
+ <DataserviceQualityTooltipContent :quality />
4
+ </ObjectCardQuality>
16
5
  </template>
17
6
 
18
7
  <script setup lang="ts">
19
- import { RiInformationLine } from '@remixicon/vue'
20
8
  import type { DataserviceQuality } from '../types/dataservices'
21
- import QualityScore from './QualityScore.vue'
22
9
  import DataserviceQualityTooltipContent from './DataserviceQualityTooltipContent.vue'
23
- import Toggletip from './Toggletip.vue'
24
- import { useTranslation } from '../composables/useTranslation'
10
+ import ObjectCardQuality from './ObjectCardQuality.vue'
25
11
 
26
12
  defineProps<{
27
13
  quality: DataserviceQuality
28
14
  }>()
29
-
30
- const { t } = useTranslation()
31
15
  </script>