1 import { BrowserRouter as Router
} from 'react-router-dom';
9 } from '@proton/components';
10 import InlineIcons
from '@proton/icons/InlineIcons';
11 import { APPS
} from '@proton/shared/lib/constants';
12 import { PROTON_DEFAULT_THEME
, PROTON_THEMES_MAP
, getThemes
} from '@proton/shared/lib/themes/themes';
14 import './prismjs.js';
15 import storybookTheme
from './theme';
17 import '../src/app/index.scss';
19 const colorSchemes
= ['default', 'ui-alias', 'ui-note', 'ui-password', 'ui-login'];
20 const themes
= getThemes(true);
22 export const globalTypes
= {
25 description
: 'Proton theme, globally applied to stories',
26 defaultValue
: PROTON_THEMES_MAP
[PROTON_DEFAULT_THEME
].label
,
29 items
: themes
.map(({ label
}) => label
),
37 description
: 'Pass specific color schemes',
38 defaultValue
: 'default',
41 items
: colorSchemes
.map((label
) => label
),
49 export const decorators
= [
51 const { theme
: themeGlobal
} = context
.globals
;
53 const identifier
= themes
.find((theme
) => theme
.label
=== themeGlobal
)?.identifier
;
55 const initialTheme
= identifier
|| PROTON_DEFAULT_THEME
;
59 <ThemeProvider initial
={initialTheme
} appName
={APPS
.PROTONMAIL
}>
61 <NotificationsProvider
>
63 <NotificationsChildren
/>
67 </NotificationsProvider
>
74 <div className
={context
.globals
.scheme
}>
85 '-theming-explanations-',
92 export const parameters
= {
94 actions
: { argTypesRegex
: '^on[A-Z].*' },
95 controls
: { expanded
: true },
96 docs
: { theme
: storybookTheme
},
98 canvas
: { hidden
: true },
101 storySort
: (a
, b
) => {
105 if (order
.some((name
) => aName
.includes(name
) || bName
.includes(name
))) {
106 const aIdx
= order
.findIndex((i
) => aName
.indexOf(i
) > -1);
107 const bIdx
= order
.findIndex((i
) => bName
.indexOf(i
) > -1);
111 return a
[1].kind
=== b
[1].kind
? 0 : a
[1].id
.localeCompare(b
[1].id
, undefined, { numeric
: true });