Skip to content

Commit 30e0712

Browse files
committed
feat!: ✨ utilise iconify au lieu de oh-vue-icons
BREAKING CHANGE: Les icônes sont désormais chargées via Iconify. Cf. documentation.
1 parent b346af3 commit 30e0712

File tree

136 files changed

+3056
-35201
lines changed

Some content is hidden

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

136 files changed

+3056
-35201
lines changed

.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { themes } from '@storybook/theming'
44
import { withThemeByDataAttribute } from '@storybook/addon-styling'
55
import { FocusTrap } from 'focus-trap-vue'
66
import { defineComponent } from 'vue'
7-
import { OhVueIcon as VIcon } from 'oh-vue-icons'
7+
import VIcon from '../src/components/VIcon/VIcon.vue'
88

99
import VueDsfrTheme from './vue-dsfr-theme.js'
1010
import '../src/assets/variables-fdr.css'

.vitepress/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ const guideItems = [
6262
text: 'Les icônes',
6363
link: '/guide/icones.md',
6464
},
65+
{
66+
text: 'Migrations',
67+
link: '/guide/migrations.md',
68+
},
6569
{
6670
text: 'Guide du développeur',
6771
link: '/guide/guide-developpeur.md',
@@ -271,6 +275,10 @@ const composants = [
271275
text: 'DsfrTooltip',
272276
link: '/composants/DsfrTooltip.md',
273277
},
278+
{
279+
text: 'VIcon',
280+
link: '/composants/VIcon.md',
281+
},
274282
]
275283

276284
// https://vitepress.dev/reference/site-config

.vitepress/theme/VIconLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import type { OhVueIcon as VIcon } from 'oh-vue-icons'
2+
import type VIcon from '../../src/components/VIcon.vue'
33
44
withDefaults(defineProps<{
55
href: string

.vitepress/theme/icons.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

.vitepress/theme/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import type { Theme } from 'vitepress'
22
import DefaultTheme from 'vitepress/theme'
3-
import { OhVueIcon as VIcon, addIcons } from 'oh-vue-icons'
43
import { RouterLink } from 'vue-router'
54

65
import Story from './Story.vue'
76
import AppColors from './AppColors.vue'
87
import AppIcons from './AppIcons.vue'
98
import VIconLink from './VIconLink.vue'
10-
import * as vpIcons from './icons'
119

1210
import './official-icons.css'
1311
import '@gouvfr/dsfr/dist/utility/icons/icons.main.css'
1412
import './style.css'
15-
16-
addIcons(...Object.values(vpIcons))
13+
import VIcon from '../../src/components/VIcon/VIcon.vue'
1714

1815
export default {
1916
extends: DefaultTheme,

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Language support for Vue 3
66
// https://github.com/johnsoncodehk/volar
77
"vue.volar",
8-
"vue.vscode-typescript-vue-plugin",
98

109
// Language support for PostCSS
1110
// https://github.com/csstools/postcss-language

demo-app/main.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1+
import { Icon } from '@iconify/vue'
12
import { createApp } from 'vue'
23

3-
import {
4-
RiCheckboxCircleLine,
5-
RiNotification3Line,
6-
RiGithubFill,
7-
} from 'oh-vue-icons/icons'
8-
94
import '@gouvfr/dsfr/dist/core/core.main.min.css'
105
import '@gouvfr/dsfr/dist/scheme/scheme.min.css'
116
import '@gouvfr/dsfr/dist/component/component.main.min.css'
@@ -19,7 +14,8 @@ import App from './App.vue'
1914

2015
createApp(App)
2116
.use(router)
22-
.use(VueDsfr, { icons: [RiCheckboxCircleLine, RiNotification3Line, RiGithubFill] })
17+
.component('Icon', Icon)
18+
.use(VueDsfr)
2319
.mount('#app')
2420

2521
window.dsfr = {

demo-app/views/AboutUs.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
<script lang="ts" setup>
2+
import { ref } from 'vue'
3+
4+
import MyIcon from '../../src/components/VIcon.vue'
5+
6+
const title = ref('SVG À propos')
7+
setTimeout(() => {
8+
title.value = 'SVG À propos (updated)'
9+
}, 2000)
10+
</script>
11+
112
<template>
213
À propos
14+
<MyIcon
15+
name="ri-checkbox-circle-line"
16+
:scale="2"
17+
animation="float"
18+
label="icon label"
19+
:title="title"
20+
/>
21+
Prout
22+
<VIcon
23+
name="ri-checkbox-circle-line"
24+
scale="2"
25+
animation="float"
26+
label="icon label"
27+
title="icon title"
28+
/>
29+
Prout
330
</template>

docs/_frame.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@ layout: false
77
<script setup lang="ts">
88
import { useStyleTag } from '@vueuse/core'
99
import { onMounted, ref } from 'vue'
10-
import { OhVueIcon as VIcon, addIcons } from 'oh-vue-icons'
1110
import { createApp } from 'whyframe:app'
1211

1312
import dsfrStyles from '@gouvfr/dsfr/dist/dsfr.min.css?inline'
1413
import dsfrIcons from '@gouvfr/dsfr/dist/utility/icons/icons.min.css?inline'
1514

16-
import * as icons from '../src/icons'
17-
18-
addIcons(...Object.values(icons))
19-
2015
useStyleTag(dsfrStyles, { id: 'dsfr' })
2116
useStyleTag(dsfrIcons, { id: 'dsfr-icons' })
2217

docs/docs-demo/DemoIconesDansComposants.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ import DsfrButton from '../../src/components/DsfrButton/DsfrButton.vue'
55
<template>
66
<div class="fr-p-2w flex gap-4 flex-wrap">
77
<DsfrButton icon="fr-icon-close-line">
8-
Texte avec icône Dsfr
8+
Texte avec icône Dsfr (commence par <code>'fr-'</code>)
99
</DsfrButton>
1010

1111
<DsfrButton icon="ri-close-line">
12-
Texte avec icône OhVueIcon
12+
Texte avec icône @iconify/vue
1313
</DsfrButton>
1414

1515
<DsfrButton
16-
:icon="{ name: 'ri-close-line', fill: 'purple' }"
16+
:icon="{ name: 'ri-close-line', color: 'green', animation: 'flash' }"
1717
secondary
1818
>
1919
Texte avec icône
20-
OhVueIcon violette
20+
<code>@iconify/vue</code>
21+
<span style="color: green"> verte </span>
22+
avec animation 'flash'
2123
</DsfrButton>
2224
</div>
2325
</template>

0 commit comments

Comments
 (0)