@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
|
@@ -6,7 +6,7 @@ import Alert from '../Alert/Alert.vue'
|
|
|
6
6
|
import { VSheet } from 'vuetify/components'
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Composants/Boutons/BackBtn',
|
|
10
10
|
component: BackBtn,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -26,6 +26,26 @@ export default meta
|
|
|
26
26
|
type Story = StoryObj<typeof meta>
|
|
27
27
|
|
|
28
28
|
export const Default: Story = {
|
|
29
|
+
parameters: {
|
|
30
|
+
sourceCode: [
|
|
31
|
+
{
|
|
32
|
+
name: 'Template',
|
|
33
|
+
code: `<template>
|
|
34
|
+
<VSheet class="pa-4">
|
|
35
|
+
<BackBtn />
|
|
36
|
+
</VSheet>
|
|
37
|
+
</template>
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Script',
|
|
42
|
+
code: `<script setup lang="ts">
|
|
43
|
+
import BackBtn from '@cnamts/synapse'
|
|
44
|
+
</script>
|
|
45
|
+
`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
29
49
|
args: {
|
|
30
50
|
dark: false,
|
|
31
51
|
},
|
|
@@ -55,6 +75,26 @@ export const Default: Story = {
|
|
|
55
75
|
}
|
|
56
76
|
|
|
57
77
|
export const Dark: Story = {
|
|
78
|
+
parameters: {
|
|
79
|
+
sourceCode: [
|
|
80
|
+
{
|
|
81
|
+
name: 'Template',
|
|
82
|
+
code: `<template>
|
|
83
|
+
<VSheet color="primary" class="pa-4">
|
|
84
|
+
<BackBtn dark />
|
|
85
|
+
</VSheet>
|
|
86
|
+
</template>
|
|
87
|
+
`,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Script',
|
|
91
|
+
code: `<script setup lang="ts">
|
|
92
|
+
import BackBtn from '@cnamts/synapse'
|
|
93
|
+
</script>
|
|
94
|
+
`,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
58
98
|
args: {
|
|
59
99
|
dark: true,
|
|
60
100
|
},
|
|
@@ -77,6 +117,26 @@ export const Dark: Story = {
|
|
|
77
117
|
}
|
|
78
118
|
|
|
79
119
|
export const HideBackIcon: Story = {
|
|
120
|
+
parameters: {
|
|
121
|
+
sourceCode: [
|
|
122
|
+
{
|
|
123
|
+
name: 'Template',
|
|
124
|
+
code: `<template>
|
|
125
|
+
<VSheet class="pa-4">
|
|
126
|
+
<BackBtn hide-back-icon />
|
|
127
|
+
</VSheet>
|
|
128
|
+
</template>
|
|
129
|
+
`,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'Script',
|
|
133
|
+
code: `<script setup lang="ts">
|
|
134
|
+
import BackBtn from '@cnamts/synapse'
|
|
135
|
+
</script>
|
|
136
|
+
`,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
80
140
|
args: {
|
|
81
141
|
hideBackIcon: true,
|
|
82
142
|
},
|
|
@@ -96,6 +156,29 @@ export const HideBackIcon: Story = {
|
|
|
96
156
|
}
|
|
97
157
|
|
|
98
158
|
export const DarkAndHideBackIcon: Story = {
|
|
159
|
+
parameters: {
|
|
160
|
+
sourceCode: [
|
|
161
|
+
{
|
|
162
|
+
name: 'Template',
|
|
163
|
+
code: `<template>
|
|
164
|
+
<VSheet class="pa-4">
|
|
165
|
+
<BackBtn
|
|
166
|
+
dark
|
|
167
|
+
hide-back-icon
|
|
168
|
+
/>
|
|
169
|
+
</VSheet>
|
|
170
|
+
</template>
|
|
171
|
+
`,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'Script',
|
|
175
|
+
code: `<script setup lang="ts">
|
|
176
|
+
import BackBtn from '@cnamts/synapse'
|
|
177
|
+
</script>
|
|
178
|
+
`,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
},
|
|
99
182
|
args: {
|
|
100
183
|
dark: true,
|
|
101
184
|
hideBackIcon: true,
|
|
@@ -8,7 +8,7 @@ import * as BackToTopBtnStories from './BackToTopBtn.stories';
|
|
|
8
8
|
|
|
9
9
|
Le composant `BackToTopBtn` est utilisé pour afficher un bouton permettant à l’utilisateur de remonter en haut de la page.
|
|
10
10
|
|
|
11
|
-
Le
|
|
11
|
+
Le bouton apparaît lorsque l'utilisateur scroll en dessous d'une certaine hauteur de la page. Cette hauteur est définie par la prop `threshold`, elle est de 120px par defaut.
|
|
12
12
|
|
|
13
13
|
<Canvas of={BackToTopBtnStories.Default} />
|
|
14
14
|
|
|
@@ -18,13 +18,13 @@ Le boutton apparaît lorsque l'utilisateur scroll en dessous d'une certaine haut
|
|
|
18
18
|
|
|
19
19
|
## Context d'utilisation
|
|
20
20
|
|
|
21
|
-
Ce composant peut être utilisé à la racine de la page ou bien dans un composant avant son propre context de scroll. Dans ce dernier cas, il
|
|
21
|
+
Ce composant peut être utilisé à la racine de la page ou bien dans un composant avant son propre context de scroll. Dans ce dernier cas, il convient de passer la prop `target` un id unique de l'élément scrollable.
|
|
22
22
|
|
|
23
23
|
### Exemple d'utilisation
|
|
24
24
|
|
|
25
25
|
<Source dark code={`
|
|
26
26
|
<script setup lang="ts">
|
|
27
|
-
import BackToTopBtn from '
|
|
27
|
+
import BackToTopBtn from '@cnamts/synapse'
|
|
28
28
|
import { VCard, VSheet } from 'vuetify/components'
|
|
29
29
|
</script>
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@ import BackToTopBtn from './BackToTopBtn.vue'
|
|
|
4
4
|
import { VCard, VSheet } from 'vuetify/components'
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Composants/Boutons/BackToTopBtn',
|
|
8
8
|
component: BackToTopBtn,
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: 'fullscreen',
|
|
@@ -45,6 +45,43 @@ export default meta
|
|
|
45
45
|
type Story = StoryObj<typeof meta>
|
|
46
46
|
|
|
47
47
|
export const Default: Story = {
|
|
48
|
+
parameters: {
|
|
49
|
+
sourceCode: [
|
|
50
|
+
{
|
|
51
|
+
name: 'Template',
|
|
52
|
+
code: `<template>
|
|
53
|
+
<VCard
|
|
54
|
+
id="target"
|
|
55
|
+
width="100%"
|
|
56
|
+
max-height="200px"
|
|
57
|
+
class="overflow-y-auto"
|
|
58
|
+
style="scroll-behavior: smooth"
|
|
59
|
+
>
|
|
60
|
+
<VSheet
|
|
61
|
+
height="600px"
|
|
62
|
+
class="d-flex flex-column align-center"
|
|
63
|
+
>
|
|
64
|
+
<p class="pa-2">
|
|
65
|
+
Haut de la section.
|
|
66
|
+
</p>
|
|
67
|
+
</VSheet>
|
|
68
|
+
<BackToTopBtn :target="target">
|
|
69
|
+
Retour en haut
|
|
70
|
+
</BackToTopBtn>
|
|
71
|
+
</VCard>
|
|
72
|
+
</template>
|
|
73
|
+
`,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Script',
|
|
77
|
+
code: `<script setup lang="ts">
|
|
78
|
+
import BackToTopBtn from '@cnamts/BackToTopBtn'
|
|
79
|
+
import { VCard, VSheet } from 'vuetify/components'
|
|
80
|
+
</script>
|
|
81
|
+
`,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
48
85
|
args: {
|
|
49
86
|
target: 'target',
|
|
50
87
|
vuetifyOptions: {
|
|
@@ -101,6 +138,57 @@ export const Default: Story = {
|
|
|
101
138
|
}
|
|
102
139
|
|
|
103
140
|
export const Customization: Story = {
|
|
141
|
+
parameters: {
|
|
142
|
+
sourceCode: [
|
|
143
|
+
{
|
|
144
|
+
name: 'Template',
|
|
145
|
+
code: `<template>
|
|
146
|
+
<VCard
|
|
147
|
+
id="btn-customization"
|
|
148
|
+
width="100%"
|
|
149
|
+
max-height="200px"
|
|
150
|
+
class="overflow-y-auto"
|
|
151
|
+
style="scroll-behavior: smooth"
|
|
152
|
+
>
|
|
153
|
+
<VSheet
|
|
154
|
+
height="600px"
|
|
155
|
+
class="d-flex flex-column align-center"
|
|
156
|
+
>
|
|
157
|
+
<p class="pa-2">
|
|
158
|
+
Haut de la section.
|
|
159
|
+
</p>
|
|
160
|
+
</VSheet>
|
|
161
|
+
<BackToTopBtn
|
|
162
|
+
:target="btn-customization"
|
|
163
|
+
:vuetify-options="vuetifyOptions"
|
|
164
|
+
>
|
|
165
|
+
Retour en haut
|
|
166
|
+
</BackToTopBtn>
|
|
167
|
+
</VCard>
|
|
168
|
+
</template>
|
|
169
|
+
`,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'Script',
|
|
173
|
+
code: `<script setup lang="ts">
|
|
174
|
+
import BackToTopBtn from '@cnamts/BackToTopBtn'
|
|
175
|
+
import { VCard, VSheet } from 'vuetify/components'
|
|
176
|
+
|
|
177
|
+
const vuetifyOptions = {
|
|
178
|
+
btn: {
|
|
179
|
+
variant: 'elevated',
|
|
180
|
+
color: 'primary',
|
|
181
|
+
rounded: true,
|
|
182
|
+
},
|
|
183
|
+
icon: {
|
|
184
|
+
color: 'white',
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
</script>
|
|
188
|
+
`,
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
},
|
|
104
192
|
args: {
|
|
105
193
|
target: 'btn-customization',
|
|
106
194
|
vuetifyOptions: {
|
|
@@ -152,13 +240,66 @@ export const Customization: Story = {
|
|
|
152
240
|
},
|
|
153
241
|
}
|
|
154
242
|
|
|
155
|
-
export const
|
|
243
|
+
export const CustomPosition: Story = {
|
|
244
|
+
parameters: {
|
|
245
|
+
sourceCode: [
|
|
246
|
+
{
|
|
247
|
+
name: 'Template',
|
|
248
|
+
code: `<template>
|
|
249
|
+
<VCard
|
|
250
|
+
id="pill-btn"
|
|
251
|
+
width="100%"
|
|
252
|
+
max-height="200px"
|
|
253
|
+
class="overflow-y-auto"
|
|
254
|
+
style="scroll-behavior: smooth"
|
|
255
|
+
>
|
|
256
|
+
<VSheet
|
|
257
|
+
height="600px"
|
|
258
|
+
class="d-flex flex-column align-center"
|
|
259
|
+
>
|
|
260
|
+
<p class="pa-2">
|
|
261
|
+
Haut de la section.
|
|
262
|
+
</p>
|
|
263
|
+
</VSheet>
|
|
264
|
+
<BackToTopBtn
|
|
265
|
+
:target="pill-btn"
|
|
266
|
+
:nudge-right="30"
|
|
267
|
+
:nudge-bottom="30"
|
|
268
|
+
:vuetify-options="vuetifyOptions"
|
|
269
|
+
>
|
|
270
|
+
Retour en haut
|
|
271
|
+
</BackToTopBtn>
|
|
272
|
+
</VCard>
|
|
273
|
+
</template>
|
|
274
|
+
`,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: 'Script',
|
|
278
|
+
code: `<script setup lang="ts">
|
|
279
|
+
import BackToTopBtn from '@cnamts/BackToTopBtn'
|
|
280
|
+
import { VCard, VSheet } from 'vuetify/components'
|
|
281
|
+
|
|
282
|
+
const vuetifyOptions = {
|
|
283
|
+
btn: {
|
|
284
|
+
variant: 'outlined',
|
|
285
|
+
color: 'primary',
|
|
286
|
+
minWidth: 92,
|
|
287
|
+
rounded: true,
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
</script>
|
|
291
|
+
`,
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
},
|
|
156
295
|
args: {
|
|
157
296
|
target: 'pill-btn',
|
|
297
|
+
nudgeRight: 30,
|
|
298
|
+
nudgeBottom: 30,
|
|
158
299
|
vuetifyOptions: {
|
|
159
300
|
btn: {
|
|
160
301
|
variant: 'outlined',
|
|
161
|
-
color: '
|
|
302
|
+
color: 'primary',
|
|
162
303
|
minWidth: 92,
|
|
163
304
|
rounded: true,
|
|
164
305
|
},
|
|
@@ -173,16 +314,36 @@ export const PillBtn: Story = {
|
|
|
173
314
|
return { args }
|
|
174
315
|
},
|
|
175
316
|
template: `
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
317
|
+
<VCard
|
|
318
|
+
id="pill-btn"
|
|
319
|
+
width="100%"
|
|
320
|
+
max-height="200px"
|
|
321
|
+
class="overflow-y-auto"
|
|
322
|
+
style="scroll-behavior: smooth"
|
|
182
323
|
>
|
|
183
|
-
|
|
184
|
-
|
|
324
|
+
<VSheet
|
|
325
|
+
height="600px"
|
|
326
|
+
class="d-flex flex-column align-center"
|
|
327
|
+
>
|
|
328
|
+
<p class="pa-2">
|
|
329
|
+
Haut de la section.
|
|
330
|
+
</p>
|
|
331
|
+
</VSheet>
|
|
332
|
+
<BackToTopBtn
|
|
333
|
+
v-bind="args"
|
|
334
|
+
:nudge-right="args.nudgeRight"
|
|
335
|
+
:nudge-bottom="args.nudgeBottom"
|
|
336
|
+
:vuetify-options="args.vuetifyOptions"
|
|
337
|
+
>
|
|
338
|
+
{{args.default}}
|
|
339
|
+
</BackToTopBtn>
|
|
340
|
+
</VCard>
|
|
185
341
|
`,
|
|
186
342
|
}
|
|
187
343
|
},
|
|
344
|
+
play: async ({ canvasElement }) => {
|
|
345
|
+
await new Promise((resolve: (v: unknown) => void) => setTimeout(resolve, 1000))
|
|
346
|
+
const container = canvasElement.querySelector('#pill-btn')
|
|
347
|
+
container?.scrollTo(0, 1000)
|
|
348
|
+
},
|
|
188
349
|
}
|
|
@@ -15,8 +15,8 @@ L’élément `CollapsibleList` est utilisé pour afficher des listes de liens.
|
|
|
15
15
|
|
|
16
16
|
<Source dark code={`
|
|
17
17
|
<script setup lang="ts">
|
|
18
|
-
import CollapsibleList from '
|
|
19
|
-
import type { ListItem } from '
|
|
18
|
+
import CollapsibleList from '@cnamts/synapse'
|
|
19
|
+
import type { ListItem } from '@cnamts/synapse/src/components/CollapsibleList/types'
|
|
20
20
|
|
|
21
21
|
const remboursementItems = [
|
|
22
22
|
{
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
3
3
|
import CollapsibleList from './CollapsibleList.vue'
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Composants/Données/CollapsibleList',
|
|
7
7
|
component: CollapsibleList,
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: 'fullscreen',
|
|
@@ -23,6 +23,42 @@ export default meta
|
|
|
23
23
|
type Story = StoryObj<typeof meta>
|
|
24
24
|
|
|
25
25
|
export const Default: Story = {
|
|
26
|
+
parameters: {
|
|
27
|
+
sourceCode: [
|
|
28
|
+
{
|
|
29
|
+
name: 'Template',
|
|
30
|
+
code: `<template>
|
|
31
|
+
<div class="pa-4">
|
|
32
|
+
<CollapsibleList
|
|
33
|
+
:list-title="listTitle"
|
|
34
|
+
:items="items"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Script',
|
|
42
|
+
code: `<script setup lang="ts">
|
|
43
|
+
import CollapsibleList from '@cnamts/synapse'
|
|
44
|
+
|
|
45
|
+
const listTitle = 'Santé'
|
|
46
|
+
|
|
47
|
+
const items = [
|
|
48
|
+
{
|
|
49
|
+
text: 'Mon espace santé',
|
|
50
|
+
href: 'https://www.ameli.fr/assure/sante/mon-espace-sante',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
text: 'Accomplir les bons gestes',
|
|
54
|
+
href: 'https://www.ameli.fr/assure/sante/bons-gestes',
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
</script>
|
|
58
|
+
`,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
26
62
|
args: {
|
|
27
63
|
listTitle: 'Santé',
|
|
28
64
|
items: [
|
|
@@ -18,7 +18,7 @@ Le composant `CopyBtn` est utilisé pour afficher un bouton permettant à l’ut
|
|
|
18
18
|
|
|
19
19
|
<Source dark code={`
|
|
20
20
|
<script setup lang="ts">
|
|
21
|
-
import CopyBtn from '
|
|
21
|
+
import CopyBtn from '@cnamts/synapse'
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<template>
|
|
@@ -6,7 +6,7 @@ import { mdiContentDuplicate } from '@mdi/js'
|
|
|
6
6
|
const duplicateIcon = mdiContentDuplicate
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Composants/Boutons/CopyBtn',
|
|
10
10
|
component: CopyBtn,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -60,6 +60,33 @@ export default meta
|
|
|
60
60
|
type Story = StoryObj<typeof meta>
|
|
61
61
|
|
|
62
62
|
export const Default: Story = {
|
|
63
|
+
parameters: {
|
|
64
|
+
sourceCode: [
|
|
65
|
+
{
|
|
66
|
+
name: 'Template',
|
|
67
|
+
code: `<template>
|
|
68
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
69
|
+
<p class="mb-0 mr-1">
|
|
70
|
+
Patient n°<b>1970756541</b>
|
|
71
|
+
</p>
|
|
72
|
+
|
|
73
|
+
<CopyBtn
|
|
74
|
+
label="Copier le numéro de patient"
|
|
75
|
+
text-to-copy="1970756541"
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
`,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Script',
|
|
83
|
+
code: `<script setup lang="ts">
|
|
84
|
+
import CopyBtn from '@cnamts/synapse'
|
|
85
|
+
</script>
|
|
86
|
+
`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
63
90
|
args: {
|
|
64
91
|
ariaLabel: 'Copier le numéro de patient',
|
|
65
92
|
ariaOwns: 'copy-btn-1',
|
|
@@ -108,6 +135,34 @@ export const Default: Story = {
|
|
|
108
135
|
}
|
|
109
136
|
|
|
110
137
|
export const NoTooltip: Story = {
|
|
138
|
+
parameters: {
|
|
139
|
+
sourceCode: [
|
|
140
|
+
{
|
|
141
|
+
name: 'Template',
|
|
142
|
+
code: `<template>
|
|
143
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
144
|
+
<p class="mb-0 mr-1">
|
|
145
|
+
Patient n°<b>1970756541</b>
|
|
146
|
+
</p>
|
|
147
|
+
|
|
148
|
+
<CopyBtn
|
|
149
|
+
label="Copier le numéro de patient"
|
|
150
|
+
text-to-copy="1970756541"
|
|
151
|
+
hide-tooltip
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
`,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'Script',
|
|
159
|
+
code: `<script setup lang="ts">
|
|
160
|
+
import CopyBtn from '@cnamts/synapse'
|
|
161
|
+
</script>
|
|
162
|
+
`,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
111
166
|
args: {
|
|
112
167
|
ariaLabel: 'Copier le numéro de patient',
|
|
113
168
|
textToCopy: '1970756541',
|
|
@@ -139,6 +194,37 @@ export const NoTooltip: Story = {
|
|
|
139
194
|
}
|
|
140
195
|
|
|
141
196
|
export const SlotIcon: Story = {
|
|
197
|
+
parameters: {
|
|
198
|
+
sourceCode: [
|
|
199
|
+
{
|
|
200
|
+
name: 'Template',
|
|
201
|
+
code: `<template>
|
|
202
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
203
|
+
<p class="mb-0 mr-1">
|
|
204
|
+
Patient n°<b>1970756541</b>
|
|
205
|
+
</p>
|
|
206
|
+
|
|
207
|
+
<CopyBtn
|
|
208
|
+
label="Copier le numéro de patient"
|
|
209
|
+
text-to-copy="1970756541"
|
|
210
|
+
:icon="duplicateIcon"
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
</template>
|
|
214
|
+
`,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: 'Script',
|
|
218
|
+
code: `<script setup lang="ts">
|
|
219
|
+
import CopyBtn from '@cnamts/synapse'
|
|
220
|
+
import { mdiContentDuplicate } from '@mdi/js'
|
|
221
|
+
|
|
222
|
+
const duplicateIcon = mdiContentDuplicate
|
|
223
|
+
</script>
|
|
224
|
+
`,
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
},
|
|
142
228
|
args: {
|
|
143
229
|
ariaLabel: 'Copier le numéro de patient',
|
|
144
230
|
textToCopy: '1970756541',
|
|
@@ -174,6 +260,39 @@ export const SlotIcon: Story = {
|
|
|
174
260
|
}
|
|
175
261
|
|
|
176
262
|
export const SlotTooltip: Story = {
|
|
263
|
+
parameters: {
|
|
264
|
+
sourceCode: [
|
|
265
|
+
{
|
|
266
|
+
name: 'Template',
|
|
267
|
+
code: `<template>
|
|
268
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
269
|
+
<p class="mb-0 mr-1">
|
|
270
|
+
Patient n°<b>1970756541</b>
|
|
271
|
+
</p>
|
|
272
|
+
|
|
273
|
+
<CopyBtn
|
|
274
|
+
label="Copier le numéro de patient"
|
|
275
|
+
text-to-copy="1970756541"
|
|
276
|
+
>
|
|
277
|
+
<template #tooltip>
|
|
278
|
+
{{ tooltip }}
|
|
279
|
+
</template>
|
|
280
|
+
</CopyBtn>
|
|
281
|
+
</div>
|
|
282
|
+
</template>
|
|
283
|
+
`,
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: 'Script',
|
|
287
|
+
code: `<script setup lang="ts">
|
|
288
|
+
import CopyBtn from '@cnamts/synapse'
|
|
289
|
+
|
|
290
|
+
const tooltip = 'Texte personalisé'
|
|
291
|
+
</script>
|
|
292
|
+
`,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
},
|
|
177
296
|
args: {
|
|
178
297
|
ariaLabel: 'Copier le numéro de patient',
|
|
179
298
|
textToCopy: '1970756541',
|
|
@@ -3,7 +3,7 @@ import * as CustomInputSelectStories from "./CustomInputSelect.stories.ts";
|
|
|
3
3
|
|
|
4
4
|
<Meta of={CustomInputSelectStories} />
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# CustomInputSelect
|
|
7
7
|
|
|
8
8
|
Le composant `CustomInputSelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles RGAA.
|
|
9
9
|
|
|
@@ -19,12 +19,12 @@ Le composant `CustomInputSelect` est utilisé pour proposer une alternative au `
|
|
|
19
19
|
|
|
20
20
|
<Source dark code={`
|
|
21
21
|
<script setup lang="ts">
|
|
22
|
-
import CustomInputSelect from '
|
|
23
|
-
import { ref } from 'vue'
|
|
22
|
+
import CustomInputSelect from '@cnamts/synapse'
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const items = [
|
|
25
|
+
{ text: 'Option 1', value: '1' },
|
|
26
|
+
{ text: 'Option 2', value: '2' },
|
|
27
|
+
],
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
@@ -33,8 +33,6 @@ Le composant `CustomInputSelect` est utilisé pour proposer une alternative au `
|
|
|
33
33
|
<CustomInputSelect
|
|
34
34
|
v-model="value"
|
|
35
35
|
:items="items"
|
|
36
|
-
:label="ariaLabel"
|
|
37
|
-
aria-label="Choix de la langue"
|
|
38
36
|
/>
|
|
39
37
|
</div>
|
|
40
38
|
</main>
|