From 2191479f8319c6f05690d61d161e8db6a4781866 Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Wed, 1 Apr 2026 15:09:19 +0200 Subject: [PATCH 1/7] feat(datagouv-components): add listbox components --- .../src/components/Form/Listbox.vue | 74 +++++++ datagouv-components/src/main.ts | 2 + pages/design.vue | 7 +- pages/design/listbox.vue | 186 ++++++++++++++++++ 4 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 datagouv-components/src/components/Form/Listbox.vue create mode 100644 pages/design/listbox.vue diff --git a/datagouv-components/src/components/Form/Listbox.vue b/datagouv-components/src/components/Form/Listbox.vue new file mode 100644 index 000000000..a8f06127e --- /dev/null +++ b/datagouv-components/src/components/Form/Listbox.vue @@ -0,0 +1,74 @@ + + + diff --git a/datagouv-components/src/main.ts b/datagouv-components/src/main.ts index 47abe01a2..e777147f1 100644 --- a/datagouv-components/src/main.ts +++ b/datagouv-components/src/main.ts @@ -94,6 +94,7 @@ import GlobalSearch from './components/Search/GlobalSearch.vue' import SearchInput from './components/Search/SearchInput.vue' import SearchableSelect from './components/Form/SearchableSelect.vue' import SelectGroup from './components/Form/SelectGroup.vue' +import Listbox from './components/Form/Listbox.vue' import type { UseFetchFunction } from './functions/api.types' import { configKey, useComponentsConfig, type PluginConfig } from './config.js' @@ -318,4 +319,5 @@ export { SearchInput, SearchableSelect, SelectGroup, + Listbox, } diff --git a/pages/design.vue b/pages/design.vue index 76a413626..271352da5 100644 --- a/pages/design.vue +++ b/pages/design.vue @@ -68,6 +68,11 @@ :label="$t('Traductions')" to="/design/translations" /> +
@@ -77,7 +82,7 @@ From a46f4ded33d76cf78cf0f37e1243ff4aa60e27d7 Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Wed, 1 Apr 2026 15:39:36 +0200 Subject: [PATCH 2/7] chore: lint --- .../src/components/Form/Listbox.vue | 118 ++++++++++-------- pages/design/listbox.vue | 12 +- 2 files changed, 76 insertions(+), 54 deletions(-) diff --git a/datagouv-components/src/components/Form/Listbox.vue b/datagouv-components/src/components/Form/Listbox.vue index a8f06127e..2a2e96529 100644 --- a/datagouv-components/src/components/Form/Listbox.vue +++ b/datagouv-components/src/components/Form/Listbox.vue @@ -1,59 +1,77 @@ diff --git a/pages/design/listbox.vue b/pages/design/listbox.vue index 970001316..e98b8ebea 100644 --- a/pages/design/listbox.vue +++ b/pages/design/listbox.vue @@ -68,7 +68,10 @@ }" /> {{ option.label }} - (active) + (active)
@@ -110,7 +113,10 @@ }" /> {{ option.label }} - (active) + (active) @@ -166,8 +172,6 @@ const colors: Color[] = [ { id: 'purple', name: 'Purple', hex: '#a855f7' }, ] -const selectedColor = ref(colors[0]) - const statuses: Status[] = [ { id: 'draft', label: 'Draft' }, { id: 'review', label: 'In Review' }, From e4088434fb9d0c6d9961647eb16fbed851bcea8d Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Wed, 1 Apr 2026 15:43:41 +0200 Subject: [PATCH 3/7] chore: linter --- pages/design/listbox.vue | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pages/design/listbox.vue b/pages/design/listbox.vue index e98b8ebea..6ee329f60 100644 --- a/pages/design/listbox.vue +++ b/pages/design/listbox.vue @@ -164,14 +164,6 @@ const fruits: Fruit[] = [ const selectedFruit = ref(fruits[0]) -const colors: Color[] = [ - { id: 'red', name: 'Red', hex: '#ef4444' }, - { id: 'green', name: 'Green', hex: '#22c55e' }, - { id: 'blue', name: 'Blue', hex: '#3b82f6' }, - { id: 'yellow', name: 'Yellow', hex: '#eab308' }, - { id: 'purple', name: 'Purple', hex: '#a855f7' }, -] - const statuses: Status[] = [ { id: 'draft', label: 'Draft' }, { id: 'review', label: 'In Review' }, From 6a808d0ec4ade017a6c29e17408c6b7e0fd1e86f Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Wed, 1 Apr 2026 15:46:09 +0200 Subject: [PATCH 4/7] chore: lint --- pages/design/listbox.vue | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pages/design/listbox.vue b/pages/design/listbox.vue index 6ee329f60..6f9b87022 100644 --- a/pages/design/listbox.vue +++ b/pages/design/listbox.vue @@ -129,23 +129,17 @@ import { Listbox } from '@datagouv/components-next' import BreadcrumbItem from '~/components/Breadcrumbs/BreadcrumbItem.vue' -interface Fruit { +type Fruit = { id: string label: string } -interface Color { - id: string - name: string - hex: string -} - -interface Status { +type Status = { id: string label: string } -interface Priority { +type Priority = { id: string label: string } From 2d7329c2eaedf0a0c8fb1d8b65bd9a059d0f9d1c Mon Sep 17 00:00:00 2001 From: Nicolas Kempf Le Stanc Date: Thu, 2 Apr 2026 08:58:16 +0200 Subject: [PATCH 5/7] fix(listbox) layout --- .../src/components/Form/Listbox.vue | 11 +- design-system/ChartConfigurator.vue | 567 ++++++++++++++++++ 2 files changed, 574 insertions(+), 4 deletions(-) create mode 100644 design-system/ChartConfigurator.vue diff --git a/datagouv-components/src/components/Form/Listbox.vue b/datagouv-components/src/components/Form/Listbox.vue index 2a2e96529..b8ff1ef36 100644 --- a/datagouv-components/src/components/Form/Listbox.vue +++ b/datagouv-components/src/components/Form/Listbox.vue @@ -8,9 +8,12 @@ ref="floatingReference" class="relative w-full cursor-default overflow-hidden bg-white text-left shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 focus-visible:ring-offset-2 focus-visible:ring-offset-teal-300 sm:text-sm" > - - - {{ model ? displayValue(model) : '' }} + + +
+ {{ model ? displayValue(model) : '' }} + +
@@ -58,7 +61,7 @@ import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/vue' import { useFloating, autoUpdate, autoPlacement } from '@floating-ui/vue' import { toValue, useTemplateRef } from 'vue' -import { RiCheckLine } from '@remixicon/vue' +import { RiArrowDownSLine, RiCheckLine } from '@remixicon/vue' const props = withDefaults(defineProps<{ options?: Array diff --git a/design-system/ChartConfigurator.vue b/design-system/ChartConfigurator.vue new file mode 100644 index 000000000..e9acf1acd --- /dev/null +++ b/design-system/ChartConfigurator.vue @@ -0,0 +1,567 @@ +