Skip to content

Commit

Permalink
Merge pull request #388 from WestpacGEL/fix/site-ds-grid
Browse files Browse the repository at this point in the history
fix(site): update max width for design-system containers
  • Loading branch information
samithaf authored Nov 27, 2023
2 parents 6cc0789 + a65573a commit c1cb5c6
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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 <GELContainer className={clsx('max-w-gel-container', className)} {...props} />;
}
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 2 additions & 0 deletions apps/site/src/app/design-system/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
@@ -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 ? (
<section className="bg-background">
<Container className="py-7 text-center sm:py-15">
<Container tag="section" className="py-7 text-center sm:py-15">
<>{children}</>
</Container>
</section>
Expand Down
3 changes: 3 additions & 0 deletions apps/site/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ const config: Config = withGEL({
'gel-muted': '#575F65',
'gel-hover': '#F9FAFB',
},
maxWidth: {
'gel-container': '71.5rem',
},
},
},
safelist: [
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/grid/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { Grid } from './grid.component.js';
export { Container, Item } from './components/index.js';
export { type GridProps } from './grid.types.js';
export { type ContainerProps } from './components/container/container.types.js';

0 comments on commit c1cb5c6

Please sign in to comment.