Add intended audience signifier#86
Conversation
Dependency Compatibility Matrix
|
ea37775 to
ab22b8c
Compare
coldlink
left a comment
There was a problem hiding this comment.
reviewed with @oliverabrahams
| import { IntendedAudienceSignifier } from './IntendedAudienceSignifier'; | ||
|
|
||
| const meta = { | ||
| title: 'Stand/Tools Design System/Components/IntendedAudienceSignifier', |
There was a problem hiding this comment.
| title: 'Stand/Tools Design System/Components/IntendedAudienceSignifier', | |
| title: 'Stand/Editorial Components/IntendedAudienceSignifier', |
This seems like an Editorial specific component to me, so this component should sit under that section of the documentation
| color: ${theme.color}; | ||
| border-width: 1px; | ||
| border-style: solid; | ||
| border-color: ${theme.color}; | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: center; | ||
| align-items: center; | ||
| border-radius: 2px; | ||
| padding: 2px 4px; | ||
| box-sizing: border-box; | ||
| width: fit-content; | ||
| gap: 8px; |
There was a problem hiding this comment.
All style values should be added to the theme property through style dictionary, i.e in the intendedAudienceSignifier.json file, similar to other components in stand.
| color: var(--component-intended-audience-signifier-color); | ||
| border-width: 1px; | ||
| border-style: solid; | ||
| border-color: var(--component-intended-audience-signifier-color); | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: center; | ||
| align-items: center; | ||
| border-radius: 2px; | ||
| padding: 2px 4px; | ||
| box-sizing: border-box; | ||
| width: fit-content; | ||
| gap: 8px; |
There was a problem hiding this comment.
once the tokens have been added and built using pnpm run build-styled, the hard coded values can also be replaced with css variables
| color: \${componentIntendedAudienceSignifier.color}; | ||
| border-width: 1px; | ||
| border-style: solid; | ||
| border-color: \${componentIntendedAudienceSignifier.color}; | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: center; | ||
| align-items: center; | ||
| border-radius: 2px; | ||
| padding: 2px 4px; | ||
| box-sizing: border-box; | ||
| width: fit-content; | ||
| gap: 8px; |
There was a problem hiding this comment.
likewise for these tokens too which will be available under componentIntendedAudienceSignifier
| export const defaultIntendedAudienceSignifierTheme: IntendedAudienceSignifierTheme = | ||
| componentIntendedAudienceSignifier; | ||
|
|
||
| export const intendedAudienceSignifierStyles = ( |
There was a problem hiding this comment.
it might be nice to have styles that control the size of the svg icons within the component
| export { componentIntendedAudienceSignifier } from './styleD/build/typescript/component/intendedAudienceSignifier'; | ||
| export type { ComponentIntendedAudienceSignifier } from './styleD/build/typescript/component/intendedAudienceSignifier'; |
There was a problem hiding this comment.
Can we move this to under the editorial components tokens exports sections (line 9 and below)
|
it will also need a changeset ( |
What does this change?
Adds the Intended Audience Signifier component to be used in Composer and Workflow
How has this change been tested?
Storybook and sandbox
Intended Audience Signifier
The IntendedAudienceSignifier component is a visual indicator of the intended audience for a piece of content. It's determined by the Production Office assigned to an article and the readership level intended for that.
When to use
Peer dependencies
@emotion/reactreactreact-domreact-aria-componentstypescriptSee the
peerDependenciessection ofpackage.jsonfor compatible versions.See custom component build for usage without React/Emotion.
Example usage
export type Source = 'UK' | 'US' | 'AUS';
export type IntendedAudience =
| 'Global'
| 'Domestic for Domestic'
| 'Domestic For Global'
| "Don't know"
| 'UK'
| 'US'
| 'AUS';
Props
sourceSourceUK,US,AUS.intendedAudienceIntendedAudienceGlobal,Domestic for Domestic,Domestic For Global,Don't know,UK,US,AUS.themePartial<IntendedAudienceSignifierTheme>cssOverridesSerializedStyles | SerializedStyles[]classNamestringCustomisation
Can customise the component using
themeandcssOverridesas required.CSS overrides
Pass custom Emotion styles with
cssOverrides:Custom Component Build
If you're not using React/Emotion, you can create a custom IntendedAudienceSignifier component using the styles defined in the
IntendedAudienceSignifierThemetype.cssYou can import the IntendedAudienceSignifier styles as CSS from the package:
TypeScript/JavaScript
Use the
componentIntendedAudienceSignifiervariable and theComponentIntendedAudienceSignifiertype:Images