@cnamts/synapse 1.0.20 → 1.0.21
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.
- package/dist/{DateFilter-XURUmpMl.js → DateFilter-uN8OURoP.js} +1 -1
- package/dist/{NumberFilter-BZc0O8wV.js → NumberFilter-sm1dQNQi.js} +1 -1
- package/dist/{PeriodFilter-ZNdXcl3p.js → PeriodFilter-Cklsxnh9.js} +1 -1
- package/dist/{SelectFilter-DshYU5OK.js → SelectFilter-CWefj27Z.js} +1 -1
- package/dist/{TextFilter-D_c5dRPl.js → TextFilter-Ddyj885L.js} +1 -1
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +160 -0
- package/dist/components/Customs/SyCheckBoxGroup/locales.d.ts +3 -0
- package/dist/components/Customs/SyCheckBoxGroup/types.d.ts +10 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1545 -2
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1495 -2
- package/dist/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.d.ts +60 -0
- package/dist/components/ErrorPage/ErrorPage.d.ts +1 -12
- package/dist/components/ErrorPage/locales.d.ts +18 -3
- package/dist/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/components/MaintenancePage/locales.d.ts +18 -2
- package/dist/components/NotFoundPage/locales.d.ts +20 -4
- package/dist/components/StatusPage/StatusPage.d.ts +39 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +13 -3
- package/dist/components/index.d.ts +3 -0
- package/dist/design-system-v3.js +126 -123
- package/dist/design-system-v3.umd.cjs +163 -163
- package/dist/{main-CuI6xaPq.js → main-CWniLr0s.js} +15191 -14668
- package/dist/style.css +1 -1
- package/dist/utils/theme/index.d.ts +6 -0
- package/package.json +7 -4
- package/src/components/ContextualMenu/ContextualMenu.stories.ts +0 -3
- package/src/components/ContextualMenu/accessibilite/Accessibility.mdx +67 -11
- package/src/components/CookieBanner/CookieBanner.stories.ts +11 -20
- package/src/components/CookieBanner/CookieBanner.vue +20 -5
- package/src/components/CookieBanner/accessibilite/Accessibility.mdx +67 -11
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +48 -4
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.mdx +32 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +856 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +334 -0
- package/src/components/Customs/SyCheckBoxGroup/accessibilite/Accessibility.mdx +243 -0
- package/src/components/Customs/SyCheckBoxGroup/locales.ts +3 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.a11y.spec.ts +30 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.spec.ts +152 -0
- package/src/components/Customs/SyCheckBoxGroup/types.ts +10 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +16 -27
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +1 -1
- package/src/components/Customs/SyForm/SyForm.a11y.spec.ts +1 -1
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +16 -43
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +35 -11
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +43 -2
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +48 -21
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +98 -0
- package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.mdx +83 -0
- package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.stories.ts +502 -0
- package/src/components/DeclarationAccessibilityPage/DeclarationAccessibilityPage.vue +428 -0
- package/src/components/DeclarationAccessibilityPage/accessibilite/Accessibility.mdx +75 -0
- package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.a11y.spec.ts +53 -0
- package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.spec.ts +59 -0
- package/src/components/DiacriticPicker/DiacriticPicker.vue +20 -1
- package/src/components/ErrorPage/ErrorPage.mdx +6 -16
- package/src/components/ErrorPage/ErrorPage.stories.ts +16 -87
- package/src/components/ErrorPage/ErrorPage.vue +38 -125
- package/src/components/ErrorPage/accessibilite/Accessibility.mdx +68 -6
- package/src/components/ErrorPage/assets/error-ap.svg +1774 -0
- package/src/components/ErrorPage/locales.ts +21 -3
- package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +5 -13
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +2 -41
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +8 -266
- package/src/components/FileUpload/FileUpload.vue +5 -0
- package/src/components/FooterBar/FooterBar.stories.ts +18 -14
- package/src/components/FooterBar/defaultSocialMediaLinks.ts +6 -4
- package/src/components/MaintenancePage/MaintenancePage.mdx +1 -1
- package/src/components/MaintenancePage/MaintenancePage.vue +15 -7
- package/src/components/MaintenancePage/accessibilite/Accessibility.mdx +61 -6
- package/src/components/MaintenancePage/assets/maintenance-ap.svg +1718 -0
- package/src/components/MaintenancePage/locales.ts +24 -3
- package/src/components/MaintenancePage/tests/MaintenancePage.a11y.spec.ts +75 -3
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +42 -2
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -2
- package/src/components/NotFoundPage/NotFoundPage.mdx +1 -1
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +3 -3
- package/src/components/NotFoundPage/NotFoundPage.vue +16 -11
- package/src/components/NotFoundPage/accessibilite/Accessibility.mdx +78 -6
- package/src/components/NotFoundPage/assets/not-found-ap.svg +2061 -0
- package/src/components/NotFoundPage/locales.ts +24 -4
- package/src/components/NotFoundPage/tests/NotFoundPage.a11y.spec.ts +168 -4
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +100 -12
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +2 -2
- package/src/components/NotificationBar/NotificationBar.mdx +2 -2
- package/src/components/NotificationBar/accessibilite/Accessibility.mdx +68 -8
- package/src/components/PageContainer/tests/PageContainer.a11y.spec.ts +14 -7
- package/src/components/PhoneField/PhoneField.stories.ts +46 -38
- package/src/components/SocialMediaLinks/DefaultSocialMediaLinks.ts +6 -4
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +7 -5
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +17 -13
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +9 -1
- package/src/components/SocialMediaLinks/accessibilite/Accessibility.mdx +63 -11
- package/src/components/SocialMediaLinks/tests/DefaultSocialMediaLinks.spec.ts +5 -5
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.a11y.spec.ts +59 -0
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +9 -7
- package/src/components/StatusPage/StatusPage.mdx +22 -0
- package/src/components/StatusPage/StatusPage.stories.ts +193 -0
- package/src/components/StatusPage/StatusPage.vue +145 -0
- package/src/components/StatusPage/accessibilite/Accessibility.mdx +81 -0
- package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +29 -0
- package/src/components/StatusPage/tests/StatusPage.spec.ts +50 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +270 -0
- package/src/components/TableToolbar/TableToolbar.stories.ts +6 -6
- package/src/components/TableToolbar/TableToolbar.vue +1 -1
- package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +0 -5
- package/src/components/UploadWorkflow/UploadWorkflow.mdx +11 -1
- package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +107 -3
- package/src/components/UploadWorkflow/UploadWorkflow.vue +35 -24
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +48 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +9 -5
- package/src/components/UploadWorkflow/useFileList.ts +7 -0
- package/src/components/index.ts +3 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +39 -3
- package/src/composables/rules/useFieldValidation.ts +24 -9
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +7 -0
- package/src/utils/theme/index.ts +19 -0
- package/src/utils/theme/tests/useThemeLocales.spec.ts +245 -0
- package/dist/components/MaintenancePage/index.d.ts +0 -2
- package/src/components/Customs/SyPagination/tests/SyPagination.a11y.spec.ts +0 -27
- package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +0 -51
- package/src/components/DataListItem/tests/DataListItem.a11y.spec.ts +0 -31
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +0 -27
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.a11y.spec.ts +0 -26
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.a11y.spec.ts +0 -27
- package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +0 -26
- package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +0 -39
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.a11y.spec.ts +0 -45
- package/src/components/HeaderToolbar/tests/HeaderToolbar.a11y.spec.ts +0 -25
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +0 -31
- package/src/components/MaintenancePage/index.ts +0 -3
- package/src/components/PageContainer/Accessibilite/AccessibilityGuide.mdx +0 -0
- package/src/components/PaginatedTable/tests/PaginatedTable.a11y.spec.ts +0 -43
- package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +0 -34
- /package/src/components/NotFoundPage/assets/{not-found.svg → not-found-cnam.svg} +0 -0
- /package/src/components/PageContainer/{Accessibilite → accessibilite}/Accessibility.mdx +0 -0
|
@@ -1,55 +1,12 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import ErrorPage from './ErrorPage.vue'
|
|
3
3
|
|
|
4
|
-
const meta = {
|
|
4
|
+
const meta: Meta = {
|
|
5
5
|
title: 'Templates/ErrorPage',
|
|
6
6
|
component: ErrorPage,
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: 'fullscreen',
|
|
9
9
|
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
'code': {
|
|
12
|
-
description: 'Code d\'erreur affiché en premier plan',
|
|
13
|
-
},
|
|
14
|
-
'codeErrorText': {
|
|
15
|
-
description: 'Text affiché avant le code d\'erreur pour les outils d\'accessibilité',
|
|
16
|
-
table: {
|
|
17
|
-
defaultValue: {
|
|
18
|
-
summary: 'Code d\'erreur\xa0: ',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
'additional-content': {
|
|
23
|
-
control: {
|
|
24
|
-
type: 'text',
|
|
25
|
-
},
|
|
26
|
-
table: {
|
|
27
|
-
type: {
|
|
28
|
-
summary: '{}',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
'action': {
|
|
33
|
-
control: {
|
|
34
|
-
type: 'text',
|
|
35
|
-
},
|
|
36
|
-
table: {
|
|
37
|
-
type: {
|
|
38
|
-
summary: '{}',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
'illustration': {
|
|
43
|
-
control: {
|
|
44
|
-
type: 'text',
|
|
45
|
-
},
|
|
46
|
-
table: {
|
|
47
|
-
type: {
|
|
48
|
-
summary: '{}',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
10
|
} satisfies Meta<typeof ErrorPage>
|
|
54
11
|
|
|
55
12
|
export default meta
|
|
@@ -57,11 +14,9 @@ export default meta
|
|
|
57
14
|
type Story = StoryObj<typeof ErrorPage>
|
|
58
15
|
|
|
59
16
|
export const Default: Story = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
message: 'Une erreur est survenue de notre côté, veuillez réessayer plus tard. Si le problème persiste veuillez nous contacter par téléphone au 3646',
|
|
64
|
-
},
|
|
17
|
+
decorators: [
|
|
18
|
+
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
19
|
+
],
|
|
65
20
|
parameters: {
|
|
66
21
|
sourceCode: [
|
|
67
22
|
{
|
|
@@ -69,11 +24,7 @@ export const Default: Story = {
|
|
|
69
24
|
code: `
|
|
70
25
|
<template>
|
|
71
26
|
<div style="padding: 20px; background: rgb(231, 236, 245)">
|
|
72
|
-
<ErrorPage
|
|
73
|
-
page-title="une erreur est survenue"
|
|
74
|
-
code="500"
|
|
75
|
-
message="Une erreur est survenue de notre côté, veuillez réessayer plus tard. Si le problème persiste veuillez nous contacter par téléphone au 3646"
|
|
76
|
-
>
|
|
27
|
+
<ErrorPage />
|
|
77
28
|
</div>
|
|
78
29
|
</template>
|
|
79
30
|
`,
|
|
@@ -83,14 +34,10 @@ export const Default: Story = {
|
|
|
83
34
|
<script setup lang="ts">
|
|
84
35
|
import { ErrorPage } from '@cnamts/synapse'
|
|
85
36
|
</script>
|
|
86
|
-
|
|
87
37
|
`,
|
|
88
38
|
},
|
|
89
39
|
],
|
|
90
40
|
},
|
|
91
|
-
decorators: [
|
|
92
|
-
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
93
|
-
],
|
|
94
41
|
}
|
|
95
42
|
|
|
96
43
|
export const WithLink: Story = {
|
|
@@ -99,6 +46,9 @@ export const WithLink: Story = {
|
|
|
99
46
|
btnHref: '/',
|
|
100
47
|
btnText: 'Retour à l\'accueil',
|
|
101
48
|
},
|
|
49
|
+
decorators: [
|
|
50
|
+
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
51
|
+
],
|
|
102
52
|
parameters: {
|
|
103
53
|
sourceCode: [
|
|
104
54
|
{
|
|
@@ -106,13 +56,10 @@ export const WithLink: Story = {
|
|
|
106
56
|
code: `
|
|
107
57
|
<template>
|
|
108
58
|
<div style="padding: 20px; background: rgb(231, 236, 245)">
|
|
109
|
-
<ErrorPage
|
|
110
|
-
page-title="une erreur est survenue"
|
|
111
|
-
code="500"
|
|
112
|
-
message="Une erreur est survenue de notre côté, veuillez réessayer plus tard. Si le problème persiste veuillez nous contacter par téléphone au 3646"
|
|
59
|
+
<ErrorPage
|
|
113
60
|
btn-href=""
|
|
114
61
|
btn-text="Retour à l'accueil"
|
|
115
|
-
|
|
62
|
+
/>
|
|
116
63
|
</div>
|
|
117
64
|
</template>
|
|
118
65
|
`,
|
|
@@ -122,22 +69,16 @@ export const WithLink: Story = {
|
|
|
122
69
|
<script setup lang="ts">
|
|
123
70
|
import { ErrorPage } from '@cnamts/synapse'
|
|
124
71
|
</script>
|
|
125
|
-
|
|
126
72
|
`,
|
|
127
73
|
},
|
|
128
74
|
],
|
|
129
75
|
},
|
|
130
|
-
decorators: [
|
|
131
|
-
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
132
|
-
],
|
|
133
76
|
}
|
|
134
77
|
|
|
135
78
|
export const CustomIllustration: Story = {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
btnText: 'Retour à l\'accueil',
|
|
140
|
-
},
|
|
79
|
+
decorators: [
|
|
80
|
+
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
81
|
+
],
|
|
141
82
|
parameters: {
|
|
142
83
|
sourceCode: [
|
|
143
84
|
{
|
|
@@ -145,13 +86,7 @@ export const CustomIllustration: Story = {
|
|
|
145
86
|
code: `
|
|
146
87
|
<template>
|
|
147
88
|
<div style="padding: 20px; background: rgb(231, 236, 245)">
|
|
148
|
-
<ErrorPage
|
|
149
|
-
page-title="une erreur est survenue"
|
|
150
|
-
code="500"
|
|
151
|
-
message="Une erreur est survenue de notre côté, veuillez réessayer plus tard."
|
|
152
|
-
btn-href="/"
|
|
153
|
-
btn-text="Retour à l'accueil"
|
|
154
|
-
>
|
|
89
|
+
<ErrorPage>
|
|
155
90
|
<template #illustration>
|
|
156
91
|
<div style="width: 260px; height: 200px; display: grid; place-items: center; border-radius: 12px; background: white; border: 2px dashed #0D419A;">
|
|
157
92
|
<span style="font-weight: 700; color: #0D419A;">Illustration</span>
|
|
@@ -172,16 +107,10 @@ export const CustomIllustration: Story = {
|
|
|
172
107
|
},
|
|
173
108
|
],
|
|
174
109
|
},
|
|
175
|
-
|
|
176
|
-
() => ({ template: '<div style="padding: 20px; background: rgb(231, 236, 245)"><story /></div>' }),
|
|
177
|
-
],
|
|
178
|
-
render: args => ({
|
|
110
|
+
render: () => ({
|
|
179
111
|
components: { ErrorPage },
|
|
180
|
-
setup() {
|
|
181
|
-
return { args }
|
|
182
|
-
},
|
|
183
112
|
template: `
|
|
184
|
-
<ErrorPage
|
|
113
|
+
<ErrorPage>
|
|
185
114
|
<template #illustration>
|
|
186
115
|
<div style="width: 260px; height: 200px; display: grid; place-items: center; border-radius: 12px; background: white; border: 2px dashed #0D419A;">
|
|
187
116
|
<span style="font-weight: 700; color: #0D419A;">Illustration</span>
|
|
@@ -1,50 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { RouteRecordRaw } from 'vue-router'
|
|
3
2
|
import { locales } from './locales'
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
| { type: 'phone', value: string }
|
|
9
|
-
|
|
10
|
-
// Fonction pour formater le message et ajouter des liens tel: aux numéros de téléphone
|
|
11
|
-
const splitMessage = (message?: string): MessagePart[] => {
|
|
12
|
-
// Regex pour détecter les numéros de téléphone
|
|
13
|
-
if (!message)
|
|
14
|
-
return []
|
|
15
|
-
|
|
16
|
-
const regex = /\b(\d{4}|\d{10})\b/g
|
|
17
|
-
const parts: MessagePart[] = []
|
|
18
|
-
let lastIndex = 0
|
|
19
|
-
let match: RegExpExecArray | null
|
|
20
|
-
|
|
21
|
-
while ((match = regex.exec(message)) !== null) {
|
|
22
|
-
if (match.index > lastIndex) {
|
|
23
|
-
parts.push({
|
|
24
|
-
type: 'text',
|
|
25
|
-
value: message.slice(lastIndex, match.index),
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
parts.push({
|
|
30
|
-
type: 'phone',
|
|
31
|
-
value: match[1]!,
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
lastIndex = regex.lastIndex
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (lastIndex < message.length) {
|
|
38
|
-
parts.push({
|
|
39
|
-
type: 'text',
|
|
40
|
-
value: message.slice(lastIndex),
|
|
41
|
-
})
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return parts
|
|
45
|
-
}
|
|
3
|
+
import StatusPage from '../StatusPage/StatusPage.vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
6
|
+
import { useThemeLocales } from '@/utils/theme'
|
|
46
7
|
|
|
47
|
-
|
|
8
|
+
const props = defineProps<{
|
|
48
9
|
pageTitle?: string
|
|
49
10
|
message?: string
|
|
50
11
|
code?: string
|
|
@@ -53,94 +14,46 @@
|
|
|
53
14
|
btnHref?: string
|
|
54
15
|
btnLink?: RouteRecordRaw | string
|
|
55
16
|
hideBtn?: boolean
|
|
56
|
-
}>()
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const { themeLocales } = useThemeLocales(locales)
|
|
20
|
+
|
|
21
|
+
// Utiliser les props de l'utilisateur en priorité, sinon les locales
|
|
22
|
+
const pageTitle = computed(() => props.pageTitle ?? themeLocales.value.pageTitle)
|
|
23
|
+
const message = computed(() => props.message ?? themeLocales.value.message)
|
|
24
|
+
const code = computed(() => props.code ?? themeLocales.value.code)
|
|
25
|
+
const src = computed(() => themeLocales.value.src)
|
|
66
26
|
</script>
|
|
67
27
|
|
|
68
28
|
<template>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
29
|
+
<StatusPage
|
|
30
|
+
:page-title="pageTitle"
|
|
31
|
+
:message="message"
|
|
32
|
+
:code="code"
|
|
33
|
+
:code-error-text="props.codeErrorText"
|
|
34
|
+
:btn-text="props.btnText"
|
|
35
|
+
:btn-href="props.btnHref"
|
|
36
|
+
:btn-link="props.btnLink"
|
|
37
|
+
:hide-btn="props.hideBtn"
|
|
38
|
+
>
|
|
39
|
+
<template
|
|
40
|
+
v-if="src || $slots.illustration"
|
|
41
|
+
#illustration
|
|
73
42
|
>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<div
|
|
81
|
-
v-if="code"
|
|
82
|
-
class="sy-code text-primary mb-4"
|
|
83
|
-
>
|
|
84
|
-
<span class="d-sr-only">{{ codeErrorText }}</span>
|
|
85
|
-
{{ code }}
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<h1
|
|
89
|
-
v-if="pageTitle"
|
|
90
|
-
class="mb-2 font-weight-bold text-h5 mb-4"
|
|
91
|
-
>
|
|
92
|
-
{{ pageTitle }}
|
|
93
|
-
</h1>
|
|
94
|
-
|
|
95
|
-
<p v-if="message">
|
|
96
|
-
<template
|
|
97
|
-
v-for="(part, index) in splitMessage(message)"
|
|
98
|
-
:key="index"
|
|
99
|
-
>
|
|
100
|
-
<span v-if="part.type === 'text'">
|
|
101
|
-
{{ part.value }}
|
|
102
|
-
</span>
|
|
103
|
-
<a
|
|
104
|
-
v-else
|
|
105
|
-
:href="`tel:${part.value}`"
|
|
106
|
-
>
|
|
107
|
-
{{ part.value }}
|
|
108
|
-
</a>
|
|
109
|
-
</template>
|
|
110
|
-
</p>
|
|
111
|
-
|
|
112
|
-
<slot name="additional-content" />
|
|
113
|
-
|
|
114
|
-
<slot name="action">
|
|
115
|
-
<VBtn
|
|
116
|
-
v-if="!hideBtn && btnText && (btnLink || btnHref)"
|
|
117
|
-
:to="btnHref ? undefined : btnLink"
|
|
118
|
-
:href="btnHref"
|
|
119
|
-
color="primary"
|
|
120
|
-
class="mt-6"
|
|
121
|
-
>
|
|
122
|
-
{{ btnText }}
|
|
123
|
-
</VBtn>
|
|
124
|
-
</slot>
|
|
125
|
-
</VCol>
|
|
126
|
-
|
|
127
|
-
<VCol
|
|
128
|
-
v-if="$slots.illustration"
|
|
129
|
-
cols="12"
|
|
130
|
-
sm="6"
|
|
131
|
-
class="d-flex align-center justify-center"
|
|
43
|
+
<slot name="illustration">
|
|
44
|
+
<img
|
|
45
|
+
v-if="src"
|
|
46
|
+
:src="src"
|
|
47
|
+
alt=""
|
|
48
|
+
aria-hidden="true"
|
|
132
49
|
>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</VCard>
|
|
137
|
-
</PageContainer>
|
|
50
|
+
</slot>
|
|
51
|
+
</template>
|
|
52
|
+
</StatusPage>
|
|
138
53
|
</template>
|
|
139
54
|
|
|
140
55
|
<style lang="scss" scoped>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
line-height: 6rem;
|
|
144
|
-
font-weight: 400;
|
|
56
|
+
img {
|
|
57
|
+
max-height: 290px;
|
|
145
58
|
}
|
|
146
59
|
</style>
|
|
@@ -1,15 +1,77 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/addon-docs';
|
|
2
2
|
import * as Stories from '../ErrorPage.stories.ts';
|
|
3
|
+
import AccessibilityIcon from '@/common/imgs/accessibility-svgrepo-com.svg';
|
|
3
4
|
import '@/stories/styles/shared.css';
|
|
5
|
+
import {
|
|
6
|
+
AccessibilityGuideLayout,
|
|
7
|
+
CriteriaSection,
|
|
8
|
+
CriteriaCard,
|
|
9
|
+
DemoSection,
|
|
10
|
+
BestPracticesSection,
|
|
11
|
+
ResourcesSection,
|
|
12
|
+
} from '@/stories/accessibility/AccessibilityGuideLayout.mdx';
|
|
4
13
|
|
|
5
14
|
<Meta of={Stories} />
|
|
6
15
|
|
|
7
|
-
<
|
|
8
|
-
|
|
16
|
+
<AccessibilityGuideLayout
|
|
17
|
+
componentName="ErrorPage"
|
|
18
|
+
iconSrc={AccessibilityIcon}
|
|
19
|
+
>
|
|
20
|
+
|
|
21
|
+
<div class="mt-2">
|
|
22
|
+
<p>Rapport d'audit manuel : <a href="/audits/ErrorPage.xlsx" style={{ color:'#0C41BD' }}>Voir le rapport</a></p>
|
|
23
|
+
<p style={{ color: 'grey', fontSize: '14px', marginTop: '0px' }}>Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system-v3/issues/652" target="_blank" style={{color:'#0C41BD'}}>issue #652</a>)</p>
|
|
9
24
|
</div>
|
|
10
25
|
|
|
26
|
+
<CriteriaSection>
|
|
27
|
+
<CriteriaCard icon="🔍" title="Structure sémantique">
|
|
28
|
+
<ul>
|
|
29
|
+
<li><strong>Titre de page</strong> : rendu dans une balise <code>h1</code> via <code>StatusPage</code>, unique et descriptif — surchargeable via la prop <code>page-title</code></li>
|
|
30
|
+
<li><strong>Code d'erreur</strong> : la prop <code>codeErrorText</code> (par défaut <em>"Code d'erreur : "</em>) est masquée visuellement via <code>d-sr-only</code> pour contextualiser le code aux lecteurs d'écran</li>
|
|
31
|
+
<li><strong>Valeurs par défaut</strong> : <code>pageTitle</code>, <code>message</code> et <code>code</code> proviennent des locales du thème via <code>useThemeLocales</code> et peuvent être surchargés via les props</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</CriteriaCard>
|
|
11
34
|
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
35
|
+
<CriteriaCard icon="🔗" title="Liens et boutons">
|
|
36
|
+
<ul>
|
|
37
|
+
<li><strong>Bouton de retour</strong> : rendu via <code>btn-href</code> (balise <code>a</code>) ou <code>btn-link</code> (balise <code>router-link</code>)</li>
|
|
38
|
+
<li><strong>Texte du bouton</strong> : doit être explicite et décrire la destination, ex. <em>"Retour à l'accueil"</em></li>
|
|
39
|
+
<li><strong>Masquage du bouton</strong> : la prop <code>hide-btn</code> permet de masquer le bouton si une alternative de navigation est présente</li>
|
|
40
|
+
<li><strong>Numéros de téléphone</strong> : si le message contient un numéro de téléphone, il est automatiquement transformé en lien <code>tel:</code> par <code>StatusPage</code></li>
|
|
41
|
+
</ul>
|
|
42
|
+
</CriteriaCard>
|
|
43
|
+
|
|
44
|
+
<CriteriaCard icon="🖼️" title="Illustration">
|
|
45
|
+
<ul>
|
|
46
|
+
<li><strong>Image décorative</strong> : l'illustration par défaut possède <code>alt=""</code> et <code>aria-hidden="true"</code> car elle est purement décorative</li>
|
|
47
|
+
<li><strong>Source thémable</strong> : l'image source provient des locales du thème via <code>useThemeLocales</code></li>
|
|
48
|
+
<li><strong>Slot <code>#illustration</code></strong> : si une illustration personnalisée est fournie, les mêmes règles d'accessibilité s'appliquent</li>
|
|
49
|
+
<li><strong>Mise en page adaptive</strong> : la colonne illustration n'est affichée que si <code>src</code> ou le slot <code>#illustration</code> est fourni</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</CriteriaCard>
|
|
52
|
+
</CriteriaSection>
|
|
53
|
+
|
|
54
|
+
<DemoSection title="État par défaut" componentName="ErrorPage">
|
|
55
|
+
<Story of={Stories.Default} />
|
|
56
|
+
</DemoSection>
|
|
57
|
+
|
|
58
|
+
<BestPracticesSection>
|
|
59
|
+
<ul>
|
|
60
|
+
<li>Les valeurs par défaut de <code>page-title</code>, <code>message</code> et <code>code</code> proviennent du thème — les surcharger uniquement si le contexte métier le nécessite</li>
|
|
61
|
+
<li>Fournir un <code>btn-text</code> explicite — éviter les libellés génériques comme <em>"Cliquez ici"</em></li>
|
|
62
|
+
<li>Ne pas masquer le bouton (<code>hide-btn</code>) sans proposer une alternative de navigation claire</li>
|
|
63
|
+
<li>Les illustrations doivent toujours être décoratives (<code>aria-hidden="true"</code>) — ne jamais y placer d'information essentielle</li>
|
|
64
|
+
<li>Personnaliser <code>code-error-text</code> si le contexte métier nécessite une formulation différente de <em>"Code d'erreur : "</em></li>
|
|
65
|
+
</ul>
|
|
66
|
+
</BestPracticesSection>
|
|
67
|
+
|
|
68
|
+
<ResourcesSection>
|
|
69
|
+
<ul>
|
|
70
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 1.3.1 – Info and Relationships</a></li>
|
|
71
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 2.4.4 – Link Purpose</a></li>
|
|
72
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html" target="_blank" style={{ color: '#0C41BD' }}>WCAG 1.1.1 – Non-text Content</a></li>
|
|
73
|
+
<li><a href="https://www.w3.org/WAI/ARIA/apg/patterns/" target="_blank" style={{ color: '#0C41BD' }}>ARIA Authoring Practices Guide</a></li>
|
|
74
|
+
</ul>
|
|
75
|
+
</ResourcesSection>
|
|
76
|
+
|
|
77
|
+
</AccessibilityGuideLayout>
|