Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Add program card component to radio-schedule #2938

Merged
merged 76 commits into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
f67dc2f
Create radio schedule package
EinsteinNjoroge Jan 15, 2020
fdb80bb
Add element styling and storybook story
EinsteinNjoroge Jan 15, 2020
3df4c3e
added duration wrapper and some edits
itimirichard Jan 16, 2020
b2f2bda
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 16, 2020
022525d
Rename package to psammead-program-card
EinsteinNjoroge Jan 16, 2020
e58013d
Fix header padding
EinsteinNjoroge Jan 16, 2020
179208f
Update psammead-styles
EinsteinNjoroge Jan 16, 2020
b054d00
styling programe card
itimirichard Jan 17, 2020
395bacd
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 17, 2020
979bb99
make whole program card a link
itimirichard Jan 17, 2020
bbef4e3
Merge branch 'latest' into create-radio-schedules-component
itimirichard Jan 20, 2020
48e8b6f
wrap header with Link
itimirichard Jan 20, 2020
b21dae2
changed DateWrapper to TitleWrapper
itimirichard Jan 20, 2020
ceb596b
Add prop-type validation
EinsteinNjoroge Jan 20, 2020
cf3eefb
Create radio-schedule component package
EinsteinNjoroge Jan 20, 2020
757a12a
Merge branch 'latest' into create-radio-schedule-component-package
EinsteinNjoroge Jan 20, 2020
9f90dc2
Update packages/components/psammead-radio-schedule/CHANGELOG.md
EinsteinNjoroge Jan 20, 2020
a88f105
Merge branches 'create-radio-schedule-component-package' and 'create-…
EinsteinNjoroge Jan 20, 2020
12015bf
Move program card to radio-schedule package, add snapshot tests
EinsteinNjoroge Jan 20, 2020
2cd9e98
Remove program-card package
EinsteinNjoroge Jan 20, 2020
d199fbe
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 20, 2020
e4c5213
Add documentation
EinsteinNjoroge Jan 20, 2020
0dda670
Use state translation on header labels, add test helpers and RTL story
EinsteinNjoroge Jan 20, 2020
d4881e0
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 21, 2020
d73dec1
fix package-lock.json
EinsteinNjoroge Jan 21, 2020
e1f1f9e
Fix state prop-types
EinsteinNjoroge Jan 21, 2020
9e53068
Update CHANGELOG.md
EinsteinNjoroge Jan 21, 2020
c796ee5
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 21, 2020
c219877
remove unused prop 'dir' and fixed proptype error
itimirichard Jan 22, 2020
fdbfd48
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 22, 2020
899c96a
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 22, 2020
6a80828
Merge branch 'latest' into create-radio-schedules-component
PriyaKR Jan 22, 2020
3636470
Merge branch 'latest' into create-radio-schedules-component
PriyaKR Jan 22, 2020
7c079e5
moved Link into Heading component, aria-hidden
itimirichard Jan 22, 2020
9bd01c5
updates
itimirichard Jan 22, 2020
5484da0
Merge branch 'latest' into create-radio-schedules-component
OlgaLyubin Jan 22, 2020
955d4ae
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 23, 2020
879f3d7
a11y fixes
itimirichard Jan 23, 2020
68ca817
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 23, 2020
c395978
added border
itimirichard Jan 23, 2020
321818a
Merge branch 'create-radio-schedules-component' of https://github.com…
itimirichard Jan 23, 2020
9336615
Update snapshots
EinsteinNjoroge Jan 23, 2020
d529c87
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 23, 2020
10538f6
proptype cleanup and refactor
itimirichard Jan 23, 2020
2d5a250
Merge branch 'create-radio-schedules-component' of https://github.com…
itimirichard Jan 23, 2020
7442b9e
update snapshots
itimirichard Jan 23, 2020
0e120be
Update snapshots
EinsteinNjoroge Jan 23, 2020
472419c
Remove `lang` from props, add `durationText` translation
EinsteinNjoroge Jan 23, 2020
6fe43b9
Separate `Live,` hidden text from title
EinsteinNjoroge Jan 23, 2020
3a1a8e7
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 24, 2020
e5fce34
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 24, 2020
f1dfe53
Flatten state and duration objects, update readme
EinsteinNjoroge Jan 24, 2020
1c47c59
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 24, 2020
91c1013
Update packages/components/psammead-radio-schedule/src/ProgramCard/in…
EinsteinNjoroge Jan 27, 2020
2ee6e80
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 27, 2020
d6c0c56
Code refactor
EinsteinNjoroge Jan 27, 2020
3ac09bf
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 27, 2020
93355b0
Refactor for accessibility
EinsteinNjoroge Jan 28, 2020
e88d0da
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 28, 2020
ff393e2
Fix duration wrapper
EinsteinNjoroge Jan 28, 2020
1998b9c
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 28, 2020
8c15ead
Show state label's hidden text on live only
EinsteinNjoroge Jan 28, 2020
657de62
merge pull
EinsteinNjoroge Jan 28, 2020
7d7ed10
Show state label's hidden text on live only
EinsteinNjoroge Jan 28, 2020
77abc2a
Fix hidden text in non-css view
EinsteinNjoroge Jan 28, 2020
bf8b40c
Fix aria-hidden for state label
EinsteinNjoroge Jan 28, 2020
eaf1e07
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 29, 2020
94de47d
Move `sentenceCase` to helper
EinsteinNjoroge Jan 29, 2020
d64a8b3
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 29, 2020
d04cb80
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 29, 2020
0e9d46e
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 30, 2020
175322a
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 30, 2020
ac0bd41
Update packages/components/psammead-radio-schedule/README.md
EinsteinNjoroge Jan 30, 2020
1d0f729
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 30, 2020
d116eb1
Update package.json
EinsteinNjoroge Jan 30, 2020
5a5faac
Merge branch 'latest' into create-radio-schedules-component
EinsteinNjoroge Jan 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/components/psammead-radio-schedule/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Radio Schedule Changelog

| Version | Description |
|---------|-------------|
| 0.1.0-alpha.2 | [PR#2938](https://github.com/BBC-News/psammead/pull/2938) Add radio program card component. |
thekp marked this conversation as resolved.
Show resolved Hide resolved
| 0.1.0-alpha.1 | [PR#2979](https://github.com/BBC-News/psammead/pull/2979) Initial creation of package. |

88 changes: 88 additions & 0 deletions packages/components/psammead-radio-schedule/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# ⛔️ This is an alpha component ⛔️

This component is currently tagged as alpha and is not suitable for production use. Following the passing of an accessibility review this component will be marked as ready for production and the alpha tag removed.

# psammead-radio-schedule - [![Known Vulnerabilities](https://snyk.io/test/github/bbc/psammead/badge.svg?targetFile=packages%2Fcomponents%2Fpsammead-radio-schedule%2Fpackage.json)](https://snyk.io/test/github/bbc/psammead?targetFile=packages%2Fcomponents%2Fpsammead-radio-schedule%2Fpackage.json) [![Dependency Status](https://david-dm.org/bbc/psammead.svg?path=packages/components/psammead-radio-schedule)](https://david-dm.org/bbc/psammead?path=packages/components/psammead-radio-schedule) [![peerDependencies Status](https://david-dm.org/bbc/psammead/peer-status.svg?path=packages/components/psammead-radio-schedule)](https://david-dm.org/bbc/psammead?path=packages/components/psammead-radio-schedule&type=peer) [![Storybook](https://raw.githubusercontent.com/storybooks/brand/master/badge/badge-storybook.svg?sanitize=true)](https://bbc.github.io/psammead/?path=/story/radio-schedule--containing-image) [![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/bbc/psammead/blob/latest/LICENSE) [![npm version](https://img.shields.io/npm/v/@bbc/psammead-radio-schedule.svg)](https://www.npmjs.com/package/@bbc/psammead-radio-schedule) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/bbc/psammead/blob/latest/CONTRIBUTING.md)

## Description

The `RadioSchedule` component is designed to display radio schedule programs in their different states. Currently, the component comprises of a `ProgramCard` which is comprised of a link to the radio-schedule, a state label, brand and episode titles, a summary, and a duration.

## Installation

```jsx
npm install @bbc/psammead-radio-schedule --save
```

## Components (WIP)

## ProgramCard

### Props

<!-- prettier-ignore -->
| Argument | Type | Required | Default | Example |
| -------- | ---- | -------- | ------- | ------- |
| brandTitle | string | yes | N/A | `'This is a brand title'` |
| summary | string | yes | N/A | `'This is a summary'` |
| episodeTitle | string | yes | N/A | `'29/01/1990'` |
| duration | string | yes | N/A | `'30:00'` |
| durationLabel | string | yes | N/A | `'duration'` |
| state | string | yes | N/A | `'live'` |
| stateLabel | string | yes | N/A | `'مباشر'` |
| link | string | yes | N/A | `'https://bbc.com/arabic/articles/c1er5mjnznzo'` |
| startTime | string | yes | N/A | `13:00` |
| service | string | yes | N/A | `'news'` |
| script | object | yes | N/A | `{ canon: { groupA: { fontSize: '28', lineHeight: '32',}, groupB: { fontSize: '32', lineHeight: '36', }, groupD: { fontSize: '44', lineHeight: '48', }, }, trafalgar: { groupA: { fontSize: '20', lineHeight: '24', }, groupB: { fontSize: '24', lineHeight: '28', }, groupD: { fontSize: '32', lineHeight: '36', }, }, }` |
| dir | string | no | `"ltr"` | `"rtl"` |

### Usage

This component displays a single link as program card with a brand title, an episode title, a summary and a duration.

```jsx
import React from 'react';
import { latin } from '@bbc/gel-foundations/scripts';
import ProgramCard from '@bbc/psammead-radio-schedule/ProgramCard';

<ProgramCard
service="news"
script={latin}
dir="ltr"
startTime="13:00"
brandTitle="This is a brand title"
summary="Could a computer ever create better art than a human?"
episodeTitle="29/01/1990"
duration="30:00"
durationLabel="duration"
state="live"
EinsteinNjoroge marked this conversation as resolved.
Show resolved Hide resolved
stateLabel="Live"
link="https://bbc.com/arabic/articles/c1er5mjnznzo"
/>;
```

### When to use this component

This component is to be used initially on the `front pages`, and media pages.

### When not to use this component

<!-- Description of the where the component shouldn't can be used -->

### Accessibility notes

Currently this component is in alpha. This is because it has not yet been tested with various assistive technologies. After it has had an accessibility swarm, this will be published under a standard version.

### Roadmap

## Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at [the root of the Psammead repository](https://github.com/bbc/psammead/blob/latest/CONTRIBUTING.md).

### [Code of Conduct](https://github.com/bbc/psammead/blob/latest/CODE_OF_CONDUCT.md)

We welcome feedback and help on this work. By participating in this project, you agree to abide by the [code of conduct](https://github.com/bbc/psammead/blob/latest/CODE_OF_CONDUCT.md). Please take a moment to read it.

### License

Psammead is [Apache 2.0 licensed](https://github.com/bbc/psammead/blob/latest/LICENSE).
5 changes: 5 additions & 0 deletions packages/components/psammead-radio-schedule/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions packages/components/psammead-radio-schedule/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@bbc/psammead-radio-schedule",
"version": "0.1.0-alpha.2",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
"description": "Component package for radio schedule components",
"repository": {
"type": "git",
"url": "https://github.com/BBC-News/psammead/tree/latest/packages/components/psammead-radio-schedule"
},
"author": {
"name": "Psammead Maintainers",
"email": "[email protected]"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/bbc/psammead/issues"
},
"homepage": "https://github.com/BBC-News/psammead/blob/latest/packages/components/psammead-radio-schedule/README.md",
"dependencies": {},
"peerDependencies": {
"react": "^16.12.0"
},
"keywords": [
"bbc",
"radio",
"schedule"
],
"publishConfig": {
"tag": "alpha"
}
EinsteinNjoroge marked this conversation as resolved.
Show resolved Hide resolved
}
Loading