@cnamts/synapse 0.0.3-alpha → 0.0.4-alpha
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/design-system-v3.d.ts +712 -27
- package/dist/design-system-v3.js +2715 -1485
- package/dist/design-system-v3.umd.cjs +10 -1
- package/dist/style.css +1 -1
- package/package.json +5 -2
- package/src/components/Alert/Alert.mdx +1 -1
- package/src/components/Alert/Alert.stories.ts +91 -1
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackBtn/BackBtn.stories.ts +84 -1
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +3 -3
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +172 -11
- package/src/components/CollapsibleList/CollapsibleList.mdx +2 -2
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +37 -1
- package/src/components/CopyBtn/CopyBtn.mdx +1 -1
- package/src/components/CopyBtn/CopyBtn.stories.ts +120 -1
- package/src/components/CopyBtn/CopyBtn.vue +1 -1
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +6 -8
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +270 -4
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.vue +80 -53
- package/src/components/Customs/CustomInputSelect/config.ts +10 -0
- package/src/components/Customs/CustomSelect/CustomSelect.mdx +3 -3
- package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +158 -2
- package/src/components/Customs/CustomSelect/CustomSelect.vue +25 -6
- package/src/components/Customs/CustomTextField/CustomTextField.mdx +44 -0
- package/src/components/Customs/CustomTextField/CustomTextField.stories.ts +403 -0
- package/src/components/Customs/CustomTextField/CustomTextField.vue +110 -0
- package/src/components/Customs/CustomTextField/tests/CustomTextField.spec.ts +93 -0
- package/src/components/Customs/CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap +59 -0
- package/src/components/Customs/CustomTextField/types.d.ts +3 -0
- package/src/components/DataList/DataList.mdx +77 -0
- package/src/components/DataList/DataList.stories.ts +960 -0
- package/src/components/DataList/DataList.vue +140 -0
- package/src/components/DataList/DataListLoading/DataListLoading.vue +56 -0
- package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +23 -0
- package/src/components/DataList/locales.ts +3 -0
- package/src/components/DataList/tests/DataList.spec.ts +194 -0
- package/src/components/DataList/types.d.ts +23 -0
- package/src/components/DataListGroup/DataListGroup.mdx +77 -0
- package/src/components/DataListGroup/DataListGroup.stories.ts +987 -0
- package/src/components/DataListGroup/DataListGroup.vue +59 -0
- package/src/components/DataListGroup/tests/DataListGroup.spec.ts +54 -0
- package/src/components/DataListGroup/tests/data/dataListGroupItems.ts +41 -0
- package/src/components/DataListGroup/types.d.ts +15 -0
- package/src/components/DataListItem/DataListItem.vue +135 -0
- package/src/components/DataListItem/config.ts +17 -0
- package/src/components/DataListItem/locales.ts +3 -0
- package/src/components/DataListItem/tests/DataListItem.spec.ts +156 -0
- package/src/components/DataListItem/types.d.ts +23 -0
- package/src/components/DownloadBtn/Accessibilite.mdx +14 -0
- package/src/components/DownloadBtn/Accessibilite.stories.ts +166 -0
- package/src/components/DownloadBtn/AccessibiliteItems.ts +129 -0
- package/src/components/DownloadBtn/DownloadBtn.mdx +5 -6
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +207 -2
- package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FooterBar/FooterBar.mdx +2 -2
- package/src/components/FooterBar/FooterBar.stories.ts +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +58 -1
- package/src/components/HeaderBar/HeaderBar.mdx +164 -45
- package/src/components/HeaderBar/HeaderBar.stories.ts +559 -15
- package/src/components/HeaderBar/HeaderBar.vue +60 -22
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
- package/src/components/HeaderBar/{HeaderComplexMenu/HeaderComplexMenu.vue → HeaderBurgerMenu/HeaderBurgerMenu.vue} +74 -45
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +38 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +89 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +17 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +121 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/HeaderMenuSection.vue +2 -2
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +1 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +43 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +261 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/HeaderSubMenu.vue +17 -3
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +180 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +13 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +13 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +62 -25
- package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +49 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +19 -23
- package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +70 -0
- package/src/components/HeaderBar/Usages.mdx +85 -0
- package/src/components/HeaderBar/consts.scss +0 -1
- package/src/components/HeaderBar/tests/HeaderBar.spec.ts +8 -2
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +5 -10
- package/src/components/HeaderLoading/HeaderLoading.mdx +28 -0
- package/src/components/HeaderLoading/HeaderLoading.stories.ts +62 -0
- package/src/components/HeaderLoading/HeaderLoading.vue +45 -0
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +22 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +128 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +784 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +194 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +74 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/config.ts +18 -0
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +127 -0
- package/src/components/HeaderNavigationBar/types.ts +7 -0
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +31 -0
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +343 -0
- package/src/components/HeaderToolbar/HeaderToolbar.vue +487 -0
- package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +196 -0
- package/src/components/HeaderToolbar/types.d.ts +20 -0
- package/src/components/LangBtn/LangBtn.mdx +1 -1
- package/src/components/LangBtn/LangBtn.stories.ts +125 -8
- package/src/components/Logo/Logo.mdx +2 -2
- package/src/components/Logo/Logo.stories.ts +147 -1
- package/src/components/LogoBrandSection/LogoBrandSection.mdx +14 -0
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +158 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +312 -0
- package/src/components/LogoBrandSection/assets/ameli-pro.svg +1 -0
- package/src/components/LogoBrandSection/assets/ameli.svg +1 -0
- package/src/components/LogoBrandSection/assets/cnam.svg +1 -0
- package/src/components/LogoBrandSection/assets/compte-ameli.svg +1 -0
- package/src/components/LogoBrandSection/dividerDimensionsMapping.ts +14 -0
- package/src/components/LogoBrandSection/locales.ts +14 -0
- package/src/components/LogoBrandSection/secondaryLogoMapping.ts +24 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +365 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +14 -0
- package/src/components/LogoBrandSection/types.ts +8 -0
- package/src/components/NotificationBar/NotificationBar.mdx +6 -6
- package/src/components/NotificationBar/NotificationBar.stories.ts +1 -1
- package/src/components/NotificationBar/NotificationBar.vue +2 -2
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +1 -1
- package/src/components/PageContainer/PageContainer.mdx +1 -1
- package/src/components/PageContainer/PageContainer.stories.ts +86 -1
- package/src/components/PhoneField/PhoneField.mdx +49 -0
- package/src/components/PhoneField/PhoneField.stories.ts +869 -0
- package/src/components/PhoneField/PhoneField.vue +230 -0
- package/src/components/PhoneField/indicatifs.ts +104 -0
- package/src/components/PhoneField/locales.ts +4 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +179 -0
- package/src/components/SkipLink/SkipLink.stories.ts +50 -1
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +28 -1
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +37 -1
- package/src/components/SubHeader/SubHeader.mdx +31 -0
- package/src/components/SubHeader/SubHeader.stories.ts +1032 -0
- package/src/components/SubHeader/SubHeader.vue +185 -0
- package/src/components/SubHeader/config.ts +12 -0
- package/src/components/SubHeader/locales.ts +3 -0
- package/src/components/SubHeader/tests/SubHeader.spec.ts +144 -0
- package/src/components/index.ts +24 -7
- package/src/composables/widthable/index.ts +29 -0
- package/src/composables/widthable/tests/widthable.spec.ts +52 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -2
- package/src/main.ts +1 -0
- package/src/modules.d.ts +4 -0
- package/src/services/index.ts +1 -0
- package/src/stories/Demarrer/Accueil.mdx +10 -0
- package/src/stories/Demarrer/Accueil.stories.ts +76 -0
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +9 -0
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +20 -0
- package/src/stories/Fondamentaux/Accessibilite/Accessibilite.mdx +1 -2
- package/src/stories/Fondamentaux/Accessibilite/Accessibilite.stories.ts +1 -1
- package/src/stories/Fondamentaux/EcoConception/Econception.stories.ts +1 -1
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +52 -48
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +31 -28
- package/src/stories/Guidelines/CustomisationEtThemes.mdx +1 -1
- package/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.ts +47 -0
- package/src/utils/functions/throttleDisplayFn/throttleDisplayFn.ts +26 -0
- package/src/utils/rules/exactLength/index.ts +33 -0
- package/src/utils/rules/exactLength/locales.ts +6 -0
- package/src/utils/rules/required/index.ts +25 -0
- package/src/utils/rules/required/locales.ts +5 -0
- package/src/utils/rules/required/ruleMessageHelper.ts +14 -0
- package/src/utils/rules/required/tests/index.spec.ts +47 -0
- package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +22 -0
- package/src/utils/rules/types.d.ts +15 -0
- package/src/components/Beta/beta.mdx +0 -5
- package/src/components/Deprecated/deprecated.mdx +0 -5
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderComplexMenu.stories.ts +0 -272
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +0 -49
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +0 -56
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +0 -137
- package/src/components/HeaderBar/HeaderComplexMenu/tests/HeaderComplexMenu.spec.ts +0 -129
- package/src/components/HeaderBar/HeaderComplexMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +0 -18
- package/src/stories/Home/Accueil.mdx +0 -7
- package/src/stories/Home/PolitiqueDeConfidentialite.mdx +0 -4
- package/src/stories/Home/synapse.webp +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/HeaderMenuItem.vue +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/conts.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/locals.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/tests/useHandleSubMenus.spec.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/useHandleSubMenus.ts +0 -0
- /package/src/components/Logo/{types.d.ts → types.ts} +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { mdiKeyboardBackspace } from '@mdi/js'
|
|
4
|
+
|
|
5
|
+
import { config } from './config'
|
|
6
|
+
import { locales } from './locales'
|
|
7
|
+
|
|
8
|
+
import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
|
|
9
|
+
import { useWidthable, type Widthable } from '@/composables/widthable'
|
|
10
|
+
|
|
11
|
+
import DataListGroup from '../DataListGroup/DataListGroup.vue'
|
|
12
|
+
import HeaderLoading from '../HeaderLoading/HeaderLoading.vue'
|
|
13
|
+
import type { DataListActionEvent, DataListGroupItems } from '../DataListGroup/types'
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<CustomizableOptions & Widthable & {
|
|
16
|
+
hideBackBtn: boolean
|
|
17
|
+
backBtnText?: string
|
|
18
|
+
titleText?: string
|
|
19
|
+
subTitleText?: string
|
|
20
|
+
dataListGroupItems?: DataListGroupItems | undefined
|
|
21
|
+
loading?: boolean
|
|
22
|
+
renderHtmlValue?: boolean
|
|
23
|
+
}>(), {
|
|
24
|
+
hideBackBtn: false,
|
|
25
|
+
backBtnText: locales.backBtnText,
|
|
26
|
+
titleText: undefined,
|
|
27
|
+
subTitleText: undefined,
|
|
28
|
+
dataListGroupItems: undefined,
|
|
29
|
+
loading: false,
|
|
30
|
+
renderHtmlValue: false,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const options = useCustomizableOptions(config, props)
|
|
34
|
+
const { widthStyles } = useWidthable(props)
|
|
35
|
+
|
|
36
|
+
const backArrowIcon = ref(mdiKeyboardBackspace)
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits(['click:list-item', 'back'])
|
|
39
|
+
|
|
40
|
+
function emitItemAction(eventValue: DataListActionEvent) {
|
|
41
|
+
emit('click:list-item', eventValue)
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<VSheet
|
|
47
|
+
v-bind="options.sheet"
|
|
48
|
+
:style="widthStyles"
|
|
49
|
+
class="vd-sub-header white--text py-6 px-8"
|
|
50
|
+
>
|
|
51
|
+
<slot name="back-btn">
|
|
52
|
+
<VFadeTransition
|
|
53
|
+
v-if="!hideBackBtn"
|
|
54
|
+
mode="out-in"
|
|
55
|
+
>
|
|
56
|
+
<VSkeletonLoader
|
|
57
|
+
v-if="loading"
|
|
58
|
+
max-height="28"
|
|
59
|
+
type="button"
|
|
60
|
+
color="secondary"
|
|
61
|
+
class="vd-subheader-loading mb-4"
|
|
62
|
+
/>
|
|
63
|
+
<VBtn
|
|
64
|
+
v-else
|
|
65
|
+
v-bind="options.backBtn"
|
|
66
|
+
class="vd-sub-header-back-btn mb-1"
|
|
67
|
+
@click="$emit('back')"
|
|
68
|
+
>
|
|
69
|
+
<slot name="back-btn-icon">
|
|
70
|
+
<VIcon class="mr-2">
|
|
71
|
+
{{ backArrowIcon }}
|
|
72
|
+
</VIcon>
|
|
73
|
+
</slot>
|
|
74
|
+
{{ backBtnText }}
|
|
75
|
+
</VBtn>
|
|
76
|
+
</VFadeTransition>
|
|
77
|
+
</slot>
|
|
78
|
+
|
|
79
|
+
<div class="vd-sub-header-content d-flex justify-space-between">
|
|
80
|
+
<div class="vd-sub-header-informations d-flex flex-column flex-shrink-0 mr-10">
|
|
81
|
+
<slot name="title">
|
|
82
|
+
<VFadeTransition mode="out-in">
|
|
83
|
+
<HeaderLoading
|
|
84
|
+
v-if="loading"
|
|
85
|
+
width="300"
|
|
86
|
+
height="2rem"
|
|
87
|
+
color="secondary"
|
|
88
|
+
/>
|
|
89
|
+
<h2
|
|
90
|
+
v-else-if="titleText"
|
|
91
|
+
class="text-h5 font-weight-bold"
|
|
92
|
+
>
|
|
93
|
+
{{ titleText }}
|
|
94
|
+
</h2>
|
|
95
|
+
</VFadeTransition>
|
|
96
|
+
</slot>
|
|
97
|
+
|
|
98
|
+
<slot name="sub-title">
|
|
99
|
+
<VFadeTransition
|
|
100
|
+
v-if="subTitleText"
|
|
101
|
+
mode="out-in"
|
|
102
|
+
>
|
|
103
|
+
<HeaderLoading
|
|
104
|
+
v-if="loading"
|
|
105
|
+
class="mt-1"
|
|
106
|
+
width="250"
|
|
107
|
+
height="2rem"
|
|
108
|
+
color="secondary"
|
|
109
|
+
/>
|
|
110
|
+
<p
|
|
111
|
+
v-else
|
|
112
|
+
class="text-h6 font-weight-bold mt-1 mb-0"
|
|
113
|
+
:style="{ color: 'rgba(255, 255, 255, .7)' }"
|
|
114
|
+
>
|
|
115
|
+
{{ subTitleText }}
|
|
116
|
+
</p>
|
|
117
|
+
</VFadeTransition>
|
|
118
|
+
</slot>
|
|
119
|
+
|
|
120
|
+
<slot name="additional-informations" />
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<slot name="right-content">
|
|
124
|
+
<DataListGroup
|
|
125
|
+
v-if="dataListGroupItems"
|
|
126
|
+
:items="dataListGroupItems"
|
|
127
|
+
:loading="loading"
|
|
128
|
+
:render-html-value="renderHtmlValue"
|
|
129
|
+
item-width="auto"
|
|
130
|
+
class="flex-nowrap flex-shrink-0"
|
|
131
|
+
@click:list-item="emitItemAction"
|
|
132
|
+
/>
|
|
133
|
+
</slot>
|
|
134
|
+
</div>
|
|
135
|
+
</VSheet>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<style lang="scss" scoped>
|
|
139
|
+
.vd-sub-header {
|
|
140
|
+
overflow-x: auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.vd-sub-header-back-btn {
|
|
144
|
+
margin: 0 -6px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.vd-data-list-group,
|
|
148
|
+
.vd-sub-header-informations {
|
|
149
|
+
// Don't take all available space
|
|
150
|
+
max-width: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.vd-data-list-group :deep(.vd-data-list) {
|
|
154
|
+
max-width: 200px;
|
|
155
|
+
|
|
156
|
+
// Apply margin right to avoid empty
|
|
157
|
+
// space on smaller screens
|
|
158
|
+
&:not(:last-child) {
|
|
159
|
+
margin-right: 80px !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.vd-key {
|
|
163
|
+
display: inline-block;
|
|
164
|
+
font-size: 0.75rem !important;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.vd-data-list-item-label {
|
|
168
|
+
color: rgba(255, 255, 255, 0.7) !important;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.vd-data-list-item-action-btn {
|
|
172
|
+
color: #fff !important;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.vd-subheader-loading :deep() {
|
|
177
|
+
background: transparent;
|
|
178
|
+
.v-skeleton-loader__button {
|
|
179
|
+
margin: 0;
|
|
180
|
+
min-height: 28px;
|
|
181
|
+
height: auto;
|
|
182
|
+
background: rgba(white, var(--v-border-opacity));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { vuetify } from '@tests/unit/setup'
|
|
4
|
+
|
|
5
|
+
import SubHeader from '../SubHeader.vue'
|
|
6
|
+
|
|
7
|
+
import type { DataList } from '@/components/DataList/types'
|
|
8
|
+
import type { DataListGroupItems } from '@/components/DataListGroup/types'
|
|
9
|
+
|
|
10
|
+
const dataListItems: DataList = [
|
|
11
|
+
{
|
|
12
|
+
key: 'Libellé',
|
|
13
|
+
value: 'Texte saisi',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: 'Libellé',
|
|
17
|
+
value: 'Texte saisi',
|
|
18
|
+
},
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
const dataListItemsActions: DataList = [
|
|
22
|
+
{
|
|
23
|
+
key: 'Libellé',
|
|
24
|
+
value: 'Texte à modifier',
|
|
25
|
+
action: 'Modifier',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: 'Libellé',
|
|
29
|
+
value: 'Texte à modifier',
|
|
30
|
+
action: 'Modifier',
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
const dataListGroupItems: DataListGroupItems = [
|
|
35
|
+
{
|
|
36
|
+
title: 'Catégorie 1',
|
|
37
|
+
items: dataListItems,
|
|
38
|
+
itemsNumberLoading: 2,
|
|
39
|
+
headingLoading: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: 'Catégorie 2',
|
|
43
|
+
items: dataListItemsActions,
|
|
44
|
+
itemsNumberLoading: 2,
|
|
45
|
+
headingLoading: true,
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
describe('SubHeader', () => {
|
|
50
|
+
it('renders correctly', () => {
|
|
51
|
+
const wrapper = mount(SubHeader, {
|
|
52
|
+
global: {
|
|
53
|
+
plugins: [vuetify],
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
hideBackBtn: false,
|
|
57
|
+
backBtnText: 'Retour',
|
|
58
|
+
loading: false,
|
|
59
|
+
renderHtmlValue: false,
|
|
60
|
+
dataListGroupItems,
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const elExists = wrapper.find('.vd-sub-header').exists()
|
|
65
|
+
expect(elExists).toBe(true)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('renders loading state correctly', async () => {
|
|
69
|
+
const wrapper = mount(SubHeader, {
|
|
70
|
+
global: {
|
|
71
|
+
plugins: [vuetify],
|
|
72
|
+
},
|
|
73
|
+
props: {
|
|
74
|
+
hideBackBtn: false,
|
|
75
|
+
titleText: 'Test',
|
|
76
|
+
loading: true,
|
|
77
|
+
dataListGroupItems,
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const elExists = wrapper.find('.vd-subheader-loading').exists()
|
|
82
|
+
expect(elExists).toBe(true)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('get subTitleText is defined', async () => {
|
|
86
|
+
const wrapper = mount(SubHeader, {
|
|
87
|
+
global: {
|
|
88
|
+
plugins: [vuetify],
|
|
89
|
+
},
|
|
90
|
+
props: {
|
|
91
|
+
hideBackBtn: false,
|
|
92
|
+
titleText: 'Test',
|
|
93
|
+
subTitleText: 'SubTitle',
|
|
94
|
+
dataListGroupItems,
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const subTitleText = wrapper.vm.subTitleText
|
|
99
|
+
expect(subTitleText).toBe('SubTitle')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
it('emits itemAction event when called', async () => {
|
|
103
|
+
const wrapper = mount(SubHeader, {
|
|
104
|
+
global: {
|
|
105
|
+
plugins: [vuetify],
|
|
106
|
+
},
|
|
107
|
+
props: {
|
|
108
|
+
hideBackBtn: false,
|
|
109
|
+
titleText: 'Test',
|
|
110
|
+
dataListGroupItems,
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
const btn = wrapper.find('.vd-data-list-item-action-btn')
|
|
115
|
+
await btn.trigger('click')
|
|
116
|
+
|
|
117
|
+
await wrapper.vm.$nextTick()
|
|
118
|
+
|
|
119
|
+
expect(wrapper.emitted('click:list-item')).toBeTruthy()
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('emits back event when called in slot', async () => {
|
|
123
|
+
const wrapper = mount(SubHeader, {
|
|
124
|
+
global: {
|
|
125
|
+
plugins: [vuetify],
|
|
126
|
+
},
|
|
127
|
+
props: {
|
|
128
|
+
hideBackBtn: false,
|
|
129
|
+
titleText: 'Test',
|
|
130
|
+
dataListGroupItems,
|
|
131
|
+
},
|
|
132
|
+
slots: {
|
|
133
|
+
backBtn: '<div class="vd-back-btn">Back</div>',
|
|
134
|
+
},
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
const btn = wrapper.find('.vd-sub-header-back-btn')
|
|
138
|
+
await btn.trigger('click')
|
|
139
|
+
|
|
140
|
+
await wrapper.vm.$nextTick()
|
|
141
|
+
|
|
142
|
+
expect(wrapper.emitted('back')).toBeTruthy()
|
|
143
|
+
})
|
|
144
|
+
})
|
package/src/components/index.ts
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
export { default as PageContainer } from './PageContainer/PageContainer.vue'
|
|
2
1
|
export { default as Alert } from './Alert/Alert.vue'
|
|
3
|
-
export { default as CopyBtn } from './CopyBtn/CopyBtn.vue'
|
|
4
|
-
export { default as SkipLink } from './SkipLink/SkipLink.vue'
|
|
5
|
-
export { default as BackToTopBtn } from './BackToTopBtn/BackToTopBtn.vue'
|
|
6
2
|
export { default as BackBtn } from './BackBtn/BackBtn.vue'
|
|
3
|
+
export { default as BackToTopBtn } from './BackToTopBtn/BackToTopBtn.vue'
|
|
4
|
+
export { default as CollapsibleList } from './CollapsibleList/CollapsibleList.vue'
|
|
5
|
+
export { default as CopyBtn } from './CopyBtn/CopyBtn.vue'
|
|
6
|
+
export { default as CustomInputSelect } from './Customs/CustomInputSelect/CustomInputSelect.vue'
|
|
7
|
+
export { default as CustomSelect } from './Customs/CustomSelect/CustomSelect.vue'
|
|
8
|
+
export { default as CustomTextField } from './Customs/CustomTextField/CustomTextField.vue'
|
|
9
|
+
export { default as DataList } from './DataList/DataList.vue'
|
|
10
|
+
export { default as DataListGroup } from './DataListGroup/DataListGroup.vue'
|
|
7
11
|
export { default as DownloadBtn } from './DownloadBtn/DownloadBtn.vue'
|
|
12
|
+
export { default as FooterBar } from './FooterBar/FooterBar.vue'
|
|
8
13
|
export { default as FranceConnectBtn } from './FranceConnectBtn/FranceConnectBtn.vue'
|
|
9
|
-
export { default as
|
|
14
|
+
export { default as HeaderBar } from './HeaderBar/HeaderBar.vue'
|
|
15
|
+
export { default as HeaderBurgerMenu } from './HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue'
|
|
16
|
+
export { default as HeaderMenuItem } from './HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue'
|
|
17
|
+
export { default as HeaderMenuSection } from './HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue'
|
|
18
|
+
export { default as HeaderSubMenu } from './HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue'
|
|
19
|
+
export { default as HeaderLogo } from './HeaderBar/HeaderLogo/HeaderLogo.vue'
|
|
20
|
+
export { default as HeaderMenuBtn } from './HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue'
|
|
21
|
+
export { default as HeaderLoading } from './HeaderLoading/HeaderLoading.vue'
|
|
22
|
+
export { default as HeaderNavigationBar } from './HeaderNavigationBar/HeaderNavigationBar.vue'
|
|
10
23
|
export { default as LangBtn } from './LangBtn/LangBtn.vue'
|
|
11
24
|
export { default as Logo } from './Logo/Logo.vue'
|
|
12
|
-
export { default as
|
|
25
|
+
export { default as LogoBrandSection } from './LogoBrandSection/LogoBrandSection.vue'
|
|
26
|
+
export { default as NotificationBar } from './NotificationBar/NotificationBar.vue'
|
|
27
|
+
export * from './NotificationBar/types'
|
|
28
|
+
export { default as PageContainer } from './PageContainer/PageContainer.vue'
|
|
29
|
+
export { default as SkipLink } from './SkipLink/SkipLink.vue'
|
|
13
30
|
export { default as SocialMediaLinks } from './SocialMediaLinks/SocialMediaLinks.vue'
|
|
14
|
-
export { default as
|
|
31
|
+
export { default as SubHeader } from './SubHeader/SubHeader.vue'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
import { convertToUnit } from '@/utils/convertToUnit'
|
|
3
|
+
|
|
4
|
+
export type NumberOrNumberString = string | number | undefined
|
|
5
|
+
|
|
6
|
+
export function useWidthable(props: {
|
|
7
|
+
maxWidth?: NumberOrNumberString
|
|
8
|
+
minWidth?: NumberOrNumberString
|
|
9
|
+
width?: NumberOrNumberString
|
|
10
|
+
}) {
|
|
11
|
+
// Computed style properties
|
|
12
|
+
const widthStyles = computed<Record<string, string | undefined>>(() => {
|
|
13
|
+
return {
|
|
14
|
+
maxWidth: convertToUnit(props.maxWidth),
|
|
15
|
+
minWidth: convertToUnit(props.minWidth),
|
|
16
|
+
width: convertToUnit(props.width ?? '100%'),
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
widthStyles,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface Widthable {
|
|
26
|
+
maxWidth?: NumberOrNumberString
|
|
27
|
+
minWidth?: NumberOrNumberString
|
|
28
|
+
width?: NumberOrNumberString
|
|
29
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { useWidthable } from '../'
|
|
3
|
+
|
|
4
|
+
describe('useWidthable', () => {
|
|
5
|
+
it('returns correct styles for default props', () => {
|
|
6
|
+
const props = {
|
|
7
|
+
maxWidth: undefined,
|
|
8
|
+
minWidth: undefined,
|
|
9
|
+
width: undefined,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { widthStyles } = useWidthable(props)
|
|
13
|
+
|
|
14
|
+
expect(widthStyles.value).toEqual({
|
|
15
|
+
maxWidth: undefined,
|
|
16
|
+
minWidth: undefined,
|
|
17
|
+
width: '100%',
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('returns correct styles for specific width values', () => {
|
|
22
|
+
const props = {
|
|
23
|
+
maxWidth: '500px',
|
|
24
|
+
minWidth: '200px',
|
|
25
|
+
width: 300,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { widthStyles } = useWidthable(props)
|
|
29
|
+
|
|
30
|
+
expect(widthStyles.value).toEqual({
|
|
31
|
+
maxWidth: '500px',
|
|
32
|
+
minWidth: '200px',
|
|
33
|
+
width: '300px',
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('handles numeric and string values correctly', () => {
|
|
38
|
+
const props = {
|
|
39
|
+
maxWidth: 600,
|
|
40
|
+
minWidth: '50%',
|
|
41
|
+
width: '75%',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { widthStyles } = useWidthable(props)
|
|
45
|
+
|
|
46
|
+
expect(widthStyles.value).toEqual({
|
|
47
|
+
maxWidth: '600px',
|
|
48
|
+
minWidth: '50%',
|
|
49
|
+
width: '75%',
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})
|
|
@@ -7,8 +7,8 @@ export const cnamLightTheme = {
|
|
|
7
7
|
accent: cnamColorsTokens.cyan.base,
|
|
8
8
|
error: cnamColorsTokens.orange.darken20,
|
|
9
9
|
info: cnamColorsTokens.blue.base,
|
|
10
|
-
success: cnamColorsTokens.
|
|
11
|
-
warning: cnamColorsTokens.yellow.
|
|
10
|
+
success: cnamColorsTokens.turquoise.darken60,
|
|
11
|
+
warning: cnamColorsTokens.yellow.darken60,
|
|
12
12
|
risquePro: cnamColorsTokens.brick.base,
|
|
13
13
|
onBackground: cnamSemanticTokens.colors.background.surface,
|
|
14
14
|
onSurfaceAlt: cnamSemanticTokens.colors.background.surfaceAlt,
|
package/src/main.ts
CHANGED
package/src/modules.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as NotificationService from './NotificationService'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {Story, Meta} from '@storybook/blocks';
|
|
2
|
+
import * as AccueilStories from './Accueil.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={AccueilStories} />
|
|
5
|
+
|
|
6
|
+
<Story of={AccueilStories.Header} />
|
|
7
|
+
|
|
8
|
+
<p>Au service des équipes-produits de la Caisse Nationale de l’Assurance Maladie, cette boîte à outil met à disposition un ensemble de principes et de composants d’interfaces pour harmoniser et accélérer la fabrication des produits.</p>
|
|
9
|
+
|
|
10
|
+
<Story of={AccueilStories.List} />
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { VBtn, VIcon, VRow, VCol } from 'vuetify/components'
|
|
2
|
+
import type { StoryObj } from '@storybook/vue3'
|
|
3
|
+
|
|
4
|
+
import { mdiGithub } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
import { version } from '../../../package.json'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Démarrer/Accueil',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Header: StoryObj = {
|
|
13
|
+
render: () => {
|
|
14
|
+
return {
|
|
15
|
+
components: { VBtn, VIcon },
|
|
16
|
+
setup() {
|
|
17
|
+
return {
|
|
18
|
+
githubIcon: mdiGithub,
|
|
19
|
+
version,
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
template: `
|
|
23
|
+
<div class="d-flex justify-space-between align-center">
|
|
24
|
+
<h1 class="title font-weight-medium">Un Design System<br/>pour l’Assurance Maladie</h1>
|
|
25
|
+
<VBtn
|
|
26
|
+
:icon="githubIcon"
|
|
27
|
+
aria-label="GitHub"
|
|
28
|
+
href="https://github.com/assurance-maladie-digital/design-system-v3"
|
|
29
|
+
target="_blank"
|
|
30
|
+
rel="noopener noreferrer"
|
|
31
|
+
class="d-xs-none d-sm-flex"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<p class="mt-4 mb-8">
|
|
35
|
+
<b>v{{ version }}</b>
|
|
36
|
+
</p>
|
|
37
|
+
`,
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
tags: ['!dev'],
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const List: StoryObj = {
|
|
44
|
+
render: () => {
|
|
45
|
+
return {
|
|
46
|
+
components: { VRow, VCol },
|
|
47
|
+
setup() {
|
|
48
|
+
return {
|
|
49
|
+
githubIcon: mdiGithub,
|
|
50
|
+
version,
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
template: `
|
|
54
|
+
<VRow class="mt-8">
|
|
55
|
+
<VCol cols="12" sm="6" class="m-2 p-2 v-col-auto background-list">
|
|
56
|
+
<p class="font-weight-bold mb-2">Qui sont nos principaux utilisateurs ?</p>
|
|
57
|
+
<p>Respectant les règles graphiques de la charte graphique de la CNAM, ce design system couvre prioritairement les produits à destination des assurés, des entreprises et des agents.</p>
|
|
58
|
+
</VCol>
|
|
59
|
+
<VCol cols="12" sm="6" class="m-2 p-2 v-col-auto background-list">
|
|
60
|
+
<p class="font-weight-bold mb-2">Comment accéder au design system ?</p>
|
|
61
|
+
<p>Afin d’améliorer la collaboration, il est disponible pour les développeurs depuis GitHub (accès open source) et pour les designers depuis Figma (accès sur demande).</p>
|
|
62
|
+
</VCol>
|
|
63
|
+
<VCol cols="12" sm="6" class="m-2 p-2 v-col-auto background-list">
|
|
64
|
+
<p class="font-weight-bold mb-2">Est-ce que le design system est complet ?</p>
|
|
65
|
+
<p>Face à l’ampleur des composants et des fonctionnalités nécessaires au bon fonctionnement d’un produit, le design system ne suffit pas seul. Vous devez composer avec la librairie vuetify et le framework vue.js.</p>
|
|
66
|
+
</VCol>
|
|
67
|
+
<VCol cols="12" sm="6" class="m-2 p-2 v-col-auto background-list">
|
|
68
|
+
<p class="font-weight-bold mb-2">Quels sont les bénéfices du design system ?</p>
|
|
69
|
+
<p>Utiliser un design system permet d’accélérer la fabrication, la collaboration et la prise de décision puisqu’il suffit à l’équipe-produit de piocher directement dans une collection de composants déjà adaptés aux besoins de CNAM.</p>
|
|
70
|
+
</VCol>
|
|
71
|
+
</VRow>
|
|
72
|
+
`,
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
tags: ['!dev'],
|
|
76
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {Story, Meta} from '@storybook/blocks';
|
|
2
|
+
import * as PolitiqueDeConfidentialiteStories from './PolitiqueDeConfidentialite.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={PolitiqueDeConfidentialiteStories} />
|
|
5
|
+
|
|
6
|
+
# Politique de confidentialité
|
|
7
|
+
|
|
8
|
+
<Story of={PolitiqueDeConfidentialiteStories.Default} />
|
|
9
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { VCard } from 'vuetify/components'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Démarrer/Politique de confidentialité',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const Default: StoryObj = {
|
|
9
|
+
render: () => {
|
|
10
|
+
return {
|
|
11
|
+
components: { VCard },
|
|
12
|
+
template: `
|
|
13
|
+
<VCard class="mt-4 pa-2">
|
|
14
|
+
<iframe src="https://assurancemaladiesec.github.io/abuse/reporting/" width="100%" height="800px" frameBorder="0"></iframe>
|
|
15
|
+
</VCard>
|
|
16
|
+
`,
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
tags: ['!dev'],
|
|
20
|
+
}
|
|
@@ -13,8 +13,7 @@ En tant que personne morale de droit public nous concevons les composants de not
|
|
|
13
13
|
|
|
14
14
|
Le RGAA est un outil méthodologique de certification permettant d'assurer par le respect de ses critères une manipulation des produits numériques dans le domaine du Web de manière égale entre chaque citoyen, qu'il soit ou non en situation de handicap (visuel, auditif, moteur, trouble dys...). Basé sur les travaux du W3C Web Accessibility Initiative (WAI) il vise à garantir quatre indices de performance:**la bonne perceptibilité de l'information**, une **manipulation efficiente dans la navigation**, une **bonne compréhension** et une **robustesse efficace** dans l'usage des produits numériques.
|
|
15
15
|
|
|
16
|
-
[En savoir plus sur le RGAA](https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu)
|
|
17
|
-
|
|
16
|
+
[En savoir plus sur le RGAA](https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu)<br/>
|
|
18
17
|
[En savoir plus sur le W3C WAI](https://www.w3.org/WAI/fundamentals/)
|
|
19
18
|
|
|
20
19
|
[](https://digital-design-system.netlify.app/fondamentaux/accessibilite#quels-sont-les-criteres-du-rgaa)Quels sont les critères du RGAA?
|
|
@@ -3,7 +3,7 @@ import type { StoryObj } from '@storybook/vue3'
|
|
|
3
3
|
import { ecoDesignItems } from '@/stories/Fondamentaux/EcoConception/ecoDesignItems'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title: 'Fondamentaux
|
|
6
|
+
title: 'Fondamentaux/Éco-conception',
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const EcoPanel: StoryObj = {
|