Skip to content

Commit 37527d1

Browse files
authored
Added additional agenda stories (#1129)
1 parent 05ee2b6 commit 37527d1

File tree

6 files changed

+366
-15
lines changed

6 files changed

+366
-15
lines changed

.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
}
1717
}
1818
],
19-
stories: ['../stories/**/*.stories.(js|mdx)'],
19+
stories: ['../stories/**/*.(js|mdx)'],
2020
addons: [
2121
// '@storybook/addon-a11y/register',
2222
// '@storybook/addon-actions/register',

.storybook/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ addParameters({
2727
});
2828

2929
// force full reload to not reregister web components
30-
const req = require.context('../stories', true, /\.stories\.(js|mdx)$/);
30+
const req = require.context('../stories', true, /\.(js|mdx)$/);
3131
configure(req, module);
3232
if (module.hot) {
3333
module.hot.accept(req.id, () => {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* -------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4+
* See License in the project root for license information.
5+
* -------------------------------------------------------------------------------------------
6+
*/
7+
8+
import { html } from 'lit-element';
9+
import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon';
10+
11+
export default {
12+
title: 'Components | mgt-agenda',
13+
component: 'mgt-agenda',
14+
decorators: [withCodeEditor]
15+
};
16+
17+
export const simple = () => html`
18+
<mgt-agenda></mgt-agenda>
19+
`;
20+
21+
export const events = () => html`
22+
<!-- Open dev console and click on an event -->
23+
<!-- See js tab for event subscription -->
24+
25+
<mgt-agenda></mgt-agenda>
26+
<script>
27+
const agenda = document.querySelector('mgt-agenda');
28+
agenda.addEventListener('eventClick', (e) => {
29+
console.log(e.detail.event);
30+
})
31+
</script>
32+
`;
33+
34+
export const RTL = () => html`
35+
<mgt-agenda dir="rtl"></mgt-agenda>
36+
`;
37+

stories/components/agenda.stories.js renamed to stories/components/agenda/agenda.properties.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66
*/
77

88
import { html } from 'lit-element';
9-
import { withCodeEditor } from '../../.storybook/addons/codeEditorAddon/codeAddon';
9+
import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon';
1010

1111
export default {
12-
title: 'Components | mgt-agenda',
12+
title: 'Components / mgt-agenda / Properties',
1313
component: 'mgt-agenda',
1414
decorators: [withCodeEditor]
1515
};
1616

17-
export const simple = () => html`
18-
<mgt-agenda></mgt-agenda>
19-
`;
20-
2117
export const getByEventQuery = () => html`
2218
<mgt-agenda event-query="/me/events?orderby=start/dateTime"></mgt-agenda>
2319
`;
2420

21+
export const groupByDay = () => html`
22+
<mgt-agenda group-by-day></mgt-agenda>
23+
`;
24+
25+
export const showMax = () => html`
26+
<mgt-agenda show-max="4"></mgt-agenda>
27+
`;
28+
2529
export const getByDate = () => html`
2630
<mgt-agenda group-by-day date="May 7, 2019" days="3"></mgt-agenda>
2731
`;
@@ -30,11 +34,7 @@ export const getEventsForNextWeek = () => html`
3034
<mgt-agenda group-by-day days="7"></mgt-agenda>
3135
`;
3236

33-
export const darkTheme = () => html`
34-
<mgt-agenda group-by-day days="7" class="mgt-dark"></mgt-agenda>
35-
<style>
36-
body {
37-
background-color: black;
38-
}
39-
</style>
37+
export const preferredTimezone = () => html`
38+
<mgt-agenda preferred-timezone="Europe/Paris"></mgt-agenda>
4039
`;
40+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* -------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4+
* See License in the project root for license information.
5+
* -------------------------------------------------------------------------------------------
6+
*/
7+
8+
import { html } from 'lit-element';
9+
import { withCodeEditor } from '../../../.storybook/addons/codeEditorAddon/codeAddon';
10+
11+
export default {
12+
title: 'Components / mgt-agenda / Style',
13+
component: 'mgt-agenda',
14+
decorators: [withCodeEditor]
15+
};
16+
17+
export const darkTheme = () => html`
18+
<mgt-agenda class="mgt-dark"></mgt-agenda>
19+
<style>
20+
body {
21+
background-color: black;
22+
}
23+
</style>
24+
`;
25+
26+
export const customProperties = () => html`
27+
<mgt-agenda group-by-day></mgt-agenda>
28+
<style>
29+
mgt-agenda {
30+
--event-box-shadow: 0px 2px 30px pink;
31+
--event-margin: 0px 10px 40px 10px;
32+
--event-padding: 8px 0px;
33+
--event-background-color: pink;
34+
--event-border: dotted 2px white;
35+
36+
--agenda-header-margin: 3px;
37+
--agenda-header-font-size: 20px;
38+
--agenda-header-color: pink;
39+
40+
--event-time-font-size: 20px;
41+
--event-time-color: white;
42+
43+
--event-subject-font-size: 12px;
44+
--event-subject-color: white;
45+
46+
--event-location-font-size: 20px;
47+
--event-location-color: white;
48+
}
49+
</style>
50+
`;

0 commit comments

Comments
 (0)