@cnamts/synapse 0.0.7-alpha → 0.0.9-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 +785 -372
- package/dist/design-system-v3.js +4993 -3357
- package/dist/design-system-v3.umd.cjs +1 -10
- package/dist/style.css +1 -1
- package/package.json +10 -2
- package/src/assets/settings.scss +2 -2
- package/src/assets/tokens.scss +107 -112
- package/src/components/BackBtn/BackBtn.vue +4 -4
- package/src/components/BackToTopBtn/BackToTopBtn.vue +1 -0
- package/src/components/CollapsibleList/CollapsibleList.mdx +1 -1
- package/src/components/CollapsibleList/CollapsibleList.vue +43 -44
- package/src/components/ContextualMenu/Accessibilite.mdx +14 -0
- package/src/components/ContextualMenu/Accessibilite.stories.ts +191 -0
- package/src/components/ContextualMenu/AccessibiliteItems.ts +89 -0
- package/src/components/ContextualMenu/ContextualMenu.mdx +118 -0
- package/src/components/ContextualMenu/ContextualMenu.stories.ts +430 -0
- package/src/components/ContextualMenu/ContextualMenu.vue +101 -0
- package/src/components/ContextualMenu/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/ContextualMenu/tests/ContextualMenu.spec.ts +115 -0
- package/src/components/ContextualMenu/tests/__snapshots__/ContextualMenu.spec.ts.snap +10 -0
- package/src/components/ContextualMenu/types.ts +5 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +1 -2
- package/src/components/CookieBanner/CookieBanner.vue +13 -10
- package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +17 -15
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +6 -1
- package/src/components/CookiesSelection/CookiesInformation/locales.ts +1 -0
- package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +1 -0
- package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +17 -15
- package/src/components/CopyBtn/CopyBtn.vue +7 -7
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +26 -26
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +24 -24
- package/src/components/Customs/SySelect/SySelect.stories.ts +7 -7
- package/src/components/Customs/SySelect/SySelect.vue +36 -30
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +2 -2
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +187 -2
- package/src/components/Customs/SyTextField/SyTextField.vue +185 -16
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +2 -4
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +18 -16
- package/src/components/Customs/SyTextField/types.d.ts +2 -2
- package/src/components/DataList/DataList.stories.ts +3 -2
- package/src/components/DataList/DataList.vue +1 -1
- package/src/components/DataListGroup/DataListGroup.stories.ts +3 -2
- package/src/components/DataListItem/DataListItem.vue +12 -12
- package/src/components/DatePicker/DatePicker.mdx +191 -0
- package/src/components/DatePicker/DatePicker.stories.ts +787 -0
- package/src/components/DatePicker/DatePicker.vue +560 -0
- package/src/components/DatePicker/DateTextInput.vue +409 -0
- package/src/components/DatePicker/tests/DatePicker.spec.ts +266 -0
- package/src/components/DialogBox/DialogBox.mdx +28 -2
- package/src/components/DialogBox/DialogBox.stories.ts +2 -2
- package/src/components/DialogBox/DialogBox.vue +3 -2
- package/src/components/DownloadBtn/DownloadBtn.vue +2 -1
- package/src/components/ExternalLinks/Accessibilite.mdx +14 -0
- package/src/components/ExternalLinks/Accessibilite.stories.ts +191 -0
- package/src/components/ExternalLinks/AccessibiliteItems.ts +197 -0
- package/src/components/ExternalLinks/ExternalLinks.mdx +86 -0
- package/src/components/ExternalLinks/ExternalLinks.stories.ts +553 -0
- package/src/components/ExternalLinks/ExternalLinks.vue +200 -0
- package/src/components/ExternalLinks/config.ts +34 -0
- package/src/components/ExternalLinks/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/ExternalLinks/locales.ts +4 -0
- package/src/components/ExternalLinks/tests/ExternalLinks.spec.ts +154 -0
- package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +159 -0
- package/src/components/FileUpload/FileUpload.mdx +165 -0
- package/src/components/FileUpload/FileUpload.stories.ts +429 -0
- package/src/components/FileUpload/FileUpload.vue +195 -0
- package/src/components/FileUpload/FileUploadContent.vue +109 -0
- package/src/components/FileUpload/locales.ts +10 -0
- package/src/components/FileUpload/tests/FileUpload.spec.ts +332 -0
- package/src/components/FileUpload/tests/__snapshots__/FileUpload.spec.ts.snap +7 -0
- package/src/components/FileUpload/useFileDrop.ts +23 -0
- package/src/components/FileUpload/validateFiles.ts +39 -0
- package/src/components/FooterBar/FooterBar.vue +105 -80
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +14 -13
- package/src/components/HeaderBar/HeaderBar.vue +3 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +11 -7
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +5 -5
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +2 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +10 -8
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -2
- package/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.vue +2 -1
- package/src/components/HeaderBar/HeaderLogo/logos/Logo.vue +2 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +10 -10
- package/src/components/HeaderBar/consts.scss +1 -1
- package/src/components/HeaderLoading/HeaderLoading.vue +12 -11
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +9 -9
- package/src/components/HeaderToolbar/HeaderToolbar.vue +215 -202
- package/src/components/LangBtn/LangBtn.vue +8 -6
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
- package/src/components/NirField/NirField.stories.ts +8 -8
- package/src/components/NirField/NirField.vue +46 -48
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +33 -2
- package/src/components/NotFoundPage/NotFoundPage.vue +17 -0
- package/src/components/NotificationBar/NotificationBar.mdx +5 -5
- package/src/components/NotificationBar/NotificationBar.stories.ts +410 -314
- package/src/components/NotificationBar/NotificationBar.vue +43 -41
- package/src/components/PageContainer/PageContainer.vue +4 -4
- package/src/components/PasswordField/Accessibilite.mdx +14 -0
- package/src/components/PasswordField/Accessibilite.stories.ts +191 -0
- package/src/components/PasswordField/AccessibiliteItems.ts +184 -0
- package/src/components/PasswordField/PasswordField.mdx +70 -0
- package/src/components/PasswordField/PasswordField.stories.ts +213 -0
- package/src/components/PasswordField/PasswordField.vue +189 -0
- package/src/components/PasswordField/config.ts +11 -0
- package/src/components/PasswordField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PasswordField/locales.ts +4 -0
- package/src/components/PasswordField/tests/PasswordField.spec.ts +96 -0
- package/src/components/PhoneField/PhoneField.mdx +0 -2
- package/src/components/PhoneField/PhoneField.stories.ts +10 -50
- package/src/components/PhoneField/PhoneField.vue +77 -93
- package/src/components/PhoneField/tests/PhoneField.spec.ts +0 -15
- package/src/components/RangeField/RangeField.mdx +54 -0
- package/src/components/RangeField/RangeField.stories.ts +189 -0
- package/src/components/RangeField/RangeField.vue +157 -0
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +387 -0
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +64 -0
- package/src/components/RangeField/RangeSlider/tests/__snapshots__/rangeSlider.spec.ts.snap +27 -0
- package/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.ts +100 -0
- package/src/components/RangeField/RangeSlider/tests/useDoubleSlider.spec.ts +246 -0
- package/src/components/RangeField/RangeSlider/tests/useMouseSlide.spec.ts +204 -0
- package/src/components/RangeField/RangeSlider/tests/useThumb.spec.ts +22 -0
- package/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.ts +233 -0
- package/src/components/RangeField/RangeSlider/tests/useTooltipsNudge.spec.ts +150 -0
- package/src/components/RangeField/RangeSlider/tests/useTrack.spec.ts +314 -0
- package/src/components/RangeField/RangeSlider/tests/vAnimateClick.spec.ts +32 -0
- package/src/components/RangeField/RangeSlider/types.ts +15 -0
- package/src/components/RangeField/RangeSlider/useMouseSlide.ts +109 -0
- package/src/components/RangeField/RangeSlider/useRangeSlider.ts +126 -0
- package/src/components/RangeField/RangeSlider/useThumb.ts +18 -0
- package/src/components/RangeField/RangeSlider/useThumbKeyboard.ts +84 -0
- package/src/components/RangeField/RangeSlider/useTooltipsNudge.ts +92 -0
- package/src/components/RangeField/RangeSlider/useTrack.ts +116 -0
- package/src/components/RangeField/RangeSlider/vAnimateClick.ts +19 -0
- package/src/components/RangeField/config.ts +7 -0
- package/src/components/RangeField/locales.ts +4 -0
- package/src/components/RangeField/tests/RangeField.spec.ts +224 -0
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +379 -0
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +205 -0
- package/src/components/RatingPicker/EmotionPicker/locales.ts +3 -0
- package/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.ts +104 -0
- package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +66 -0
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +159 -0
- package/src/components/RatingPicker/NumberPicker/locales.ts +4 -0
- package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +73 -0
- package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +105 -0
- package/src/components/RatingPicker/Rating.ts +45 -0
- package/src/components/RatingPicker/RatingPicker.mdx +56 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +515 -0
- package/src/components/RatingPicker/RatingPicker.vue +122 -0
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +116 -0
- package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +95 -0
- package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +36 -0
- package/src/components/RatingPicker/locales.ts +3 -0
- package/src/components/RatingPicker/tests/Rating.spec.ts +104 -0
- package/src/components/RatingPicker/tests/RatingPicker.spec.ts +187 -0
- package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +108 -0
- package/src/components/SearchListField/SearchListField.mdx +74 -0
- package/src/components/SearchListField/SearchListField.stories.ts +126 -0
- package/src/components/SearchListField/SearchListField.vue +194 -0
- package/src/components/SearchListField/locales.ts +5 -0
- package/src/components/SearchListField/tests/SearchListField.spec.ts +323 -0
- package/src/components/SearchListField/types.d.ts +4 -0
- package/src/components/SelectBtnField/SelectBtnField.mdx +50 -0
- package/src/components/SelectBtnField/SelectBtnField.stories.ts +763 -0
- package/src/components/SelectBtnField/SelectBtnField.vue +283 -0
- package/src/components/SelectBtnField/config.ts +11 -0
- package/src/components/SelectBtnField/tests/SelectBtnField.spec.ts +327 -0
- package/src/components/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +125 -0
- package/src/components/SelectBtnField/types.d.ts +11 -0
- package/src/components/SkipLink/SkipLink.vue +10 -10
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +28 -26
- package/src/components/SubHeader/SubHeader.vue +32 -31
- package/src/components/SyAlert/SyAlert.vue +12 -12
- package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -1
- package/src/components/UserMenuBtn/config.ts +1 -1
- package/src/components/index.ts +17 -7
- package/src/composables/rules/useFieldValidation.ts +172 -44
- package/src/designTokens/index.ts +6 -4
- package/src/designTokens/{bootstrapColors.md → paColors.md} +1 -1
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -0
- package/src/designTokens/tokens/pa/paColors.ts +171 -0
- package/src/designTokens/tokens/pa/paContextual.ts +58 -0
- package/src/designTokens/tokens/pa/paDarkTheme.ts +5 -0
- package/src/designTokens/tokens/pa/paLightTheme.ts +123 -0
- package/src/designTokens/tokens/pa/paSemantic.ts +87 -0
- package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +52 -2
- package/src/stories/GuideDuDev/CreerUneIssue.mdx +64 -0
- package/src/stories/GuideDuDev/{CommentUtiliserLesRules.mdx → UtiliserLesRules.mdx} +2 -2
- package/src/stories/GuideDuDev/components.stories.ts +9 -7
- package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +163 -88
- package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +250 -23
- package/src/temp/TestDTComponent.vue +5 -6
- package/src/utils/calcHumanFileSize/index.ts +12 -0
- package/src/utils/calcHumanFileSize/tests/calcHumanFileSize.spec.ts +21 -0
- package/src/designTokens/tokens/bootstrap/bootstrapColors.ts +0 -158
- package/src/designTokens/tokens/bootstrap/bootstrapLightTheme.ts +0 -22
- package/src/stories/GuideDuDev/CommentContribuer.mdx +0 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from '@storybook/vue3'
|
|
2
2
|
import NotificationBar from './NotificationBar.vue'
|
|
3
3
|
import { VBtn } from 'vuetify/components'
|
|
4
|
-
import { ref, toRefs
|
|
4
|
+
import { ref, toRefs } from 'vue'
|
|
5
5
|
import { useNotificationService } from '@/services/NotificationService'
|
|
6
6
|
import type { Notification } from '@/components/NotificationBar/types'
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ interface StoryArgs {
|
|
|
9
9
|
closeBtnText: string
|
|
10
10
|
type: Notification['type']
|
|
11
11
|
bottom: boolean
|
|
12
|
-
rounded: string
|
|
12
|
+
rounded: string | number | boolean
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof NotificationBar> = {
|
|
@@ -17,10 +17,42 @@ const meta: Meta<typeof NotificationBar> = {
|
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: 'fullscreen',
|
|
19
19
|
},
|
|
20
|
+
component: NotificationBar,
|
|
20
21
|
argTypes: {
|
|
21
|
-
closeBtnText: {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
closeBtnText: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
table: {
|
|
25
|
+
type: {
|
|
26
|
+
summary: 'string',
|
|
27
|
+
},
|
|
28
|
+
defaultValue: {
|
|
29
|
+
summary: 'Fermer',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
bottom: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
table: {
|
|
36
|
+
type: {
|
|
37
|
+
summary: 'boolean',
|
|
38
|
+
},
|
|
39
|
+
defaultValue: {
|
|
40
|
+
summary: 'false',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
rounded: {
|
|
45
|
+
control: 'select',
|
|
46
|
+
options: [0, 1, 2, 3, 4, 'xs', 'sm', true, 'lg', 'xl', 'pill', 'circle', 'shaped'],
|
|
47
|
+
table: {
|
|
48
|
+
type: {
|
|
49
|
+
summary: '0, 1, 2, 3, 4, \'xs\', \'sm\', true, \'lg\', \'xl\', \'pill\', \'circle\', \'shaped\'',
|
|
50
|
+
},
|
|
51
|
+
defaultValue: {
|
|
52
|
+
summary: '4',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
24
56
|
},
|
|
25
57
|
}
|
|
26
58
|
|
|
@@ -28,339 +60,403 @@ export default meta
|
|
|
28
60
|
|
|
29
61
|
type Story = StoryFn<StoryArgs>
|
|
30
62
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
export const Default: Story = (args) => {
|
|
64
|
+
return {
|
|
65
|
+
components: { NotificationBar, VBtn },
|
|
66
|
+
setup() {
|
|
67
|
+
const { addNotification } = useNotificationService()
|
|
68
|
+
const showNotification = ref(false)
|
|
69
|
+
const { type, closeBtnText, bottom, rounded } = toRefs(args)
|
|
38
70
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
const envoyerNotification = (message: string) => {
|
|
51
|
-
const notification: Notification = {
|
|
52
|
-
id: Date.now().toString(),
|
|
53
|
-
message,
|
|
54
|
-
type: typeRef.value,
|
|
55
|
-
timeout: -1,
|
|
71
|
+
const envoyerNotification = (message: string) => {
|
|
72
|
+
const notification: Notification = {
|
|
73
|
+
id: Date.now().toString(),
|
|
74
|
+
message,
|
|
75
|
+
type: type.value,
|
|
76
|
+
timeout: -1,
|
|
77
|
+
}
|
|
78
|
+
addNotification(notification)
|
|
79
|
+
showNotification.value = true
|
|
56
80
|
}
|
|
57
|
-
addNotification(notification)
|
|
58
|
-
showNotification.value = true
|
|
59
|
-
}
|
|
60
81
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
template: `
|
|
71
|
-
<div class="d-flex flex-wrap align-center justify-center">
|
|
72
|
-
<NotificationBar
|
|
73
|
-
v-model="showNotification"
|
|
74
|
-
:close-btn-text="closeBtnText"
|
|
75
|
-
:bottom="bottom"
|
|
76
|
-
:rounded="rounded"
|
|
77
|
-
>
|
|
78
|
-
<template #default>This is a {{ typeRef }} notification</template>
|
|
79
|
-
</NotificationBar>
|
|
80
|
-
<VBtn
|
|
81
|
-
color="primary"
|
|
82
|
-
@click="envoyerNotification('This is a ' + typeRef + ' notification')"
|
|
83
|
-
class="ma-6"
|
|
84
|
-
>
|
|
85
|
-
Afficher la notification
|
|
86
|
-
</VBtn>
|
|
87
|
-
</div>
|
|
88
|
-
`,
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
export const Success = Template.bind({})
|
|
92
|
-
Success.args = { type: 'success', closeBtnText: 'Fermer', bottom: false, rounded: 'lg' }
|
|
93
|
-
export const Info = Template.bind({})
|
|
94
|
-
Info.args = { type: 'info', closeBtnText: 'Fermer', bottom: false, rounded: 'lg' }
|
|
95
|
-
export const Warning = Template.bind({})
|
|
96
|
-
Warning.args = { type: 'warning', closeBtnText: 'Fermer', bottom: false, rounded: 'lg' }
|
|
97
|
-
export const Error = Template.bind({})
|
|
98
|
-
Error.args = { type: 'error', closeBtnText: 'Fermer', bottom: false, rounded: 'lg' }
|
|
99
|
-
|
|
100
|
-
export const WithAction: Story = args => ({
|
|
101
|
-
components: { NotificationBar, VBtn },
|
|
102
|
-
setup() {
|
|
103
|
-
const { addNotification } = useNotificationService()
|
|
104
|
-
const showNotification = ref(false)
|
|
105
|
-
const { type: typeRef, closeBtnText } = toRefs(args)
|
|
106
|
-
|
|
107
|
-
const envoyerNotification = (message: string) => {
|
|
108
|
-
const notification: Notification = {
|
|
109
|
-
id: Date.now().toString(),
|
|
110
|
-
message,
|
|
111
|
-
type: typeRef.value,
|
|
112
|
-
timeout: -1,
|
|
82
|
+
return {
|
|
83
|
+
showNotification,
|
|
84
|
+
type,
|
|
85
|
+
closeBtnText,
|
|
86
|
+
bottom,
|
|
87
|
+
rounded,
|
|
88
|
+
envoyerNotification,
|
|
113
89
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
},
|
|
91
|
+
template: `
|
|
92
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
93
|
+
<NotificationBar
|
|
94
|
+
v-model="showNotification"
|
|
95
|
+
:close-btn-text="closeBtnText"
|
|
96
|
+
:bottom="bottom"
|
|
97
|
+
:rounded="rounded"
|
|
98
|
+
:type="type"
|
|
99
|
+
>
|
|
100
|
+
<template #default>This is a {{ type }} notification</template>
|
|
101
|
+
</NotificationBar>
|
|
102
|
+
<VBtn
|
|
103
|
+
color="primary"
|
|
104
|
+
@click="envoyerNotification('This is a ' + type + ' notification')"
|
|
105
|
+
class="ma-6"
|
|
106
|
+
>
|
|
107
|
+
Afficher la notification
|
|
108
|
+
</VBtn>
|
|
109
|
+
</div>
|
|
110
|
+
`,
|
|
111
|
+
}
|
|
112
|
+
}
|
|
117
113
|
|
|
118
|
-
|
|
119
|
-
showNotification,
|
|
120
|
-
typeRef,
|
|
121
|
-
closeBtnText,
|
|
122
|
-
envoyerNotification,
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
template: `
|
|
126
|
-
<div class="d-flex flex-wrap align-center justify-center">
|
|
127
|
-
<NotificationBar
|
|
128
|
-
v-model="showNotification"
|
|
129
|
-
:close-btn-text="closeBtnText"
|
|
130
|
-
>
|
|
131
|
-
<template #default>This is a {{ typeRef }} notification</template>
|
|
132
|
-
<template #action>
|
|
133
|
-
<VBtn variant="outlined">Action</VBtn>
|
|
134
|
-
</template>
|
|
135
|
-
</NotificationBar>
|
|
136
|
-
<VBtn
|
|
137
|
-
color="primary"
|
|
138
|
-
@click="envoyerNotification('This is a ' + typeRef + ' notification')"
|
|
139
|
-
class="ma-6"
|
|
140
|
-
>
|
|
141
|
-
Afficher la notification
|
|
142
|
-
</VBtn>
|
|
143
|
-
</div>
|
|
144
|
-
`,
|
|
145
|
-
})
|
|
146
|
-
WithAction.args = {
|
|
147
|
-
type: 'info',
|
|
114
|
+
Default.args = {
|
|
148
115
|
closeBtnText: 'Fermer',
|
|
116
|
+
type: 'info',
|
|
117
|
+
bottom: false,
|
|
118
|
+
rounded: 'rounded',
|
|
149
119
|
}
|
|
150
120
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
121
|
+
Default.parameters = {
|
|
122
|
+
sourceCode: [
|
|
123
|
+
{
|
|
124
|
+
name: 'Template',
|
|
125
|
+
code: `
|
|
126
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
127
|
+
<NotificationBar
|
|
128
|
+
v-model="showNotification"
|
|
129
|
+
:close-btn-text="closeBtnText"
|
|
130
|
+
:bottom="bottom"
|
|
131
|
+
:rounded="rounded"
|
|
132
|
+
:type="type"
|
|
133
|
+
>
|
|
134
|
+
<template #default>This is a {{ type }} notification</template>
|
|
135
|
+
</NotificationBar>
|
|
136
|
+
<VBtn
|
|
137
|
+
color="primary"
|
|
138
|
+
@click="envoyerNotification('This is a ' + type + ' notification')"
|
|
139
|
+
class="ma-6"
|
|
140
|
+
>
|
|
141
|
+
Afficher la notification
|
|
142
|
+
</VBtn>
|
|
143
|
+
</div>
|
|
144
|
+
`,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'Script',
|
|
148
|
+
code: `
|
|
149
|
+
<script setup lang="ts">
|
|
150
|
+
import { VBtn } from 'vuetify/components'
|
|
151
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
152
|
+
import { ref } from 'vue'
|
|
153
|
+
import { useNotificationService } from '@/services/NotificationService'
|
|
156
154
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const { closeBtnText } = toRefs(args)
|
|
155
|
+
const { addNotification } = useNotificationService()
|
|
156
|
+
const showNotification = ref(false)
|
|
160
157
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
closeBtnText,
|
|
176
|
-
envoyerNotification,
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
template: `
|
|
180
|
-
<div class="d-flex flex-wrap align-center justify-center">
|
|
181
|
-
<NotificationBar
|
|
182
|
-
v-model="showNotification"
|
|
183
|
-
:close-btn-text="closeBtnText"
|
|
184
|
-
>
|
|
185
|
-
<template #default>This is a {{ typeRef }} notification</template>
|
|
186
|
-
</NotificationBar>
|
|
187
|
-
<VBtn
|
|
188
|
-
color="primary"
|
|
189
|
-
@click="envoyerNotification('This is a ' + typeRef + ' notification')"
|
|
190
|
-
class="ma-6"
|
|
191
|
-
>
|
|
192
|
-
Afficher la notification
|
|
193
|
-
</VBtn>
|
|
194
|
-
</div>
|
|
195
|
-
`,
|
|
196
|
-
})
|
|
197
|
-
WithTimeout.args = {
|
|
198
|
-
type: 'info', // Valeur par défaut pour `type`
|
|
199
|
-
closeBtnText: 'Fermer',
|
|
158
|
+
const envoyerNotification = (message: string) => {
|
|
159
|
+
const notification = {
|
|
160
|
+
id: Date.now().toString(),
|
|
161
|
+
message,
|
|
162
|
+
type: 'info',
|
|
163
|
+
timeout: -1,
|
|
164
|
+
}
|
|
165
|
+
addNotification(notification)
|
|
166
|
+
showNotification.value = true
|
|
167
|
+
}
|
|
168
|
+
</script>
|
|
169
|
+
`,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
200
172
|
}
|
|
201
173
|
|
|
202
|
-
export const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
174
|
+
export const Success: Story = Default.bind({})
|
|
175
|
+
Success.args = {
|
|
176
|
+
...Default.args,
|
|
177
|
+
type: 'success',
|
|
178
|
+
}
|
|
179
|
+
Success.parameters = {
|
|
180
|
+
sourceCode: [
|
|
181
|
+
{
|
|
182
|
+
name: 'Template',
|
|
183
|
+
code: `
|
|
184
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
185
|
+
<NotificationBar
|
|
186
|
+
v-model="showNotification"
|
|
187
|
+
:close-btn-text="closeBtnText"
|
|
188
|
+
:bottom="bottom"
|
|
189
|
+
:rounded="rounded"
|
|
190
|
+
type="success"
|
|
191
|
+
>
|
|
192
|
+
<template #default>This is a success notification</template>
|
|
193
|
+
</NotificationBar>
|
|
194
|
+
<VBtn
|
|
195
|
+
color="success"
|
|
196
|
+
@click="envoyerNotification('This is a success notification')"
|
|
197
|
+
class="ma-6"
|
|
198
|
+
>
|
|
199
|
+
Afficher la notification
|
|
200
|
+
</VBtn>
|
|
201
|
+
</div>
|
|
202
|
+
`,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'Script',
|
|
206
|
+
code: `
|
|
207
|
+
<script setup lang="ts">
|
|
208
|
+
import { VBtn } from 'vuetify/components'
|
|
209
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
210
|
+
import { ref } from 'vue'
|
|
211
|
+
import { useNotificationService } from '@/services/NotificationService'
|
|
207
212
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const { closeBtnText } = toRefs(args)
|
|
213
|
+
const { addNotification } = useNotificationService()
|
|
214
|
+
const showNotification = ref(false)
|
|
211
215
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
closeBtnText,
|
|
227
|
-
envoyerNotification,
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
template: `
|
|
231
|
-
<div class="d-flex flex-wrap align-center justify-center">
|
|
232
|
-
<NotificationBar
|
|
233
|
-
v-model="showNotification"
|
|
234
|
-
:close-btn-text="closeBtnText"
|
|
235
|
-
>
|
|
236
|
-
<template #default>
|
|
237
|
-
<div>
|
|
238
|
-
<p>This is a {{ typeRef }} notification</p>
|
|
239
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p>
|
|
240
|
-
</div>
|
|
241
|
-
</template>
|
|
242
|
-
</NotificationBar>
|
|
243
|
-
<VBtn
|
|
244
|
-
color="primary"
|
|
245
|
-
@click="envoyerNotification('This is a ' + typeRef + ' lorem ipsum dolor sit amet, consectetur adipiscing elit...')"
|
|
246
|
-
class="ma-6"
|
|
247
|
-
>
|
|
248
|
-
Afficher la notification
|
|
249
|
-
</VBtn>
|
|
250
|
-
</div>
|
|
251
|
-
`,
|
|
252
|
-
})
|
|
253
|
-
WithLongText.args = {
|
|
254
|
-
type: 'info',
|
|
255
|
-
closeBtnText: 'Fermer',
|
|
216
|
+
const envoyerNotification = (message: string) => {
|
|
217
|
+
const notification = {
|
|
218
|
+
id: Date.now().toString(),
|
|
219
|
+
message,
|
|
220
|
+
type: 'success',
|
|
221
|
+
timeout: -1,
|
|
222
|
+
}
|
|
223
|
+
addNotification(notification)
|
|
224
|
+
showNotification.value = true
|
|
225
|
+
}
|
|
226
|
+
</script>
|
|
227
|
+
`,
|
|
228
|
+
},
|
|
229
|
+
],
|
|
256
230
|
}
|
|
257
231
|
|
|
258
|
-
export const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
232
|
+
export const Warning: Story = Default.bind({})
|
|
233
|
+
Warning.args = {
|
|
234
|
+
...Default.args,
|
|
235
|
+
type: 'warning',
|
|
236
|
+
}
|
|
237
|
+
Warning.parameters = {
|
|
238
|
+
sourceCode: [
|
|
239
|
+
{
|
|
240
|
+
name: 'Template',
|
|
241
|
+
code: `
|
|
242
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
243
|
+
<NotificationBar
|
|
244
|
+
v-model="showNotification"
|
|
245
|
+
:close-btn-text="closeBtnText"
|
|
246
|
+
:bottom="bottom"
|
|
247
|
+
:rounded="rounded"
|
|
248
|
+
type="warning"
|
|
249
|
+
>
|
|
250
|
+
<template #default>This is a warning notification</template>
|
|
251
|
+
</NotificationBar>
|
|
252
|
+
<VBtn
|
|
253
|
+
color="warning"
|
|
254
|
+
@click="envoyerNotification('This is a warning notification')"
|
|
255
|
+
class="ma-6"
|
|
256
|
+
>
|
|
257
|
+
Afficher la notification
|
|
258
|
+
</VBtn>
|
|
259
|
+
</div>
|
|
260
|
+
`,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'Script',
|
|
264
|
+
code: `
|
|
265
|
+
<script setup lang="ts">
|
|
266
|
+
import { VBtn } from 'vuetify/components'
|
|
267
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
268
|
+
import { ref } from 'vue'
|
|
269
|
+
import { useNotificationService } from '@/services/NotificationService'
|
|
263
270
|
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
const { addNotification } = useNotificationService()
|
|
272
|
+
const showNotification = ref(false)
|
|
266
273
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
const envoyerNotification = (message: string) => {
|
|
275
|
+
const notification = {
|
|
276
|
+
id: Date.now().toString(),
|
|
277
|
+
message,
|
|
278
|
+
type: 'warning',
|
|
279
|
+
timeout: -1,
|
|
280
|
+
}
|
|
281
|
+
addNotification(notification)
|
|
282
|
+
showNotification.value = true
|
|
283
|
+
}
|
|
284
|
+
</script>
|
|
285
|
+
`,
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
}
|
|
277
289
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
envoyerNotification,
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
template: `
|
|
286
|
-
<div class="d-flex flex-wrap align-center justify-center">
|
|
287
|
-
<NotificationBar
|
|
288
|
-
v-model="showNotification"
|
|
289
|
-
:close-btn-text="closeBtnText"
|
|
290
|
-
>
|
|
291
|
-
<template #default>This is a {{ typeRef }} notification</template>
|
|
292
|
-
</NotificationBar>
|
|
293
|
-
<VBtn
|
|
294
|
-
color="primary"
|
|
295
|
-
@click="envoyerNotification('This is a ' + typeRef + ' notification ')"
|
|
296
|
-
class="ma-6"
|
|
297
|
-
>
|
|
298
|
-
Afficher la notification
|
|
299
|
-
</VBtn>
|
|
300
|
-
</div>
|
|
301
|
-
`,
|
|
302
|
-
})
|
|
303
|
-
forMobile.args = {
|
|
304
|
-
type: 'info',
|
|
305
|
-
closeBtnText: 'Fermer',
|
|
290
|
+
export const Error: Story = Default.bind({})
|
|
291
|
+
Error.args = {
|
|
292
|
+
...Default.args,
|
|
293
|
+
type: 'error',
|
|
306
294
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
295
|
+
Error.parameters = {
|
|
296
|
+
sourceCode: [
|
|
297
|
+
{
|
|
298
|
+
name: 'Template',
|
|
299
|
+
code: `
|
|
300
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
301
|
+
<NotificationBar
|
|
302
|
+
v-model="showNotification"
|
|
303
|
+
:close-btn-text="closeBtnText"
|
|
304
|
+
:bottom="bottom"
|
|
305
|
+
:rounded="rounded"
|
|
306
|
+
type="error"
|
|
307
|
+
>
|
|
308
|
+
<template #default>This is an error notification</template>
|
|
309
|
+
</NotificationBar>
|
|
310
|
+
<VBtn
|
|
311
|
+
color="error"
|
|
312
|
+
@click="envoyerNotification('This is an error notification')"
|
|
313
|
+
class="ma-6"
|
|
314
|
+
>
|
|
315
|
+
Afficher la notification
|
|
316
|
+
</VBtn>
|
|
317
|
+
</div>
|
|
318
|
+
`,
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: 'Script',
|
|
322
|
+
code: `
|
|
323
|
+
<script setup lang="ts">
|
|
324
|
+
import { VBtn } from 'vuetify/components'
|
|
325
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
326
|
+
import { ref } from 'vue'
|
|
327
|
+
import { useNotificationService } from '@/services/NotificationService'
|
|
328
|
+
|
|
329
|
+
const { addNotification } = useNotificationService()
|
|
330
|
+
const showNotification = ref(false)
|
|
331
|
+
|
|
332
|
+
const envoyerNotification = (message: string) => {
|
|
333
|
+
const notification = {
|
|
334
|
+
id: Date.now().toString(),
|
|
335
|
+
message,
|
|
336
|
+
type: 'error',
|
|
337
|
+
timeout: -1,
|
|
338
|
+
}
|
|
339
|
+
addNotification(notification)
|
|
340
|
+
showNotification.value = true
|
|
341
|
+
}
|
|
342
|
+
</script>
|
|
343
|
+
`,
|
|
344
|
+
},
|
|
345
|
+
],
|
|
311
346
|
}
|
|
312
347
|
|
|
313
|
-
export const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
348
|
+
export const Bottom: Story = Default.bind({})
|
|
349
|
+
Bottom.args = {
|
|
350
|
+
...Default.args,
|
|
351
|
+
bottom: true,
|
|
352
|
+
}
|
|
353
|
+
Bottom.parameters = {
|
|
354
|
+
sourceCode: [
|
|
355
|
+
{
|
|
356
|
+
name: 'Template',
|
|
357
|
+
code: `
|
|
358
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
359
|
+
<NotificationBar
|
|
360
|
+
v-model="showNotification"
|
|
361
|
+
:close-btn-text="closeBtnText"
|
|
362
|
+
:bottom="true"
|
|
363
|
+
:rounded="rounded"
|
|
364
|
+
:type="type"
|
|
365
|
+
>
|
|
366
|
+
<template #default>This is a bottom-positioned notification</template>
|
|
367
|
+
</NotificationBar>
|
|
368
|
+
<VBtn
|
|
369
|
+
color="primary"
|
|
370
|
+
@click="envoyerNotification('This is a bottom-positioned notification')"
|
|
371
|
+
class="ma-6"
|
|
372
|
+
>
|
|
373
|
+
Afficher la notification
|
|
374
|
+
</VBtn>
|
|
375
|
+
</div>
|
|
376
|
+
`,
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: 'Script',
|
|
380
|
+
code: `
|
|
381
|
+
<script setup lang="ts">
|
|
382
|
+
import { VBtn } from 'vuetify/components'
|
|
383
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
384
|
+
import { ref } from 'vue'
|
|
385
|
+
import { useNotificationService } from '@/services/NotificationService'
|
|
318
386
|
|
|
319
|
-
|
|
320
|
-
|
|
387
|
+
const { addNotification } = useNotificationService()
|
|
388
|
+
const showNotification = ref(false)
|
|
321
389
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
390
|
+
const envoyerNotification = (message: string) => {
|
|
391
|
+
const notification = {
|
|
392
|
+
id: Date.now().toString(),
|
|
393
|
+
message,
|
|
394
|
+
type: 'info',
|
|
395
|
+
timeout: -1,
|
|
396
|
+
}
|
|
397
|
+
addNotification(notification)
|
|
398
|
+
showNotification.value = true
|
|
399
|
+
}
|
|
400
|
+
</script>
|
|
401
|
+
`,
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
}
|
|
332
405
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
envoyerNotification,
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
template: `
|
|
341
|
-
<div class="d-flex flex-wrap align-center justify-center">
|
|
342
|
-
<NotificationBar
|
|
343
|
-
v-model="showNotification"
|
|
344
|
-
:close-btn-text="closeBtnText"
|
|
345
|
-
>
|
|
346
|
-
<template #default>This is a {{ typeRef }} notification</template>
|
|
347
|
-
</NotificationBar>
|
|
348
|
-
<VBtn
|
|
349
|
-
color="primary"
|
|
350
|
-
@click="envoyerNotification('This is a ' + typeRef + ' lorem ipsum dolor sit amet, consectetur adipiscing elit...')"
|
|
351
|
-
class="ma-6"
|
|
352
|
-
>
|
|
353
|
-
Afficher la notification
|
|
354
|
-
</VBtn>
|
|
355
|
-
</div>
|
|
356
|
-
`,
|
|
357
|
-
})
|
|
358
|
-
forMobileWithLongText.args = {
|
|
359
|
-
type: 'info',
|
|
360
|
-
closeBtnText: 'Fermer',
|
|
406
|
+
export const CustomCloseBtnText: Story = Default.bind({})
|
|
407
|
+
CustomCloseBtnText.args = {
|
|
408
|
+
...Default.args,
|
|
409
|
+
closeBtnText: 'Masquer',
|
|
361
410
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
411
|
+
CustomCloseBtnText.parameters = {
|
|
412
|
+
sourceCode: [
|
|
413
|
+
{
|
|
414
|
+
name: 'Template',
|
|
415
|
+
code: `
|
|
416
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
417
|
+
<NotificationBar
|
|
418
|
+
v-model="showNotification"
|
|
419
|
+
close-btn-text="Masquer"
|
|
420
|
+
:bottom="bottom"
|
|
421
|
+
:rounded="rounded"
|
|
422
|
+
:type="type"
|
|
423
|
+
>
|
|
424
|
+
<template #default>This is a notification with custom close button text</template>
|
|
425
|
+
</NotificationBar>
|
|
426
|
+
<VBtn
|
|
427
|
+
color="primary"
|
|
428
|
+
@click="envoyerNotification('This is a notification with custom close button text')"
|
|
429
|
+
class="ma-6"
|
|
430
|
+
>
|
|
431
|
+
Afficher la notification
|
|
432
|
+
</VBtn>
|
|
433
|
+
</div>
|
|
434
|
+
`,
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: 'Script',
|
|
438
|
+
code: `
|
|
439
|
+
<script setup lang="ts">
|
|
440
|
+
import { VBtn } from 'vuetify/components'
|
|
441
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
442
|
+
import { ref } from 'vue'
|
|
443
|
+
import { useNotificationService } from '@/services/NotificationService'
|
|
444
|
+
|
|
445
|
+
const { addNotification } = useNotificationService()
|
|
446
|
+
const showNotification = ref(false)
|
|
447
|
+
|
|
448
|
+
const envoyerNotification = (message: string) => {
|
|
449
|
+
const notification = {
|
|
450
|
+
id: Date.now().toString(),
|
|
451
|
+
message,
|
|
452
|
+
type: 'info',
|
|
453
|
+
timeout: -1,
|
|
454
|
+
}
|
|
455
|
+
addNotification(notification)
|
|
456
|
+
showNotification.value = true
|
|
457
|
+
}
|
|
458
|
+
</script>
|
|
459
|
+
`,
|
|
460
|
+
},
|
|
461
|
+
],
|
|
366
462
|
}
|