Skip to content

Commit 13ae9e1

Browse files
authored
Merge pull request #703 from dnum-mi/develop
Develop
2 parents df8a6e8 + 625646c commit 13ae9e1

File tree

99 files changed

+4421
-676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+4421
-676
lines changed

.husky/commit-msg

100644100755
File mode changed.

.husky/pre-commit

100644100755
File mode changed.

.husky/pre-push

100644100755
File mode changed.

.storybook/preview.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { Preview } from "@storybook/vue3"
2-
import { setup } from "@storybook/vue3"
1+
import type { Preview } from '@storybook/vue3'
2+
import { setup } from '@storybook/vue3'
33
import { themes } from '@storybook/theming'
4-
import { withThemeByDataAttribute } from "@storybook/addon-styling"
4+
import { withThemeByDataAttribute } from '@storybook/addon-styling'
55
import { FocusTrap } from 'focus-trap-vue'
66
import { defineComponent } from 'vue'
77
import { OhVueIcon as VIcon} from 'oh-vue-icons'
@@ -33,7 +33,7 @@ const preview: Preview = {
3333
docs: {
3434
theme: { ...themes.normal, ...VueDsfrTheme },
3535
},
36-
actions: { argTypesRegex: "^on[A-Z].*" },
36+
actions: { argTypesRegex: '^on[A-Z].*' },
3737
controls: {
3838
matchers: {
3939
color: /(background|color)$/i,

.vitepress/config.ts

Lines changed: 153 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,65 @@ import { whyframe } from '@whyframe/core'
55
import { whyframeVue } from '@whyframe/vue'
66
import { hmrFix } from './plugins/hmrFix.js'
77

8+
const composants = [
9+
{
10+
text: 'DsfrAccordion',
11+
link: '/composants/DsfrAccordion.md',
12+
},
13+
{
14+
text: 'DsfrAlert',
15+
link: '/composants/DsfrAlert.md',
16+
},
17+
{
18+
text: 'DsfrBackToTop',
19+
link: '/composants/DsfrBackToTop.md',
20+
},
21+
{
22+
text: 'DsfrBadge',
23+
link: '/composants/DsfrBadge.md',
24+
},
25+
{
26+
text: 'DsfrBreadcrumb',
27+
link: '/composants/DsfrBreadcrumb.md',
28+
},
29+
{
30+
text: 'DsfrButton',
31+
link: '/composants/DsfrButton.md',
32+
},
33+
{
34+
text: 'DsfrButtonGroup',
35+
link: '/composants/DsfrButtonGroup.md',
36+
},
37+
{
38+
text: 'DsfrCard',
39+
link: '/composants/DsfrCard.md',
40+
},
41+
{
42+
text: 'DsfrRange',
43+
link: '/composants/DsfrRange.md',
44+
},
45+
{
46+
text: 'DsfrNotice',
47+
link: '/composants/DsfrNotice.md',
48+
},
49+
{
50+
text: 'DsfrSegmented',
51+
link: '/composants/DsfrSegmented.md',
52+
},
53+
{
54+
text: 'DsfrSegmentedSet',
55+
link: '/composants/DsfrSegmentedSet.md',
56+
},
57+
{
58+
text: 'DsfrTag',
59+
link: '/composants/DsfrTag.md',
60+
},
61+
{
62+
text: 'DsfrTooltip',
63+
link: '/composants/DsfrTooltip.md',
64+
},
65+
]
66+
867
// https://vitepress.dev/reference/site-config
968
export default defineConfig({
1069
title: "VueDsfr",
@@ -14,11 +73,54 @@ export default defineConfig({
1473
appearance: { listenToStorageChanges: false }, // handling this in Story.vue itself to avoid flickering
1574

1675
rewrites: {
76+
'src/components/DsfrButton/DsfrButtonGroup.md': 'composants/DsfrButtonGroup.md',
77+
'src/components/DsfrSegmented/DsfrSegmentedSet.md': 'composants/DsfrSegmentedSet.md',
1778
'src/components/:comp/:comp.md': 'composants/:comp.md',
1879
'docs/:splat*': ':splat*',
1980
},
2081

2182
themeConfig: {
83+
docFooter: {
84+
next: 'Page suivante',
85+
prev: 'Page précédente',
86+
},
87+
logo: '/nouveau-logo-marianne-gouvernement.png',
88+
nav: [
89+
{
90+
text: 'Guide',
91+
link: '/guide/pour-commencer',
92+
items: [
93+
{ text: 'Tous les composants', link: '/composants' },
94+
{ text: 'Tous les types', link: '/types' }
95+
],
96+
},
97+
{
98+
text: 'Références',
99+
items: [
100+
{ text: 'Tous les composants', link: '/composants' },
101+
{ text: 'Tous les types', link: '/types' }
102+
],
103+
},
104+
{
105+
text: 'Liens',
106+
items: [
107+
{
108+
text: 'Système de Design Français',
109+
link: 'https://www.systeme-de-design.gouv.fr/',
110+
target: '_blank'
111+
},
112+
{
113+
text: 'Storybook de VueDsfr',
114+
link: 'https://vue-ds.fr/',
115+
target: '_blank'
116+
},
117+
],
118+
},
119+
],
120+
outline:{
121+
level: [2, 3],
122+
label: 'Sur cette page :',
123+
},
22124
search: {
23125
provider: 'local',
24126
options: {
@@ -36,97 +138,80 @@ export default defineConfig({
36138
selectText: 'aller à ce texte',
37139
navigateText: 'naviguer dans les résultats',
38140
closeText: 'fermer'
39-
}
40-
}
141+
},
142+
},
41143
},
42144
}
43145
},
44-
outline:{
45-
level: [2, 3],
46-
label: 'Sur cette page :',
146+
sidebar: {
147+
'/composants': composants,
148+
'/': [
149+
{
150+
text: 'Guide',
151+
items: [
152+
{
153+
text: 'Introduction',
154+
link: '/guide/',
155+
},
156+
{
157+
text: 'Commencer',
158+
link: '/guide/pour-commencer',
159+
},
160+
{
161+
text: 'L’écosystème',
162+
link: '/guide/ecosysteme',
163+
},
164+
{
165+
text: 'Les icônes',
166+
link: '/guide/icones',
167+
},
168+
{
169+
text: 'Guide du développeur',
170+
link: '/guide/guide-developpeur',
171+
},
172+
]
173+
},
174+
{
175+
text: 'Tous les types',
176+
link: '/types',
177+
items: [],
178+
},
179+
{
180+
text: 'Tous les composants',
181+
link: '/composants',
182+
items: [],
183+
},
184+
{
185+
text: 'Recettes nuxt',
186+
link: '/nuxt/',
187+
},
188+
],
47189
},
48-
logo: '/nouveau-logo-marianne-gouvernement.png',
49-
// https://vitepress.dev/reference/default-theme-config
50-
nav: [
51-
{ text: 'Home', link: '/' },
52-
],
53-
54-
sidebar: [
55-
{
56-
text: 'Pour commencer',
57-
collapsed: false,
58-
items: [
59-
{
60-
text: 'Commencer',
61-
link: '/pour-commencer',
62-
},
63-
{
64-
text: 'L’écosystème',
65-
link: '/ecosysteme',
66-
},
67-
{
68-
text: 'Les icônes',
69-
link: '/icones',
70-
},
71-
{
72-
text: 'Guide du développeur',
73-
link: '/guide-developpeur',
74-
},
75-
]
76-
},
77-
{
78-
text: 'Tous les types',
79-
link: '/types',
80-
items: []
81-
},
82-
{
83-
text: 'Tous les composants',
84-
link: '/composants',
85-
collapsed: false,
86-
items: [
87-
{
88-
text: 'DsfrAlert',
89-
link: '/composants/DsfrAlert.md',
90-
},
91-
{
92-
text: 'DsfrBadge',
93-
link: '/composants/DsfrBadge.md',
94-
},
95-
{
96-
text: 'DsfrNotice',
97-
link: '/composants/DsfrNotice.md',
98-
},
99-
]
100-
},
101-
{
102-
text: 'Recettes nuxt',
103-
link: '/nuxt/',
104-
},
105-
],
106190

107191
socialLinks: [
108-
{ icon: 'github', link: 'https://github.com/dnum-mi/vue-dsfr' }
192+
{ icon: 'github', link: 'https://github.com/dnum-mi/vue-dsfr' },
193+
{ icon: 'discord', link: 'https://discord.gg/jbBJ9769ZZ' },
109194
]
110195
},
111196

112197
vite: {
113198
plugins: [
114199
whyframe({ defaultSrc: '/_frame', components: [{ name: 'Story' }] }),
115200
whyframeVue({ include: /\.(vue|md)$/ }),
116-
hmrFix()
201+
hmrFix(),
117202
],
118203

119204
resolve: {
120205
alias: {
121206
'@': fileURLToPath(new URL('../src', import.meta.url)),
122-
}
207+
},
123208
},
124209

125210
// not needed, just there to prevent reload on cold start
126211
optimizeDeps: {
127212
include: [
128213
'@vueuse/core',
129-
]
130-
}
214+
],
215+
},
131216
},
132217
})

.vitepress/theme/VIconLink.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ withDefaults(defineProps<{
55
href: string
66
rel?: string
77
target?: string
8+
internal?: boolean
89
icon?: string | InstanceType<typeof VIcon>['$props']
910
iconLeft: string | InstanceType<typeof VIcon>['$props']
1011
}>(), {
11-
rel: 'noreferrer',
12+
rel: 'noopener noreferrer',
1213
target: '_blank',
1314
})
1415
</script>
1516

1617
<template>
17-
<a :href="href" :target="target" :rel="rel">
18+
<a :href="href" :target="internal ? undefined : target" :rel="internal ? undefined : rel">
1819
<VIcon v-if="iconLeft" style="margin-right: 0.125rem;" v-bind="typeof iconLeft == 'object' ? iconLeft : { name: iconLeft }" />
1920
<slot />
2021
<VIcon v-if="icon" style="margin-left: 0.125rem;" v-bind="typeof icon == 'object' ? icon : { name: icon }" />

.vitepress/theme/icons.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
export {
2-
RiCloseLine,
2+
GiChocolateBar,
3+
RiArrowDownLine,
34
RiArrowDropDownLine,
45
RiArrowDropUpLine,
6+
RiCloseLine,
7+
RiMoonLine,
8+
RiRefreshLine,
59
SiDiscord,
610
SiGithub,
711
SiNpm,
12+
SiNuxtdotjs,
813
SiVisualstudiocode,
14+
ViFileTypeStorybook,
915
} from 'oh-vue-icons/icons'

.vitepress/theme/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Theme } from 'vitepress'
22
import DefaultTheme from 'vitepress/theme'
33
import { OhVueIcon as VIcon, addIcons } from 'oh-vue-icons'
4+
import { RouterLink } from 'vue-router'
45

56
import Story from './Story.vue'
67
import VIconLink from './VIconLink.vue'
@@ -16,5 +17,6 @@ export default {
1617
app.component('VIcon', VIcon)
1718
app.component('VIconLink', VIconLink)
1819
app.component('Story', Story)
20+
app.component('RouterLink', RouterLink)
1921
}
2022
} satisfies Theme

0 commit comments

Comments
 (0)