Skip to content

Commit 04f925e

Browse files
authored
Add Media options, add Media Summary component, deprecate Event Summary component (#1954)
* Add element class properties to media object * Add Media Summary component * Add deprecation statuses
1 parent 1c7f142 commit 04f925e

File tree

15 files changed

+295
-5
lines changed

15 files changed

+295
-5
lines changed

.changeset/lovely-pans-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': patch
3+
---
4+
5+
Deprecated the Button Swap component

.changeset/short-clouds-buy.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@cloudfour/patterns': minor
3+
---
4+
5+
- Add Media Summary component, extending the Media object for linked content summaries (events, books, projects, etc.)
6+
- Deprecated the Event Summary component

.changeset/tricky-poems-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': minor
3+
---
4+
5+
Add `object_class` and `content_class` properties to the Media object template to make it more extensible

.storybook/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ module.exports = {
1919
},
2020
},
2121
'@storybook/addon-a11y',
22-
'storybook-mobile',
22+
// Disabling these two until they are fixed upstream
23+
// 'storybook-mobile',
24+
// '@whitespace/storybook-addon-html',
2325
'storybook-addon-outline',
24-
'@whitespace/storybook-addon-html',
26+
'@etchteam/storybook-addon-status',
2527
'@storybook/addon-postcss',
2628
],
2729
managerHead: (head) => {

package-lock.json

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@changesets/changelog-github": "0.4.5",
5050
"@changesets/cli": "2.23.1",
5151
"@cloudfour/eslint-plugin": "20.0.2",
52+
"@etchteam/storybook-addon-status": "^4.2.1",
5253
"@rollup/plugin-babel": "5.3.1",
5354
"@rollup/plugin-node-resolve": "13.3.0",
5455
"@storybook/addon-a11y": "6.5.9",

src/components/button-swap/button-swap.stories.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import buttonSwap from './button-swap.twig';
44

55
<Meta
66
title="Components/Button Swap"
7+
parameters={{ status: { type: 'deprecated' } }}
78
argTypes={{
89
content_start_icon: {
910
options: ['bell', 'magnifying-glass'],
@@ -19,6 +20,8 @@ import buttonSwap from './button-swap.twig';
1920

2021
# Button Swap
2122

23+
**Note:** This component has been deprecated and will be removed in a future update.
24+
2225
The Button Swap component was built with the article Push Notifications use case in mind. It has two buttons that are swapped on click representing two visual states accompanied with visually hidden text for a more inclusive experience.
2326

2427
You have the ability to pass `initialCallback` and `swappedCallback` callback functions to the `initButtonSwap` initialization function to add custom actions for when each of the buttons is clicked.

src/components/event-summary/event-summary.stories.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import { Canvas, Meta, Story } from '@storybook/addon-docs';
22
import template from './event-summary.twig';
33

4-
<Meta title="Components/Event Summary" />
4+
<Meta
5+
title="Components/Event Summary"
6+
parameters={{ status: { type: 'deprecated' } }}
7+
/>
58

69
# Event Summary
710

11+
**Note:** This component has been deprecated, please use the [Media Summary component](/docs/components-media-summary--event) instead.
12+
813
Combines the [Media object](/docs/objects-media--image) and [Calendar Date component](/docs/components-calendar-date--basic) to display information for an upcoming speaking event.
914

1015
<Canvas>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% embed '@cloudfour/components/media-summary/media-summary.twig' with {
2+
heading: "Progressive Web Apps",
3+
href: "https://cloudfour.com/thinks/progressive-web-apps-book-now-available/",
4+
reverse_markup: true,
5+
align_start: true,
6+
class: 'o-media--1-by-2@l',
7+
} only %}
8+
{% block object %}
9+
<img src="/media/home-page/bookicon.png" width="730" height="992" alt="" style="width: 7em;">
10+
{% endblock %}
11+
{% block content %}
12+
<p>Progressive web apps represent the next big digital opportunity: they look and feel like native apps, they work offline, and they’re available to anyone—no app store required.</p>
13+
{% endblock %}
14+
{% endembed %}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% embed '@cloudfour/components/media-summary/media-summary.twig' with {
2+
heading: "Smashing Magazine",
3+
href: "https://cloudfour.com",
4+
reverse_markup: true,
5+
} only %}
6+
{% block object %}
7+
{% include '@cloudfour/components/calendar-date/calendar-date.twig' with {
8+
"datetime": "2022-07-14T23:25:59.626Z",
9+
"note": "3-day event"
10+
} only %}
11+
{% endblock %}
12+
{% block content %}
13+
<p>New York, NY</p>
14+
<p>Speakers: Megan, Aileen</p>
15+
{% endblock %}
16+
{% endembed %}

0 commit comments

Comments
 (0)