@ouestfrance/sipa-bms-ui 8.19.0 → 8.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/BmsFilePicker.vue.d.ts +4 -0
- package/dist/components/form/BmsInputText.vue.d.ts +1 -0
- package/dist/components/form/BmsMultiSelect.vue.d.ts +4 -0
- package/dist/components/form/BmsSearch.vue.d.ts +3 -1
- package/dist/components/form/RawAutocomplete.vue.d.ts +8 -0
- package/dist/components/layout/BmsSplitWindow.vue.d.ts +1 -0
- package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +3 -1
- package/dist/components/table/BmsTableFilters.vue.d.ts +3 -1
- package/dist/mockServiceWorker.js +1 -1
- package/dist/sipa-bms-ui.css +54 -368
- package/dist/sipa-bms-ui.es.js +118 -47
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +117 -46
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +13 -12
- package/src/assets/scss/_conf.scss +0 -1
- package/src/assets/scss/app.scss +0 -1
- package/src/components/button/BmsAllButtons.stories.js +50 -23
- package/src/components/button/BmsButton.stories.js +151 -65
- package/src/components/button/BmsIconButton.stories.js +14 -8
- package/src/components/button/UiButton.stories.js +31 -0
- package/src/components/feedback/BmsCircularProgress.stories.js +0 -7
- package/src/components/feedback/BmsLoader.stories.js +0 -6
- package/src/components/feedback/BmsTooltip.stories.js +1 -0
- package/src/components/feedback/UiTooltip.stories.js +1 -0
- package/src/components/form/BmsAutocomplete.stories.js +11 -1
- package/src/components/form/BmsBetweenInput.stories.js +17 -1
- package/src/components/form/BmsFilePicker.stories.js +8 -1
- package/src/components/form/BmsFilePicker.vue +10 -5
- package/src/components/form/BmsInputBooleanCheckbox.stories.js +9 -0
- package/src/components/form/BmsInputCheckboxCaption.stories.js +16 -0
- package/src/components/form/BmsInputCheckboxCaptionGroup.stories.js +21 -1
- package/src/components/form/BmsInputText.vue +1 -0
- package/src/components/form/BmsMultiSelect.vue +32 -25
- package/src/components/form/BmsSelect.vue +18 -16
- package/src/components/form/RawAutocomplete.vue +16 -4
- package/src/components/form/RawInputText.vue +1 -0
- package/src/components/form/UiBmsInputCheckbox.stories.js +1 -0
- package/src/components/form/UiBmsSwitch.stories.js +1 -5
- package/src/components/layout/BmsForm_retrocompat.stories.js +1 -0
- package/src/components/layout/BmsModal.stories.js +2 -1
- package/src/components/layout/BmsSplitWindow.vue +4 -3
- package/src/components/navigation/BmsBreadcrumb.stories.js +0 -18
- package/src/components/navigation/BmsMenu.stories.js +4 -4
- package/src/components/navigation/BmsMenuNav.stories.js +4 -3
- package/src/components/navigation/UiMenuItem.stories.js +53 -2
- package/src/components/navigation/UiTab.stories.js +1 -0
- package/src/components/navigation/UiTenantSwitcher.stories.js +1 -0
- package/src/components/table/BmsEmptyScreen.stories.js +0 -7
- package/src/components/table/BmsTableFilters.vue +1 -1
- package/src/components/table/UiBmsTable.stories.js +1 -0
- package/src/components/table/UiFilterButton.stories.js +3 -8
- package/src/components/utils/BmsRelativeTime.stories.js +0 -6
- package/src/documentation/button/primaryButton.mdx +142 -0
- package/src/documentation/{secondaryButton.mdx → button/secondaryButton.mdx} +2 -2
- package/src/documentation/foundation/contributing.mdx +72 -0
- package/src/documentation/foundation/gettingstarted.mdx +7 -0
- package/src/documentation/{principles.mdx → foundation/principles.mdx} +9 -9
- package/src/documentation/icons.mdx +43 -0
- package/src/showroom/pages/forms.vue +10 -1
- package/src/assets/scss/_formkit.scss +0 -353
- package/src/components/feedback/Notification.stories.js +0 -37
- package/src/components/form/Form.stories.js +0 -35
- package/src/components/navigation/UiMenuItemStatus.stories.js +0 -64
- package/src/documentation/primaryButton.mdx +0 -20
- /package/src/documentation/{button.mdx → button/button.mdx} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouestfrance/sipa-bms-ui",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.21.0",
|
|
4
4
|
"author": "Ouest-France BMS",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"scripts": {
|
|
@@ -30,16 +30,15 @@
|
|
|
30
30
|
"url": "https://gitlab.ouest-france.fr/sipa-ouest-france/platform/platform-library-vuejs-bms.git"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@chromatic-com/storybook": "^4.1.
|
|
33
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
34
34
|
"@codemirror/lang-html": "6.4.11",
|
|
35
35
|
"@codemirror/lang-json": "6.0.2",
|
|
36
36
|
"@commitlint/cli": "20.1.0",
|
|
37
37
|
"@commitlint/config-conventional": "20.0.0",
|
|
38
|
-
"@formkit/vue": "1.6.9",
|
|
39
38
|
"@mdx-js/react": "3.1.1",
|
|
40
|
-
"@storybook/addon-docs": "10.
|
|
41
|
-
"@storybook/addon-links": "10.
|
|
42
|
-
"@storybook/vue3-vite": "10.
|
|
39
|
+
"@storybook/addon-docs": "10.1.6",
|
|
40
|
+
"@storybook/addon-links": "10.1.6",
|
|
41
|
+
"@storybook/vue3-vite": "10.1.6",
|
|
43
42
|
"@types/lodash": "4.17.21",
|
|
44
43
|
"@types/uuid": "11.0.0",
|
|
45
44
|
"@vitejs/plugin-vue": "6.0.2",
|
|
@@ -61,15 +60,18 @@
|
|
|
61
60
|
"lint-staged": "16.2.7",
|
|
62
61
|
"lodash": "4.17.21",
|
|
63
62
|
"lucide-vue-next": "0.554.0",
|
|
63
|
+
"msw": "^2.12.4",
|
|
64
64
|
"msw-storybook-addon": "^2.0.3",
|
|
65
65
|
"normalize.css": "8.0.1",
|
|
66
66
|
"path": "0.12.7",
|
|
67
67
|
"prettier": "3.6.2",
|
|
68
|
+
"remark-gfm": "^4.0.1",
|
|
68
69
|
"sass": "1.94.2",
|
|
69
70
|
"semantic-release": "25.0.2",
|
|
70
71
|
"start-server-and-test": "2.1.3",
|
|
71
|
-
"storybook": "10.
|
|
72
|
-
"storybook-addon-pseudo-states": "10.
|
|
72
|
+
"storybook": "10.1.6",
|
|
73
|
+
"storybook-addon-pseudo-states": "10.1.6",
|
|
74
|
+
"storybook-addon-tag-badges": "^3.0.2",
|
|
73
75
|
"storybook-vue3-router": "^7.0.0",
|
|
74
76
|
"typescript": "5.2.2",
|
|
75
77
|
"uuid": "13.0.0",
|
|
@@ -117,9 +119,8 @@
|
|
|
117
119
|
]
|
|
118
120
|
},
|
|
119
121
|
"msw": {
|
|
120
|
-
"workerDirectory":
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"msw": "^2.3.1"
|
|
122
|
+
"workerDirectory": [
|
|
123
|
+
"public"
|
|
124
|
+
]
|
|
124
125
|
}
|
|
125
126
|
}
|
package/src/assets/scss/app.scss
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import BmsButton from '@/components/button/BmsButton.vue';
|
|
2
2
|
import BmsIconButton from '@/components/button/BmsIconButton.vue';
|
|
3
|
-
import { Heart } from 'lucide-vue-next';
|
|
3
|
+
import { Heart, ArrowLeft, ArrowRight } from 'lucide-vue-next';
|
|
4
4
|
|
|
5
5
|
const types = ['primary', 'secondary', 'tertiary'];
|
|
6
6
|
const modes = ['default', 'danger'];
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
title: 'Composants/button',
|
|
9
|
+
title: 'Composants/button/Button',
|
|
10
10
|
component: BmsButton,
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -14,41 +14,68 @@ const AllButtonsTemplate = () => ({
|
|
|
14
14
|
components: {
|
|
15
15
|
BmsButton,
|
|
16
16
|
BmsIconButton,
|
|
17
|
+
ArrowLeft,
|
|
18
|
+
ArrowRight,
|
|
17
19
|
Heart,
|
|
18
20
|
},
|
|
19
21
|
setup() {
|
|
20
22
|
return { types, modes };
|
|
21
23
|
},
|
|
22
24
|
template: `
|
|
23
|
-
<div style="display:grid;grid-template-columns:repeat(
|
|
25
|
+
<div style="display:grid;grid-template-columns:repeat(4, auto); gap:1em; justify-items: start; align-items: center;">
|
|
24
26
|
<template v-for="mode in modes" :key="mode">
|
|
25
27
|
<template v-for="type in types">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Button {{ mode }} {{ type }} {{ to ? ' avec une URL ' : '' }}
|
|
28
|
+
<BmsButton :mode="mode" :type="type" small>
|
|
29
|
+
Button {{ mode }} {{ type }} small
|
|
29
30
|
</BmsButton>
|
|
30
|
-
<BmsButton :mode="mode" :type="type"
|
|
31
|
-
Button {{ mode }} {{ type }}
|
|
31
|
+
<BmsButton :mode="mode" :type="type">
|
|
32
|
+
Button {{ mode }} {{ type }}
|
|
32
33
|
</BmsButton>
|
|
33
|
-
<BmsButton :mode="mode" :type="type"
|
|
34
|
-
Button {{ mode }} {{ type }}
|
|
34
|
+
<BmsButton :mode="mode" :type="type" class="_hover">
|
|
35
|
+
Button {{ mode }} {{ type }} hovered
|
|
36
|
+
</BmsButton>
|
|
37
|
+
<BmsButton :mode="mode" :type="type" disabled>
|
|
38
|
+
Button {{ mode }} {{ type }} disabled
|
|
35
39
|
</BmsButton>
|
|
36
|
-
</template>
|
|
37
40
|
</template>
|
|
38
41
|
</template>
|
|
42
|
+
|
|
43
|
+
<BmsButton small>
|
|
44
|
+
<template #start> <ArrowLeft/> </template>
|
|
45
|
+
Button small
|
|
46
|
+
<template #end> <ArrowRight/> </template>
|
|
47
|
+
</BmsButton>
|
|
48
|
+
<BmsButton>
|
|
49
|
+
<template #start> <ArrowLeft/> </template>
|
|
50
|
+
Button
|
|
51
|
+
<template #end> <ArrowRight/> </template>
|
|
52
|
+
</BmsButton>
|
|
53
|
+
<BmsButton class="_hover">
|
|
54
|
+
<template #start> <ArrowLeft/> </template>
|
|
55
|
+
Button hovered
|
|
56
|
+
<template #end> <ArrowRight/> </template>
|
|
57
|
+
</BmsButton>
|
|
58
|
+
<BmsButton disabled>
|
|
59
|
+
<template #start> <ArrowLeft/> </template>
|
|
60
|
+
Button disabled
|
|
61
|
+
<template #end> <ArrowRight/> </template>
|
|
62
|
+
</BmsButton>
|
|
63
|
+
|
|
39
64
|
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
65
|
+
<template v-for="mode in modes" :key="mode">
|
|
66
|
+
<BmsIconButton v-bind="args" :mode="mode" small>
|
|
67
|
+
<Heart />
|
|
68
|
+
</BmsIconButton>
|
|
69
|
+
<BmsIconButton v-bind="args" :mode="mode">
|
|
70
|
+
<Heart />
|
|
71
|
+
</BmsIconButton>
|
|
72
|
+
<BmsIconButton v-bind="args" :mode="mode" class="_hover">
|
|
73
|
+
<Heart />
|
|
74
|
+
</BmsIconButton>
|
|
75
|
+
<BmsIconButton v-bind="args" :mode="mode" disabled>
|
|
76
|
+
<Heart />
|
|
77
|
+
</BmsIconButton>
|
|
78
|
+
</template>
|
|
52
79
|
</div>
|
|
53
80
|
`,
|
|
54
81
|
});
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import BmsButton from '@/components/button/BmsButton.vue';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ArrowLeft,
|
|
4
|
+
ArrowRight,
|
|
5
|
+
Camera,
|
|
6
|
+
Heart,
|
|
7
|
+
Wand,
|
|
8
|
+
Check,
|
|
9
|
+
} from 'lucide-vue-next';
|
|
3
10
|
import { StatusType } from '@/models';
|
|
4
11
|
|
|
5
12
|
export default {
|
|
6
13
|
title: 'Composants/button/Button',
|
|
7
14
|
component: BmsButton,
|
|
15
|
+
tags: ['with_useable_code'],
|
|
16
|
+
parameters: {
|
|
17
|
+
chromatic: { disable: true },
|
|
18
|
+
},
|
|
8
19
|
argTypes: {
|
|
9
20
|
type: {
|
|
10
21
|
control: { type: 'select' },
|
|
@@ -24,87 +35,162 @@ export default {
|
|
|
24
35
|
const Template = (args) => ({
|
|
25
36
|
components: {
|
|
26
37
|
BmsButton,
|
|
27
|
-
ArrowRight,
|
|
28
|
-
ArrowLeft,
|
|
29
|
-
Camera,
|
|
30
|
-
Heart,
|
|
31
|
-
Wand,
|
|
32
38
|
},
|
|
33
39
|
setup() {
|
|
34
40
|
return { args };
|
|
35
41
|
},
|
|
36
42
|
template: `
|
|
37
|
-
<BmsButton v-bind="args">Save me</BmsButton>
|
|
38
|
-
<br>
|
|
39
|
-
<br>
|
|
40
|
-
<BmsButton v-bind="args">
|
|
41
|
-
Next page
|
|
42
|
-
<template #end><ArrowRight /></template>
|
|
43
|
-
</BmsButton>
|
|
44
|
-
<br>
|
|
45
|
-
<br>
|
|
46
|
-
<BmsButton v-bind="args">
|
|
47
|
-
<template #start>
|
|
48
|
-
<Heart/>
|
|
49
|
-
</template>
|
|
50
|
-
Icons left & right
|
|
51
|
-
<template #end>
|
|
52
|
-
<Wand/>
|
|
53
|
-
</template>
|
|
54
|
-
</BmsButton>
|
|
55
|
-
<br>
|
|
56
|
-
<br>
|
|
57
43
|
<BmsButton v-bind="args">
|
|
58
|
-
|
|
59
|
-
Retour
|
|
44
|
+
Save
|
|
60
45
|
</BmsButton>
|
|
61
|
-
|
|
62
|
-
`,
|
|
46
|
+
`,
|
|
63
47
|
});
|
|
64
48
|
|
|
65
|
-
export const
|
|
66
|
-
|
|
67
|
-
type: 'primary',
|
|
68
|
-
};
|
|
49
|
+
export const Playground = Template.bind({});
|
|
50
|
+
Playground.args = {};
|
|
69
51
|
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
// Stories for documentation examples (Do/Don't)
|
|
53
|
+
export const DoSimple = Template.bind({});
|
|
54
|
+
DoSimple.args = {
|
|
72
55
|
type: 'primary',
|
|
73
|
-
mode: StatusType.Danger,
|
|
74
56
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
type: 'secondary',
|
|
57
|
+
export const DoDanger = Template.bind({});
|
|
58
|
+
DoDanger.args = {
|
|
59
|
+
mode: 'danger',
|
|
79
60
|
};
|
|
80
61
|
|
|
81
|
-
export const
|
|
82
|
-
|
|
83
|
-
|
|
62
|
+
export const DoSmall = Template.bind({});
|
|
63
|
+
DoSmall.args = {
|
|
64
|
+
small: true,
|
|
84
65
|
};
|
|
85
66
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
67
|
+
// Do: Button with icon at start
|
|
68
|
+
export const DoIconStart = () => ({
|
|
69
|
+
components: { BmsButton, Check },
|
|
70
|
+
template: `
|
|
71
|
+
<BmsButton type="primary">
|
|
72
|
+
<template #start><Check /></template>
|
|
73
|
+
Confirm
|
|
74
|
+
</BmsButton>
|
|
75
|
+
`,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Do: Button with icon at end
|
|
79
|
+
export const DoIconEnd = () => ({
|
|
80
|
+
components: { BmsButton, ArrowRight },
|
|
98
81
|
template: `
|
|
99
|
-
<BmsButton
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
<BmsButton type="primary">
|
|
83
|
+
Next
|
|
84
|
+
<template #end><ArrowRight /></template>
|
|
85
|
+
</BmsButton>
|
|
104
86
|
`,
|
|
105
87
|
});
|
|
106
88
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
89
|
+
// Do: Submit button
|
|
90
|
+
export const DoSubmit = () => ({
|
|
91
|
+
components: { BmsButton },
|
|
92
|
+
template: `
|
|
93
|
+
<form>
|
|
94
|
+
<BmsButton type="primary" :submit="true">Submit form</BmsButton>
|
|
95
|
+
</form>
|
|
96
|
+
`,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// Don't: Long labels
|
|
100
|
+
export const DontLongLabel = () => ({
|
|
101
|
+
components: { BmsButton },
|
|
102
|
+
template:
|
|
103
|
+
'<BmsButton type="primary">Click here to save your changes to the document</BmsButton>',
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export const DoShortLabel = () => ({
|
|
107
|
+
components: { BmsButton },
|
|
108
|
+
template: '<BmsButton type="primary">Save changes</BmsButton>',
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Don't: Multiple primary buttons
|
|
112
|
+
export const DontMultiplePrimary = () => ({
|
|
113
|
+
components: { BmsButton },
|
|
114
|
+
template: `
|
|
115
|
+
<div style="display: flex; gap: 8px;">
|
|
116
|
+
<BmsButton type="primary">Save</BmsButton>
|
|
117
|
+
<BmsButton type="primary">Cancel</BmsButton>
|
|
118
|
+
<BmsButton type="primary">Delete</BmsButton>
|
|
119
|
+
</div>
|
|
120
|
+
`,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const DoOnePrimary = () => ({
|
|
124
|
+
components: { BmsButton },
|
|
125
|
+
template: `
|
|
126
|
+
<div style="display: flex; gap: 8px;">
|
|
127
|
+
<BmsButton type="primary">Save</BmsButton>
|
|
128
|
+
<BmsButton type="secondary">Cancel</BmsButton>
|
|
129
|
+
<BmsButton type="secondary">Delete</BmsButton>
|
|
130
|
+
</div>
|
|
131
|
+
`,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Don't: Too many icons
|
|
135
|
+
export const DontTooManyIcons = () => ({
|
|
136
|
+
components: { BmsButton, Heart, Wand, Check, ArrowRight },
|
|
137
|
+
template: `
|
|
138
|
+
<BmsButton type="primary">
|
|
139
|
+
<template #start><Heart /><Wand /></template>
|
|
140
|
+
Save changes
|
|
141
|
+
<template #end><Check /><ArrowRight /></template>
|
|
142
|
+
</BmsButton>
|
|
143
|
+
`,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export const DoOneIcon = () => ({
|
|
147
|
+
components: { BmsButton, ArrowRight },
|
|
148
|
+
template: `
|
|
149
|
+
<BmsButton type="primary">
|
|
150
|
+
<template #end><ArrowRight /></template>
|
|
151
|
+
Next
|
|
152
|
+
</BmsButton>
|
|
153
|
+
`,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Don't: Generic labels
|
|
157
|
+
export const DontGenericLabel = () => ({
|
|
158
|
+
components: { BmsButton },
|
|
159
|
+
template: `
|
|
160
|
+
<div style="display: flex; gap: 8px;">
|
|
161
|
+
<BmsButton type="primary">Click here</BmsButton>
|
|
162
|
+
<BmsButton type="primary">Submit</BmsButton>
|
|
163
|
+
</div>
|
|
164
|
+
`,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
export const DoSpecificLabel = () => ({
|
|
168
|
+
components: { BmsButton },
|
|
169
|
+
template: `
|
|
170
|
+
<div style="display: flex; gap: 8px;">
|
|
171
|
+
<BmsButton type="primary">Save changes</BmsButton>
|
|
172
|
+
<BmsButton type="primary">Confirm order</BmsButton>
|
|
173
|
+
</div>
|
|
174
|
+
`,
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// Don't: Primary for cancel
|
|
178
|
+
export const DontPrimaryForCancel = () => ({
|
|
179
|
+
components: { BmsButton },
|
|
180
|
+
template: `
|
|
181
|
+
<div style="display: flex; gap: 8px;">
|
|
182
|
+
<BmsButton type="primary">Cancel</BmsButton>
|
|
183
|
+
<BmsButton type="secondary">Save</BmsButton>
|
|
184
|
+
</div>
|
|
185
|
+
`,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export const DoPrimaryForSave = () => ({
|
|
189
|
+
components: { BmsButton },
|
|
190
|
+
template: `
|
|
191
|
+
<div style="display: flex; gap: 8px;">
|
|
192
|
+
<BmsButton type="secondary">Cancel</BmsButton>
|
|
193
|
+
<BmsButton type="primary">Save</BmsButton>
|
|
194
|
+
</div>
|
|
195
|
+
`,
|
|
196
|
+
});
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SquarePen } from 'lucide-vue-next';
|
|
2
2
|
import BmsIconButton from './BmsIconButton.vue';
|
|
3
3
|
import { StatusType } from '@/models';
|
|
4
4
|
import { vueRouter } from 'storybook-vue3-router';
|
|
5
5
|
|
|
6
|
+
const WITH_DEFAULT_SLOT = {
|
|
7
|
+
default: '<SquarePen/>',
|
|
8
|
+
};
|
|
9
|
+
|
|
6
10
|
export default {
|
|
7
11
|
title: 'Composants/button/IconButton',
|
|
8
12
|
component: BmsIconButton,
|
|
13
|
+
tags: ['with_useable_code'],
|
|
9
14
|
decorators: [
|
|
10
15
|
vueRouter([
|
|
11
16
|
{
|
|
@@ -26,21 +31,21 @@ export default {
|
|
|
26
31
|
const Template = (args) => ({
|
|
27
32
|
components: {
|
|
28
33
|
BmsIconButton,
|
|
29
|
-
|
|
34
|
+
SquarePen,
|
|
30
35
|
},
|
|
31
36
|
setup() {
|
|
32
37
|
return { args };
|
|
33
38
|
},
|
|
34
39
|
template: `
|
|
35
40
|
<br><b>default</b>
|
|
36
|
-
<BmsIconButton v-bind="args"><
|
|
41
|
+
<BmsIconButton v-bind="args"><SquarePen/></BmsIconButton>
|
|
37
42
|
<br>
|
|
38
43
|
<br> <b>:hover</b>
|
|
39
|
-
<BmsIconButton v-bind="args" class="_hover"><
|
|
44
|
+
<BmsIconButton v-bind="args" class="_hover"><SquarePen/></BmsIconButton>
|
|
40
45
|
|
|
41
46
|
<br>
|
|
42
47
|
<br> <b>Small</b>
|
|
43
|
-
<BmsIconButton v-bind="args" small><
|
|
48
|
+
<BmsIconButton v-bind="args" small><SquarePen/></BmsIconButton>
|
|
44
49
|
|
|
45
50
|
|
|
46
51
|
<br> <b>BmsIconButton must be on same alignment (using BmsLink and native button html tag)</b>
|
|
@@ -48,7 +53,7 @@ const Template = (args) => ({
|
|
|
48
53
|
tooltip-text="BmsIconButton with BmsLink"
|
|
49
54
|
to="/toto"
|
|
50
55
|
>
|
|
51
|
-
<
|
|
56
|
+
<SquarePen/>
|
|
52
57
|
</BmsIconButton>
|
|
53
58
|
<BmsIconButton
|
|
54
59
|
tooltip-text="BmsIconButton with button html tag"
|
|
@@ -59,13 +64,14 @@ const Template = (args) => ({
|
|
|
59
64
|
});
|
|
60
65
|
|
|
61
66
|
export const IconButton = Template.bind({});
|
|
62
|
-
IconButton.args = {};
|
|
67
|
+
IconButton.args = { ...WITH_DEFAULT_SLOT };
|
|
63
68
|
|
|
64
69
|
export const IconButtonWithTargetLink = Template.bind({});
|
|
65
70
|
IconButtonWithTargetLink.args = {
|
|
66
71
|
target: '_blank',
|
|
67
72
|
to: { name: 'firstRoute' },
|
|
73
|
+
...WITH_DEFAULT_SLOT,
|
|
68
74
|
};
|
|
69
75
|
|
|
70
76
|
export const DangerIconButton = Template.bind({});
|
|
71
|
-
DangerIconButton.args = { mode: StatusType.Danger };
|
|
77
|
+
DangerIconButton.args = { mode: StatusType.Danger, ...WITH_DEFAULT_SLOT };
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
page: template,
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
|
+
tags: ['code-only'],
|
|
21
22
|
title: 'Composants/button/UiButton',
|
|
22
23
|
component: UiButton,
|
|
23
24
|
argTypes: {
|
|
@@ -119,20 +120,50 @@ const TemplateIcon = ({ mode }) => ({
|
|
|
119
120
|
|
|
120
121
|
export const IconButton = TemplateIcon.bind({});
|
|
121
122
|
IconButton.args = {};
|
|
123
|
+
IconButton.parameters = {
|
|
124
|
+
docs: {
|
|
125
|
+
// 👇 Disable Code panel for this specific story
|
|
126
|
+
codePanel: false,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
122
129
|
|
|
123
130
|
export const IconButtonWithRouterArg = Template.bind({});
|
|
124
131
|
IconButtonWithRouterArg.args = { to: { name: 'route' } };
|
|
132
|
+
IconButtonWithRouterArg.parameters = {
|
|
133
|
+
docs: {
|
|
134
|
+
// 👇 Disable Code panel for this specific story
|
|
135
|
+
codePanel: false,
|
|
136
|
+
},
|
|
137
|
+
};
|
|
125
138
|
|
|
126
139
|
export const Error = Template.bind({});
|
|
127
140
|
Error.args = {
|
|
128
141
|
color: StatusType.Danger,
|
|
129
142
|
};
|
|
143
|
+
Error.parameters = {
|
|
144
|
+
docs: {
|
|
145
|
+
// 👇 Disable Code panel for this specific story
|
|
146
|
+
codePanel: false,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
130
149
|
|
|
131
150
|
export const PrimaryUI = Template.bind({});
|
|
132
151
|
PrimaryUI.args = {};
|
|
152
|
+
PrimaryUI.parameters = {
|
|
153
|
+
docs: {
|
|
154
|
+
// 👇 Disable Code panel for this specific story
|
|
155
|
+
codePanel: false,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
133
158
|
|
|
134
159
|
export const SecondaryUI = Template.bind({});
|
|
135
160
|
SecondaryUI.args = {
|
|
136
161
|
color: StatusType.Default,
|
|
137
162
|
mode: 'outline',
|
|
138
163
|
};
|
|
164
|
+
SecondaryUI.parameters = {
|
|
165
|
+
docs: {
|
|
166
|
+
// 👇 Disable Code panel for this specific story
|
|
167
|
+
codePanel: false,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import BmsCircularProgress from '@/components/feedback/BmsCircularProgress.vue';
|
|
2
2
|
|
|
3
|
-
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
|
4
3
|
export default {
|
|
5
4
|
title: 'Composants/feedback/CircularProgress',
|
|
6
5
|
component: BmsCircularProgress,
|
|
7
|
-
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
8
6
|
argTypes: {
|
|
9
7
|
progress: {
|
|
10
8
|
control: { type: 'number' },
|
|
@@ -12,24 +10,19 @@ export default {
|
|
|
12
10
|
},
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
16
13
|
const Template = (args) => ({
|
|
17
|
-
// Components used in your story `template` are defined in the `components` object
|
|
18
14
|
components: {
|
|
19
15
|
BmsCircularProgress,
|
|
20
16
|
},
|
|
21
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
22
17
|
setup() {
|
|
23
18
|
return { args };
|
|
24
19
|
},
|
|
25
|
-
// And then the `args` are bound to your component with `v-bind="args"`
|
|
26
20
|
template: `
|
|
27
21
|
<BmsCircularProgress v-bind="args" />
|
|
28
22
|
`,
|
|
29
23
|
});
|
|
30
24
|
|
|
31
25
|
export const NoProgress = Template.bind({});
|
|
32
|
-
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
33
26
|
NoProgress.args = {
|
|
34
27
|
progress: 0,
|
|
35
28
|
};
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import BmsLoader from '@/components/feedback/BmsLoader.vue';
|
|
2
2
|
|
|
3
|
-
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
|
4
3
|
export default {
|
|
5
4
|
title: 'Composants/feedback/Loader',
|
|
6
5
|
component: BmsLoader,
|
|
7
6
|
};
|
|
8
7
|
|
|
9
|
-
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
10
8
|
const Template = (args) => ({
|
|
11
|
-
// Components used in your story `template` are defined in the `components` object
|
|
12
9
|
components: {
|
|
13
10
|
BmsLoader,
|
|
14
11
|
},
|
|
15
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
16
12
|
setup() {
|
|
17
13
|
return { args };
|
|
18
14
|
},
|
|
19
|
-
// And then the `args` are bound to your component with `v-bind="args"`
|
|
20
15
|
template: `
|
|
21
16
|
<BmsLoader v-bind="args">
|
|
22
17
|
This is content
|
|
@@ -25,7 +20,6 @@ const Template = (args) => ({
|
|
|
25
20
|
});
|
|
26
21
|
|
|
27
22
|
export const Primary = Template.bind({});
|
|
28
|
-
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
29
23
|
Primary.args = {
|
|
30
24
|
size: 64,
|
|
31
25
|
};
|