diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ee182485..d966f337 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: 18 + node-version: 20 - name: Install pnpm run: npm i -g pnpm - name: Install dependencies @@ -32,5 +32,16 @@ jobs: run: pnpm lint --quiet - name: Test run: pnpm test + - name: Install Playwright + run: pnpx playwright install --with-deps + - name: Build Storybook + run: pnpm build-storybook --quiet + - name: Serve Storybook and run tests + env: + TEST_STORYBOOK_URL: http://localhost:6006 + run: | + pnpx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ + "pnpx http-server storybook-static --port 6006 --silent" \ + "pnpx wait-on tcp:6006 && pnpm test-storybook" - name: Build run: pnpm build diff --git a/.husky/commit-msg b/.husky/commit-msg index b5676766..eff685f9 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx --no -- commitlint --edit "$1" +pnpx commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index d24fdfc6..09dd6bf4 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx lint-staged +pnpx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push index 610c2a54..98475b50 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npm test +pnpm test diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 9516725b..e47a6446 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -4,7 +4,7 @@ import { themes } from '@storybook/theming' import { withThemeByDataAttribute } from '@storybook/addon-styling' import { FocusTrap } from 'focus-trap-vue' import { defineComponent } from 'vue' -import { OhVueIcon as VIcon } from 'oh-vue-icons' +import VIcon from '../src/components/VIcon/VIcon.vue' import VueDsfrTheme from './vue-dsfr-theme.js' import '../src/assets/variables-fdr.css' diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 3a86ddd8..3b42fe8b 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -62,6 +62,10 @@ const guideItems = [ text: 'Les icônes', link: '/guide/icones.md', }, + { + text: 'Migrations', + link: '/guide/migrations.md', + }, { text: 'Guide du développeur', link: '/guide/guide-developpeur.md', @@ -95,6 +99,10 @@ const composants = [ text: 'DsfrAccordion', link: '/composants/DsfrAccordion.md', }, + { + text: 'DsfrAccordionsGroup', + link: '/composants/DsfrAccordionsGroup.md', + }, { text: 'DsfrAlert', link: '/composants/DsfrAlert.md', @@ -119,6 +127,10 @@ const composants = [ text: 'DsfrButtonGroup', link: '/composants/DsfrButtonGroup.md', }, + { + text: 'DsfrCallout', + link: '/composants/DsfrCallout.md', + }, { text: 'DsfrCard', link: '/composants/DsfrCard.md', @@ -135,6 +147,10 @@ const composants = [ text: 'DsfrConsent', link: '/composants/DsfrConsent.md', }, + { + text: 'DsfrDataTable', + link: '/composants/DsfrDataTable.md', + }, { text: 'DsfrErrorPage', link: '/composants/DsfrErrorPage.md', @@ -271,6 +287,10 @@ const composants = [ text: 'DsfrTooltip', link: '/composants/DsfrTooltip.md', }, + { + text: 'VIcon', + link: '/composants/VIcon.md', + }, ] // https://vitepress.dev/reference/site-config diff --git a/.vitepress/theme/VIconLink.vue b/.vitepress/theme/VIconLink.vue index acd39dc3..dbd18c38 100644 --- a/.vitepress/theme/VIconLink.vue +++ b/.vitepress/theme/VIconLink.vue @@ -1,5 +1,5 @@ + diff --git a/demo-app/views/AppAccordions.vue b/demo-app/views/AppAccordions.vue index a95d9465..522840ab 100644 --- a/demo-app/views/AppAccordions.vue +++ b/demo-app/views/AppAccordions.vue @@ -3,24 +3,66 @@ import { ref } from 'vue' import DsfrAccordion from '@/components/DsfrAccordion/DsfrAccordion.vue' import DsfrAccordionsGroup from '@/components/DsfrAccordion/DsfrAccordionsGroup.vue' +import DsfrTranscription from '@/components/DsfrTranscription/DsfrTranscription.vue' -const accordionTitle = 'Titre de l’accordéon' -const expandedId = ref(undefined) +const activeAccordion = ref(-1) +const activeAccordionInGroup = ref(-1) +const title1 = 'Un titre d’accordéon 1' +const title2 = 'Un titre d’accordéon 2' +const title3 = 'Un titre d’accordéon 3' + + diff --git a/demo-app/views/AppTabs.vue b/demo-app/views/AppTabs.vue index cf5723fd..05bd8c9d 100644 --- a/demo-app/views/AppTabs.vue +++ b/demo-app/views/AppTabs.vue @@ -12,76 +12,51 @@ const tabTitles = [ { title: 'Titre 2', icon: 'ri-checkbox-circle-line', tabId: 'tab-1', panelId: 'tab-content-1' }, ] const selectedTabIndex = ref(0) -const asc = ref(true) -const initialSelectedIndex = 0 const title1 = 'Un titre d’accordéon 1' const title2 = 'Un titre d’accordéon 2' const title3 = 'Un titre d’accordéon 3' -const expandedId = ref(undefined) - -function selectTab (idx) { - asc.value = selectedTabIndex.value < idx - selectedTabIndex.value = idx -} +const activeAccordion = ref(-1)