Skip to content

Commit

Permalink
feat(806): move props out of overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFinch committed May 16, 2023
2 parents 80110a6 + a3becab commit b2425fb
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 5 deletions.
5 changes: 4 additions & 1 deletion site/components/page-introduction/page-introduction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const heroIsImage = (hero: PageIntroductionProps['hero']): hero is ImageProps =>
Boolean(hero && (hero as any).src);

export const PageIntroduction: React.FC<PageIntroductionProps> = ({
nameAs = 'h1',
introductionAs, // eg 'h2'
type,
name,
introduction,
Expand All @@ -31,7 +33,7 @@ export const PageIntroduction: React.FC<PageIntroductionProps> = ({
</Block>
<Block spaceStack={{xs: 'space050', md: 'space070'}}>
<TextBlock
as="h1"
as={nameAs}
stylePreset="inkContrast"
typographyPreset={{
xs: 'editorialHeadline060',
Expand All @@ -46,6 +48,7 @@ export const PageIntroduction: React.FC<PageIntroductionProps> = ({
<ComponentPageCellCompact>
<Block spaceStack={{xs: 'space070', md: 'space080'}}>
<TextBlock
as={introductionAs}
stylePreset="inkBase"
typographyPreset={{
xs: 'editorialSubheadline010',
Expand Down
2 changes: 2 additions & 0 deletions site/components/page-introduction/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {ImageProps} from 'newskit';

export interface PageIntroductionProps {
nameAs?: 'h1' | 'h2';
introductionAs?: 'h1' | 'h2' | 'h3';
type?: string;
name: string;
introduction: React.ReactNode;
Expand Down
9 changes: 9 additions & 0 deletions site/components/site-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ const SiteFooter: React.FC<FooterProps> = ({cellProps = {xs: 12}}) => (
Terms & conditions
</Link>
</FooterLink>
<FooterLink>
<Link
type="standalone"
href="/help/accessibility-statement"
overrides={linkOverrides}
>
Accessibility
</Link>
</FooterLink>
</FooterMenu>
</InstrumentationProvider>
</Cell>
Expand Down
114 changes: 114 additions & 0 deletions site/pages/help/accessibility-statement.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import React from 'react';
import Layout, {LayoutProps} from '../../components/layout';
import {PageIntroduction} from '../../components/page-introduction';
import {ComponentPageCell} from '../../components/layout-cells';
import {Link} from '../../components/link';
import {HeadNextSeo} from '../../components/head-next-seo';
import {
ContentSection,
ContentSecondary,
ContentColSpan,
} from '../../components/content-structure';

const Accessibility = ({path, ...props}: LayoutProps) => (
<Layout {...props} path={`${path}-new`}>
<HeadNextSeo
title="NewsKit Accessibility Statement"
description="NewsKit Accessibility Statement"
image={{
url: 'social/about.png',
alt: 'NewsKit Accessibility Statement',
}}
/>

<PageIntroduction
nameAs="h1"
introductionAs="h2"
name="NewsKit Accessibility Statement"
introduction={
<>
This accessibility statement applies to the website{' '}
<Link href="https://newskit.co.uk" external={false}>
newskit.co.uk
</Link>
{', '}
which is run by the NewsKit Design System at News UK.
</>
}
/>

<ComponentPageCell>
<ContentSection sectionName="Commitment">
<ContentSecondary
headline="Commitment"
description={
<>
NewsKit is committed to providing a website that is accessible to
the widest possible audience, regardless of technology or ability.
We are actively working to increase accessibility and usability.
</>
}
childrenColSpan={ContentColSpan.TEXT}
/>
</ContentSection>

<ContentSection sectionName="Standards">
<ContentSecondary
headline="Standards"
description={
<>
This website endeavours to meet the Web Content Accessibility
Guidelines (WCAG){' '}
<Link
href="https://www.w3.org/WAI/WCAG2AA-Conformance"
target="_blank"
>
2.1 AA standard
</Link>
. WCAG guidelines explain how to make content accessible for
people with disabilities, but also make the experience better for
all people.
<br />
<br />
Whilst NewsKit strives to adhere to WCAG guidelines and standards
for accessibility, it is not always possible to do so in all areas
of the website. We are working to bring all areas of the site up
to a WCAG 2.1 AA standard.
</>
}
/>
</ContentSection>

<ContentSection sectionName="Feedback">
<ContentSecondary
headline="Feedback"
description={
<>
We welcome your feedback and encourage you to contact us if you
have experienced any difficulty viewing, listening to or
navigating content on this website. We’d also like to hear if you
have identified any content or functionality that you believe is
not accessible to people with disabilities. If you have any
difficulty accessing this website, please contact us at{' '}
<Link href="mailto:[email protected]" target="_blank">
[email protected]
</Link>{' '}
or raise an{' '}
<Link
href="https://github.com/newscorp-ghfb/NewsKit/issues/new/choose"
target="_blank"
>
A11y Investigation ticket
</Link>{' '}
on GitHub. We take your feedback seriously and will apply it to
our ongoing efforts to improve the user experience for all of our
customers.
</>
}
/>
</ContentSection>
</ComponentPageCell>
</Layout>
);

export default Accessibility;
6 changes: 4 additions & 2 deletions site/pages/help/terms-and-conditions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ const Introduction = ({path, ...props}: LayoutProps) => (
}}
/>
<PageIntroduction
nameAs="h1"
introductionAs="h2"
name="Website terms and conditions of use"
introduction={
<>
Welcome to the Website Terms and Conditions of Use (<b>Terms</b>)
which apply to{' '}
<Link href="https://newskit.co.uk/" target="_blank">
https://newskit.co.uk/
<Link href="https://newskit.co.uk" external={false}>
newskit.co.uk
</Link>{' '}
(the <b>Website</b>).
</>
Expand Down
4 changes: 2 additions & 2 deletions site/utils/colors-token-description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ export const INTERFACE_DESCRIPTION = {
'Interface colour complimentary to interfaceInformative010',
interfaceNotice010: 'Background for notice or warning messages',
interfaceNotice020: 'Interface colour complimentary to interfaceNotice010',
interfaceNegative010: 'Background for success messages',
interfaceNegative010: 'Background for error messages',
interfaceNegative020:
'Interface colour complimentary to interfaceNegative010',
interfacePositive010: 'Background for error messages',
interfacePositive010: 'Background for success messages',
interfacePositive020:
'Interface colour complimentary to interfacePositive010',
interfaceSkeleton010:
Expand Down
43 changes: 43 additions & 0 deletions src/icons/__tests__/progress-indicator.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import {IndeterminateProgressIndicator} from '../filled/custom';
import {StorybookCase, StorybookPage} from '../../test/storybook-comps';
import * as React from 'react';
import {Story as StoryType} from '@storybook/react/dist/ts3.9/client/preview/types-6-0';
import {ThemeProvider} from '../../theme';
import {createCustomThemeWithBaseThemeSwitch} from '../../test/theme-select-object';

export const StoryProgressIndicator = () => (
<StorybookPage columns="repeat(5, 1fr)">
<StorybookCase>
<IndeterminateProgressIndicator />
</StorybookCase>
</StorybookPage>
);
StoryProgressIndicator.storyName = 'Default';
StoryProgressIndicator.parameters = {
percy: {skip: true},
};

export default {
title: 'Components/Progress indicator',
component: () => 'None',
parameters: {
nkDocs: {
title: 'Progress indicator',
url: 'https://newskit.co.uk/components/progress-indicator/',
description:
'The progress indicator shows the progression of a system operation such as downloading, uploading, processing, etc. in a visual way.',
},
},
decorators: [
(Story: StoryType, context: {globals: {backgrounds: {value: string}}}) => (
<ThemeProvider
theme={createCustomThemeWithBaseThemeSwitch(
context?.globals?.backgrounds?.value,
{},
)}
>
<Story />
</ThemeProvider>
),
],
};

0 comments on commit b2425fb

Please sign in to comment.