3.0.31 • Published 3 years ago

@bbc/psammead-copyright v3.0.31

Weekly downloads
1,377
License
Apache-2.0
Repository
github
Last release
3 years ago

psammead-copyright - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Description

Displays a source attribution in block capitals in the bottom-right of the parent element. This implementation is primarily intended for use alongside images.

Installation

npm install @bbc/psammead-copyright

Props

ArgumentTypeRequiredDefaultExample
No props.

Usage

Commonly used alongside psammead-figure, psammead-image and psammead-image-placeholder. Can also pass in psammead-visually-hidden-text in order to announce the component.

const WrapperComponent = ({ alt, ratio, src, width }) => (
  <Figure>
    <ImagePlaceholder ratio={ratio}>
      <Image alt={alt} src={src} width={width} />
      <Copyright>
        <VisuallyHiddenText>Image source, </VisuallyHiddenText>
        Getty Images
      </Copyright>
    </ImagePlaceholder>
  </Figure>
);

When to use this component

This component is intended to be used alongside images or diagrams contained within a Figure component.

When not to use this component

This component should not be used arbitrarily to represent source attribution across the page. As above, it is not intended to be used outside the Figure component. The accessibility text would be incorrect and potentially confusing.

Do not use this component if you know the source attribution is already covered by another copyright disclosure on the page.

Accessibility notes

The default styling of this component is intended to comply with WCAG colour contrast standards.

The VisuallyHiddenText component can be used as a child of Copyright to add additional context to screen reader users. An example of this can be found in our storybook

This component uses aria role text, to stop 'text splitting' that is observed when using VoiceOver on iPhone and therefore improve the screen reader UX. Without this, the image source element is 2 swipes on VoiceOver (left to right), one for 'Image source' and one for the actual source such as 'Getty images'.

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 respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.

3.0.30

3 years ago

3.0.31

3 years ago

3.0.29

3 years ago

3.0.28

3 years ago

3.0.27

3 years ago

3.0.24

3 years ago

3.0.25

3 years ago

3.0.26

3 years ago

3.0.23

3 years ago

3.0.22

3 years ago

3.0.21

3 years ago

3.0.20

3 years ago

3.0.19

3 years ago

3.0.18

3 years ago

3.0.17

4 years ago

3.0.16

4 years ago

3.0.15

4 years ago

3.0.14

4 years ago

3.0.13

4 years ago

3.0.12

4 years ago

3.0.11

4 years ago

3.0.10

4 years ago

3.0.9

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0-alpha.0

4 years ago

1.2.35

4 years ago

1.2.34

4 years ago

1.2.33

4 years ago

1.2.32

4 years ago

1.2.31

4 years ago

1.2.29

4 years ago

1.2.30

4 years ago

1.2.28

4 years ago

1.2.27

4 years ago

1.2.26

5 years ago

1.2.25

5 years ago

1.2.24

5 years ago

1.2.23

5 years ago

1.2.22

5 years ago

1.2.20

5 years ago

1.2.21

5 years ago

1.2.19

5 years ago

1.2.17

5 years ago

1.2.18

5 years ago

1.2.16

5 years ago

1.2.15

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago