@cnamts/synapse 0.0.2-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/README.md +1 -1
- package/dist/design-system-v3.d.ts +712 -27
- package/dist/design-system-v3.js +2745 -5384
- package/dist/design-system-v3.umd.cjs +10 -2
- package/dist/style.css +1 -1
- package/package.json +32 -29
- package/src/components/Alert/Alert.mdx +1 -1
- package/src/components/Alert/Alert.stories.ts +91 -1
- package/src/components/Alert/Alert.vue +8 -8
- 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/FranceConnectBtn/FranceConnectBtn.vue +2 -2
- package/src/components/HeaderBar/HeaderBar.mdx +256 -0
- package/src/components/HeaderBar/HeaderBar.stories.ts +703 -0
- package/src/components/HeaderBar/HeaderBar.vue +276 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +234 -0
- 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/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +51 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +16 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +3 -0
- 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/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +51 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +31 -0
- 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/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +194 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +63 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/conts.ts +1 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/locals.ts +4 -0
- 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/HeaderBurgerMenu/tests/useHandleSubMenus.spec.ts +158 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/useHandleSubMenus.ts +49 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +143 -0
- package/src/components/HeaderBar/HeaderLogo/locales.ts +3 -0
- package/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.vue +117 -0
- package/src/components/HeaderBar/HeaderLogo/logos/Logo.vue +279 -0
- package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +119 -0
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +84 -0
- package/src/components/HeaderBar/HeaderMenuBtn/locals.ts +4 -0
- 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 +6 -0
- package/src/components/HeaderBar/consts.ts +2 -0
- package/src/components/HeaderBar/locales.ts +3 -0
- package/src/components/HeaderBar/tests/HeaderBar.spec.ts +216 -0
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +45 -0
- package/src/components/HeaderBar/tests/useHeaderResponsiveMode.spec.ts +26 -0
- package/src/components/HeaderBar/tests/useScrollDirection.spec.ts +34 -0
- package/src/components/HeaderBar/useHeaderResponsiveMode.ts +25 -0
- package/src/components/HeaderBar/useScrollDirection.ts +26 -0
- 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 +7 -9
- 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/PageContainer/PageContainer.vue +0 -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/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/Logo/{types.d.ts → types.ts} +0 -0
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
3
3
|
import { VBtn, VMenu, VList, VListItem, VListItemTitle } from 'vuetify/components'
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof LangBtn> = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Composants/Boutons/LangBtn',
|
|
7
7
|
component: LangBtn,
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: 'fullscreen',
|
|
@@ -16,7 +16,7 @@ const meta: Meta<typeof LangBtn> = {
|
|
|
16
16
|
// @ts-expect-error Type '"array"' is not assignable to type 'Control | undefined'.
|
|
17
17
|
availableLanguages: { control: { type: 'array' } },
|
|
18
18
|
vuetifyOptions: {
|
|
19
|
-
|
|
19
|
+
control: { type: 'object' },
|
|
20
20
|
default: () => ({
|
|
21
21
|
menu: {
|
|
22
22
|
offsetY: true,
|
|
@@ -39,11 +39,38 @@ export default meta
|
|
|
39
39
|
type Story = StoryObj<typeof meta>
|
|
40
40
|
|
|
41
41
|
export const Default: Story = {
|
|
42
|
+
parameters: {
|
|
43
|
+
sourceCode: [
|
|
44
|
+
{
|
|
45
|
+
name: 'Template',
|
|
46
|
+
code: `<template>
|
|
47
|
+
<LangBtn
|
|
48
|
+
v-model="value"
|
|
49
|
+
:items="items"
|
|
50
|
+
:aria-label="ariaLabel"
|
|
51
|
+
/>
|
|
52
|
+
</template>
|
|
53
|
+
`,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Script',
|
|
57
|
+
code: `<script setup lang="ts">
|
|
58
|
+
import LangBtn from '@cnamts/synapse'
|
|
59
|
+
import { ref } from 'vue'
|
|
60
|
+
|
|
61
|
+
const value = ref('fr')
|
|
62
|
+
const items = ['fr', 'en', 'es']
|
|
63
|
+
const ariaLabel = 'Choix de la langue'
|
|
64
|
+
</script>
|
|
65
|
+
`,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
42
69
|
args: {
|
|
43
|
-
modelValue: '
|
|
70
|
+
modelValue: 'fr',
|
|
44
71
|
hideDownArrow: false,
|
|
45
|
-
ariaLabel: '
|
|
46
|
-
availableLanguages: ['fr', '
|
|
72
|
+
ariaLabel: 'Choix de la langue',
|
|
73
|
+
availableLanguages: ['fr', 'en', 'es'],
|
|
47
74
|
vuetifyOptions: {
|
|
48
75
|
menu: {
|
|
49
76
|
offsetY: true,
|
|
@@ -74,10 +101,36 @@ export const Default: Story = {
|
|
|
74
101
|
}
|
|
75
102
|
|
|
76
103
|
export const AllLanguages: Story = {
|
|
104
|
+
parameters: {
|
|
105
|
+
sourceCode: [
|
|
106
|
+
{
|
|
107
|
+
name: 'Template',
|
|
108
|
+
code: `<template>
|
|
109
|
+
<LangBtn
|
|
110
|
+
v-model="value"
|
|
111
|
+
:aria-label="ariaLabel"
|
|
112
|
+
available-languages="*"
|
|
113
|
+
/>
|
|
114
|
+
</template>
|
|
115
|
+
`,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'Script',
|
|
119
|
+
code: `<script setup lang="ts">
|
|
120
|
+
import LangBtn from '@cnamts/synapse'
|
|
121
|
+
import { ref } from 'vue'
|
|
122
|
+
|
|
123
|
+
const value = ref('fr')
|
|
124
|
+
const ariaLabel = 'Choix de la langue'
|
|
125
|
+
</script>
|
|
126
|
+
`,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
77
130
|
args: {
|
|
78
131
|
modelValue: 'fr',
|
|
79
132
|
hideDownArrow: false,
|
|
80
|
-
ariaLabel: '
|
|
133
|
+
ariaLabel: 'Choix de la langue',
|
|
81
134
|
availableLanguages: '*',
|
|
82
135
|
},
|
|
83
136
|
render: (args) => {
|
|
@@ -96,10 +149,38 @@ export const AllLanguages: Story = {
|
|
|
96
149
|
}
|
|
97
150
|
|
|
98
151
|
export const NoDownArrow: Story = {
|
|
152
|
+
parameters: {
|
|
153
|
+
sourceCode: [
|
|
154
|
+
{
|
|
155
|
+
name: 'Template',
|
|
156
|
+
code: `<template>
|
|
157
|
+
<LangBtn
|
|
158
|
+
v-model="value"
|
|
159
|
+
:items="items"
|
|
160
|
+
:aria-label="ariaLabel"
|
|
161
|
+
hide-down-arrow
|
|
162
|
+
/>
|
|
163
|
+
</template>
|
|
164
|
+
`,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'Script',
|
|
168
|
+
code: `<script setup lang="ts">
|
|
169
|
+
import LangBtn from '@cnamts/synapse'
|
|
170
|
+
import { ref } from 'vue'
|
|
171
|
+
|
|
172
|
+
const value = ref('fr')
|
|
173
|
+
const items = ['fr', 'en', 'es']
|
|
174
|
+
const ariaLabel = 'Choix de la langue'
|
|
175
|
+
</script>
|
|
176
|
+
`,
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
99
180
|
args: {
|
|
100
181
|
modelValue: 'fr',
|
|
101
182
|
hideDownArrow: true,
|
|
102
|
-
ariaLabel: '
|
|
183
|
+
ariaLabel: 'Choix de la langue',
|
|
103
184
|
availableLanguages: ['fr', 'en', 'de'],
|
|
104
185
|
},
|
|
105
186
|
render: (args) => {
|
|
@@ -118,10 +199,46 @@ export const NoDownArrow: Story = {
|
|
|
118
199
|
}
|
|
119
200
|
|
|
120
201
|
export const FlatBtn: Story = {
|
|
202
|
+
parameters: {
|
|
203
|
+
sourceCode: [
|
|
204
|
+
{
|
|
205
|
+
name: 'Template',
|
|
206
|
+
code: `<template>
|
|
207
|
+
<LangBtn
|
|
208
|
+
v-model="value"
|
|
209
|
+
:items="items"
|
|
210
|
+
:aria-label="ariaLabel"
|
|
211
|
+
:vuetify-options="vuetifyOptions"
|
|
212
|
+
/>
|
|
213
|
+
</template>
|
|
214
|
+
`,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: 'Script',
|
|
218
|
+
code: `<script setup lang="ts">
|
|
219
|
+
import LangBtn from '@cnamts/synapse'
|
|
220
|
+
import { ref } from 'vue'
|
|
221
|
+
|
|
222
|
+
const value = ref('fr')
|
|
223
|
+
const items = ['fr', 'en', 'es']
|
|
224
|
+
const ariaLabel = 'Choix de la langue'
|
|
225
|
+
|
|
226
|
+
const vuetifyOptions = {
|
|
227
|
+
btn: {
|
|
228
|
+
color: 'primary',
|
|
229
|
+
variant: 'flat',
|
|
230
|
+
ripple: true,
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
</script>
|
|
234
|
+
`,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
},
|
|
121
238
|
args: {
|
|
122
239
|
modelValue: 'fr',
|
|
123
240
|
hideDownArrow: false,
|
|
124
|
-
ariaLabel: '
|
|
241
|
+
ariaLabel: 'Choix de la langue',
|
|
125
242
|
availableLanguages: ['fr', 'en', 'de'],
|
|
126
243
|
vuetifyOptions: {
|
|
127
244
|
btn: {
|
|
@@ -2,7 +2,7 @@ import { Canvas, Meta, Controls, Source } from '@storybook/blocks';
|
|
|
2
2
|
import * as LogoStories from './Logo.stories.ts';
|
|
3
3
|
import Logo from './Logo.vue';
|
|
4
4
|
|
|
5
|
-
<Meta title="
|
|
5
|
+
<Meta title="Composants/Données/Logo" component={Logo} />
|
|
6
6
|
|
|
7
7
|
# Logo
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ Le composant `Logo` est utilisé pour afficher le logo de l'application avec dif
|
|
|
18
18
|
|
|
19
19
|
<Source dark code={`
|
|
20
20
|
<script setup lang='ts'>
|
|
21
|
-
import Logo from '
|
|
21
|
+
import Logo from '@cnamts/synapse'
|
|
22
22
|
</script>
|
|
23
23
|
<template>
|
|
24
24
|
<Logo :hideSignature="false" :hideOrganism="false" :risquePro="false" ariaLabel="" :avatar="false" :dark="false" />
|
|
@@ -3,7 +3,7 @@ import Logo from './Logo.vue'
|
|
|
3
3
|
import { VSheet } from 'vuetify/components'
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Composants/Données/Logo',
|
|
7
7
|
component: Logo,
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: 'fullscreen',
|
|
@@ -28,6 +28,24 @@ export default meta
|
|
|
28
28
|
type Story = StoryObj<typeof meta>
|
|
29
29
|
|
|
30
30
|
export const Default: Story = {
|
|
31
|
+
parameters: {
|
|
32
|
+
sourceCode: [
|
|
33
|
+
{
|
|
34
|
+
name: 'Template',
|
|
35
|
+
code: `<template>
|
|
36
|
+
<Logo />
|
|
37
|
+
</template>
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Script',
|
|
42
|
+
code: `<script setup lang="ts">
|
|
43
|
+
import Logo from '@cnamts/synapse'
|
|
44
|
+
</script>
|
|
45
|
+
`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
31
49
|
args: {
|
|
32
50
|
hideSignature: false,
|
|
33
51
|
hideOrganism: false,
|
|
@@ -54,6 +72,24 @@ export const Default: Story = {
|
|
|
54
72
|
}
|
|
55
73
|
|
|
56
74
|
export const small: Story = {
|
|
75
|
+
parameters: {
|
|
76
|
+
sourceCode: [
|
|
77
|
+
{
|
|
78
|
+
name: 'Template',
|
|
79
|
+
code: `<template>
|
|
80
|
+
<Logo size="small" />
|
|
81
|
+
</template>
|
|
82
|
+
`,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Script',
|
|
86
|
+
code: `<script setup lang="ts">
|
|
87
|
+
import Logo from '@cnamts/synapse'
|
|
88
|
+
</script>
|
|
89
|
+
`,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
57
93
|
args: {
|
|
58
94
|
hideSignature: false,
|
|
59
95
|
hideOrganism: false,
|
|
@@ -77,6 +113,24 @@ export const small: Story = {
|
|
|
77
113
|
}
|
|
78
114
|
|
|
79
115
|
export const xSmall: Story = {
|
|
116
|
+
parameters: {
|
|
117
|
+
sourceCode: [
|
|
118
|
+
{
|
|
119
|
+
name: 'Template',
|
|
120
|
+
code: `<template>
|
|
121
|
+
<Logo size="x-small" />
|
|
122
|
+
</template>
|
|
123
|
+
`,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'Script',
|
|
127
|
+
code: `<script setup lang="ts">
|
|
128
|
+
import Logo from '@cnamts/synapse'
|
|
129
|
+
</script>
|
|
130
|
+
`,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
80
134
|
args: {
|
|
81
135
|
hideSignature: false,
|
|
82
136
|
hideOrganism: false,
|
|
@@ -100,6 +154,24 @@ export const xSmall: Story = {
|
|
|
100
154
|
}
|
|
101
155
|
|
|
102
156
|
export const hideSignature: Story = {
|
|
157
|
+
parameters: {
|
|
158
|
+
sourceCode: [
|
|
159
|
+
{
|
|
160
|
+
name: 'Template',
|
|
161
|
+
code: `<template>
|
|
162
|
+
<Logo hide-signature />
|
|
163
|
+
</template>
|
|
164
|
+
`,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'Script',
|
|
168
|
+
code: `<script setup lang="ts">
|
|
169
|
+
import Logo from '@cnamts/synapse'
|
|
170
|
+
</script>
|
|
171
|
+
`,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
103
175
|
args: {
|
|
104
176
|
hideSignature: true,
|
|
105
177
|
hideOrganism: false,
|
|
@@ -123,6 +195,24 @@ export const hideSignature: Story = {
|
|
|
123
195
|
}
|
|
124
196
|
|
|
125
197
|
export const hideOrganism: Story = {
|
|
198
|
+
parameters: {
|
|
199
|
+
sourceCode: [
|
|
200
|
+
{
|
|
201
|
+
name: 'Template',
|
|
202
|
+
code: `<template>
|
|
203
|
+
<Logo hide-organism />
|
|
204
|
+
</template>
|
|
205
|
+
`,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'Script',
|
|
209
|
+
code: `<script setup lang="ts">
|
|
210
|
+
import Logo from '@cnamts/synapse'
|
|
211
|
+
</script>
|
|
212
|
+
`,
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
126
216
|
args: {
|
|
127
217
|
hideSignature: false,
|
|
128
218
|
hideOrganism: true,
|
|
@@ -146,6 +236,24 @@ export const hideOrganism: Story = {
|
|
|
146
236
|
}
|
|
147
237
|
|
|
148
238
|
export const risquePro: Story = {
|
|
239
|
+
parameters: {
|
|
240
|
+
sourceCode: [
|
|
241
|
+
{
|
|
242
|
+
name: 'Template',
|
|
243
|
+
code: `<template>
|
|
244
|
+
<Logo risque-pro />
|
|
245
|
+
</template>
|
|
246
|
+
`,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: 'Script',
|
|
250
|
+
code: `<script setup lang="ts">
|
|
251
|
+
import Logo from '@cnamts/synapse'
|
|
252
|
+
</script>
|
|
253
|
+
`,
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
},
|
|
149
257
|
args: {
|
|
150
258
|
hideSignature: false,
|
|
151
259
|
hideOrganism: false,
|
|
@@ -169,6 +277,24 @@ export const risquePro: Story = {
|
|
|
169
277
|
}
|
|
170
278
|
|
|
171
279
|
export const avatar: Story = {
|
|
280
|
+
parameters: {
|
|
281
|
+
sourceCode: [
|
|
282
|
+
{
|
|
283
|
+
name: 'Template',
|
|
284
|
+
code: `<template>
|
|
285
|
+
<Logo avatar />
|
|
286
|
+
</template>
|
|
287
|
+
`,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'Script',
|
|
291
|
+
code: `<script setup lang="ts">
|
|
292
|
+
import Logo from '@cnamts/synapse'
|
|
293
|
+
</script>
|
|
294
|
+
`,
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
},
|
|
172
298
|
args: {
|
|
173
299
|
hideSignature: false,
|
|
174
300
|
hideOrganism: false,
|
|
@@ -192,6 +318,26 @@ export const avatar: Story = {
|
|
|
192
318
|
}
|
|
193
319
|
|
|
194
320
|
export const dark: Story = {
|
|
321
|
+
parameters: {
|
|
322
|
+
sourceCode: [
|
|
323
|
+
{
|
|
324
|
+
name: 'Template',
|
|
325
|
+
code: `<template>
|
|
326
|
+
<VSheet color="primary" class="pa-4">
|
|
327
|
+
<Logo dark />
|
|
328
|
+
</VSheet>
|
|
329
|
+
</template>
|
|
330
|
+
`,
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'Script',
|
|
334
|
+
code: `<script setup lang="ts">
|
|
335
|
+
import Logo from '@cnamts/synapse'
|
|
336
|
+
</script>
|
|
337
|
+
`,
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
},
|
|
195
341
|
args: {
|
|
196
342
|
hideSignature: false,
|
|
197
343
|
hideOrganism: false,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Canvas, Meta, Controls, Source } from '@storybook/blocks';
|
|
2
|
+
import * as LogoBrandSectionStories from './LogoBrandSection.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta title="Composants/Données/LogoBrandSection" component={LogoBrandSectionStories} />
|
|
5
|
+
|
|
6
|
+
# LogoBrandSection
|
|
7
|
+
|
|
8
|
+
Il permet d'afficher le logo de l'Assurance Maladie avec des logos ou un titre secondaire et contient des présets pour différentes marques de l'Assurance Maladie grace a la props `theme` (ex: `ameli`, `ameli-pro`, `compte-entreprise`...).
|
|
9
|
+
|
|
10
|
+
<Canvas of={LogoBrandSectionStories.Default} />
|
|
11
|
+
|
|
12
|
+
## API
|
|
13
|
+
|
|
14
|
+
<Controls of={LogoBrandSectionStories.Default} />
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import LogoBrandSection from './LogoBrandSection.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Composants/Données/LogoBrandSection',
|
|
6
|
+
component: LogoBrandSection,
|
|
7
|
+
argTypes: {
|
|
8
|
+
'theme': {
|
|
9
|
+
description: 'Applique un preset de style à la section.',
|
|
10
|
+
control: {
|
|
11
|
+
type: 'select',
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
'ameli',
|
|
15
|
+
'ameli-pro',
|
|
16
|
+
'cnam',
|
|
17
|
+
'compte-ameli',
|
|
18
|
+
'compte-entreprise',
|
|
19
|
+
'default',
|
|
20
|
+
'risque-pro',
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
'serviceTitle': {
|
|
24
|
+
description: 'Le titre du service (titre de niveau 1).',
|
|
25
|
+
},
|
|
26
|
+
'serviceSubTitle': {
|
|
27
|
+
description: 'Le sous-titre du service (titre de niveau 2).',
|
|
28
|
+
},
|
|
29
|
+
'mobileVersion': {
|
|
30
|
+
control: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
description: 'Affiche la version mobile.',
|
|
34
|
+
},
|
|
35
|
+
'reduceLogo': {
|
|
36
|
+
control: {
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
},
|
|
39
|
+
description: 'Affiche la version Avatar du logo de l’Assurance Maladie s’il y a une marque secondaire. Sinon, masque la signature.<br> Déprécié, la ronde seule ne devrait plus être utilisée.',
|
|
40
|
+
},
|
|
41
|
+
'homeLink': {
|
|
42
|
+
description: 'Le lien vers la page d’accueil. <br>La valeur `false` permet de désactiver le lien..',
|
|
43
|
+
table: {
|
|
44
|
+
type: {
|
|
45
|
+
summary: '{ href?: string, to?: RouteLocationRaw, ariaLabel?: string }',
|
|
46
|
+
},
|
|
47
|
+
defaultValue: { summary: `{ href: '/'}` },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
'default': {
|
|
51
|
+
control: {
|
|
52
|
+
type: 'text',
|
|
53
|
+
},
|
|
54
|
+
description: 'Slot pour remplacer le contenu et afficher une marque partenaire.',
|
|
55
|
+
table: {
|
|
56
|
+
type: {
|
|
57
|
+
summary: '{}',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
'brand-content': {
|
|
62
|
+
control: {
|
|
63
|
+
type: 'text',
|
|
64
|
+
},
|
|
65
|
+
description: 'Slot pour personnaliser le contenu de la marque.',
|
|
66
|
+
table: {
|
|
67
|
+
type: {
|
|
68
|
+
summary: '{}',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
args: {
|
|
74
|
+
theme: 'default',
|
|
75
|
+
},
|
|
76
|
+
} satisfies Meta<typeof LogoBrandSection>
|
|
77
|
+
|
|
78
|
+
export default meta
|
|
79
|
+
|
|
80
|
+
type Story = StoryObj<typeof LogoBrandSection>
|
|
81
|
+
|
|
82
|
+
export const Default: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
serviceTitle: 'Synapse',
|
|
85
|
+
serviceSubTitle: 'Documentation du Design System',
|
|
86
|
+
},
|
|
87
|
+
parameters: {
|
|
88
|
+
sourceCode: [
|
|
89
|
+
{
|
|
90
|
+
name: 'Template',
|
|
91
|
+
code: `
|
|
92
|
+
<template>
|
|
93
|
+
<LogoBrandSection
|
|
94
|
+
:service-title="Synapse"
|
|
95
|
+
:service-sub-title="Documentation du Design System"
|
|
96
|
+
/>
|
|
97
|
+
</template>
|
|
98
|
+
`,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Script',
|
|
102
|
+
code: `
|
|
103
|
+
<script setup lang="ts">
|
|
104
|
+
import { LogoBrandSection } from '@cnamts/synapse'
|
|
105
|
+
</script>
|
|
106
|
+
`,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const WithBrand: Story = {
|
|
113
|
+
args: {
|
|
114
|
+
serviceTitle: 'Synapse',
|
|
115
|
+
serviceSubTitle: ' Documentation du Design System',
|
|
116
|
+
},
|
|
117
|
+
render: (args) => {
|
|
118
|
+
return {
|
|
119
|
+
components: { LogoBrandSection },
|
|
120
|
+
setup() {
|
|
121
|
+
return { args }
|
|
122
|
+
},
|
|
123
|
+
template: `
|
|
124
|
+
<LogoBrandSection v-bind="args">
|
|
125
|
+
<img
|
|
126
|
+
src="/logo-msa.svg"
|
|
127
|
+
alt="Logo MSA"
|
|
128
|
+
width="115px"
|
|
129
|
+
height="52px"
|
|
130
|
+
class="ml-8 my-auto"
|
|
131
|
+
/>
|
|
132
|
+
</LogoBrandSection>
|
|
133
|
+
`,
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
parameters: {
|
|
137
|
+
sourceCode: [
|
|
138
|
+
{
|
|
139
|
+
name: 'Template',
|
|
140
|
+
code: `
|
|
141
|
+
<template>
|
|
142
|
+
<LogoBrandSection>
|
|
143
|
+
<img src="/logo-msa.svg" alt="Logo MSA" width="115px" height="52px" class="ml-8 my-auto">
|
|
144
|
+
</LogoBrandSection>
|
|
145
|
+
</template>
|
|
146
|
+
`,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'Script',
|
|
150
|
+
code: `
|
|
151
|
+
<script setup lang="ts">
|
|
152
|
+
import { LogoBrandSection } from '@cnamts/synapse'
|
|
153
|
+
</script>
|
|
154
|
+
`,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
}
|