diff --git a/apps/site/keystatic.config.ts b/apps/site/keystatic.config.ts index 3d928327b..db7b2a387 100644 --- a/apps/site/keystatic.config.ts +++ b/apps/site/keystatic.config.ts @@ -163,17 +163,26 @@ export default config({ links: true, label: 'Accessibility Demo', }), - relatedInformation: fields.array( - fields.relationship({ - label: 'Related components', - description: 'A list of related components', - collection: 'designSystem', + relatedComponents: fields.array( + fields.object({ + title: fields.text({ + label: 'Related Components', + }), + slug: fields.url({ + label: 'Slug', + }), }), { label: 'Related Components', - itemLabel: props => props.value || '', + itemLabel: props => props.fields.title.value || '', }, ), + relatedArticles: fields.document({ + formatting: true, + dividers: true, + links: true, + label: 'Related Articles', + }), code: fields.document({ formatting: true, dividers: true, diff --git a/apps/site/src/app/articles/[article]/error.tsx b/apps/site/src/app/articles/[article]/error.tsx index 43fbc3b34..32f9b95b4 100644 --- a/apps/site/src/app/articles/[article]/error.tsx +++ b/apps/site/src/app/articles/[article]/error.tsx @@ -5,6 +5,7 @@ import { useEffect } from 'react'; export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service + // eslint-disable-next-line no-console console.error(error); }, [error]); diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/code-content/code-content.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/code-content/code-content.component.tsx index 4f8319d24..b451a5e53 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/code-content/code-content.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/code-content/code-content.component.tsx @@ -89,9 +89,11 @@ export function CodeContent({ content = [], westpacUIInfo, componentProps, subCo {componentProps && ( -
+
- Props + + Props +
{subComponentProps?.map(subComponentProps => ( diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx index 95952c862..32ac788cc 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.component.tsx @@ -8,6 +8,7 @@ import { Colors } from '@/components/component-blocks/colors/colors.component'; import { Icons } from '@/components/component-blocks/icons/icons.component'; import { Logos } from '@/components/component-blocks/logos/logos.component'; import { Pictograms } from '@/components/component-blocks/pictograms/pictograms.component'; +import { Symbols } from '@/components/component-blocks/symbols/symbols.component'; import { Section } from '@/components/content-blocks/section'; import { Code, Heading } from '@/components/document-renderer'; import { RelatedInfo } from '@/components/related-info'; @@ -17,7 +18,7 @@ import { DOCUMENT_RENDERERS } from '../document-renderer'; import { type DesignContentProps } from '.'; -export function DesignContent({ designSections, description, relatedComponents }: DesignContentProps) { +export function DesignContent({ designSections, description, relatedComponents, relatedArticles }: DesignContentProps) { const sectionNames = useMemo(() => { return designSections?.filter(({ noTitle }) => !noTitle).map(({ title }) => ({ title })) || []; }, [designSections]); @@ -44,6 +45,7 @@ export function DesignContent({ designSections, description, relatedComponents } icons: () => , logos: () => , pictograms: () => , + symbols: () => , colors: props => , }} /> @@ -51,7 +53,9 @@ export function DesignContent({ designSections, description, relatedComponents }
); })} - {!!relatedComponents?.length && } + {(!!relatedComponents?.length || !!relatedArticles?.length) && ( + + )} ); } diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.types.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.types.tsx index 4c6f00e0f..e125ed182 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.types.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/design-content/design-content.types.tsx @@ -7,5 +7,6 @@ export type DesignSectionProps = { content: DocumentElement[]; noTitle?: boolean export type DesignContentProps = { description?: string; designSections?: DesignSectionProps[]; + relatedArticles?: RelatedInfoProps['relatedArticles']; relatedComponents?: RelatedInfoProps['relatedComponents']; }; diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/document-renderer.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/document-renderer.tsx index 0024ec3cb..72c26605b 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/document-renderer.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/document-renderer.tsx @@ -8,7 +8,7 @@ export const DOCUMENT_RENDERERS: Required['renderers'] = block: { divider: Divider, paragraph: props => , - code: props => , + code: props => , heading: Heading, list: props => , layout: Layout, diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.component.tsx index e3b86dae6..61219e9ed 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.component.tsx @@ -1,5 +1,5 @@ import { useRef } from 'react'; -import { AriaTabProps, useTab } from 'react-aria'; +import { AriaTabProps, mergeProps, useFocusRing, useTab } from 'react-aria'; import { Node, TabListState } from 'react-stately'; import { styles } from './tab.styles'; @@ -7,10 +7,11 @@ import { styles } from './tab.styles'; export function Tab({ item, state }: { item: Node; state: TabListState }) { const { key, rendered } = item; const ref = useRef(null); + const { focusProps, isFocusVisible } = useFocusRing(); const { tabProps } = useTab({ key }, state, ref); const selected = key === state.selectedKey; return ( -
+
{rendered}
); diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.styles.ts b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.styles.ts index 1b5986e10..3264da568 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.styles.ts +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/tabs/components/tab/tab.styles.ts @@ -1,10 +1,13 @@ import { tv } from 'tailwind-variants'; export const styles = tv({ - base: 'relative flex h-9 flex-1 cursor-pointer items-center justify-center border-r border-r-border font-semibold text-muted after:absolute after:inset-x-0 after:bottom-0 after:h-0 after:border-b-[3px] after:border-[transparent] last:border-r-0 sm:h-11 sm:grow-0 sm:px-10 sm:last:border-r', + base: 'relative flex h-9 flex-1 cursor-pointer items-center justify-center border-r border-r-border font-semibold text-muted after:absolute after:inset-x-0 after:bottom-0 after:h-0 after:border-b-[3px] after:border-[transparent] last:border-r-0 focus-visible:outline-none sm:h-11 sm:grow-0 sm:px-10 sm:last:border-r', variants: { selected: { true: 'text-text after:border-primary', }, + isFocusVisible: { + true: '!outline-offset-0 focus-outline focus:focus-outline focus-visible:focus-outline', + }, }, }); diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.component.tsx index a1802e394..dd86a71d8 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.component.tsx @@ -13,6 +13,7 @@ const TabPanelByKey = ({ tabKey, content }: { content: ContentTabsProps; tabKey: description={content.description} designSections={content.designSections} relatedComponents={content.relatedComponents} + relatedArticles={content.relatedArticles} /> ); } diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.types.ts b/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.types.ts index 775259924..69b9305ec 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.types.ts +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/content-tabs.types.ts @@ -1,6 +1,7 @@ import { DocumentElement } from '@keystatic/core'; import { ComponentProps } from '@westpac/ui'; +import { RelatedInfoLinks } from '@/components/related-info/related-info.types'; import { WestpacUIInfo } from '@/types/westpac-ui-info.types'; import { AccessibilitySectionProps } from './components/accessibility-content/accessibility-content.types'; @@ -13,7 +14,8 @@ export type ContentTabsProps = { componentProps?: ComponentProps; description?: string; designSections?: DesignSectionProps[]; - relatedComponents?: string[]; + relatedArticles?: DocumentElement[]; + relatedComponents?: RelatedInfoLinks[]; subComponentProps: ComponentProps[]; westpacUIInfo: WestpacUIInfo; }; diff --git a/apps/site/src/app/design-system/[...component]/components/header/header.styles.ts b/apps/site/src/app/design-system/[...component]/components/header/header.styles.ts index fb8c36862..cd8c93764 100644 --- a/apps/site/src/app/design-system/[...component]/components/header/header.styles.ts +++ b/apps/site/src/app/design-system/[...component]/components/header/header.styles.ts @@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants'; export const styles = tv( { slots: { - base: 'sticky top-0 z-50 flex w-full items-center gap-2 bg-hero px-2 py-3.5 transition-colors sm:px-4 md:top-[-10.125rem] md:h-[14.25rem] md:items-end', + base: 'sticky top-0 z-50 flex w-full items-center gap-2 bg-hero px-2 py-3.5 antialiased transition-colors sm:px-4 md:top-[-10.125rem] md:h-[14.25rem] md:items-end', gridButton: 'flex h-6 items-stretch gap-[0.125rem] p-1', gridButtonWrapper: 'fixed right-2 top-2 hidden items-center text-white sm:flex', hamburgerButton: 'fixed left-0 top-0 block h-4 w-4 translate-y-[-0.125rem] px-2 py-3.5 sm:left-2 lg:hidden', @@ -17,7 +17,7 @@ export const styles = tv( }, false: { base: '', - title: 'md:typography-brand-2 md:px-2 md:pb-[1.75rem] md:pt-5 md:leading-none lg:ml-2', + title: 'md:typography-brand-2 md:px-2 md:pb-[1.6875rem] md:pt-5 md:leading-none lg:ml-2', }, }, brand: { diff --git a/apps/site/src/app/design-system/[...component]/page.tsx b/apps/site/src/app/design-system/[...component]/page.tsx index ac4571274..6723f9a5b 100644 --- a/apps/site/src/app/design-system/[...component]/page.tsx +++ b/apps/site/src/app/design-system/[...component]/page.tsx @@ -3,6 +3,7 @@ import json from '@westpac/ui/component-type.json'; import { Metadata } from 'next'; import { reader } from '@/app/reader'; +import { RelatedInfoLinks } from '@/components/related-info/related-info.types'; import { ContentTabs } from './components'; import { AccessibilitySectionProps } from './components/content-tabs/components/accessibility-content/accessibility-content.types'; @@ -48,12 +49,12 @@ export default async function ComponentPage({ params }: { params: { component: s reader.collections.designSystem.readOrThrow(component.join('/')), reader.singletons.westpacUIInfo.readOrThrow(), ]); - const componentName = component[1] - .split('-') + const componentName = component?.[1] + ?.split('-') .map(name => `${name[0].toUpperCase()}${name.slice(1)}`) .join(''); - const [designSections, accessibilitySections, accessibilityDemo, code] = await Promise.all([ + const [designSections, accessibilitySections, accessibilityDemo, code, relatedArticles] = await Promise.all([ Promise.all( content.design.map(section => { return new Promise((resolve, reject) => { @@ -99,10 +100,12 @@ export default async function ComponentPage({ params }: { params: { component: s ), content?.accessibilityDemo(), content?.code(), + content?.relatedArticles(), ]); const codeIsEmpty = code[0].children.length <= 1 && !code[0].children[0].text; const accessibilityIsEmpty = accessibilityDemo[0].children.length <= 1 && !accessibilityDemo[0].children[0].text; + const relatedArticlesIsEmpty = relatedArticles[0].children.length <= 1 && !relatedArticles[0].children[0].text; const componentProps: ComponentProps | undefined = (json as any)[componentName]; const subComponentProps = Object.entries(json).reduce((acc, [key, value]: [string, any]) => { @@ -121,7 +124,8 @@ export default async function ComponentPage({ params }: { params: { component: s code: codeIsEmpty ? undefined : code, description: content.description, designSections, - relatedComponents: content.relatedInformation.filter(value => !!value) as string[], + relatedArticles: relatedArticlesIsEmpty ? undefined : relatedArticles, + relatedComponents: content.relatedComponents.filter(value => !!value) as RelatedInfoLinks[], componentProps, subComponentProps, }} diff --git a/apps/site/src/app/design-system/components/hero/hero.component.tsx b/apps/site/src/app/design-system/components/hero/hero.component.tsx index df304c05c..6df926eac 100644 --- a/apps/site/src/app/design-system/components/hero/hero.component.tsx +++ b/apps/site/src/app/design-system/components/hero/hero.component.tsx @@ -19,37 +19,41 @@ export function Hero() {
- +

Deliver quality user interfaces that scale – fast!

-

Simplify your projects with reusable components and patterns

+

Simplify your projects with reusable components and patterns

- + -
+
-
Go to market faster leveraging tools to get you up and running instantly
+
+ Go to market faster leveraging tools to get you up and running instantly +
-
+
-
Design, build and ship consistent brand experiences
+
Design, build and ship consistent brand experiences
-
+
- + +
+
+ Create more accessible solutions that are inclusive of all customers
-
Create more accessible solutions that are inclusive of all customers
diff --git a/apps/site/src/app/design-system/components/hero/hero.styles.ts b/apps/site/src/app/design-system/components/hero/hero.styles.ts index 1ed26aee1..92886cda9 100644 --- a/apps/site/src/app/design-system/components/hero/hero.styles.ts +++ b/apps/site/src/app/design-system/components/hero/hero.styles.ts @@ -4,7 +4,7 @@ import { tv } from 'tailwind-variants'; export const styles = tv({ slots: { base: 'relative overflow-hidden bg-background pb-7 text-center antialiased sm:pb-11 sm:text-white', - heading: 'typography-brand-4 mt-15 sm:typography-brand-1 sm:mt-7', + heading: 'typography-brand-4 mt-15 !leading-none sm:typography-brand-1 sm:mt-7', }, variants: { brand: { diff --git a/apps/site/src/app/design-system/error.tsx b/apps/site/src/app/design-system/error.tsx index 43fbc3b34..32f9b95b4 100644 --- a/apps/site/src/app/design-system/error.tsx +++ b/apps/site/src/app/design-system/error.tsx @@ -5,6 +5,7 @@ import { useEffect } from 'react'; export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service + // eslint-disable-next-line no-console console.error(error); }, [error]); diff --git a/apps/site/src/components/code/code.inject-components.ts b/apps/site/src/components/code/code.inject-components.ts index 2600e171c..fcb2179fd 100644 --- a/apps/site/src/components/code/code.inject-components.ts +++ b/apps/site/src/components/code/code.inject-components.ts @@ -45,6 +45,12 @@ export { } from '@westpac/ui'; export { + NewWindowIcon, + DropDownIcon, + PrintIcon, + PlayIcon, + PauseIcon, + AddCircleIcon, AddIcon, TickCircleIcon, ArrowRightIcon, @@ -80,6 +86,9 @@ export { GiftIcon, WarningIcon, SuccessIcon, + ArrowLeftIcon, + GenericFileIcon, + GithubIcon, } from '@westpac/ui/icon'; export { GiftPictogram } from '@westpac/ui/pictogram'; diff --git a/apps/site/src/components/code/components/live-code/live-code.component.tsx b/apps/site/src/components/code/components/live-code/live-code.component.tsx index 49cbb1249..734d6a0d0 100644 --- a/apps/site/src/components/code/components/live-code/live-code.component.tsx +++ b/apps/site/src/components/code/components/live-code/live-code.component.tsx @@ -3,6 +3,7 @@ import copy from 'clipboard-copy'; import { themes } from 'prism-react-renderer'; import { KeyboardEvent, useCallback, useContext, useId, useRef, useState } from 'react'; import { LiveContext, LiveEditor, LivePreview } from 'react-live'; +import { VariantProps } from 'tailwind-variants'; import { styles as liveCodeStyles } from './live-code.styles'; import { LiveCodeProps } from './live-code.types'; @@ -15,7 +16,10 @@ export function LiveCode({ showCode = false, enableLiveCode = true, className }: const [localCopy, setLocalCopy] = useState(live.code); const [isCodeVisible, toggleIsCodeVisible] = useState(showCode); - const styles = liveCodeStyles({ isCodeVisible }); + const styles = liveCodeStyles({ + isCodeVisible, + language: live.language as VariantProps['language'], + }); const copyLiveCode = useCallback(() => { copy(localCopy); @@ -56,7 +60,7 @@ export function LiveCode({ showCode = false, enableLiveCode = true, className }: {enableLiveCode && (
- setOpen(false)}> - Heads up! This alert needs your attention, but it’s not super important. Link - - - ); -}; -``` diff --git a/apps/site/src/content/design-system/components/alert/design/alert-boxes/content.mdoc b/apps/site/src/content/design-system/components/alert/design/alert-boxes/content.mdoc index 1eb4d190d..98cd80015 100644 --- a/apps/site/src/content/design-system/components/alert/design/alert-boxes/content.mdoc +++ b/apps/site/src/content/design-system/components/alert/design/alert-boxes/content.mdoc @@ -2,33 +2,33 @@ Alerts come in five different styles and are configurable to allow for simple st ```jsx
-

Success

+ Success Thank you Your account has successfully been opened. -

Information

+ Information Changed Opening Hours The opening hours for this branch have changed. -

Warning

+ Warning Time out Please make sure you complete this process, this operation will time out in 5 min. -

Danger

+ Danger Please fix the 3 errors listed below -
    +
    • Select a title
    • Enter your given name
    • Enter your family name
    -

    System error

    + System error System Error The server is not responding. Please try again later. We are sorry for any inconvenience. -

    Flexible info style icon

    + Flexible info style icon Please make sure your mobile number is correct, we will use this to contact you if we have any questions about your application. diff --git a/apps/site/src/content/design-system/components/alert/design/alert-text/content.mdoc b/apps/site/src/content/design-system/components/alert/design/alert-text/content.mdoc index ff2d4492e..ee8f7ed9b 100644 --- a/apps/site/src/content/design-system/components/alert/design/alert-text/content.mdoc +++ b/apps/site/src/content/design-system/components/alert/design/alert-text/content.mdoc @@ -2,19 +2,19 @@ Alert text comes in four different styles and is configurable to allow for simpl ```jsx
    -

    Success

    + Success Your account has successfully been opened. -

    Information

    + Information The opening hours for this branch have changed. -

    Warning

    + Warning Please make sure you complete this process, this operation will time out in 5 min. -

    Danger

    + Danger Please enter a valid account number. diff --git a/apps/site/src/content/design-system/components/alert/index.yaml b/apps/site/src/content/design-system/components/alert/index.yaml index 009203f9a..5f1973a22 100644 --- a/apps/site/src/content/design-system/components/alert/index.yaml +++ b/apps/site/src/content/design-system/components/alert/index.yaml @@ -31,4 +31,8 @@ accessibility: - title: name: Accessibility API slug: accessibility-api -relatedInformation: [] +relatedComponents: + - title: Colours + slug: foundation/colour + - title: Icons + slug: foundation/icon diff --git a/apps/site/src/content/design-system/components/badge/code.mdoc b/apps/site/src/content/design-system/components/badge/code.mdoc index 463b1adcf..bf5efdddc 100644 --- a/apps/site/src/content/design-system/components/badge/code.mdoc +++ b/apps/site/src/content/design-system/components/badge/code.mdoc @@ -1,33 +1,21 @@ ## Autocomplete ```tsx -() => { - const COLORS = ['danger', 'faint', 'hero', 'info', 'neutral', 'primary', 'success', 'warning'] as const; - - const INVERTED_COLORS = [ - 'danger-inverted', - 'faint-inverted', - 'hero-inverted', - 'info-inverted', - 'neutral-inverted', - 'primary-inverted', - 'success-inverted', - 'warning-inverted', - ] as const; - - return ( -
    -
    - {COLORS.map(color => ( - {color} - ))} -
    -
    - {INVERTED_COLORS.map(color => ( - {color} - ))} -
    -
    - ); -}; + +

    + Default +

    +

    + Primary{" "} + Hero{" "} + Neutral{" "} + Faint +

    +

    + Success{" "} + Info{" "} + Warning{" "} + Danger +

    +
    ``` diff --git a/apps/site/src/content/design-system/components/badge/design/badge-styles/content.mdoc b/apps/site/src/content/design-system/components/badge/design/badge-styles/content.mdoc index d5fc5f4ef..6334769d5 100644 --- a/apps/site/src/content/design-system/components/badge/design/badge-styles/content.mdoc +++ b/apps/site/src/content/design-system/components/badge/design/badge-styles/content.mdoc @@ -4,31 +4,15 @@ Badges come in 2 different styles, _Default_ and _Pill._ Each style has 8 colour ```tsx () => { - const COLORS = ['danger', 'faint', 'hero', 'info', 'neutral', 'primary', 'success', 'warning'] as const; - - const INVERTED_COLORS = [ - 'danger-inverted', - 'faint-inverted', - 'hero-inverted', - 'info-inverted', - 'neutral-inverted', - 'primary-inverted', - 'success-inverted', - 'warning-inverted', - ] as const; + const COLORS = ['danger', 'warning', 'success', 'info', 'primary', 'hero', 'neutral', 'faint'] as const; return ( -
    -
    - {COLORS.map(color => ( - {color} - ))} -
    -
    - {INVERTED_COLORS.map(color => ( - {color} - ))} -
    +
    + {COLORS.map(color => ( + + {color} + + ))}
    ); }; @@ -38,34 +22,15 @@ Badges come in 2 different styles, _Default_ and _Pill._ Each style has 8 colour ```tsx () => { - const COLORS = ['danger', 'faint', 'hero', 'info', 'neutral', 'primary', 'success', 'warning'] as const; - const INVERTED_COLORS = [ - 'danger-inverted', - 'faint-inverted', - 'hero-inverted', - 'info-inverted', - 'neutral-inverted', - 'primary-inverted', - 'success-inverted', - 'warning-inverted', - ] as const; + const COLORS = ['danger', 'warning', 'success', 'info', 'primary', 'hero', 'neutral', 'faint'] as const; return ( -
    -
    - {COLORS.map(color => ( - - {color} - - ))} -
    -
    - {INVERTED_COLORS.map(color => ( - - {color} - - ))} -
    +
    + {COLORS.map(color => ( + + 88 + + ))}
    ); }; diff --git a/apps/site/src/content/design-system/components/badge/index.yaml b/apps/site/src/content/design-system/components/badge/index.yaml index 9e275ea04..4be2d6d7a 100644 --- a/apps/site/src/content/design-system/components/badge/index.yaml +++ b/apps/site/src/content/design-system/components/badge/index.yaml @@ -29,3 +29,8 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Buttons + slug: components/button + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/components/breadcrumb/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/breadcrumb/accessibilityDemo.mdoc index 4cce98db2..6a21514e7 100644 --- a/apps/site/src/content/design-system/components/breadcrumb/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/breadcrumb/accessibilityDemo.mdoc @@ -1,12 +1,12 @@ ```jsx -// Using the Link component (as NextLink) from 'next/LinkLink' -
    - +// Using the Link component (as NextLink) from 'next/Link' +
    + Home - + Home @@ -14,7 +14,7 @@ Personal - + Home @@ -25,23 +25,5 @@ Credit cards - - - Anchor item - - - Another anchor item - - - - Disabled item - - - - - Last item - - -
    ``` diff --git a/apps/site/src/content/design-system/components/breadcrumb/code.mdoc b/apps/site/src/content/design-system/components/breadcrumb/code.mdoc index 6e6a7aeb1..dccb4cca1 100644 --- a/apps/site/src/content/design-system/components/breadcrumb/code.mdoc +++ b/apps/site/src/content/design-system/components/breadcrumb/code.mdoc @@ -1,24 +1,30 @@ ### Default breadcrumb ```jsx -// Using the Link component (as NextLink) from 'next/LinkLink' -
    - - - Anchor item +// Using the Link component (as NextLink) from 'next/Link' +
    + + + Home - - Another anchor item + + + + Home - - - Disabled item - + + Personal - - - Last item - + + + + Home + + + Personal + + + Credit cards
    diff --git a/apps/site/src/content/design-system/components/breadcrumb/design/breadcrumbs/content.mdoc b/apps/site/src/content/design-system/components/breadcrumb/design/breadcrumbs/content.mdoc index ea461ece0..e2228c2e8 100644 --- a/apps/site/src/content/design-system/components/breadcrumb/design/breadcrumbs/content.mdoc +++ b/apps/site/src/content/design-system/components/breadcrumb/design/breadcrumbs/content.mdoc @@ -1,23 +1,31 @@ Breadcrumbs come in one style for navigational consistency across all touch-points. ```jsx -// Using the Link component (as NextLink) from 'next/LinkLink' - - - Anchor item - - - Another anchor item - - - - Disabled item - - - - - Last item - - - +// Using the Link component (as NextLink) from 'next/Link' +
    + + + Home + + + + + Home + + + Personal + + + + + Home + + + Personal + + + Credit cards + + +
    ``` diff --git a/apps/site/src/content/design-system/components/breadcrumb/index.yaml b/apps/site/src/content/design-system/components/breadcrumb/index.yaml index 22104e1ed..1796d9a33 100644 --- a/apps/site/src/content/design-system/components/breadcrumb/index.yaml +++ b/apps/site/src/content/design-system/components/breadcrumb/index.yaml @@ -26,4 +26,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api -relatedInformation: [] +relatedComponents: + - title: Icons + slug: foundation/icon diff --git a/apps/site/src/content/design-system/components/breadcrumb/relatedArticles.mdoc b/apps/site/src/content/design-system/components/breadcrumb/relatedArticles.mdoc new file mode 100644 index 000000000..5454dd9f3 --- /dev/null +++ b/apps/site/src/content/design-system/components/breadcrumb/relatedArticles.mdoc @@ -0,0 +1,3 @@ +**Neilson Norman Group** + +Find out what they have to say about breadcrumbs. Read [Breadcrumbs: 11 Design Guidelines for Desktop and Mobile](https://www.nngroup.com/articles/breadcrumbs/). diff --git a/apps/site/src/content/design-system/components/button-dropdown/code.mdoc b/apps/site/src/content/design-system/components/button-dropdown/code.mdoc index cd07cf957..bb2568894 100644 --- a/apps/site/src/content/design-system/components/button-dropdown/code.mdoc +++ b/apps/site/src/content/design-system/components/button-dropdown/code.mdoc @@ -1,29 +1,22 @@ ### Default button dropdown ```jsx - -

    - Example dropdown{' '} - - content - - ... -

    -
    -``` - -### Dropdown with headings - -```jsx - - Dropdown heading #1 - Example dropdown content... - Dropdown heading #2 - Example dropdown content... - +
    + +

    Example dropdown content ...

    +
    +
    +
    + + Dropdown heading #1 + Example dropdown content... + Dropdown heading #2 + Example dropdown content... + +
    ``` -### Dropdown box sizes (min-widths) +### Button dropdown sizes ```jsx
    diff --git a/apps/site/src/content/design-system/components/button-dropdown/index.yaml b/apps/site/src/content/design-system/components/button-dropdown/index.yaml index c853c504e..799c5899c 100644 --- a/apps/site/src/content/design-system/components/button-dropdown/index.yaml +++ b/apps/site/src/content/design-system/components/button-dropdown/index.yaml @@ -25,3 +25,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Checkboxes + slug: components/checkbox-group + - title: Buttons + slug: components/button + - title: Switches + slug: components/switch diff --git a/apps/site/src/content/design-system/components/button-group/index.yaml b/apps/site/src/content/design-system/components/button-group/index.yaml index fab23ed84..7d000d5b7 100644 --- a/apps/site/src/content/design-system/components/button-group/index.yaml +++ b/apps/site/src/content/design-system/components/button-group/index.yaml @@ -28,3 +28,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Buttons + slug: components/button + - title: Checkboxes + slug: components/checkbox-group + - title: Switches + slug: components/switch diff --git a/apps/site/src/content/design-system/components/button/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/button/accessibilityDemo.mdoc index e38ffe2e8..6e8daae7a 100644 --- a/apps/site/src/content/design-system/components/button/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/button/accessibilityDemo.mdoc @@ -1,31 +1,46 @@ ```jsx
    -
    - - - {' '} + {' '} + {' '} + {' '} +
    -
    - - - +
    +
    +
    + Icon positioning +
    + + +
    -
    - -
    diff --git a/apps/site/src/content/design-system/components/button/code.mdoc b/apps/site/src/content/design-system/components/button/code.mdoc index 961b47c69..ef7526794 100644 --- a/apps/site/src/content/design-system/components/button/code.mdoc +++ b/apps/site/src/content/design-system/components/button/code.mdoc @@ -1,105 +1,67 @@ -## Button sizes +### Button looks ```jsx -
    - {' '} + +
    + Standard + - - - - - - -
    -``` - ---- - -## Standard buttons - -```jsx -
    - - - - -
    -``` - ---- - -## Soft buttons - -```jsx -
    + +
    + Soft + {' '} + {' '} -
    + ``` ---- - -## Buttons with icons +### Button sizes ```jsx -
    -
    - - - -
    -
    - - - -
    -
    - - -
    -
    + + Sizes + +
    + Responsive sizing + +
    +
    + +
    ``` ---- - -## Responsive buttons - -Medium size button becomes Extra large from the MD breakpoint +### Block buttons ```jsx - + + Block + +
    + Responsive block + +
    +
    + +
    ``` -Small size button becomes medium at the SM breakpoint, large at the MD breakpoint and Extra large at the LG breakpoint +### Buttons with icons ```jsx - +
    + + +
    ``` diff --git a/apps/site/src/content/design-system/components/button/design/button-sizes/content.mdoc b/apps/site/src/content/design-system/components/button/design/button-sizes/content.mdoc index f219b3189..f84508194 100644 --- a/apps/site/src/content/design-system/components/button/design/button-sizes/content.mdoc +++ b/apps/site/src/content/design-system/components/button/design/button-sizes/content.mdoc @@ -1,7 +1,7 @@ Buttons are available in four sizes. These sizes align with other form element sizes. Please only use the button sizes provided. Button widths are auto-sized by default or can be made to fit to the full width of their container, see block buttons, below. ```tsx -
    +
    diff --git a/apps/site/src/content/design-system/components/button/design/button-styles/content.mdoc b/apps/site/src/content/design-system/components/button/design/button-styles/content.mdoc index a1b67e964..b5ee6c10f 100644 --- a/apps/site/src/content/design-system/components/button/design/button-styles/content.mdoc +++ b/apps/site/src/content/design-system/components/button/design/button-styles/content.mdoc @@ -1,18 +1,17 @@ **Standard buttons:** There are three standard button styles you can use in your interface. ```jsx -
    +
    -
    ``` **Soft buttons:** The soft button option places less visual emphasis on the button. Soft buttons are useful when grouping buttons with differing importance. ```jsx -
    +
    @@ -29,32 +28,47 @@ ```jsx
    -
    - - - {' '} + {' '} + {' '} + {' '} +
    -
    - - - +
    +
    +
    + Icon positioning +
    + + +
    -
    - -
    diff --git a/apps/site/src/content/design-system/components/button/design/dos-and-donts/content.mdoc b/apps/site/src/content/design-system/components/button/design/dos-and-donts/content.mdoc index c9ed0f468..62de21f85 100644 --- a/apps/site/src/content/design-system/components/button/design/dos-and-donts/content.mdoc +++ b/apps/site/src/content/design-system/components/button/design/dos-and-donts/content.mdoc @@ -10,12 +10,17 @@ {% layout-area %} ![Two buttons vertically stacked with space between them, labelled ‘Save’ and ‘Delete’. This diagram has a tick.](https://res.cloudinary.com/westpac-gel/image/upload/v1603847085/5f98c3ac28dd13161ae76fd8.png) -Do - Prevent errors by keeping buttons a safe distance apart. +```html +

    Do - Prevent errors by keeping buttons a safe distance apart.

    +``` + {% /layout-area %} {% layout-area %} ![Two buttons vertically stacked with no space between them, labelled ‘Save’ and ‘Delete’. This diagram has a cross.](https://res.cloudinary.com/westpac-gel/image/upload/v1603847093/5f98c3b428dd13161ae76fd9.png) -Avoid - Placing buttons next to each other that perform an opposing function that a user cannot recover from. +```html +

    Avoid - Placing buttons next to each other that perform an opposing function that a user cannot recover from.

    +``` {% /layout-area %} {% /layout %} diff --git a/apps/site/src/content/design-system/components/button/design/responsive-buttons/content.mdoc b/apps/site/src/content/design-system/components/button/design/responsive-buttons/content.mdoc index 73b76dd5b..291a34a9f 100644 --- a/apps/site/src/content/design-system/components/button/design/responsive-buttons/content.mdoc +++ b/apps/site/src/content/design-system/components/button/design/responsive-buttons/content.mdoc @@ -1,13 +1,25 @@ Responsive buttons can change appearance based on breakpoint. For example, the buttons can change size or become block or inline. This feature is often used at the XS breakpoint (generally for mobile devices). The example descriptions below assume the button is first viewed at XS, resize your browser to see them change. -Medium size button becomes Extra large from the MD breakpoint - ```jsx - -``` + + Medium size button becomes Extra large from the MD breakpoint + +
    -Small size button becomes medium at the SM breakpoint, large at the MD breakpoint and Extra large at the LG breakpoint + Extra large size button becomes small from the SM breakpoint + +
    -```jsx - + + Small size button becomes medium at the SM breakpoint, large at the MD breakpoint and Extra large at the LG + breakpoint + + +
    + + Block button becomes non-block from the SM breakpoint + +
    ``` diff --git a/apps/site/src/content/design-system/components/button/index.yaml b/apps/site/src/content/design-system/components/button/index.yaml index 6ee624a33..dab6cf6da 100644 --- a/apps/site/src/content/design-system/components/button/index.yaml +++ b/apps/site/src/content/design-system/components/button/index.yaml @@ -35,4 +35,12 @@ accessibility: - title: name: Accessibility API slug: accessibility-api -relatedInformation: [] +relatedComponents: + - title: Icons + slug: foundation/icon + - title: Button dropdowns + slug: components/button-dropdown + - title: Button groups + slug: components/button-group + - title: Colours + slug: foundation/colour diff --git a/apps/site/src/content/design-system/components/checkbox-group/design/dos-and-donts/content.mdoc b/apps/site/src/content/design-system/components/checkbox-group/design/dos-and-donts/content.mdoc index 410b75043..c4bd42c1a 100644 --- a/apps/site/src/content/design-system/components/checkbox-group/design/dos-and-donts/content.mdoc +++ b/apps/site/src/content/design-system/components/checkbox-group/design/dos-and-donts/content.mdoc @@ -8,13 +8,19 @@ {% layout-area %} ![Question set asking ‘Which methods do you use to get to work?’ With checkbox options: Car, Bicycle, Train, Other means. This diagram has a tick.](https://res.cloudinary.com/westpac-gel/image/upload/v1603779769/5f97bcb7bf99e236cd9193f6.png) -Do - Remain consistent with the control type used +```html +

    Do - Remain consistent with the control type used

    +``` + {% /layout-area %} {% layout-area %} ![Question set asking ‘Which methods do you use to get to work?’ With checkbox options: Car, Bicycle, Train. Last item Other means as radio button. This diagram has a cross.](https://res.cloudinary.com/westpac-gel/image/upload/v1603779775/5f97bcbebf99e236cd9193f7.png) -Avoid - Mixing checkboxes and radios +```html +

    Avoid - Mixing checkboxes and radios

    +``` + {% /layout-area %} {% /layout %} @@ -22,12 +28,18 @@ Avoid - Mixing checkboxes and radios {% layout-area %} ![Question set asking ‘Do you have any of the following in your household?’ With checkbox options: Cameras, Bicycles, Audio equipment, Computer equipment. This diagram has a tick.](https://res.cloudinary.com/westpac-gel/image/upload/v1604288190/5f9f7ebdc5be90222be29900.png) -Do - Keep labels short, makes scanning easier. +```html +

    Do - Keep labels short, makes scanning easier.

    +``` + {% /layout-area %} {% layout-area %} ![Question set asking ‘Do you have any of the following in your household?’ With checkbox options: Cameras such as professional cameras, consumer cameras, digital cameras, film cameras, video cameras; Bicycles (whether it’s yours or someone else’s in the same household); Audio equipment including CB radios; Computer equipment including smartphones, desktops, tablets, laptops, game consoles. This diagram has a cross.](https://res.cloudinary.com/westpac-gel/image/upload/v1604287897/5f9f7d97c5be90222be298ff.png) -Avoid - Having long descriptive labels, if you need more content you can try using the 'Hint' option. +```html +

    Avoid - Having long descriptive labels, if you need more content you can try using the 'Hint' option.

    +``` + {% /layout-area %} {% /layout %} diff --git a/apps/site/src/content/design-system/components/checkbox-group/index.yaml b/apps/site/src/content/design-system/components/checkbox-group/index.yaml index 6b1af8d88..22d3afc13 100644 --- a/apps/site/src/content/design-system/components/checkbox-group/index.yaml +++ b/apps/site/src/content/design-system/components/checkbox-group/index.yaml @@ -1,4 +1,4 @@ -name: Checkbox Groups +name: Checkboxes description: >- Checkboxes are a proven and effective way to elicit a multiple choice from a user. They also require careful consideration to produce the best results. @@ -37,3 +37,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Radios + slug: components/radio-group + - title: Buttons groups + slug: components/button-group + - title: Switches + slug: components/switch diff --git a/apps/site/src/content/design-system/components/collapsible/index.yaml b/apps/site/src/content/design-system/components/collapsible/index.yaml index de905e9ca..2743ddc1d 100644 --- a/apps/site/src/content/design-system/components/collapsible/index.yaml +++ b/apps/site/src/content/design-system/components/collapsible/index.yaml @@ -1,4 +1,4 @@ -name: Collapsibles +name: Collapsible description: >- A Collapsible is a component used for containing information that you may not want to surface at the page or screen level, but needs to be findable. @@ -25,3 +25,14 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Buttons + slug: components/button + - title: Accordions + slug: components/accordion + - title: Tabs + slug: components/tabs + - title: Colours + slug: foundation/colour + - title: Pictograms + slug: foundation/pictogram diff --git a/apps/site/src/content/design-system/components/compacta/index.yaml b/apps/site/src/content/design-system/components/compacta/index.yaml index 7b1363c0e..22df25f61 100644 --- a/apps/site/src/content/design-system/components/compacta/index.yaml +++ b/apps/site/src/content/design-system/components/compacta/index.yaml @@ -1,4 +1,4 @@ -name: Compactas +name: Compacta description: >- The Compacta is a form input for capturing multiple instances of multiple fields, saving valuable screen space. @@ -19,3 +19,8 @@ accessibility: - title: name: Accessibility notes slug: accessibility-notes +relatedComponents: + - title: Accordions + slug: components/accordion + - title: Tabs + slug: components/tabs diff --git a/apps/site/src/content/design-system/components/date-picker/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/date-picker/accessibilityDemo.mdoc index 59d8177b5..11009c7db 100644 --- a/apps/site/src/content/design-system/components/date-picker/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/date-picker/accessibilityDemo.mdoc @@ -1,12 +1,17 @@ ```jsx -
    -
    - Select from - + + Selecting a date range +
    +
    + + + +
    +
    + + + +
    -
    - Select to - -
    -
    + ``` diff --git a/apps/site/src/content/design-system/components/date-picker/code.mdoc b/apps/site/src/content/design-system/components/date-picker/code.mdoc index 22ec91199..a8029a4a0 100644 --- a/apps/site/src/content/design-system/components/date-picker/code.mdoc +++ b/apps/site/src/content/design-system/components/date-picker/code.mdoc @@ -1,23 +1,49 @@ -## Datepicker sizes +### Sizes ```jsx () => { - const sizes = ['sm', 'md', 'lg', 'xl']; - return sizes.map(size => ( -
    - size {size} + const sizes = [ + { label: 'Small', size: 'sm' }, + { label: 'Medium (default)', size: 'md' }, + { label: 'Large', size: 'lg' }, + { label: 'XLarge', size: 'xl' }, + ]; + return sizes.map(({ label, size }) => ( +
    + {label}
    )); }; ``` ---- +### Range -## Disable Weekends +```jsx + + Selecting a date range +
    +
    + + + +
    +
    + + + +
    +
    +
    +``` + +### Disabled dates ```jsx -() => { - return ; -}; + + Blocked out dates + + + + ``` diff --git a/apps/site/src/content/design-system/components/date-picker/design/date-range/content.mdoc b/apps/site/src/content/design-system/components/date-picker/design/date-range/content.mdoc index f788e35c1..d25a7d61c 100644 --- a/apps/site/src/content/design-system/components/date-picker/design/date-range/content.mdoc +++ b/apps/site/src/content/design-system/components/date-picker/design/date-range/content.mdoc @@ -3,14 +3,19 @@ In order to create a date range, two date pickers need to be used with appropria Established convention of layout places two date pickers side by side, with stacked date pickers also an option particularly when horizontal space is at a premium or in a responsive context. ```jsx -
    -
    - Select from - + + Selecting a date range +
    +
    + + + +
    +
    + + + +
    -
    - Select to - -
    -
    + ``` diff --git a/apps/site/src/content/design-system/components/date-picker/design/sizes/content.mdoc b/apps/site/src/content/design-system/components/date-picker/design/sizes/content.mdoc index 0f0690b83..c08d18f26 100644 --- a/apps/site/src/content/design-system/components/date-picker/design/sizes/content.mdoc +++ b/apps/site/src/content/design-system/components/date-picker/design/sizes/content.mdoc @@ -2,10 +2,15 @@ The date picker can be used in various sizes to match the UI direction. ```jsx () => { - const sizes = ['sm', 'md', 'lg', 'xl']; - return sizes.map(size => ( -
    - size {size} + const sizes = [ + { label: 'Small', size: 'sm' }, + { label: 'Medium (default)', size: 'md' }, + { label: 'Large', size: 'lg' }, + { label: 'XLarge', size: 'xl' }, + ]; + return sizes.map(({ label, size }) => ( +
    + {label}
    )); diff --git a/apps/site/src/content/design-system/components/date-picker/design/unavailable-dates/content.mdoc b/apps/site/src/content/design-system/components/date-picker/design/unavailable-dates/content.mdoc index 6366e42c8..25c5032cf 100644 --- a/apps/site/src/content/design-system/components/date-picker/design/unavailable-dates/content.mdoc +++ b/apps/site/src/content/design-system/components/date-picker/design/unavailable-dates/content.mdoc @@ -7,9 +7,7 @@ When dates are unavailable for whatever reason, the strikethrough styling is app ```jsx -

    - Blocked out dates -

    + Blocked out dates diff --git a/apps/site/src/content/design-system/components/date-picker/index.yaml b/apps/site/src/content/design-system/components/date-picker/index.yaml index bf38a506c..d4769daea 100644 --- a/apps/site/src/content/design-system/components/date-picker/index.yaml +++ b/apps/site/src/content/design-system/components/date-picker/index.yaml @@ -1,4 +1,4 @@ -name: Date pickers +name: Date picker description: >- Date pickers assist when dates are not known, set in the future, to schedule something, or assist in providing “day of the week” context. @@ -31,3 +31,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Input fields + slug: components/input-field diff --git a/apps/site/src/content/design-system/components/flexi-cell/index.yaml b/apps/site/src/content/design-system/components/flexi-cell/index.yaml index 12ddc7854..f4634a976 100644 --- a/apps/site/src/content/design-system/components/flexi-cell/index.yaml +++ b/apps/site/src/content/design-system/components/flexi-cell/index.yaml @@ -1 +1 @@ -name: Flexi-Cells +name: Flexi Cell diff --git a/apps/site/src/content/design-system/components/heading/index.yaml b/apps/site/src/content/design-system/components/heading/index.yaml index 42fbf47bb..b60e4cb55 100644 --- a/apps/site/src/content/design-system/components/heading/index.yaml +++ b/apps/site/src/content/design-system/components/heading/index.yaml @@ -1,4 +1,4 @@ -name: Headings +name: Heading (Dev) description: >- This is a developer-only package containing styling for heading elements supporting visual and semantic heading levels, uppercase and both body font diff --git a/apps/site/src/content/design-system/components/input-field/index.yaml b/apps/site/src/content/design-system/components/input-field/index.yaml index e6f3091c2..71eb0b997 100644 --- a/apps/site/src/content/design-system/components/input-field/index.yaml +++ b/apps/site/src/content/design-system/components/input-field/index.yaml @@ -1,4 +1,4 @@ -name: Input Fields +name: Input groups description: >- Input field is an input field either followed or preceded by an input or character. They are useful for giving context to input field values. @@ -31,3 +31,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Text inputs + slug: components/input diff --git a/apps/site/src/content/design-system/components/input/design/dos-and-donts/content.mdoc b/apps/site/src/content/design-system/components/input/design/dos-and-donts/content.mdoc index e7f61cb85..9c32ad94d 100644 --- a/apps/site/src/content/design-system/components/input/design/dos-and-donts/content.mdoc +++ b/apps/site/src/content/design-system/components/input/design/dos-and-donts/content.mdoc @@ -8,12 +8,18 @@ ![](https://res.cloudinary.com/westpac-gel/image/upload/v1603846745/5f98c25828dd13161ae76fd6.png) -Do - Place labels in close proximity above the input field - this helps promote scanning, readability and faster progress. +```html +

    Do - Place labels in close proximity above the input field - this helps promote scanning, readability and faster progress.

    +``` + {% /layout-area %} {% layout-area %} ![](https://res.cloudinary.com/westpac-gel/image/upload/v1603846751/5f98c25e28dd13161ae76fd7.png) -Avoid - Placing labels too far away from the input field, this can create confusion and lose any perceived connection between the items. +```html +

    Avoid - Placing labels too far away from the input field, this can create confusion and lose any perceived connection between the items.

    +``` + {% /layout-area %} {% /layout %} diff --git a/apps/site/src/content/design-system/components/input/index.yaml b/apps/site/src/content/design-system/components/input/index.yaml index f89d3253d..2bba36731 100644 --- a/apps/site/src/content/design-system/components/input/index.yaml +++ b/apps/site/src/content/design-system/components/input/index.yaml @@ -35,3 +35,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Input fields + slug: components/input-field diff --git a/apps/site/src/content/design-system/components/link/index.yaml b/apps/site/src/content/design-system/components/link/index.yaml index 2da2b90e6..4bedf4f51 100644 --- a/apps/site/src/content/design-system/components/link/index.yaml +++ b/apps/site/src/content/design-system/components/link/index.yaml @@ -1,4 +1,4 @@ -name: Links (anchor) +name: Link (Anchor) description: >- The Link component is a way for developers to quickly apply consistent web link styling while also providing global guidance for designers. There are two @@ -30,3 +30,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Colours + slug: foundation/colour + - title: Lists + slug: components/list + - title: Icons + slug: foundation/icon diff --git a/apps/site/src/content/design-system/components/list/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/list/accessibilityDemo.mdoc index e3f7c00c8..5fae0f5f1 100644 --- a/apps/site/src/content/design-system/components/list/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/list/accessibilityDemo.mdoc @@ -1,15 +1,31 @@ -```tsx -() => { - const TYPES = ['bullet', 'link', 'tick', 'cross', 'unstyled', 'icon', 'ordered']; - return TYPES.map(type => ( -
    -

    {type}

    - - Styled {type} list - Styled {type} list - Styled {type} list - -
    - )); -}; -``` +```jsx +<> +

    Link list

    + + This is a link list + This is a link list + +

    Tick list

    + + This is a tick list + This is a tick list + +

    Cross list

    + + This is a cross list + This is a cross list + +

    Unstyled list

    + + This is an unstyled list + This is an unstyled list + +

    Icon list

    + + This is an icon list + This is an icon list + This is an icon list + This is an icon list + + +``` \ No newline at end of file diff --git a/apps/site/src/content/design-system/components/list/code.mdoc b/apps/site/src/content/design-system/components/list/code.mdoc index 4ba73916e..bfd040ad0 100644 --- a/apps/site/src/content/design-system/components/list/code.mdoc +++ b/apps/site/src/content/design-system/components/list/code.mdoc @@ -1,8 +1,8 @@ -## Default List +### Default list ```jsx
    -

    Default list

    +

    Default list

    Styled bullet list Styled bullet list @@ -20,7 +20,7 @@ Styled bullet list -

    Look

    +

    Look

    Styled bullet list - primary Styled bullet list - primary @@ -36,15 +36,15 @@
    ``` -## List Looks +### List looks ```jsx () => { - const TYPES = ['bullet', 'link', 'tick', 'cross', 'unstyled', 'icon', 'ordered']; + const TYPES = ['bullet', 'link', 'tick', 'ordered', 'unstyled', 'icon']; return TYPES.map(type => (
    -

    {type}

    - +

    {`${type[0].toUpperCase()}${type.slice(1)} List`}

    + Styled {type} list Styled {type} list Styled {type} list @@ -54,17 +54,17 @@ }; ``` -## List spacing +### List spacing ```jsx
    -

    Medium

    +

    Medium

    Styled bullet list Styled bullet list Styled bullet list -

    Large

    +

    Large

    Styled bullet list Styled bullet list @@ -72,21 +72,3 @@
    ``` - -## Using Next Link - -```jsx -
    - - - Styled bullet list - - - Styled bullet list - - - Styled bullet list - - -
    -``` diff --git a/apps/site/src/content/design-system/components/list/design/bullet-lists/content.mdoc b/apps/site/src/content/design-system/components/list/design/bullet-lists/content.mdoc index be8d7b10f..9412370b3 100644 --- a/apps/site/src/content/design-system/components/list/design/bullet-lists/content.mdoc +++ b/apps/site/src/content/design-system/components/list/design/bullet-lists/content.mdoc @@ -2,7 +2,7 @@ Create simple and easily scannable lists with these list and nested list styles. ```jsx
    -

    Default list

    +

    Default list

    Styled bullet list Styled bullet list @@ -20,18 +20,12 @@ Create simple and easily scannable lists with these list and nested list styles. Styled bullet list -

    Look

    - - Styled bullet list - primary - Styled bullet list - primary - - - Styled bullet list - hero - Styled bullet list - hero - - - Styled bullet list - neutral - Styled bullet list - neutral +
    +

    List colours

    + + This is a primary list + This is a hero list + This is a neutral list
    ``` diff --git a/apps/site/src/content/design-system/components/list/design/list-item-spacing/content.mdoc b/apps/site/src/content/design-system/components/list/design/list-item-spacing/content.mdoc index 87825806d..2b4ba343c 100644 --- a/apps/site/src/content/design-system/components/list/design/list-item-spacing/content.mdoc +++ b/apps/site/src/content/design-system/components/list/design/list-item-spacing/content.mdoc @@ -2,17 +2,10 @@ Use a large spaced list when you have interactive elements. This can be used to ```jsx
    -

    Medium

    - - Styled bullet list - Styled bullet list - Styled bullet list - -

    Large

    - - Styled bullet list - Styled bullet list - Styled bullet list + + This is a large spaced link list + This is a large spaced link list + This is a large spaced link list
    ``` diff --git a/apps/site/src/content/design-system/components/list/design/other-lists/content.mdoc b/apps/site/src/content/design-system/components/list/design/other-lists/content.mdoc index 3c52152df..121da8625 100644 --- a/apps/site/src/content/design-system/components/list/design/other-lists/content.mdoc +++ b/apps/site/src/content/design-system/components/list/design/other-lists/content.mdoc @@ -1,17 +1,33 @@ Use link list styling when the list items are clickable. An un-styled list has no bullets, ticks or icons. ```jsx -() => { - const TYPES = ['bullet', 'link', 'tick', 'cross', 'unstyled', 'icon', 'ordered']; - return TYPES.map(type => ( -
    -

    {type}

    - - Styled {type} list - Styled {type} list - Styled {type} list - -
    - )); -}; +<> +

    Link list

    + + This is a link list + This is a link list + +

    Tick list

    + + This is a tick list + This is a tick list + +

    Cross list

    + + This is a cross list + This is a cross list + +

    Unstyled list

    + + This is an unstyled list + This is an unstyled list + +

    Icon list

    + + This is an icon list + This is an icon list + This is an icon list + This is an icon list + + ``` diff --git a/apps/site/src/content/design-system/components/list/index.yaml b/apps/site/src/content/design-system/components/list/index.yaml index 964526b0f..dee2c2164 100644 --- a/apps/site/src/content/design-system/components/list/index.yaml +++ b/apps/site/src/content/design-system/components/list/index.yaml @@ -32,3 +32,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Icons + slug: foundation/icon diff --git a/apps/site/src/content/design-system/components/modal/index.yaml b/apps/site/src/content/design-system/components/modal/index.yaml index 983315b43..6bf71aafa 100644 --- a/apps/site/src/content/design-system/components/modal/index.yaml +++ b/apps/site/src/content/design-system/components/modal/index.yaml @@ -29,3 +29,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Popovers + slug: components/popover + - title: Buttons + slug: components/button + - title: Icons + slug: foundation/icon diff --git a/apps/site/src/content/design-system/components/pagination/index.yaml b/apps/site/src/content/design-system/components/pagination/index.yaml index 534c3a9bc..5482e949e 100644 --- a/apps/site/src/content/design-system/components/pagination/index.yaml +++ b/apps/site/src/content/design-system/components/pagination/index.yaml @@ -1,4 +1,4 @@ -name: Paginations +name: Pagination description: >- Pagination is a component capable of helping the user navigate and give access to multiple pages of content, typically used in long form content. @@ -28,3 +28,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Buttons + slug: components/button diff --git a/apps/site/src/content/design-system/components/panel/index.yaml b/apps/site/src/content/design-system/components/panel/index.yaml index 63f5435a0..81de24778 100644 --- a/apps/site/src/content/design-system/components/panel/index.yaml +++ b/apps/site/src/content/design-system/components/panel/index.yaml @@ -34,3 +34,12 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Accordions + slug: components/accordion + - title: Tabs + slug: components/tabs + - title: Wells + slug: components/well + - title: Tables + slug: components/table diff --git a/apps/site/src/content/design-system/components/popover/code.mdoc b/apps/site/src/content/design-system/components/popover/code.mdoc index af43cf7cc..acf905137 100644 --- a/apps/site/src/content/design-system/components/popover/code.mdoc +++ b/apps/site/src/content/design-system/components/popover/code.mdoc @@ -3,6 +3,7 @@ ```tsx
    } diff --git a/apps/site/src/content/design-system/components/popover/index.yaml b/apps/site/src/content/design-system/components/popover/index.yaml index f94d518a7..75c211813 100644 --- a/apps/site/src/content/design-system/components/popover/index.yaml +++ b/apps/site/src/content/design-system/components/popover/index.yaml @@ -25,3 +25,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Modals + slug: components/modal diff --git a/apps/site/src/content/design-system/components/progress-bar/index.yaml b/apps/site/src/content/design-system/components/progress-bar/index.yaml index 993e1da2d..783c7bcce 100644 --- a/apps/site/src/content/design-system/components/progress-bar/index.yaml +++ b/apps/site/src/content/design-system/components/progress-bar/index.yaml @@ -1,4 +1,4 @@ -name: Progress bars +name: Progress bar description: >- Progress bars are animated bars which show a rate of completion for a system task or a response to user input. They can be accompanied by a percentage of diff --git a/apps/site/src/content/design-system/components/progress-rope/index.yaml b/apps/site/src/content/design-system/components/progress-rope/index.yaml index e4476c286..f065807c7 100644 --- a/apps/site/src/content/design-system/components/progress-rope/index.yaml +++ b/apps/site/src/content/design-system/components/progress-rope/index.yaml @@ -1,4 +1,4 @@ -name: Progress ropes +name: Progress rope description: >- The progress rope is a tool for signposting completion on long forms or applications and is designed to be used with the GEL forms framework. diff --git a/apps/site/src/content/design-system/components/radio-group/design/dos-and-donts/content.mdoc b/apps/site/src/content/design-system/components/radio-group/design/dos-and-donts/content.mdoc index 18884b7d2..909c66145 100644 --- a/apps/site/src/content/design-system/components/radio-group/design/dos-and-donts/content.mdoc +++ b/apps/site/src/content/design-system/components/radio-group/design/dos-and-donts/content.mdoc @@ -8,13 +8,19 @@ {% layout-area %} ![Question set asking ‘Select your favourite fruit’ With radio options vertically stacked: Apples, Pineapples, Pears. This diagram has a tick.](https://res.cloudinary.com/westpac-gel/image/upload/v1604287075/5f9f7a62c5be90222be298fc.png) -Do - List checkboxes and radios vertically, this makes scanning choices faster and easier. +```html +

    Do - List checkboxes and radios vertically, this makes scanning choices faster and easier.

    +``` + {% /layout-area %} {% layout-area %} ![Question set asking ‘Select your favourite fruit’ With radio options horizontally displayed: Apples, Pineapples, Pears. This diagram has a cross.](https://res.cloudinary.com/westpac-gel/image/upload/v1604287083/5f9f7a69c5be90222be298fd.png) -Avoid - Placing more than two checkboxes horizontally, side-by-side. +```html +

    Avoid - Placing more than two checkboxes horizontally, side-by-side.

    +``` + {% /layout-area %} {% /layout %} @@ -22,12 +28,18 @@ Avoid - Placing more than two checkboxes horizontally, side-by-side. {% layout-area %} ![Question set asking ‘Select your favourite fruit’ With radio options: Apples, Pineapples, Pears, Watermelons. This diagram has a tick.](https://res.cloudinary.com/westpac-gel/image/upload/v1624410638/60d28a0d62675721d7db363e.png) -Do - Use a consistent taxonomy +```html +

    Do - Use a consistent taxonomy

    +``` + {% /layout-area %} {% layout-area %} ![Question set asking ‘Select your favourite fruit’ With radio options: Apples, Pineapples, Red apples, Green apples. This diagram has a cross.](https://res.cloudinary.com/westpac-gel/image/upload/v1624410646/60d28a1562675721d7db363f.png) -Avoid - Mixing taxonomy categories and sub categories +```html +

    Avoid - Mixing taxonomy categories and sub categories

    +``` + {% /layout-area %} {% /layout %} diff --git a/apps/site/src/content/design-system/components/radio-group/index.yaml b/apps/site/src/content/design-system/components/radio-group/index.yaml index 51384bdbb..8869b45d5 100644 --- a/apps/site/src/content/design-system/components/radio-group/index.yaml +++ b/apps/site/src/content/design-system/components/radio-group/index.yaml @@ -1,4 +1,4 @@ -name: Radio groups +name: Radios description: >- Radios are a proven and effective way to elicit a single choice from a user. They also require careful consideration to produce the best results. @@ -37,3 +37,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Checkboxes + slug: components/checkbox-group + - title: Button groups + slug: components/button-group + - title: Switches + slug: components/switch diff --git a/apps/site/src/content/design-system/components/repeater/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/repeater/accessibilityDemo.mdoc index 64c88e311..4137a8ca0 100644 --- a/apps/site/src/content/design-system/components/repeater/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/repeater/accessibilityDemo.mdoc @@ -1,9 +1,5 @@ ```jsx - - Primary - Primary title text - console.log(e)} /> - +

    Repeater

    ``` diff --git a/apps/site/src/content/design-system/components/repeater/code.mdoc b/apps/site/src/content/design-system/components/repeater/code.mdoc index 64c88e311..4137a8ca0 100644 --- a/apps/site/src/content/design-system/components/repeater/code.mdoc +++ b/apps/site/src/content/design-system/components/repeater/code.mdoc @@ -1,9 +1,5 @@ ```jsx - - Primary - Primary title text - console.log(e)} /> - +

    Repeater

    ``` diff --git a/apps/site/src/content/design-system/components/repeater/design/default/content.mdoc b/apps/site/src/content/design-system/components/repeater/design/default/content.mdoc index 05619983b..f8a4550d8 100644 --- a/apps/site/src/content/design-system/components/repeater/design/default/content.mdoc +++ b/apps/site/src/content/design-system/components/repeater/design/default/content.mdoc @@ -2,10 +2,6 @@ Sitting directly under the elements or component it aims to repeat, by selecting ```jsx - - Primary - Primary title text - console.log(e)} /> - +

    Repeater

    ``` diff --git a/apps/site/src/content/design-system/components/repeater/index.yaml b/apps/site/src/content/design-system/components/repeater/index.yaml index 08db1ae4d..72219be59 100644 --- a/apps/site/src/content/design-system/components/repeater/index.yaml +++ b/apps/site/src/content/design-system/components/repeater/index.yaml @@ -1,4 +1,4 @@ -name: Repeaters +name: Repeater description: >- A Repeater is a user controlled pattern for allowing multiple instances of something. diff --git a/apps/site/src/content/design-system/components/selector/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/selector/accessibilityDemo.mdoc index d73b3cf49..bbb5227c9 100644 --- a/apps/site/src/content/design-system/components/selector/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/selector/accessibilityDemo.mdoc @@ -1,55 +1,62 @@ ```tsx - - {[ - { - before: ( - - - - ), - label: 'Label', - hint: 'Some supporting hint text can do here', - key: 'A', - secondaryText: '$10,000.00', - disabled: false, - }, - { - before: ( - - - - ), - label: 'Label', - hint: 'Some supporting hint text can do here', - key: 'B', - secondaryText: '$10,000.00', - disabled: false, - }, - { - before: ( - - - - ), - label: 'Label', - hint: 'Some supporting hint text can do here', - key: 'C', - secondaryText: '$10,000.00', - disabled: false, - }, - ].map(({ key, disabled, hint, label, before, secondaryText }) => ( - {secondaryText}} - key={key} - body - value={key} - isDisabled={disabled} - > - {label} - {hint && {hint}} - - ))} - + + + + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    +
    +
    +
    ``` diff --git a/apps/site/src/content/design-system/components/selector/code.mdoc b/apps/site/src/content/design-system/components/selector/code.mdoc index 519958b6e..47310a6a4 100644 --- a/apps/site/src/content/design-system/components/selector/code.mdoc +++ b/apps/site/src/content/design-system/components/selector/code.mdoc @@ -1,95 +1,148 @@ +### Button select + ```tsx - - {[ - { key: 'A', disabled: false }, - { key: 'B', disabled: false }, - { key: 'C', disabled: false }, - { key: 'D', disabled: true }, - ].map(({ key, disabled }) => ( - - Something {key} - - ))} - + + + + + Button select + Some supporting hint text can go here + + + Button select + Some supporting hint text can go here + + + Button select + Some supporting hint text can go here + + + + ``` ---- - -### Radio +### Single-select ```tsx - - {[ - { key: 'A', disabled: false }, - { key: 'B', disabled: false }, - { key: 'C', disabled: false }, - { key: 'D', disabled: true }, - ].map(({ key, disabled }) => ( - - Something {key} - - ))} - + + + + + Single-select + Some supporting hint text can go here + + + Single-select + Some supporting hint text can go here + + + Single-select + Some supporting hint text can go here + + + + ``` --- -### Check with arrow +### Multi-select ```tsx - - {[ - { key: 'A', disabled: false }, - { key: 'B', disabled: false }, - { key: 'C', disabled: false }, - { key: 'D', disabled: true }, - ].map(({ key, disabled }) => ( - - Something {key} - - ))} - +() => { + const [selectedValues, setSelectedValues] = useState(['2', '3']); + return ( + + + { + setSelectedValues(value); + }} + > + + Multi-select + Some supporting hint text can go here + + + Multi-select + Some supporting hint text can go here + + + Multi-select + Some supporting hint text can go here + + + + + ); +}; ``` --- -### Check with arrow +### Complex layout ```tsx -() => { - return ( - - {[ - { - label: 'Here is a label A', - hint: ( - <> - Bank Account - 123-456 123456 - - ), - key: 'A', - disabled: false, - }, - { - label: 'Here is a label B', - hint: ( - <> - Bank Account - 123-456 123456 - - ), - key: 'B', - disabled: false, - }, - { label: 'Here is a label C', hint: '', key: 'C', disabled: false }, - ].map(({ key, disabled, hint, label }) => ( - - {label} - {hint && {hint}} - - ))} + + + + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    - ); -}; +
    +
    ``` diff --git a/apps/site/src/content/design-system/components/selector/design/selector-design/content.mdoc b/apps/site/src/content/design-system/components/selector/design/selector-design/content.mdoc index 649fb5dcd..fcd0bafcf 100644 --- a/apps/site/src/content/design-system/components/selector/design/selector-design/content.mdoc +++ b/apps/site/src/content/design-system/components/selector/design/selector-design/content.mdoc @@ -5,17 +5,26 @@ Any of the variations described above can come in either a simple or complex lay The minimum content requirement is a label. ```tsx - - {[ - { key: 'A', disabled: false }, - { key: 'B', disabled: false }, - { key: 'C', disabled: false }, - ].map(({ key, disabled }) => ( - - Label - - ))} - +() => { + const [value, setValue] = useState('2'); + return ( + + + setValue(value)}> + + Label + + + Label + + + Label + + + + + ); +}; ``` ### Complex layout @@ -25,57 +34,64 @@ Some experiences may require more detail such as monetary values or product name Any combination of these elements may be used as long as they are used consistently throughout a set, and should always at least have a label. ```tsx - - {[ - { - before: ( - - - - ), - label: 'Label', - hint: 'Some supporting hint text can do here', - key: 'A', - secondaryText: '$10,000.00', - disabled: false, - }, - { - before: ( - - - - ), - label: 'Label', - hint: 'Some supporting hint text can do here', - key: 'B', - secondaryText: '$10,000.00', - disabled: false, - }, - { - before: ( - - - - ), - label: 'Label', - hint: 'Some supporting hint text can do here', - key: 'C', - secondaryText: '$10,000.00', - disabled: false, - }, - ].map(({ key, disabled, hint, label, before, secondaryText }) => ( - {secondaryText}} - key={key} - body - value={key} - isDisabled={disabled} - > - {label} - {hint && {hint}} - - ))} - + + + + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    + + + + } + > +
    + Label + + $10,000.00 + +
    + Some supporting hint text can go here +
    +
    +
    +
    ``` diff --git a/apps/site/src/content/design-system/components/selector/design/selector-functionality/content.mdoc b/apps/site/src/content/design-system/components/selector/design/selector-functionality/content.mdoc index d2842ca5a..b7ef72f1e 100644 --- a/apps/site/src/content/design-system/components/selector/design/selector-functionality/content.mdoc +++ b/apps/site/src/content/design-system/components/selector/design/selector-functionality/content.mdoc @@ -1,20 +1,50 @@ +### Button select + +The Button select variation, or 'Select and go' functionality is used to direct the user to a new destination or to present them with something new (eg a new question). The hover state includes a micro-interaction of the chevron, as well as an increase in border thickness. +```tsx + + + + + Button select + Some supporting hint text can go here + + + Button select + Some supporting hint text can go here + + + Button select + Some supporting hint text can go here + + + + +``` + ### Single select The single-select variation mimics the functionality of radio buttons, allowing only one item from the set to be selected. When an item is selected, the border increases in thickness with a tick icon used for further aid in visual confirmation. ```tsx - - {[ - { key: 'A', disabled: false }, - { key: 'B', disabled: false }, - { key: 'C', disabled: false }, - { key: 'D', disabled: true }, - ].map(({ key, disabled }) => ( - - Something {key} - - ))} - + + + + + Single-select + Some supporting hint text can go here + + + Single-select + Some supporting hint text can go here + + + Single-select + Some supporting hint text can go here + + + + ``` ### Multi-select @@ -22,16 +52,33 @@ The single-select variation mimics the functionality of radio buttons, allowing The multi-select variation mimics the functionality of checkboxes, allowing multiple items from the set to be selected. When an item is selected, the border increases in thickness with a tick icon used for further aid in visual confirmation. ```tsx - - {[ - { key: 'A', disabled: false }, - { key: 'B', disabled: false }, - { key: 'C', disabled: false }, - { key: 'D', disabled: true }, - ].map(({ key, disabled }) => ( - - Something {key} - - ))} - +() => { + const [selectedValues, setSelectedValues] = useState(['2', '3']); + return ( + + + { + setSelectedValues(value); + }} + > + + Multi-select + Some supporting hint text can go here + + + Multi-select + Some supporting hint text can go here + + + Multi-select + Some supporting hint text can go here + + + + + ); +}; ``` diff --git a/apps/site/src/content/design-system/components/selector/index.yaml b/apps/site/src/content/design-system/components/selector/index.yaml index c26262b8f..23d4b5dd2 100644 --- a/apps/site/src/content/design-system/components/selector/index.yaml +++ b/apps/site/src/content/design-system/components/selector/index.yaml @@ -1,4 +1,4 @@ -name: Selectors +name: Selector description: >- A Selector is essentially a large stylised radio or checkbox that can be configured in many different ways for different uses. @@ -28,3 +28,14 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Icons + slug: foundation/icon + - title: Checkboxes + slug: components/checkbox-group + - title: Colours + slug: foundation/colour + - title: Radios + slug: components/radio-group + - title: Pictograms + slug: foundation/pictogram diff --git a/apps/site/src/content/design-system/components/switch/design/dos-and-donts/content.mdoc b/apps/site/src/content/design-system/components/switch/design/dos-and-donts/content.mdoc index 9fcc0b2e5..205f0af8e 100644 --- a/apps/site/src/content/design-system/components/switch/design/dos-and-donts/content.mdoc +++ b/apps/site/src/content/design-system/components/switch/design/dos-and-donts/content.mdoc @@ -6,12 +6,18 @@ {% layout-area %} ![](https://res.cloudinary.com/westpac-gel/image/upload/v1604288835/5f9f8142c5be90222be29901.png) -Do - Use switches to reflect On or Off. +```html +

    Do - Use switches to reflect On or Off.

    +``` + {% /layout-area %} {% layout-area %} ![](https://res.cloudinary.com/westpac-gel/image/upload/v1604288842/5f9f8149c5be90222be29902.png) -Avoid - Using switches to indicate a Yes or No answer to a question. +```html +

    Avoid - Using switches to indicate a Yes or No answer to a question.

    +``` + {% /layout-area %} {% /layout %} diff --git a/apps/site/src/content/design-system/components/switch/design/switches/content.mdoc b/apps/site/src/content/design-system/components/switch/design/switches/content.mdoc deleted file mode 100644 index 4f058f25f..000000000 --- a/apps/site/src/content/design-system/components/switch/design/switches/content.mdoc +++ /dev/null @@ -1,31 +0,0 @@ -**Sizes:** We have one simple switch style that is available in four sizes (heights), with the default being Medium 36px. These four sizes align with other form element sizes. - -```jsx -
    - - - - -
    -``` - -**Block switches:** Use Block switches in small break points to align the label and element to either side of the screen. This behaviour can be set up to work responsively, and change depending on breakpoint. - -```jsx -
    - -
    -``` - -**Using responsive breakpoint control:** As well as determining if the switch is a Block switch, the switch's size can also change based on breakpoint. - -```jsx -
    - - -
    -``` diff --git a/apps/site/src/content/design-system/components/switch/index.yaml b/apps/site/src/content/design-system/components/switch/index.yaml index 2765877ba..a1a4cdf48 100644 --- a/apps/site/src/content/design-system/components/switch/index.yaml +++ b/apps/site/src/content/design-system/components/switch/index.yaml @@ -28,4 +28,8 @@ accessibility: - title: name: Accessibility API slug: accessibility-api -relatedInformation: ['checkbox-group', 'button-group'] \ No newline at end of file +relatedComponents: + - title: Checkboxes + slug: components/checkbox-group + - title: Button groups + slug: components/button-group diff --git a/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc b/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc index 56a010f03..b888c7521 100644 --- a/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc +++ b/apps/site/src/content/design-system/components/symbol/design/third-party-symbols/content.mdoc @@ -1,47 +1 @@ -Filter by name - -Found 22 symbols - -AmericanExpressSymbol - -AppleStoreInverseSymbol - -AppleStoreSymbol - -BPayLandSymbol - -BPayPortSymbol - -FacebookSymbol - -GooglePlusSymbol - -GoogleStoreSymbol - -InstagramSymbol - -LinkedInSymbol - -MastercardAcceptedSymbol - -MastercardHorizontalSymbol - -MastercardSymbol - -MicrosoftStoreSymbol - -PayIDSymbol - -SlackSymbol - -TwitterSymbol - -VisaBlueSymbol - -VisaSymbol - -VisaWhiteSymbol - -YammerSymbol - -YouTubeSymbol +{% symbols /%} diff --git a/apps/site/src/content/design-system/components/symbol/index.yaml b/apps/site/src/content/design-system/components/symbol/index.yaml index 4c9a4084f..3b3aa6d4b 100644 --- a/apps/site/src/content/design-system/components/symbol/index.yaml +++ b/apps/site/src/content/design-system/components/symbol/index.yaml @@ -27,3 +27,8 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Logos + slug: foundation/logo + - title: Icons + slug: foundation/icon diff --git a/apps/site/src/content/design-system/components/table/index.yaml b/apps/site/src/content/design-system/components/table/index.yaml index 72e24f97f..9abc37cf5 100644 --- a/apps/site/src/content/design-system/components/table/index.yaml +++ b/apps/site/src/content/design-system/components/table/index.yaml @@ -7,27 +7,35 @@ design: - title: name: Basic table slug: basic-table + - title: name: Striped row table slug: striped-row-table + - title: name: Bordered table slug: bordered-table + - title: name: Bordered, striped table slug: bordered-striped-table + - title: name: Basic table with highlights slug: basic-table-with-highlights + - title: name: User experience slug: user-experience + - title: name: Visual design slug: visual-design + - title: name: Dos and don’ts slug: dos-and-donts + accessibility: - title: name: Notes on accessibility @@ -41,3 +49,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Panels + slug: components/panel diff --git a/apps/site/src/content/design-system/components/tabs/index.yaml b/apps/site/src/content/design-system/components/tabs/index.yaml index 1f62afbb9..9ec35cc99 100644 --- a/apps/site/src/content/design-system/components/tabs/index.yaml +++ b/apps/site/src/content/design-system/components/tabs/index.yaml @@ -28,3 +28,8 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Wells + slug: components/well + - title: Panels + slug: components/panel diff --git a/apps/site/src/content/design-system/components/well/design/well/content.mdoc b/apps/site/src/content/design-system/components/well/design/well/content.mdoc deleted file mode 100644 index a23c2208f..000000000 --- a/apps/site/src/content/design-system/components/well/design/well/content.mdoc +++ /dev/null @@ -1,23 +0,0 @@ -Choose the colour of your well and the background it appears on to help your content either stand out or recede. Contrasting colours will always make an impact. - -```tsx - - It was a bright morning in the early part of summer; the river had resumed its wonted banks and its accustomed pace, - and a hot sun seemed to be pulling everything green and bushy and spiky up out of the earth towards him, as if by - strings. The Mole and the Water Rat had been up since dawn, very busy on matters connected with boats and the opening - of the boating season; painting and varnishing, mending paddles, repairing cushions, hunting for missing boat-hooks, - and so on; and were finishing breakfast in their little parlour and eagerly discussing their plans for the day, when a - heavy knock sounded at the door. - -``` - -```tsx - - It was a bright morning in the early part of summer; the river had resumed its wonted banks and its accustomed pace, - and a hot sun seemed to be pulling everything green and bushy and spiky up out of the earth towards him, as if by - strings. The Mole and the Water Rat had been up since dawn, very busy on matters connected with boats and the opening - of the boating season; painting and varnishing, mending paddles, repairing cushions, hunting for missing boat-hooks, - and so on; and were finishing breakfast in their little parlour and eagerly discussing their plans for the day, when a - heavy knock sounded at the door. - -``` diff --git a/apps/site/src/content/design-system/components/well/index.yaml b/apps/site/src/content/design-system/components/well/index.yaml index e8f06d403..7f6b9100b 100644 --- a/apps/site/src/content/design-system/components/well/index.yaml +++ b/apps/site/src/content/design-system/components/well/index.yaml @@ -25,4 +25,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api -relatedInformation: ['panel', 'accordion', 'tabs'] \ No newline at end of file +relatedComponents: + - title: Panels + slug: components/panel + - title: Accordions + slug: components/accordion + - title: Tabs + slug: components/tabs diff --git a/apps/site/src/content/design-system/content/guidelines/age-school-year/index.yaml b/apps/site/src/content/design-system/content/guidelines/age-school-year/index.yaml index d4dfa42ed..4ed07b41d 100644 --- a/apps/site/src/content/design-system/content/guidelines/age-school-year/index.yaml +++ b/apps/site/src/content/design-system/content/guidelines/age-school-year/index.yaml @@ -6,4 +6,4 @@ design: slug: undefined noTitle: true accessibility: [] -relatedInformation: [] +relatedComponents: [] diff --git a/apps/site/src/content/design-system/content/guidelines/error-message/relatedArticles.mdoc b/apps/site/src/content/design-system/content/guidelines/error-message/relatedArticles.mdoc new file mode 100644 index 000000000..0a33ec695 --- /dev/null +++ b/apps/site/src/content/design-system/content/guidelines/error-message/relatedArticles.mdoc @@ -0,0 +1,3 @@ +[3.3.1 Error identification (Level A)](https://www.w3.org/WAI/WCAG21/quickref/#error-identification) : If an input error is automatically detected, the item that is in error is identified and the error is described to the user in text. + +[3.3.3 Error Suggestion (Level AA)](https://www.w3.org/WAI/WCAG21/quickref/#error-suggestion) : If an input error is automatically detected and suggestions for correction are known, then the suggestions are provided to the user, unless it would jeopardize the security or purpose of the content. diff --git a/apps/site/src/content/design-system/content/writing-for-digital/design/writing-tips/content.mdoc b/apps/site/src/content/design-system/content/writing-for-digital/design/writing-tips/content.mdoc index bcdd763a1..1375fd4e9 100644 --- a/apps/site/src/content/design-system/content/writing-for-digital/design/writing-tips/content.mdoc +++ b/apps/site/src/content/design-system/content/writing-for-digital/design/writing-tips/content.mdoc @@ -176,8 +176,12 @@ For example: ![Mobile screen showing a clear call-to-action label that does not use a double negative.](https://res.cloudinary.com/westpac-gel/image/upload/v1670300581/clbbpu83p0001bn8igu6e5yj1.png) -Do - Use clear call to action labels +```html +

    Do - Use clear call to action labels

    +``` ![Mobile screen showing a confusing call-to-action label that does use a double negative.](https://res.cloudinary.com/westpac-gel/image/upload/v1670300587/clbbpud7x0002bn8i2m1mbnul.png) -Avoid - Using double negative labels +```html +

    Avoid - Using double negative labels

    +``` \ No newline at end of file diff --git a/apps/site/src/content/design-system/design-tokens/code.mdoc b/apps/site/src/content/design-system/design-tokens/code.mdoc new file mode 100644 index 000000000..e69de29bb diff --git a/apps/site/src/content/design-system/design-tokens/design/main/content.mdoc b/apps/site/src/content/design-system/design-tokens/design/main/content.mdoc new file mode 100644 index 000000000..782638295 --- /dev/null +++ b/apps/site/src/content/design-system/design-tokens/design/main/content.mdoc @@ -0,0 +1,22 @@ +This basic information includes things like: + +- Colours +- Fonts and font sizes +- Spacing +- Breakpoints + +More complex features such as animation can also be shared once a common design is reached. + +Design tokens create a common language that can be accessed by each platform where typically this data cannot be shared due to technical limitations. + +GEL Design System tokens deliver the basic core elements of the system which provide an accurate representation of brand. These tokens are exported for any platform to consume ‘as is’ or to transform them into the correct value type required for their platform. When adopted they can support increased brand consistency across our web or native touchpoints. + +Design tokens optimise workflow and mitigate the risk of error which arises when copying styles. + +Using a central design token system keeps things simple – a single source of truth for any platform to reference the latest approved brand styles. + +Adopting the GEL Design System tokens: + +- Optimises workflow +- Removes risk of copying styles +- Reduces the time and cost of each platform maintaining styles diff --git a/apps/site/src/content/design-system/design-tokens/index.yaml b/apps/site/src/content/design-system/design-tokens/index.yaml new file mode 100644 index 000000000..f65c2f60e --- /dev/null +++ b/apps/site/src/content/design-system/design-tokens/index.yaml @@ -0,0 +1,9 @@ +name: Design tokens +description: Design tokens support us to share basic brand styling at the simplest level with any interface on any platform across the Bank. +design: + - title: + name: Main + slug: main + noTitle: true +accessibility: [] +relatedComponents: [] diff --git a/apps/site/src/content/design-system/foundation/colour/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/colour/relatedArticles.mdoc new file mode 100644 index 000000000..78ed2ce1c --- /dev/null +++ b/apps/site/src/content/design-system/foundation/colour/relatedArticles.mdoc @@ -0,0 +1,7 @@ +**Colour system** + +Why we've done it, how it works and why you should use it. Read about the [colour](/articles/colour) system. + +**Multi-brand** + +Strategic approach to digital brand management and delivery. Find out how to [think multi-brand](/articles/multi-brand-made-easy). diff --git a/apps/site/src/content/design-system/foundation/font/index.yaml b/apps/site/src/content/design-system/foundation/font/index.yaml index fb9799efc..c173ce411 100644 --- a/apps/site/src/content/design-system/foundation/font/index.yaml +++ b/apps/site/src/content/design-system/foundation/font/index.yaml @@ -31,3 +31,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Text styling + slug: foundation/text-styling diff --git a/apps/site/src/content/design-system/foundation/font/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/font/relatedArticles.mdoc new file mode 100644 index 000000000..f11153f9c --- /dev/null +++ b/apps/site/src/content/design-system/foundation/font/relatedArticles.mdoc @@ -0,0 +1,7 @@ +**Typography** + +Why we've done it, how it works and why you should use it. Read about [typography](/articles/typography). + +**Multi-brand** + +Strategic approach to digital brand management and delivery. Find out how to [think multi-brand](/articles/multi-brand-made-easy). diff --git a/apps/site/src/content/design-system/foundation/grid/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/grid/relatedArticles.mdoc new file mode 100644 index 000000000..1e55f86cd --- /dev/null +++ b/apps/site/src/content/design-system/foundation/grid/relatedArticles.mdoc @@ -0,0 +1,7 @@ +**The grid** + +Why you should use it and how it works. Read about the responsive [grid](/articles/the-grid). + +**Responsive design** + +Responsive design is the right approach, influence your project to do the right thing by our customers and adopt it. Read about [responsive design](/articles/think-responsive). diff --git a/apps/site/src/content/design-system/foundation/icon/index.yaml b/apps/site/src/content/design-system/foundation/icon/index.yaml index 69a37dc93..6b9b352f5 100644 --- a/apps/site/src/content/design-system/foundation/icon/index.yaml +++ b/apps/site/src/content/design-system/foundation/icon/index.yaml @@ -35,3 +35,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Logos + slug: foundation/logo + - title: Colours + slug: foundation/colour + - title: Pictograms + slug: foundation/pictogram diff --git a/apps/site/src/content/design-system/foundation/icon/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/icon/relatedArticles.mdoc new file mode 100644 index 000000000..52640cf3a --- /dev/null +++ b/apps/site/src/content/design-system/foundation/icon/relatedArticles.mdoc @@ -0,0 +1,3 @@ +**Iconography** + +How to use icons, when and when not to use icons. Read more about [iconography](/articles/iconography). diff --git a/apps/site/src/content/design-system/foundation/logo/index.yaml b/apps/site/src/content/design-system/foundation/logo/index.yaml index 60c0a078f..9b502bc59 100644 --- a/apps/site/src/content/design-system/foundation/logo/index.yaml +++ b/apps/site/src/content/design-system/foundation/logo/index.yaml @@ -27,3 +27,8 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Icons + slug: foundation/icon + - title: Symbols + slug: components/symbol diff --git a/apps/site/src/content/design-system/foundation/logo/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/logo/relatedArticles.mdoc new file mode 100644 index 000000000..b86b6bbdf --- /dev/null +++ b/apps/site/src/content/design-system/foundation/logo/relatedArticles.mdoc @@ -0,0 +1,3 @@ +**Multibrand** + +Learn about the strategic approach to digital brand management & delivery. Read about [Multi-brand](/articles/multi-brand-made-easy). diff --git a/apps/site/src/content/design-system/foundation/pictogram/index.yaml b/apps/site/src/content/design-system/foundation/pictogram/index.yaml index 243b9cf86..d07827602 100644 --- a/apps/site/src/content/design-system/foundation/pictogram/index.yaml +++ b/apps/site/src/content/design-system/foundation/pictogram/index.yaml @@ -26,3 +26,10 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Icons + slug: foundation/icon + - title: Symbols + slug: components/symbol + - title: Logos + slug: foundation/logo diff --git a/apps/site/src/content/design-system/foundation/pictogram/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/pictogram/relatedArticles.mdoc new file mode 100644 index 000000000..78ed2ce1c --- /dev/null +++ b/apps/site/src/content/design-system/foundation/pictogram/relatedArticles.mdoc @@ -0,0 +1,7 @@ +**Colour system** + +Why we've done it, how it works and why you should use it. Read about the [colour](/articles/colour) system. + +**Multi-brand** + +Strategic approach to digital brand management and delivery. Find out how to [think multi-brand](/articles/multi-brand-made-easy). diff --git a/apps/site/src/content/design-system/foundation/text-styling/design/visual-design/content.mdoc b/apps/site/src/content/design-system/foundation/text-styling/design/visual-design/content.mdoc deleted file mode 100644 index ae55514d2..000000000 --- a/apps/site/src/content/design-system/foundation/text-styling/design/visual-design/content.mdoc +++ /dev/null @@ -1 +0,0 @@ -See [Fonts](/design-system/foundation/fonts) for further information on the use of typography diff --git a/apps/site/src/content/design-system/foundation/text-styling/index.yaml b/apps/site/src/content/design-system/foundation/text-styling/index.yaml index b02a938c0..f3491b972 100644 --- a/apps/site/src/content/design-system/foundation/text-styling/index.yaml +++ b/apps/site/src/content/design-system/foundation/text-styling/index.yaml @@ -28,3 +28,6 @@ accessibility: - title: name: Accessibility API slug: accessibility-api +relatedComponents: + - title: Fonts + slug: foundation/font diff --git a/apps/site/src/content/design-system/foundation/text-styling/relatedArticles.mdoc b/apps/site/src/content/design-system/foundation/text-styling/relatedArticles.mdoc new file mode 100644 index 000000000..f11153f9c --- /dev/null +++ b/apps/site/src/content/design-system/foundation/text-styling/relatedArticles.mdoc @@ -0,0 +1,7 @@ +**Typography** + +Why we've done it, how it works and why you should use it. Read about [typography](/articles/typography). + +**Multi-brand** + +Strategic approach to digital brand management and delivery. Find out how to [think multi-brand](/articles/multi-brand-made-easy). diff --git a/apps/site/src/content/design-system/patterns/addresses/auto-address/index.yaml b/apps/site/src/content/design-system/patterns/addresses/auto-address/index.yaml index 65a28c411..af4e6ddbc 100644 --- a/apps/site/src/content/design-system/patterns/addresses/auto-address/index.yaml +++ b/apps/site/src/content/design-system/patterns/addresses/auto-address/index.yaml @@ -17,3 +17,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/addresses/complex-address/index.yaml b/apps/site/src/content/design-system/patterns/addresses/complex-address/index.yaml index 32ed076d4..4929a1389 100644 --- a/apps/site/src/content/design-system/patterns/addresses/complex-address/index.yaml +++ b/apps/site/src/content/design-system/patterns/addresses/complex-address/index.yaml @@ -10,3 +10,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/addresses/manual-address/index.yaml b/apps/site/src/content/design-system/patterns/addresses/manual-address/index.yaml index a050b427b..d99638d10 100644 --- a/apps/site/src/content/design-system/patterns/addresses/manual-address/index.yaml +++ b/apps/site/src/content/design-system/patterns/addresses/manual-address/index.yaml @@ -13,3 +13,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/dates/date-of-birth/index.yaml b/apps/site/src/content/design-system/patterns/dates/date-of-birth/index.yaml index 777e8518a..b44c2d009 100644 --- a/apps/site/src/content/design-system/patterns/dates/date-of-birth/index.yaml +++ b/apps/site/src/content/design-system/patterns/dates/date-of-birth/index.yaml @@ -19,3 +19,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/dates/expiry-date/index.yaml b/apps/site/src/content/design-system/patterns/dates/expiry-date/index.yaml index d3339228a..7bfb8b6a4 100644 --- a/apps/site/src/content/design-system/patterns/dates/expiry-date/index.yaml +++ b/apps/site/src/content/design-system/patterns/dates/expiry-date/index.yaml @@ -16,3 +16,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/personal-details/email/index.yaml b/apps/site/src/content/design-system/patterns/personal-details/email/index.yaml index 3df2cf167..1db0e2efb 100644 --- a/apps/site/src/content/design-system/patterns/personal-details/email/index.yaml +++ b/apps/site/src/content/design-system/patterns/personal-details/email/index.yaml @@ -16,3 +16,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/personal-details/employment/index.yaml b/apps/site/src/content/design-system/patterns/personal-details/employment/index.yaml index d7696fcab..71a9fb5c1 100644 --- a/apps/site/src/content/design-system/patterns/personal-details/employment/index.yaml +++ b/apps/site/src/content/design-system/patterns/personal-details/employment/index.yaml @@ -16,3 +16,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/personal-details/name/index.yaml b/apps/site/src/content/design-system/patterns/personal-details/name/index.yaml index e5815b650..53ea02ac2 100644 --- a/apps/site/src/content/design-system/patterns/personal-details/name/index.yaml +++ b/apps/site/src/content/design-system/patterns/personal-details/name/index.yaml @@ -17,3 +17,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/personal-details/phone/index.yaml b/apps/site/src/content/design-system/patterns/personal-details/phone/index.yaml index 8f3a68e3c..13b026fd1 100644 --- a/apps/site/src/content/design-system/patterns/personal-details/phone/index.yaml +++ b/apps/site/src/content/design-system/patterns/personal-details/phone/index.yaml @@ -1,4 +1,4 @@ -name: Phone +name: Phone number description: >- This pattern is used for accurately capturing phone numbers. Only capture what you need for your application. @@ -19,3 +19,10 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Input fields + slug: components/input-field + - title: Alerts + slug: components/alert diff --git a/apps/site/src/content/design-system/patterns/tax-file-number/index.yaml b/apps/site/src/content/design-system/patterns/tax-file-number/index.yaml index 49a111eea..ed6e57788 100644 --- a/apps/site/src/content/design-system/patterns/tax-file-number/index.yaml +++ b/apps/site/src/content/design-system/patterns/tax-file-number/index.yaml @@ -16,3 +16,8 @@ design: name: Pattern examples in code slug: pattern-examples-in-code accessibility: [] +relatedComponents: + - title: Text inputs + slug: components/input + - title: Alerts + slug: components/alert diff --git a/apps/site/tailwind.config.ts b/apps/site/tailwind.config.ts index 34663735f..7f493f540 100644 --- a/apps/site/tailwind.config.ts +++ b/apps/site/tailwind.config.ts @@ -82,6 +82,14 @@ const config: Config = withGEL({ 'sm:typography-body-6', 'md:typography-body-4', 'lg:typography-body-2', + 'w-[15.625rem]', + 'w-[12rem]', + '[&_li]:my-1', + '[&_li]:underline', + 'ml-2', + 'text-success', + 'text-danger', + 'font-bold', ], plugins: [SitePlugin], options: { diff --git a/helpers/create-package/index.js b/helpers/create-package/index.js index 5d15cdf51..f6651ddf4 100644 --- a/helpers/create-package/index.js +++ b/helpers/create-package/index.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ const shell = require('child_process').execSync; const fs = require('fs'); const readline = require('readline'); diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index c51270286..844ca4cb5 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -50,6 +50,7 @@ module.exports = { ignoredKeys: ['compoundVariants', 'defaultVariants', 'responsiveVariants', 'compoundSlots'], }, ], + 'no-console': 'error', }, settings: { 'import/parsers': { diff --git a/packages/ui/src/components/alert/alert.stories.tsx b/packages/ui/src/components/alert/alert.stories.tsx index 3fa388c17..ef8a81f67 100644 --- a/packages/ui/src/components/alert/alert.stories.tsx +++ b/packages/ui/src/components/alert/alert.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { TelephoneIcon } from '../icon/index.js'; diff --git a/packages/ui/src/components/button-dropdown/components/panel/panel.component.tsx b/packages/ui/src/components/button-dropdown/components/panel/panel.component.tsx index f3f4db18c..f20add3e6 100644 --- a/packages/ui/src/components/button-dropdown/components/panel/panel.component.tsx +++ b/packages/ui/src/components/button-dropdown/components/panel/panel.component.tsx @@ -16,7 +16,7 @@ export function Panel({ className, children, state, block, id, ...props }: Panel // Added this based on accessibility features seen https://gel.westpacgroup.com.au/design-system/components/button-dropdowns?b=WBC&tab=accessibility and React Aria doesn't do this const focusHandler = useCallback( - (event: globalThis.FocusEvent) => { + (event: FocusEvent) => { if ( event.target && popoverRef.current && @@ -31,8 +31,15 @@ export function Panel({ className, children, state, block, id, ...props }: Panel // React Aria does not handle click as we need when isNonModal is true so this is needed const clickHandler = useCallback( - (event: globalThis.MouseEvent) => { - if (event.target && popoverRef.current && !popoverRef.current.contains(event.target as Node) && state.isOpen) + (event: MouseEvent) => { + if ( + event.target && + props.triggerRef.current && + !props.triggerRef.current.contains(event.target as Node) && + popoverRef.current && + !popoverRef.current.contains(event.target as Node) && + state.isOpen + ) state.close(); }, [state.isOpen], diff --git a/packages/ui/src/components/button/button.component.tsx b/packages/ui/src/components/button/button.component.tsx index b20b23079..b2e510f1e 100644 --- a/packages/ui/src/components/button/button.component.tsx +++ b/packages/ui/src/components/button/button.component.tsx @@ -13,7 +13,7 @@ function BaseButton( size = 'medium', look = 'hero', soft, - block, + block = false, justify, tag: Tag = 'button', iconBefore: IconBefore, diff --git a/packages/ui/src/components/button/button.spec.tsx b/packages/ui/src/components/button/button.spec.tsx index b45bd4cff..74bd84595 100644 --- a/packages/ui/src/components/button/button.spec.tsx +++ b/packages/ui/src/components/button/button.spec.tsx @@ -17,7 +17,7 @@ describe('Button', () => { it('renders the style correctly', () => { const style = styles({ look: 'primary', size: 'medium' }); expect(style.base()).toBe( - 'inline-flex items-center justify-center rounded leading-[1.5] transition-[background] disabled:pointer-events-none disabled:opacity-50 group-[.add-on-after]:rounded-l-none group-[.add-on-before]:rounded-r-none typography-body-9 px-2 py-[0.3125rem] active-theme-rams:before:h-[0.125rem] relative border border-primary bg-primary text-white hover:bg-primary-70 active:bg-primary-50 active-theme-rams:border-b-pop active-theme-rams:before:absolute active-theme-rams:before:bottom-0 active-theme-rams:before:block active-theme-rams:before:w-full active-theme-rams:before:bg-pop', + 'items-center justify-center rounded leading-[1.5] transition-[background] disabled:pointer-events-none disabled:opacity-50 group-[.add-on-after]:rounded-l-none group-[.add-on-before]:rounded-r-none typography-body-9 active-theme-rams:before:h-[0.125rem] px-2 py-[0.3125rem] border-primary bg-primary hover:bg-primary-70 active:bg-primary-50 active-theme-rams:border-b-pop active-theme-rams:before:absolute active-theme-rams:before:bottom-0 active-theme-rams:before:block active-theme-rams:before:w-full active-theme-rams:before:bg-pop relative border text-white', ); }); diff --git a/packages/ui/src/components/button/button.styles.ts b/packages/ui/src/components/button/button.styles.ts index 8968dc962..d6deebf35 100644 --- a/packages/ui/src/components/button/button.styles.ts +++ b/packages/ui/src/components/button/button.styles.ts @@ -6,7 +6,7 @@ import { tv } from 'tailwind-variants'; export const styles = tv( { slots: { - base: 'inline-flex items-center justify-center rounded leading-[1.5] transition-[background] disabled:pointer-events-none disabled:opacity-50 group-[.add-on-after]:rounded-l-none group-[.add-on-before]:rounded-r-none', + base: 'items-center justify-center rounded leading-[1.5] transition-[background] disabled:pointer-events-none disabled:opacity-50 group-[.add-on-after]:rounded-l-none group-[.add-on-before]:rounded-r-none', iconBefore: '', iconAfter: '', dropdown: 'ml-[0.4em]', @@ -14,17 +14,17 @@ export const styles = tv( }, variants: { size: { - small: { base: 'typography-body-10 px-2 pb-[0.25rem] pt-0.5 active-theme-rams:before:h-[0.0625rem]' }, - medium: { base: 'typography-body-9 px-2 py-[0.3125rem] active-theme-rams:before:h-[0.125rem]' }, - large: { base: 'typography-body-9 px-2.5 py-[0.5rem] active-theme-rams:before:h-0.5' }, - xlarge: { base: 'typography-body-8 px-3 pb-[0.625rem] pt-1.5 active-theme-rams:before:h-[0.25rem]' }, + small: { base: 'typography-body-10 active-theme-rams:before:h-[0.0625rem] px-2 pb-[0.25rem] pt-0.5' }, + medium: { base: 'typography-body-9 active-theme-rams:before:h-[0.125rem] px-2 py-[0.3125rem]' }, + large: { base: 'typography-body-9 active-theme-rams:before:h-0.5 px-2.5 py-[0.5rem]' }, + xlarge: { base: 'typography-body-8 active-theme-rams:before:h-[0.25rem] px-3 pb-[0.625rem] pt-1.5' }, }, look: { primary: { - base: 'relative border border-primary bg-primary text-white hover:bg-primary-70 active:bg-primary-50 active-theme-rams:border-b-pop active-theme-rams:before:absolute active-theme-rams:before:bottom-0 active-theme-rams:before:block active-theme-rams:before:w-full active-theme-rams:before:bg-pop', + base: 'border-primary bg-primary hover:bg-primary-70 active:bg-primary-50 active-theme-rams:border-b-pop active-theme-rams:before:absolute active-theme-rams:before:bottom-0 active-theme-rams:before:block active-theme-rams:before:w-full active-theme-rams:before:bg-pop relative border text-white', }, - hero: { base: 'border border-hero bg-hero text-white hover:bg-hero-70 active:bg-hero-50' }, - faint: { base: 'border border-border bg-light text-muted hover:bg-white active:bg-white' }, + hero: { base: 'border-hero bg-hero hover:bg-hero-70 active:bg-hero-50 border text-white' }, + faint: { base: 'border-border bg-light text-muted border hover:bg-white active:bg-white' }, link: { base: 'text-link underline' }, }, soft: { @@ -32,6 +32,7 @@ export const styles = tv( }, block: { true: { base: 'flex w-full' }, + false: { base: 'inline-flex w-auto' }, }, justify: { true: { base: 'justify-between' }, @@ -49,7 +50,7 @@ export const styles = tv( slots: ['base'], look: 'primary', soft: true, - className: 'text-text hover:text-white active-theme-rams:text-primary active-theme-rams:hover:text-white', + className: 'text-text active-theme-rams:text-primary active-theme-rams:hover:text-white hover:text-white', }, { slots: ['base'], diff --git a/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx b/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx index 4ebc5ec6d..54ee61faa 100644 --- a/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx +++ b/packages/ui/src/components/checkbox-group/checkbox-group.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { CheckboxGroup } from './checkbox-group.component.js'; diff --git a/packages/ui/src/components/date-picker/date-picker.component.tsx b/packages/ui/src/components/date-picker/date-picker.component.tsx index b50445a08..07cdad5cf 100644 --- a/packages/ui/src/components/date-picker/date-picker.component.tsx +++ b/packages/ui/src/components/date-picker/date-picker.component.tsx @@ -20,8 +20,9 @@ export function DatePicker({ max, value, id, - size = 'xl', + size = 'md', name, + block = false, ...props }: DatePickerProps) { const [initialized, setInitialized] = useState(false); @@ -121,5 +122,5 @@ export function DatePicker({ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - return ; + return ; } diff --git a/packages/ui/src/components/date-picker/date-picker.stories.tsx b/packages/ui/src/components/date-picker/date-picker.stories.tsx index 6b22d72d0..e766ab805 100644 --- a/packages/ui/src/components/date-picker/date-picker.stories.tsx +++ b/packages/ui/src/components/date-picker/date-picker.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { useState } from 'react'; diff --git a/packages/ui/src/components/date-picker/date-picker.styles.ts b/packages/ui/src/components/date-picker/date-picker.styles.ts index 0a72d7526..cc8fa21bb 100644 --- a/packages/ui/src/components/date-picker/date-picker.styles.ts +++ b/packages/ui/src/components/date-picker/date-picker.styles.ts @@ -10,6 +10,10 @@ export const styles = tv( lg: 'date-picker-lg', xl: 'date-picker-xl', }, + block: { + true: 'date-picker-block', + false: '', + }, }, }, { responsiveVariants: ['xsl', 'sm', 'md', 'lg', 'xl'] }, diff --git a/packages/ui/src/components/date-picker/date-picker.types.ts b/packages/ui/src/components/date-picker/date-picker.types.ts index 1f2af8f52..30f497706 100644 --- a/packages/ui/src/components/date-picker/date-picker.types.ts +++ b/packages/ui/src/components/date-picker/date-picker.types.ts @@ -17,6 +17,10 @@ export type DuetDatePickerElement = Element & { type Variants = VariantProps; export type DatePickerProps = { + /** + * Make Datepicker block + */ + block?: Variants['block']; /* * Disable specific dates. Must be in IS0-8601 format: YYYY-MM-DD */ diff --git a/packages/ui/src/components/icon/icon.stories.tsx b/packages/ui/src/components/icon/icon.stories.tsx index cd8311adc..7d642cf26 100644 --- a/packages/ui/src/components/icon/icon.stories.tsx +++ b/packages/ui/src/components/icon/icon.stories.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { type Meta, StoryFn, type StoryObj } from '@storybook/react'; import { ChangeEvent, useCallback, useMemo, useState } from 'react'; @@ -35,7 +36,7 @@ const AllIconsExample = (props: AllIcons.IconProps) => { return (
    @@ -43,7 +44,7 @@ const AllIconsExample = (props: AllIcons.IconProps) => { {filteredIcons.map(({ key, Icon }) => (