@cnamts/synapse 0.0.15-alpha → 1.0.0

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.
Files changed (133) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +39 -0
  2. package/dist/components/Accordion/config.d.ts +9 -0
  3. package/dist/components/ChipList/ChipList.d.ts +1 -1
  4. package/dist/components/CookiesSelection/CookiesSelection.d.ts +26 -26
  5. package/dist/components/CopyBtn/CopyBtn.d.ts +2 -0
  6. package/dist/components/Customs/SyInputSelect/SyInputSelect.d.ts +12 -0
  7. package/dist/components/Customs/SySelect/SySelect.d.ts +43 -16
  8. package/dist/components/Customs/SyTextField/SyTextField.d.ts +1391 -1
  9. package/dist/components/DatePicker/DatePicker.d.ts +2810 -16
  10. package/dist/components/DatePicker/DateTextInput.d.ts +1401 -4
  11. package/dist/components/DiacriticPicker/DiacriticPicker.d.ts +27 -0
  12. package/dist/components/DiacriticPicker/config.d.ts +14 -0
  13. package/dist/components/DiacriticPicker/locales.d.ts +6 -0
  14. package/dist/components/DownloadBtn/DownloadBtn.d.ts +1 -1
  15. package/dist/components/FooterBar/FooterBar.d.ts +1 -1
  16. package/dist/components/LangBtn/LangBtn.d.ts +4 -4
  17. package/dist/components/NirField/NirField.d.ts +2796 -4
  18. package/dist/components/NotificationBar/NotificationBar.d.ts +1 -1
  19. package/dist/components/PasswordField/PasswordField.d.ts +1 -1
  20. package/dist/components/PeriodField/PeriodField.d.ts +5636 -48
  21. package/dist/components/PhoneField/PhoneField.d.ts +1 -0
  22. package/dist/components/PhoneField/tests/types.d.ts +18 -0
  23. package/dist/components/SyAlert/SyAlert.d.ts +72 -1
  24. package/dist/components/SyTextArea/SyTextArea.d.ts +900 -0
  25. package/dist/components/SyTextArea/locales.d.ts +3 -0
  26. package/dist/components/SyTextArea/trimStartOnUpdate.d.ts +1 -0
  27. package/dist/components/SyTextArea/useTextActions.d.ts +13 -0
  28. package/dist/components/SyTextArea/wrapText.d.ts +1 -0
  29. package/dist/components/TableToolbar/TableToolbar.d.ts +10 -4
  30. package/dist/components/TableToolbar/config.d.ts +3 -2
  31. package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +26 -26
  32. package/dist/components/index.d.ts +4 -0
  33. package/dist/composables/date/useDateFormat.d.ts +2 -2
  34. package/dist/composables/date/useDateFormatDayjs.d.ts +23 -0
  35. package/dist/composables/date/useDateInitializationDayjs.d.ts +18 -0
  36. package/dist/composables/date/useHolidayDay.d.ts +36 -0
  37. package/dist/design-system-v3.js +5106 -4208
  38. package/dist/design-system-v3.umd.cjs +4 -1
  39. package/dist/designTokens/tokens/pa/paLightTheme.d.ts +1 -32
  40. package/dist/style.css +1 -1
  41. package/dist/utils/rules/index.d.ts +1 -0
  42. package/dist/utils/rules/isHolidayDay/index.d.ts +11 -0
  43. package/dist/utils/rules/isHolidayDay/locales.d.ts +2 -0
  44. package/package.json +3 -2
  45. package/src/assets/settings.scss +12 -0
  46. package/src/components/Accordion/Accordion.mdx +69 -0
  47. package/src/components/Accordion/Accordion.stories.ts +262 -0
  48. package/src/components/Accordion/Accordion.vue +319 -0
  49. package/src/components/Accordion/config.ts +9 -0
  50. package/src/components/Accordion/tests/__snapshots__/accordion.spec.ts.snap +155 -0
  51. package/src/components/Accordion/tests/accordion.spec.ts +492 -0
  52. package/src/components/CopyBtn/CopyBtn.stories.ts +189 -0
  53. package/src/components/CopyBtn/CopyBtn.vue +29 -1
  54. package/src/components/CopyBtn/tests/CopyBtn.spec.ts +102 -0
  55. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +155 -1
  56. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +97 -14
  57. package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +386 -106
  58. package/src/components/Customs/SySelect/SySelect.stories.ts +121 -2
  59. package/src/components/Customs/SySelect/SySelect.vue +33 -8
  60. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +290 -1
  61. package/src/components/Customs/SyTextField/Accessibilite.stories.ts +7 -0
  62. package/src/components/Customs/SyTextField/SyTextField.stories.ts +13 -0
  63. package/src/components/Customs/SyTextField/SyTextField.vue +87 -20
  64. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +795 -0
  65. package/src/components/DatePicker/DatePicker.stories.ts +432 -1
  66. package/src/components/DatePicker/DatePicker.vue +82 -27
  67. package/src/components/DatePicker/DatePickerValidation.stories.ts +9 -1
  68. package/src/components/DatePicker/DateTextInput.vue +101 -138
  69. package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +282 -0
  70. package/src/components/DatePicker/examples/DatePickerHolidayRule.vue +130 -0
  71. package/src/components/DatePicker/tests/DatePicker.spec.ts +33 -32
  72. package/src/components/DatePicker/tests/DateTextInput.spec.ts +81 -33
  73. package/src/components/DiacriticPicker/DiacriticPicker.mdx +104 -0
  74. package/src/components/DiacriticPicker/DiacriticPicker.stories.ts +447 -0
  75. package/src/components/DiacriticPicker/DiacriticPicker.vue +262 -0
  76. package/src/components/DiacriticPicker/config.ts +15 -0
  77. package/src/components/DiacriticPicker/locales.ts +6 -0
  78. package/src/components/DiacriticPicker/tests/DiatriticPicker.spec.ts +132 -0
  79. package/src/components/DialogBox/DialogBox.vue +1 -3
  80. package/src/components/NirField/NirField.stories.ts +172 -0
  81. package/src/components/NirField/NirField.vue +15 -7
  82. package/src/components/NotificationBar/Accessibilite.stories.ts +1 -1
  83. package/src/components/NotificationBar/NotificationBar.stories.ts +14 -0
  84. package/src/components/NotificationBar/NotificationBar.vue +26 -3
  85. package/src/components/NotificationBar/{options.ts → config.ts} +0 -1
  86. package/src/components/PaginatedTable/PaginatedTable.vue +0 -11
  87. package/src/components/PasswordField/PasswordField.stories.ts +4 -3
  88. package/src/components/PasswordField/PasswordField.vue +26 -18
  89. package/src/components/PasswordField/tests/PasswordField.spec.ts +1 -10
  90. package/src/components/PhoneField/PhoneField.stories.ts +143 -0
  91. package/src/components/PhoneField/PhoneField.vue +88 -30
  92. package/src/components/PhoneField/tests/PhoneField.additional.spec.ts +266 -0
  93. package/src/components/PhoneField/tests/PhoneField.spec.ts +248 -28
  94. package/src/components/PhoneField/tests/types.d.ts +19 -0
  95. package/src/components/SyAlert/Accessibilite.stories.ts +4 -0
  96. package/src/components/SyAlert/SyAlert.mdx +3 -7
  97. package/src/components/SyAlert/SyAlert.stories.ts +19 -12
  98. package/src/components/SyAlert/SyAlert.vue +88 -51
  99. package/src/components/SyAlert/tests/SyAlert.spec.ts +20 -2
  100. package/src/components/SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap +83 -75
  101. package/src/components/SyTextArea/SyTextArea.mdx +17 -0
  102. package/src/components/SyTextArea/SyTextArea.stories.ts +322 -0
  103. package/src/components/SyTextArea/SyTextArea.vue +113 -0
  104. package/src/components/SyTextArea/locales.ts +3 -0
  105. package/src/components/SyTextArea/tests/SyTextArea.spec.ts +194 -0
  106. package/src/components/SyTextArea/trimStartOnUpdate.ts +12 -0
  107. package/src/components/SyTextArea/useTextActions.ts +52 -0
  108. package/src/components/SyTextArea/wrapText.ts +42 -0
  109. package/src/components/TableToolbar/TableToolbar.mdx +86 -1
  110. package/src/components/TableToolbar/TableToolbar.stories.ts +422 -74
  111. package/src/components/TableToolbar/TableToolbar.vue +25 -8
  112. package/src/components/TableToolbar/config.ts +3 -2
  113. package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +35 -12
  114. package/src/components/index.ts +4 -0
  115. package/src/composables/date/useDateFormat.ts +17 -1
  116. package/src/composables/date/useDateFormatDayjs.ts +84 -0
  117. package/src/composables/date/useDateInitializationDayjs.ts +133 -0
  118. package/src/composables/date/useHolidayDay.ts +98 -0
  119. package/src/composables/rules/useFieldValidation.ts +16 -3
  120. package/src/composables/validation/useValidation.ts +2 -1
  121. package/src/designTokens/tokens/pa/paLightTheme.ts +10 -41
  122. package/src/stories/Accessibilite/Avancement/Avancement.mdx +12 -0
  123. package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +134 -0
  124. package/src/stories/Accessibilite/Introduction.mdx +5 -2
  125. package/src/stories/DesignTokens/colors.stories.ts +100 -41
  126. package/src/utils/rules/index.ts +1 -0
  127. package/src/utils/rules/isHolidayDay/IsHolidayDay.mdx +52 -0
  128. package/src/utils/rules/isHolidayDay/IsHolidayDay.stories.ts +129 -0
  129. package/src/utils/rules/isHolidayDay/index.ts +36 -0
  130. package/src/utils/rules/isHolidayDay/locales.ts +5 -0
  131. package/src/utils/rules/isHolidayDay/tests/isHolidayDay.spec.ts +35 -0
  132. /package/dist/components/NotificationBar/{options.d.ts → config.d.ts} +0 -0
  133. /package/src/components/DatePicker/{DatePickerValidationExamples.vue → docExamples/DatePickerValidationExamples.vue} +0 -0
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Composable pour la gestion des jours fériés
3
+ */
4
+
5
+ import dayjs from 'dayjs'
6
+ import customParseFormat from 'dayjs/plugin/customParseFormat'
7
+
8
+ // Étendre dayjs avec le plugin customParseFormat
9
+ dayjs.extend(customParseFormat)
10
+
11
+ /**
12
+ * Algorithme de GAUSS pour calculer la date de Pâques
13
+ * @param annee - L'année pour laquelle calculer la date de Pâques
14
+ * @returns Un objet contenant le jour et le mois de Pâques
15
+ */
16
+ function calculPaquesGregorienne(annee: number): { jour: number, mois: number } {
17
+ const val1 = (19 * (annee % 19) + 24) % 30
18
+ const val2 = (2 * (annee % 4) + 4 * (annee % 7) + 6 * val1 + 5) % 7
19
+ const sum = val1 + val2
20
+
21
+ let jourPaques: number
22
+ let moisPaques: number
23
+
24
+ if (sum <= 9) {
25
+ jourPaques = sum + 22
26
+ moisPaques = 3
27
+ }
28
+ else {
29
+ jourPaques = sum - 9
30
+ moisPaques = 4
31
+ }
32
+
33
+ return { jour: jourPaques, mois: moisPaques }
34
+ }
35
+
36
+ /**
37
+ * Calcule les jours fériés d'une année donnée
38
+ * @param annee - L'année pour laquelle calculer les jours fériés
39
+ * @param format - Format des jours fériés en retour (défaut : "DD/MM/YYYY")
40
+ * @returns Un Set contenant la liste des jours fériés
41
+ */
42
+ export function getJoursFeries(annee: number, format = 'DD/MM/YYYY'): Set<string> {
43
+ const { jour: jourPaques, mois: moisPaques } = calculPaquesGregorienne(annee)
44
+ const formatDay = (date: dayjs.Dayjs) => date.format(format)
45
+
46
+ const jours = new Set([
47
+ formatDay(dayjs(`01/01/${annee}`, 'DD/MM/YYYY')), // Jour de l'an
48
+ formatDay(dayjs(new Date(annee, moisPaques - 1, jourPaques + 1))), // Lundi de Pâques
49
+ formatDay(dayjs(`01/05/${annee}`, 'DD/MM/YYYY')), // Fête du travail
50
+ formatDay(dayjs(`08/05/${annee}`, 'DD/MM/YYYY')), // Victoire des alliés
51
+ formatDay(dayjs(new Date(annee, moisPaques - 1, jourPaques + 39))), // Ascension
52
+ formatDay(dayjs(new Date(annee, moisPaques - 1, jourPaques + 50))), // Lundi de Pentecôte
53
+ formatDay(dayjs(`14/07/${annee}`, 'DD/MM/YYYY')), // Fête Nationale
54
+ formatDay(dayjs(`15/08/${annee}`, 'DD/MM/YYYY')), // Assomption
55
+ formatDay(dayjs(`01/11/${annee}`, 'DD/MM/YYYY')), // Toussaint
56
+ formatDay(dayjs(`11/11/${annee}`, 'DD/MM/YYYY')), // Armistice
57
+ formatDay(dayjs(`25/12/${annee}`, 'DD/MM/YYYY')), // Noël
58
+ ])
59
+
60
+ return jours
61
+ }
62
+
63
+ /**
64
+ * Vérifie si une date est un jour férié
65
+ * @param date - La date à vérifier (Date ou string)
66
+ * @param format - Format de la date si elle est fournie en string (défaut : "DD/MM/YYYY")
67
+ * @returns true si la date est un jour férié, false sinon
68
+ */
69
+ export function isHolidayDay(date: Date | string, format = 'DD/MM/YYYY'): boolean {
70
+ // Convertir la date en objet dayjs
71
+ const dateObj = typeof date === 'string'
72
+ ? dayjs(date, format)
73
+ : dayjs(date)
74
+
75
+ if (!dateObj.isValid()) {
76
+ return false
77
+ }
78
+
79
+ const annee = dateObj.year()
80
+ const joursFeries = getJoursFeries(annee, format)
81
+
82
+ // Vérifier si la date formatée est dans l'ensemble des jours fériés
83
+ return joursFeries.has(dateObj.format(format))
84
+ }
85
+
86
+ /**
87
+ * Hook composable pour la gestion des jours fériés
88
+ * @returns Fonctions pour gérer les jours fériés
89
+ */
90
+ export function useHolidayDay() {
91
+ return {
92
+ getJoursFeries,
93
+ isHolidayDay,
94
+ calculPaquesGregorienne,
95
+ }
96
+ }
97
+
98
+ export default useHolidayDay
@@ -1,6 +1,9 @@
1
1
  // Regular expressions
2
2
  export const EMAIL_REGEXP = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
3
3
 
4
+ // Import du composable pour les jours fériés
5
+ import { useHolidayDay } from '@/composables/date/useHolidayDay'
6
+
4
7
  export type ValidationResult = {
5
8
  success?: string
6
9
  error?: string
@@ -291,14 +294,24 @@ export function useFieldValidation() {
291
294
  )
292
295
  }
293
296
 
297
+ case 'isHolidayDay': {
298
+ const { isHolidayDay } = useHolidayDay()
299
+ const dateValue = new Date(value)
300
+
301
+ return createValidationResult(
302
+ !isHolidayDay(dateValue),
303
+ options.message || options.warningMessage || `${identifier} n'est pas un jour férié.`,
304
+ )
305
+ }
306
+
294
307
  case 'custom': {
295
308
  const result = options.validate?.(value)
296
309
  if (result === true) {
297
- return { success: baseMessages.success }
310
+ return { success: options.successMessage || baseMessages.success }
298
311
  }
299
312
  return options.isWarning
300
- ? { warning: typeof result === 'string' ? result : baseMessages.warning }
301
- : { error: typeof result === 'string' ? result : baseMessages.error }
313
+ ? { warning: typeof result === 'string' ? result : options.warningMessage || baseMessages.warning }
314
+ : { error: typeof result === 'string' ? result : options.message || baseMessages.error }
302
315
  }
303
316
 
304
317
  default:
@@ -94,7 +94,8 @@ export function useValidation(options: ValidationOptions = { showSuccessMessages
94
94
  })
95
95
 
96
96
  // Si pas d'erreur, ajouter le message de succès ou un message par défaut
97
- if (!hasValidationError && value && options.showSuccessMessages !== false) {
97
+ // Mais seulement si aucun customSuccessRules n'est défini pour éviter la duplication
98
+ if (!hasValidationError && value && options.showSuccessMessages !== false && (!successRules || successRules.length === 0)) {
98
99
  const customSuccessMessage = rules.find(rule => rule.options.successMessage)?.options.successMessage
99
100
  if (customSuccessMessage) {
100
101
  successes.value.push(customSuccessMessage)
@@ -2,48 +2,17 @@ import { paColorsTokens } from './paColors'
2
2
  import { paSemanticTokens } from '../pa/paSemantic'
3
3
 
4
4
  export const paLightTheme = {
5
- primary: '#0062ac',
6
- secondary: '#ac1c81',
7
- accent: '#6f42c1',
8
- error: '#B6052A',
9
- info: '#0062AC',
10
- success: '#73A839',
11
- warning: '#FD7E14',
12
- avatar: '#0062AC',
13
- blue: '#007bff',
14
- blueBase: '#007bff',
15
- indigo: '#6610f2',
16
- indigoBase: '#6610f2',
17
- purple: '#6f42c1',
18
- purpleBase: '#6f42c1',
19
- pink: '#e83e8c',
20
- pinkBase: '#e83e8c',
21
- red: '#dc3545',
22
- redBase: '#dc3545',
23
- orange: '#fd7e14',
24
- orangeBase: '#fd7e14',
25
- yellow: '#ffc107',
26
- yellowBase: '#ffc107',
27
- green: '#28a745',
28
- greenBase: '#28a745',
29
- teal: '#20c997',
30
- tealBase: '#20c997',
31
- cyan: '#17a2b8',
32
- cyanBase: '#17a2b8',
33
- gray: '#8a8b8b',
34
- grayBase: '#8a8b8b',
35
- grayDark: '#343434',
36
- grayDarkBase: '#343434',
5
+ primary: paColorsTokens.blue.base,
6
+ secondary: paColorsTokens.cyan.darken40,
7
+ accent: paColorsTokens.cyan.base,
8
+ error: paColorsTokens.orange.darken20,
9
+ info: paColorsTokens.blue.base,
10
+ avatar: paColorsTokens.cyan.darken20,
11
+ success: paColorsTokens.turquoise.darken60,
12
+ warning: paColorsTokens.yellow.darken60,
37
13
  risquePro: paColorsTokens.brick.base,
38
- light: '#f4f5f1',
39
- dark: '#343434',
40
- default: '#b7cbd6',
41
- brand: '#4a3f59',
42
- brandSecondary: '#ac1c81',
43
- brandMuted: '#b7cbd6',
44
- brandMutedLite: '#E7F3F9',
45
- hilitePrimary: '#0062ac',
46
- hiliteSecondary: '#e6bebf',
14
+ light: paColorsTokens.grey.lighten60,
15
+ dark: paColorsTokens.grey.darken80,
47
16
  onBackground: paSemanticTokens.colors.background.surface,
48
17
  onSurfaceAlt: paSemanticTokens.colors.background.surfaceAlt,
49
18
  onSurface: paSemanticTokens.colors.background.surface,
@@ -0,0 +1,12 @@
1
+ import { Story, Meta } from '@storybook/addon-docs/blocks';
2
+ import * as AvancementStories from './Avancement.stories.ts';
3
+
4
+ <Meta of={AvancementStories} />
5
+
6
+ # Outils de pré-audit
7
+
8
+ <Story of={AvancementStories.PreAudit} />
9
+
10
+ # Contrôle manuel
11
+
12
+ <Story of={AvancementStories.Manuel} />
@@ -0,0 +1,134 @@
1
+ import type { StoryObj } from '@storybook/vue3'
2
+ import { computed } from 'vue'
3
+
4
+ export default {
5
+ title: 'Accessibilité/Avancement',
6
+ }
7
+
8
+ export const PreAudit: StoryObj = {
9
+ render: () => {
10
+ return {
11
+ setup() {},
12
+ template: `
13
+ <v-chip
14
+ class="ma-2"
15
+ color="success"
16
+ variant="elevated"
17
+ >
18
+ 50/50 Composants
19
+ </v-chip>
20
+ `,
21
+ }
22
+ },
23
+ tags: ['!dev'],
24
+ }
25
+
26
+ export const Manuel: StoryObj = {
27
+ render: () => {
28
+ return {
29
+ setup() {
30
+ const headers = [
31
+ { text: 'Composant', value: 'composant' },
32
+ { text: 'Statut', value: 'status' },
33
+ ]
34
+
35
+ const items = [
36
+ { composant: 'PageContainer', status: 'Audité' },
37
+ { composant: 'SkipLink', status: 'Audité' },
38
+ { composant: 'Alerts', status: 'Audité' },
39
+ { composant: 'NotificationBar', status: 'Non audité' },
40
+ { composant: 'BackBtn', status: 'Audité' },
41
+ { composant: 'BackToTopBtn', status: 'Audité' },
42
+ { composant: 'CopyBtn', status: 'Audité' },
43
+ { composant: 'LangBtn', status: 'Audité' },
44
+ { composant: 'DownloadBtn', status: 'Audité' },
45
+ { composant: 'FranceConnectBtn', status: 'Audité' },
46
+ { composant: 'SyTextField', status: 'Audité' },
47
+ { composant: 'HeaderBar', status: 'Non audité' },
48
+ { composant: 'HeaderNavigationBar', status: 'Non audité' },
49
+ { composant: 'LogoBrandSection', status: 'Non audité' },
50
+ { composant: 'SubHeader', status: 'Non audité' },
51
+ { composant: 'HeaderLoading', status: 'Non audité' },
52
+ { composant: 'HeaderToolbar', status: 'Non audité' },
53
+ { composant: 'Footer', status: 'Non audité' },
54
+ { composant: 'SySelect', status: 'Non audité' },
55
+ { composant: 'SyInputSelect', status: 'Non audité' },
56
+ { composant: 'Logo', status: 'Non audité' },
57
+ { composant: 'DataListGroup', status: 'Non audité' },
58
+ { composant: 'DataList', status: 'Non audité' },
59
+ { composant: 'DataListItem', status: 'Non audité' },
60
+ { composant: 'DataListLoading', status: 'Non audité' },
61
+ { composant: 'ErrorPage', status: 'Non audité' },
62
+ { composant: 'CookieBanner', status: 'Non audité' },
63
+ { composant: 'ExternalLinks', status: 'Non audité' },
64
+ { composant: 'ContextualMenu', status: 'Non audité' },
65
+ { composant: 'DialogBox', status: 'Non audité' },
66
+ { composant: 'PasswordField', status: 'Non audité' },
67
+ { composant: 'PhoneField', status: 'Non audité' },
68
+ { composant: 'UserMenuBtn', status: 'Non audité' },
69
+ { composant: 'SyBtnSelect', status: 'Non audité' },
70
+ { composant: 'NirField', status: 'Non audité' },
71
+ { composant: 'PeriodField', status: 'Non audité' },
72
+ { composant: 'RangeField', status: 'Non audité' },
73
+ { composant: 'SearchListField', status: 'Non audité' },
74
+ { composant: 'SelectBtnField', status: 'Non audité' },
75
+ { composant: 'RatingPicker', status: 'Non audité' },
76
+ { composant: 'DatePicker', status: 'Non audité' },
77
+ { composant: 'FileUpload', status: 'Non audité' },
78
+ { composant: 'FilePreview', status: 'Non audité' },
79
+ { composant: 'FileList', status: 'Non audité' },
80
+ { composant: 'UploadWorkflow', status: 'Non audité' },
81
+ { composant: 'ChipList', status: 'Non audité' },
82
+ { composant: 'FilterInline', status: 'Non audité' },
83
+ { composant: 'FilterSideBar', status: 'Non audité' },
84
+ { composant: 'PaginatedTable', status: 'Non audité' },
85
+ { composant: 'TableToolbar', status: 'Non audité' },
86
+ ]
87
+
88
+ const totalItems = computed(() => items.length)
89
+
90
+ const checkedItems = computed(() => {
91
+ return items.filter(item => item.status === 'Audité').length
92
+ })
93
+
94
+ return { headers, items, totalItems, checkedItems }
95
+ },
96
+ template: `
97
+ <v-chip
98
+ class="ma-2"
99
+ color="warning"
100
+ variant="elevated"
101
+ >
102
+ {{checkedItems}}/{{totalItems}} Composants
103
+ </v-chip>
104
+
105
+ <v-data-table
106
+ :items="items"
107
+ :items-per-page="10"
108
+ class="elevation-1 mt-4"
109
+ item-value="composant"
110
+ >
111
+ <template #header.composant>
112
+ <span class="font-weight-bold">Composant</span>
113
+ </template>
114
+ <template #header.status>
115
+ <span class="font-weight-bold">Status</span>
116
+ </template>
117
+ <template #item.composant="{ item }">
118
+ {{ item.composant }}
119
+ </template>
120
+ <template #item.status="{ item }">
121
+ <v-chip
122
+ :color="item.status === 'Audité' ? 'success' : 'warning'"
123
+ variant="flat"
124
+ small
125
+ >
126
+ {{ item.status }}
127
+ </v-chip>
128
+ </template>
129
+ </v-data-table>
130
+ `,
131
+ }
132
+ },
133
+ tags: ['!dev'],
134
+ }
@@ -16,8 +16,11 @@ C'est pourquoi et sauf exception motivée, toute nouvelle demande d'audit d'acce
16
16
  L'objectif ici est d'anticiper les erreurs et diluer l'effort de mise en conformité tout au long du processus de fabrication afin de ne pas attendre le résultat de l'audit pour réécrire le produit.<br/>
17
17
  Une fois le produit éligible, l'équipe experte de la Filière Digital réalise un audit et communique à l'équipe-produit un rapport comportant des recommandations. Si le produit utilise le DS CNAM et que des problèmes sont identifiés associés à ce dernier, les évolutions seront portés directement par la Filière Digital, en cas contraire il est demandé à l'équipe-produit de corriger les anomalies et de mettre à jour en autonomie le rapport d'audit pour atteindre la pleine conformité.
18
18
 
19
- Conscient que tous les produits ne peuvent pas utiliser dans l’immédiat le Design System thème Cnam ou thème Portail Agent, nous avons conçu le kit de pré-audit pour qu’il puisse fonctionner en autonomie.<br/>
20
- Si vous avez besoin d’un accompagnement sur le sujet, merci de prendre contact avec valentin.becquet@assurance-maladie.fr.
19
+ Conscient que tous les produits ne peuvent pas utiliser dans l’immédiat le Design System thème Cnam ou thème Portail Agent, nous avons conçu le kit de pré-audit pour qu’il puisse fonctionner en autonomie.
20
+
21
+ Si vous avez besoin d’un accompagnement sur le sujet, merci de prendre contact avec [valentin.becquet@assurance-maladie.fr](mailto:valentin.becquet@assurance-maladie.fr).
22
+
23
+ Pour toute remontée de problème liée à l’accessibilité, veuillez ouvrir une issue à l’adresse suivante : [Signaler un problème d'accessibilité](https://github.com/assurance-maladie-digital/design-system-v3/issues/new?template=accessibility.md)
21
24
 
22
25
  Vous trouverez dans ce dossier 3 principales rubriques :
23
26
 
@@ -45,13 +45,12 @@ export const Base: StoryObj = {
45
45
  'risque-pro': cnamLightTheme.risquePro,
46
46
  }
47
47
  const paColors = {
48
- 'primary': paLightTheme.primary,
49
- 'secondary': paLightTheme.secondary,
50
- 'error': paLightTheme.error,
51
- 'info': paLightTheme.info,
52
- 'success': paLightTheme.success,
53
- 'warning': paLightTheme.warning,
54
- 'risque-pro': paLightTheme.risquePro,
48
+ primary: paLightTheme.primary,
49
+ secondary: paLightTheme.secondary,
50
+ error: paLightTheme.error,
51
+ info: paLightTheme.info,
52
+ success: paLightTheme.success,
53
+ warning: paLightTheme.warning,
55
54
  }
56
55
  return {
57
56
  cnamColors,
@@ -82,29 +81,10 @@ export const Others: StoryObj = {
82
81
  dark: cnamLightTheme.dark,
83
82
  }
84
83
  const paColors = {
85
- 'avatar': paLightTheme.avatar,
86
- 'accent': paLightTheme.accent,
87
- 'light': paLightTheme.light,
88
- 'dark': paLightTheme.dark,
89
- 'blue': paLightTheme.blue,
90
- 'indigo': paLightTheme.indigo,
91
- 'purple': paLightTheme.purple,
92
- 'pink': paLightTheme.pink,
93
- 'red': paLightTheme.red,
94
- 'orange': paLightTheme.orange,
95
- 'yellow': paLightTheme.yellow,
96
- 'green': paLightTheme.green,
97
- 'teal': paLightTheme.teal,
98
- 'cyan': paLightTheme.cyan,
99
- 'gray': paLightTheme.gray,
100
- 'grayDark': paLightTheme.grayDark,
101
- 'default': paLightTheme.default,
102
- 'brand': paLightTheme.brand,
103
- 'brand-secondary': paLightTheme.brandSecondary,
104
- 'brand-muted': paLightTheme.brandMuted,
105
- 'brand-mutedLite': paLightTheme.brandMutedLite,
106
- 'hilite-primary': paLightTheme.hilitePrimary,
107
- 'hilite-secondary': paLightTheme.hiliteSecondary,
84
+ accent: paLightTheme.accent,
85
+ avatar: paLightTheme.avatar,
86
+ light: paLightTheme.light,
87
+ dark: paLightTheme.dark,
108
88
  }
109
89
  return {
110
90
  cnamColors,
@@ -748,7 +728,14 @@ export const Interactive: StoryObj = {
748
728
  'interactive-disabled': cnamLightTheme.interactiveDisabled,
749
729
  'interactive-hover-on-selected': cnamLightTheme.interactiveHoverOnSelected,
750
730
  }
751
- const paColors = {}
731
+ const paColors = {
732
+ 'interactive-default': paLightTheme.interactiveDefault,
733
+ 'interactive-hover': paLightTheme.interactiveHover,
734
+ 'interactive-pressed': paLightTheme.interactivePressed,
735
+ 'interactive-focus': paLightTheme.interactiveFocus,
736
+ 'interactive-disabled': paLightTheme.interactiveDisabled,
737
+ 'interactive-hover-on-selected': paLightTheme.interactiveHoverOnSelected,
738
+ }
752
739
  return {
753
740
  cnamColors,
754
741
  paColors,
@@ -786,7 +773,21 @@ export const Border: StoryObj = {
786
773
  'border-disabled': cnamLightTheme.borderDisabled,
787
774
  'border-disabled-on-dark': cnamLightTheme.borderDisabledOnDark,
788
775
  }
789
- const paColors = {}
776
+ const paColors = {
777
+ 'border-darker': paLightTheme.borderDarker,
778
+ 'border-base': paLightTheme.borderBase,
779
+ 'border-subdued': paLightTheme.borderSubdued,
780
+ 'border-accent': paLightTheme.borderAccent,
781
+ 'border-accent-contrasted': paLightTheme.borderAccentContrasted,
782
+ 'border-accent-on-dark': paLightTheme.borderAccentOnDark,
783
+ 'border-info': paLightTheme.borderInfo,
784
+ 'border-success': paLightTheme.borderSuccess,
785
+ 'border-warning': paLightTheme.borderWarning,
786
+ 'border-error': paLightTheme.borderError,
787
+ 'border-on-dark': paLightTheme.borderOnDark,
788
+ 'border-disabled': paLightTheme.borderDisabled,
789
+ 'border-disabled-on-dark': paLightTheme.borderDisabledOnDark,
790
+ }
790
791
  return {
791
792
  cnamColors,
792
793
  paColors,
@@ -823,7 +824,20 @@ export const Text: StoryObj = {
823
824
  'text-subdued-on-dark': cnamLightTheme.textSubduedOnDark,
824
825
  'text-disabled-on-dark': cnamLightTheme.textDisabledOnDark,
825
826
  }
826
- const paColors = {}
827
+ const paColors = {
828
+ 'text-base': paLightTheme.textBase,
829
+ 'text-accent': paLightTheme.textAccent,
830
+ 'text-accent-contrasted': paLightTheme.textAccentContrasted,
831
+ 'text-subdued': paLightTheme.textSubdued,
832
+ 'text-info': paLightTheme.textInfo,
833
+ 'text-success': paLightTheme.textSuccess,
834
+ 'text-warning': paLightTheme.textWarning,
835
+ 'text-error': paLightTheme.textError,
836
+ 'text-disabled': paLightTheme.textDisabled,
837
+ 'text-on-dark': paLightTheme.textOnDark,
838
+ 'text-subdued-on-dark': paLightTheme.textSubduedOnDark,
839
+ 'text-disabled-on-dark': paLightTheme.textDisabledOnDark,
840
+ }
827
841
  return {
828
842
  cnamColors,
829
843
  paColors,
@@ -859,7 +873,20 @@ export const Icons: StoryObj = {
859
873
  'icon-disabled': cnamLightTheme.iconDisabled,
860
874
  'icon-disabled-on-dark': cnamLightTheme.iconDisabledOnDark,
861
875
  }
862
- const paColors = {}
876
+ const paColors = {
877
+ 'icon-base': paLightTheme.iconBase,
878
+ 'icon-subdued': paLightTheme.iconSubdued,
879
+ 'icon-subdued-on-dark': paLightTheme.iconSubduedOnDark,
880
+ 'icon-accent': paLightTheme.iconAccent,
881
+ 'icon-accent-contrasted': paLightTheme.iconAccentContrasted,
882
+ 'icon-info': paLightTheme.iconInfo,
883
+ 'icon-success': paLightTheme.iconSuccess,
884
+ 'icon-warning': paLightTheme.iconWarning,
885
+ 'icon-error': paLightTheme.iconError,
886
+ 'icon-on-dark': paLightTheme.iconOnDark,
887
+ 'icon-disabled': paLightTheme.iconDisabled,
888
+ 'icon-disabled-on-dark': paLightTheme.iconDisabledOnDark,
889
+ }
863
890
  return {
864
891
  cnamColors,
865
892
  paColors,
@@ -887,7 +914,11 @@ export const MainBackgrounds: StoryObj = {
887
914
  'background-surface': cnamLightTheme.backgroundSurface,
888
915
  'background-surface-alt': cnamLightTheme.backgroundSurfaceAlt,
889
916
  }
890
- const paColors = {}
917
+ const paColors = {
918
+ 'background-main': paLightTheme.backgroundMain,
919
+ 'background-surface': paLightTheme.backgroundSurface,
920
+ 'background-surface-alt': paLightTheme.backgroundSurfaceAlt,
921
+ }
891
922
  return {
892
923
  cnamColors,
893
924
  paColors,
@@ -917,7 +948,13 @@ export const AlternativeBackgrounds: StoryObj = {
917
948
  'background-accent-contrasted': cnamLightTheme.backgroundAccentContrasted,
918
949
  'background-accent-alt': cnamLightTheme.backgroundAccentAlt,
919
950
  }
920
- const paColors = {}
951
+ const paColors = {
952
+ 'background-mainAlt': paLightTheme.backgroundMainAlt,
953
+ 'background-raised': paLightTheme.backgroundRaised,
954
+ 'background-accent': paLightTheme.backgroundAccent,
955
+ 'background-accent-contrasted': paLightTheme.backgroundAccentContrasted,
956
+ 'background-accent-alt': paLightTheme.backgroundAccentAlt,
957
+ }
921
958
  return {
922
959
  cnamColors,
923
960
  paColors,
@@ -945,7 +982,11 @@ export const InformationalBackgrounds: StoryObj = {
945
982
  'background-info-subdued': cnamLightTheme.backgroundInfoSubdued,
946
983
  'background-info-contrasted': cnamLightTheme.backgroundInfoContrasted,
947
984
  }
948
- const paColors = {}
985
+ const paColors = {
986
+ 'background-info': paLightTheme.backgroundInfo,
987
+ 'background-info-subdued': paLightTheme.backgroundInfoSubdued,
988
+ 'background-info-contrasted': paLightTheme.backgroundInfoContrasted,
989
+ }
949
990
  return {
950
991
  cnamColors,
951
992
  paColors,
@@ -973,7 +1014,11 @@ export const SuccessBackgrounds: StoryObj = {
973
1014
  'background-success-subdued': cnamLightTheme.backgroundSuccessSubdued,
974
1015
  'background-success-contrasted': cnamLightTheme.backgroundSuccessContrasted,
975
1016
  }
976
- const paColors = {}
1017
+ const paColors = {
1018
+ 'background-success': paLightTheme.backgroundSuccess,
1019
+ 'background-success-subdued': paLightTheme.backgroundSuccessSubdued,
1020
+ 'background-success-contrasted': paLightTheme.backgroundSuccessContrasted,
1021
+ }
977
1022
  return {
978
1023
  cnamColors,
979
1024
  paColors,
@@ -1001,7 +1046,11 @@ export const WarningBackgrounds: StoryObj = {
1001
1046
  'background-warning-subdued': cnamLightTheme.backgroundWarningSubdued,
1002
1047
  'background-warning-contrasted': cnamLightTheme.backgroundWarningContrasted,
1003
1048
  }
1004
- const paColors = {}
1049
+ const paColors = {
1050
+ 'background-warning': paLightTheme.backgroundWarning,
1051
+ 'background-warning-subdued': paLightTheme.backgroundWarningSubdued,
1052
+ 'background-warning-contrasted': paLightTheme.backgroundWarningContrasted,
1053
+ }
1005
1054
  return {
1006
1055
  cnamColors,
1007
1056
  paColors,
@@ -1029,7 +1078,11 @@ export const ErrorBackgrounds: StoryObj = {
1029
1078
  'background-error-subdued': cnamLightTheme.backgroundErrorSubdued,
1030
1079
  'background-error-contrasted': cnamLightTheme.backgroundErrorContrasted,
1031
1080
  }
1032
- const paColors = {}
1081
+ const paColors = {
1082
+ 'background-error': paLightTheme.backgroundError,
1083
+ 'background-error-subdued': paLightTheme.backgroundErrorSubdued,
1084
+ 'background-error-contrasted': paLightTheme.backgroundErrorContrasted,
1085
+ }
1033
1086
  return {
1034
1087
  cnamColors,
1035
1088
  paColors,
@@ -1059,7 +1112,13 @@ export const OtherBackgrounds: StoryObj = {
1059
1112
  'background-professionnel': cnamLightTheme.backgroundProfessionnel,
1060
1113
  'background-entreprise': cnamLightTheme.backgroundEntreprise,
1061
1114
  }
1062
- const paColors = {}
1115
+ const paColors = {
1116
+ 'background-disabled': paLightTheme.backgroundDisabled,
1117
+ 'background-disabled-on-dark': paLightTheme.backgroundDisabledOnDark,
1118
+ 'background-assure': paLightTheme.backgroundAssure,
1119
+ 'background-professionnel': paLightTheme.backgroundProfessionnel,
1120
+ 'background-entreprise': paLightTheme.backgroundEntreprise,
1121
+ }
1063
1122
  return {
1064
1123
  cnamColors,
1065
1124
  paColors,
@@ -9,3 +9,4 @@ export * from './isNotBeforeToday/index'
9
9
  export * from './isNotAfterToday/index'
10
10
  export * from './isRequired/index'
11
11
  export * from './isValidEmail/index'
12
+ export * from './isHolidayDay/index'
@@ -0,0 +1,52 @@
1
+ import { Meta } from '@storybook/blocks'
2
+
3
+ <Meta title="Guide du dev/Règles De Validation/isHolidayDay" />
4
+
5
+ # isHolidayDay
6
+
7
+ La règle `isHolidayDay` vérifie qu'une date n'est pas un jour férié en France.
8
+
9
+ ## Utilisation
10
+
11
+ ```ts
12
+ import { isHolidayDay } from '@/utils/isHolidayDay'
13
+
14
+ const rules = [
15
+ isHolidayDay,
16
+ ]
17
+ ```
18
+
19
+ ## Personnalisation des messages d'erreur
20
+
21
+ Vous pouvez personnaliser le message d'erreur en utilisant la fonction `isHolidayDayFn` :
22
+
23
+ ```ts
24
+ import { isHolidayDayFn } from '@/utils/isHolidayDay'
25
+
26
+ const customRule = isHolidayDayFn({
27
+ default: 'Veuillez sélectionner une date qui n\'est pas un jour férié.',
28
+ })
29
+ ```
30
+
31
+ ## Fonctionnement
32
+
33
+ Cette règle utilise le composable `useHolidayDay` pour déterminer si une date est un jour férié en France. La règle retourne :
34
+
35
+ - `true` si la valeur est vide ou si la date n'est pas un jour férié
36
+ - Un message d'erreur si la date est un jour férié
37
+
38
+ ## Jours fériés pris en compte
39
+
40
+ Les jours fériés suivants sont pris en compte :
41
+
42
+ - 1er janvier (Jour de l'an)
43
+ - Lundi de Pâques (date variable)
44
+ - 1er mai (Fête du travail)
45
+ - 8 mai (Victoire des alliés)
46
+ - Ascension (date variable)
47
+ - Lundi de Pentecôte (date variable)
48
+ - 14 juillet (Fête Nationale)
49
+ - 15 août (Assomption)
50
+ - 1er novembre (Toussaint)
51
+ - 11 novembre (Armistice)
52
+ - 25 décembre (Noël)