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

Commit

Permalink
Merge branch 'latest' of github.com:bbc/psammead into 6143-add-AMP-ad…
Browse files Browse the repository at this point in the history
…-script-to-boilerplate
  • Loading branch information
Ruth Ogendi committed Apr 14, 2020
2 parents 86036d5 + 81401fe commit 61bd745
Show file tree
Hide file tree
Showing 19 changed files with 492 additions and 271 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 2.0.120 | [PR#3359](https://github.com/bbc/psammead/pull/3359) Talos - Bump Dependencies - @bbc/psammead-brand, @bbc/psammead-bulletin |
| 2.0.119 | [PR#3356](https://github.com/bbc/psammead/pull/3356) Talos - Bump Dependencies - @bbc/psammead-radio-schedule, @bbc/psammead-story-promo |
| 2.0.118 | [PR#3354](https://github.com/bbc/psammead/pull/3354) Talos - Bump Dependencies - @bbc/psammead-calendars, @bbc/psammead-timestamp-container |
| 2.0.117 | [PR#3353](https://github.com/bbc/psammead/pull/3353) Talos - Bump Dependencies - @bbc/psammead-locales |
Expand Down
28 changes: 8 additions & 20 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead",
"version": "2.0.119",
"version": "2.0.120",
"description": "Core Components Library Developed & Maintained By The Articles and Reach & Languages Team",
"main": "index.js",
"private": true,
Expand Down Expand Up @@ -52,9 +52,9 @@
"@bbc/moment-timezone-include": "^1.1.4",
"@bbc/psammead-amp-geo": "^1.1.2",
"@bbc/psammead-assets": "^2.13.0",
"@bbc/psammead-brand": "^5.1.15",
"@bbc/psammead-brand": "^5.1.16",
"@bbc/psammead-bulleted-list": "^1.0.7",
"@bbc/psammead-bulletin": "^3.0.1",
"@bbc/psammead-bulletin": "^3.0.2",
"@bbc/psammead-byline": "^1.0.2",
"@bbc/psammead-calendars": "^2.0.10",
"@bbc/psammead-caption": "^2.2.26",
Expand Down
13 changes: 7 additions & 6 deletions packages/components/psammead-social-embed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Social Embed Changelog

| Version | Description |
|---------------|---------------|
| 0.1.0-alpha.4 | [PR#3319](https://github.com/bbc/psammead/pull/3319) Remove dependency on @bbc/psammead-oembed. |
| 0.1.0-alpha.3 | [PR#3311](https://github.com/bbc/psammead/pull/3311) Transpile with @loadable/babel-plugin. |
| 0.1.0-alpha.2 | [PR#3298](https://github.com/bbc/psammead/pull/3298) Add webpackChunkName to dynamic import. |
| 0.1.0-alpha.1 | [PR#3217](https://github.com/bbc/psammead/pull/3217) Initial creation of package. |
| Version | Description |
| ------------- | ------------------------------------------------------------------------------------------------- |
| 1.0.0 | [PR#3349](https://github.com/bbc/psammead/pull/3349) Resolve a11y issues and release version one. |
| 0.1.0-alpha.4 | [PR#3319](https://github.com/bbc/psammead/pull/3319) Remove dependency on @bbc/psammead-oembed. |
| 0.1.0-alpha.3 | [PR#3311](https://github.com/bbc/psammead/pull/3311) Transpile with @loadable/babel-plugin. |
| 0.1.0-alpha.2 | [PR#3298](https://github.com/bbc/psammead/pull/3298) Add webpackChunkName to dynamic import. |
| 0.1.0-alpha.1 | [PR#3217](https://github.com/bbc/psammead/pull/3217) Initial creation of package. |
4 changes: 0 additions & 4 deletions packages/components/psammead-social-embed/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# ⛔️ 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-social-embed - [![Known Vulnerabilities](https://snyk.io/test/github/bbc/psammead/badge.svg?targetFile=packages%2Fcomponents%2Fpsammead-social-embed%2Fpackage.json)](https://snyk.io/test/github/bbc/psammead?targetFile=packages%2Fcomponents%2Fpsammead-social-embed%2Fpackage.json) [![Dependency Status](https://david-dm.org/bbc/psammead.svg?path=packages/components/psammead-social-embed)](https://david-dm.org/bbc/psammead?path=packages/components/psammead-social-embed) [![peerDependencies Status](https://david-dm.org/bbc/psammead/peer-status.svg?path=packages/components/psammead-social-embed)](https://david-dm.org/bbc/psammead?path=packages/components/psammead-social-embed&type=peer) [![Storybook](https://raw.githubusercontent.com/storybooks/brand/master/badge/badge-storybook.svg?sanitize=true)](https://bbc.github.io/psammead/?path=/story/social-embed--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-social-embed.svg)](https://www.npmjs.com/package/@bbc/psammead-social-embed) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/bbc/psammead/blob/latest/CONTRIBUTING.md)

## Description
Expand Down

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

5 changes: 1 addition & 4 deletions packages/components/psammead-social-embed/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "@bbc/psammead-social-embed",
"version": "0.1.0-alpha.4",
"publishConfig": {
"tag": "alpha"
},
"version": "1.0.0",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
36 changes: 23 additions & 13 deletions packages/components/psammead-social-embed/src/Notice/index.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React, { memo } from 'react';
import { string } from 'prop-types';
import styled from 'styled-components';
import { C_EBON, C_PEBBLE } from '@bbc/psammead-styles/colours';
import { C_EBON, C_PEBBLE, C_METAL } from '@bbc/psammead-styles/colours';
import { getSansRegular, getSansBold } from '@bbc/psammead-styles/font-styles';
import { GEL_SPACING_DBL, GEL_SPACING } from '@bbc/gel-foundations/spacings';
import { GEL_BODY_COPY, GEL_MINION } from '@bbc/gel-foundations/typography';

import {
detokenise,
dictionaryFactory,
visuallyHiddenStyle,
} from '../utilities';
import { detokenise, dictionaryFactory } from '../utilities';

const BORDER_WEIGHT = '0.0625rem';

Expand All @@ -34,10 +30,16 @@ const Wrapper = styled.div`
a {
${({ service }) => getSansBold(service)}
color: inherit;
text-decoration: none;
> span {
${visuallyHiddenStyle}
&:visited {
color: ${C_METAL};
}
&:hover,
&:focus {
text-decoration: underline;
}
}
Expand All @@ -57,14 +59,22 @@ const Notice = ({
warningText,
}) => {
const dictionary = dictionaryFactory({ provider });
const [detokenisedLinkText, detokenisedLinkTextSuffix] = [
detokenise(linkText, dictionary),
detokenise(linkTextSuffixVisuallyHidden, dictionary),
];

return (
<Wrapper service={service}>
<p>{detokenise(text, dictionary)}</p>
<a href={linkHref}>
{detokenise(linkText, dictionary)}
{linkTextSuffixVisuallyHidden && (
<span>{detokenise(linkTextSuffixVisuallyHidden, dictionary)}</span>
)}
<a
href={linkHref}
aria-label={
detokenisedLinkTextSuffix &&
`${detokenisedLinkText}${detokenisedLinkTextSuffix}`
}
>
{detokenisedLinkText}
</a>
{warningText && <small>{warningText}</small>}
</Wrapper>
Expand Down
Loading

0 comments on commit 61bd745

Please sign in to comment.