diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/accessibility-content/accessibility-content.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/accessibility-content/accessibility-content.component.tsx index 20798f85c..68ea936dc 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/accessibility-content/accessibility-content.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/accessibility-content/accessibility-content.component.tsx @@ -1,9 +1,10 @@ 'use client'; import { DocumentRenderer } from '@keystatic/core/renderer'; -import { Container, Grid, Item, Select } from '@westpac/ui'; +import { Grid, Item, Select } from '@westpac/ui'; import { useId, useState } from 'react'; +import { Container } from '@/app/design-system/components'; import { Section } from '@/components/content-blocks/section'; import { Link, Text } from '@/components/content-blocks/typography'; import { Code, Heading } from '@/components/document-renderer'; @@ -32,55 +33,53 @@ export function AccessibilityContent({ accessibilitySections, accessibilityDemo return ( <> -
- - - Colour impairment demonstration - - - - - All components are designed and tested to ensure colour contrast ratios comply with the WCAG 2.1 AA - specification. Select a filter from the list below to see how this component would appear to someone - with a: colour vision impairment. - - - - {accessibilityDemo && ( - <> -
- - -
- - , - }, - }} - componentBlocks={{}} - /> - - - )} -
-
+ {accessibilityDemo && ( +
+ + + Colour impairment demonstration + + + + + All components are designed and tested to ensure colour contrast ratios comply with the WCAG 2.1 AA + specification. Select a filter from the list below to see how this component would appear to someone + with a: colour vision impairment. + + + +
+ + +
+ + , + }, + }} + componentBlocks={{}} + /> + +
+
+ )} {accessibilitySections?.map(({ title, content }) => { const id = title.toLowerCase().split(' ').join('-'); return ( 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 f3741dbea..4f8319d24 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 @@ -2,10 +2,11 @@ import { DocumentElement } from '@keystatic/core'; import { DocumentRenderer } from '@keystatic/core/renderer'; -import { Button, Container, Grid, Item } from '@westpac/ui'; +import { Button, Grid, Item } from '@westpac/ui'; import { NewWindowIcon } from '@westpac/ui/icon'; import { useMemo } from 'react'; +import { Container } from '@/app/design-system/components'; import { ComponentPropsTable } from '@/components/component-props-table'; import { Code } from '@/components/content-blocks/typography'; import { Heading } from '@/components/document-renderer'; 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 a4904871b..95952c862 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 @@ -1,9 +1,9 @@ 'use client'; import { DocumentRenderer } from '@keystatic/core/renderer'; -import { Container } from '@westpac/ui'; import { useMemo } from 'react'; +import { Container } from '@/app/design-system/components'; 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'; diff --git a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/intro/intro.component.tsx b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/intro/intro.component.tsx index e4eeddce4..2b118bf91 100644 --- a/apps/site/src/app/design-system/[...component]/components/content-tabs/components/intro/intro.component.tsx +++ b/apps/site/src/app/design-system/[...component]/components/content-tabs/components/intro/intro.component.tsx @@ -1,6 +1,8 @@ 'use client'; -import { Container, Grid, Item } from '@westpac/ui'; +import { Grid, Item } from '@westpac/ui'; + +import { Container } from '@/app/design-system/components'; import { TableOfContents } from './components'; 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 0785b7ce5..775259924 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 @@ -7,7 +7,7 @@ import { AccessibilitySectionProps } from './components/accessibility-content/ac import { DesignSectionProps } from './components/design-content/design-content.types'; export type ContentTabsProps = { - accessibilityDemo: DocumentElement[]; + accessibilityDemo?: DocumentElement[]; accessibilitySections: AccessibilitySectionProps[]; code?: DocumentElement[]; componentProps?: ComponentProps; diff --git a/apps/site/src/app/design-system/[...component]/page.tsx b/apps/site/src/app/design-system/[...component]/page.tsx index 2dade3bc4..ac4571274 100644 --- a/apps/site/src/app/design-system/[...component]/page.tsx +++ b/apps/site/src/app/design-system/[...component]/page.tsx @@ -102,6 +102,7 @@ export default async function ComponentPage({ params }: { params: { component: s ]); 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 componentProps: ComponentProps | undefined = (json as any)[componentName]; const subComponentProps = Object.entries(json).reduce((acc, [key, value]: [string, any]) => { @@ -116,7 +117,7 @@ export default async function ComponentPage({ params }: { params: { component: s content={{ westpacUIInfo: westpacInfo, accessibilitySections, - accessibilityDemo, + accessibilityDemo: accessibilityIsEmpty ? undefined : accessibilityDemo, code: codeIsEmpty ? undefined : code, description: content.description, designSections, diff --git a/apps/site/src/app/design-system/components/container/container.component.tsx b/apps/site/src/app/design-system/components/container/container.component.tsx new file mode 100644 index 000000000..fac966c36 --- /dev/null +++ b/apps/site/src/app/design-system/components/container/container.component.tsx @@ -0,0 +1,6 @@ +import { type ContainerProps, Container as GELContainer } from '@westpac/ui/grid'; +import { clsx } from 'clsx'; + +export function Container({ className, ...props }: ContainerProps) { + return ; +} 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 24d39d4fb..df304c05c 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 @@ -1,9 +1,10 @@ 'use client'; -import { Container, Grid, Item } from '@westpac/ui'; +import { Grid, Item } from '@westpac/ui'; import { AccessibilityPictogram, StopwatchPictogram, TruckPictogram } from '@westpac/ui/pictogram'; import { useSearchParams } from 'next/navigation'; +import { Container } from '@/app/design-system/components'; import { type BrandKey } from '@/app/types/brand.types'; import { BackgroundImage, Header } from './components'; diff --git a/apps/site/src/app/design-system/components/index.ts b/apps/site/src/app/design-system/components/index.ts index 15f127105..8df8ffbf9 100644 --- a/apps/site/src/app/design-system/components/index.ts +++ b/apps/site/src/app/design-system/components/index.ts @@ -6,3 +6,5 @@ export { Hero } from './hero/hero.component'; export { Section } from './section/section.component'; export { SectionHeading } from './section/section-heading.component'; export { SectionItem } from './section/section-item.component'; + +export { Container } from './container/container.component'; diff --git a/apps/site/src/app/design-system/components/section/section.component.tsx b/apps/site/src/app/design-system/components/section/section.component.tsx index 550ad0b02..3ac81c29e 100644 --- a/apps/site/src/app/design-system/components/section/section.component.tsx +++ b/apps/site/src/app/design-system/components/section/section.component.tsx @@ -1,11 +1,11 @@ 'use client'; -import { Container } from '@westpac/ui'; +import { Container } from '@/app/design-system/components'; export function Section({ background, children }: { background?: boolean; children: React.ReactNode }) { return background ? (
- + <>{children}
diff --git a/apps/site/src/components/related-info/related-info.component.tsx b/apps/site/src/components/related-info/related-info.component.tsx index e74a956e3..5c3577510 100644 --- a/apps/site/src/components/related-info/related-info.component.tsx +++ b/apps/site/src/components/related-info/related-info.component.tsx @@ -23,7 +23,7 @@ export function RelatedInfo({ relatedComponents = [] }: RelatedInfoProps) {
    {relatedComponents.map(relatedComponent => { const componentURL = relatedComponent.split('/').reverse()[0]; - const componentName = componentURL.split('-').join(' '); + const componentName = componentURL[0].toUpperCase() + componentURL.slice(1).split('-').join(' '); return (
  • {componentName} diff --git a/apps/site/src/content/design-system/components/accordion/design/Accordion/content.mdoc b/apps/site/src/content/design-system/components/accordion/design/Accordion/content.mdoc deleted file mode 100644 index 2b1f0a987..000000000 --- a/apps/site/src/content/design-system/components/accordion/design/Accordion/content.mdoc +++ /dev/null @@ -1,39 +0,0 @@ -**Default accordion:** See Visual design for the usage recommendations for the default style. - -```jsx - - {[ - { key: 'files', title: 'Your files' }, - { key: 'shared', title: 'Shared with you' }, - { key: 'last', title: 'Last item' }, - ].map(({ key, title }) => ( - -

    {title}

    -

    - Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quaerat in, nobis itaque iste sequi, pariatur, nam - reiciendis quasi illum nulla aliquid mollitia corrupti nostrum incidunt? At minima error nobis ullam! -

    -
    - ))} -
    -``` - -**Lego accordion:** See Visual design for the usage recommendations for the lego style. - -```jsx - - {[ - { key: 'files', title: 'Your files' }, - { key: 'shared', title: 'Shared with you' }, - { key: 'last', title: 'Last item' }, - ].map(({ key, title }) => ( - -

    {title}

    -

    - Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quaerat in, nobis itaque iste sequi, pariatur, nam - reiciendis quasi illum nulla aliquid mollitia corrupti nostrum incidunt? At minima error nobis ullam! -

    -
    - ))} -
    -``` 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 deleted file mode 100644 index ea461ece0..000000000 --- a/apps/site/src/content/design-system/components/breadcrumb/design/Breadcrumbs/content.mdoc +++ /dev/null @@ -1,23 +0,0 @@ -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 - - - -``` diff --git a/apps/site/src/content/design-system/components/collapsible/design/Examples/content.mdoc b/apps/site/src/content/design-system/components/collapsible/design/Examples/content.mdoc deleted file mode 100644 index 5d3ed535d..000000000 --- a/apps/site/src/content/design-system/components/collapsible/design/Examples/content.mdoc +++ /dev/null @@ -1,87 +0,0 @@ -### Basic - -Used much in the same way as an [accordion or tabcordion](/design-system/components/tabcordions), a Collapsible toggles to open and reveal more content below. - -```jsx - -

    - It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll - look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little histories - about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because they would - not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn you if you hold - it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and she had never - forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree with you, sooner - or later. -

    -
    -``` - -### Sizes - -```jsx -
    -
    - Small - - -

    - It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll - look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little - histories about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because - they would not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn - you if you hold it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and - she had never forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree - with you, sooner or later. -

    -
    -
    -
    -
    - Medium (default) - - -

    - It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll - look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little - histories about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because - they would not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn - you if you hold it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and - she had never forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree - with you, sooner or later. -

    -
    -
    -
    -
    - Large - - -

    - It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll - look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little - histories about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because - they would not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn - you if you hold it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and - she had never forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree - with you, sooner or later. -

    -
    -
    -
    -
    - XLarge - - -

    - It was all very well to say ‘Drink me,’ but the wise little Alice was not going to do that in a hurry. ‘No, I’ll - look first,’ she said, ‘and see whether it’s marked “poison” or not’; for she had read several nice little - histories about children who had got burnt, and eaten up by wild beasts and other unpleasant things, all because - they would not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn - you if you hold it too long; and that if you cut your finger very deeply with a knife, it usually bleeds; and - she had never forgotten that, if you drink much from a bottle marked ‘poison,’ it is almost certain to disagree - with you, sooner or later. -

    -
    -
    -
    -``` diff --git a/apps/site/src/content/design-system/components/compacta/design/Default/content.mdoc b/apps/site/src/content/design-system/components/compacta/design/Default/content.mdoc deleted file mode 100644 index efa9827d6..000000000 --- a/apps/site/src/content/design-system/components/compacta/design/Default/content.mdoc +++ /dev/null @@ -1,56 +0,0 @@ -Below is an example of how a Compacta may be used with fields and inputs. Any form related elements can exist inside a Compacta. - -```tsx -() => { - const [inputs, setInputs] = useState({}); - - const handleChange = (e: ChangeEvent) => { - setInputs((prev: object) => ({ ...prev, [e.target.name]: e.target.value })); - }; - - return ( - - {({ id, setPrimaryTitle, setSecondaryTitle, setTertiaryTitle }) => ( -
    - - Primary - Primary title text - { - handleChange(e); - setPrimaryTitle(e.target.value); - }} - /> - - - Secondary - Secondary title text - { - handleChange(e); - setSecondaryTitle(e.target.value); - }} - /> - - - Tertiary - Tertiary title text - { - handleChange(e); - setTertiaryTitle(e.target.value); - }} - /> - -
    - )} -
    - ); -}; -``` 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 deleted file mode 100644 index 0f0690b83..000000000 --- a/apps/site/src/content/design-system/components/date-picker/design/Sizes/content.mdoc +++ /dev/null @@ -1,13 +0,0 @@ -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} - -
    - )); -}; -``` diff --git a/apps/site/src/content/design-system/components/input/accessibilityDemo.mdoc b/apps/site/src/content/design-system/components/input/accessibilityDemo.mdoc index b43503140..3aaad2149 100644 --- a/apps/site/src/content/design-system/components/input/accessibilityDemo.mdoc +++ b/apps/site/src/content/design-system/components/input/accessibilityDemo.mdoc @@ -1,14 +1,14 @@ ```tsx () => { - const DEFAULT_OPTIONS = ['small', 'medium', 'large', 'xlarge'] as const; + const DEFAULT_OPTIONS = ['1', '2', '3'] as const; const SIZES = ['small', 'medium', 'large', 'xlarge'] as const; return (
    {SIZES.map(size => (
    -

    {size}

    - + {DEFAULT_OPTIONS.map(option => (
    - + + + + +
    -