Skip to content

Commit 0652d4e

Browse files
authored
Merge pull request #516 from dnum-mi/develop
Develop
2 parents 7de3ae7 + e21212a commit 0652d4e

File tree

134 files changed

+11414
-15006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+11414
-15006
lines changed

.storybook/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { mergeConfig } from 'vite'
2-
31
module.exports = {
42
stories: ["../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))"],
53
addons: [
64
"@storybook/addon-links",
75
"@storybook/addon-essentials",
6+
"@storybook/addon-styling",
87
"@storybook/addon-interactions",
98
{
109
name: '@storybook/addon-postcss',

.storybook/preview.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as jest from "@storybook/jest"
2-
import { defineComponent } from 'vue'
32
import { setup } from '@storybook/vue3'
3+
import { withThemeByDataAttribute } from "@storybook/addon-styling"
44
import { FocusTrap } from 'focus-trap-vue'
5-
// import '@gouvfr/dsfr/dist/core/core.module.js'
5+
import { defineComponent } from 'vue'
66

77
import '../src/assets/variables-fdr.css'
88
import '@gouvfr/dsfr/dist/dsfr.min.css'
@@ -23,14 +23,6 @@ export const parameters = {
2323
date: /Date$/,
2424
},
2525
},
26-
backgrounds: {
27-
values: [
28-
{name: 'black', value: '#000'},
29-
{name: 'dark', value: '#222'},
30-
{name: 'light', value: '#eee'},
31-
{name: 'white', value: '#fff'},
32-
]
33-
},
3426
viewport: {
3527
viewports: {
3628
DSFR_XS: {
@@ -83,6 +75,17 @@ export const parameters = {
8375
}
8476
}
8577

78+
export const decorators = [
79+
withThemeByDataAttribute({
80+
themes: {
81+
Clair: 'light',
82+
Sombre: 'dark',
83+
},
84+
defaultTheme: 'light',
85+
attributeName: 'data-fr-theme',
86+
})
87+
]
88+
8689

8790
const RouterLink = defineComponent({
8891
name: 'RouterLink',

.storybook/theme.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@
1515
-webkit-box-shadow: none;
1616
box-shadow: none;
1717
}
18+
19+
[data-fr-theme="dark"] .docs-story {
20+
background-color: var(--background-default-grey);
21+
}

cypress/support/component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ declare global {
3535
}
3636
}
3737

38-
Cypress.Commands.add('mount', mount)
38+
Cypress.Commands.add('mount', (component, options = {}) => {
39+
options.global = options.global || {}
40+
options.global.stubs = options.global.stubs || {}
41+
options.global.stubs.transition = false
42+
43+
return mount(component, options)
44+
})
3945

4046
// Example use:
41-
// cy.mount(MyComponent)
47+
// cy.mount(MyComponent)

0 commit comments

Comments
 (0)