-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
131 changed files
with
2,518 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
module.exports = { | ||
reactStrictMode: false, | ||
images: { | ||
domains: ['res.cloudinary.com'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
apps/site/src/app/(home)/components/article-tile/article-tile.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { Article } from '@/types/article.types'; | ||
import { type Article } from '@/types/article.types'; | ||
|
||
import { type ArticleRowsProps } from '../home-page/home-page.types'; | ||
|
||
export type ArticleTileProps = { | ||
article: Omit<Article, 'content'>; | ||
className?: string; | ||
index: number; | ||
layout: ArticleRowsProps['layout']; | ||
slug?: string; | ||
}; |
53 changes: 53 additions & 0 deletions
53
apps/site/src/app/(home)/components/brand-select/brand-select.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { ExpandLessIcon, ExpandMoreIcon } from '@westpac/ui/icon'; | ||
import React, { useRef } from 'react'; | ||
import { AriaLinkOptions, mergeProps, useButton, useFocusRing, useSelect } from 'react-aria'; | ||
import { Item, ItemProps, useSelectState } from 'react-stately'; | ||
|
||
import { GELLogo } from '@/components/logos'; | ||
|
||
import { styles as sidebarSelectStyles } from './brand-select.styles'; | ||
import { type BrandSelectProps } from './brand-select.types'; | ||
import { ListBox } from './components/list-box'; | ||
import { Popover } from './components/popover'; | ||
|
||
export function BrandSelect(props: BrandSelectProps) { | ||
// Create state based on the incoming props | ||
const state = useSelectState(props); | ||
|
||
// Get props for child elements from useSelect | ||
const ref = useRef(null); | ||
|
||
const { labelProps, triggerProps, valueProps, menuProps } = useSelect(props, state, ref); | ||
// Get props for the button based on the trigger props from useSelect | ||
|
||
const { buttonProps } = useButton(triggerProps, ref); | ||
|
||
const { focusProps, isFocusVisible } = useFocusRing(); | ||
const styles = sidebarSelectStyles({ isFocusVisible, isOpen: state.isOpen }); | ||
|
||
return ( | ||
<div className={styles.base()}> | ||
<div {...labelProps} className={styles.label()}> | ||
{props.label} | ||
</div> | ||
|
||
<button {...mergeProps(buttonProps, focusProps)} ref={ref} className={styles.button()}> | ||
<div className={styles.textWrapper()}> | ||
<div className="flex w-full items-center gap-2 overflow-hidden text-ellipsis py-2" {...valueProps}> | ||
<GELLogo className="w-[2.8125rem] shrink-0" /> | ||
<span className="mb-[-0.3rem] shrink truncate">Design System</span> | ||
</div> | ||
</div> | ||
<div aria-hidden="true" className={styles.iconWrapper()}> | ||
{state.isOpen ? <ExpandLessIcon className="text-gel-link" /> : <ExpandMoreIcon className="text-gel-link" />} | ||
</div> | ||
</button> | ||
{state.isOpen && ( | ||
<Popover state={state} triggerRef={ref} placement="bottom start" className={styles.popover()}> | ||
<ListBox {...menuProps} state={state} /> | ||
</Popover> | ||
)} | ||
</div> | ||
); | ||
} | ||
BrandSelect.Option = Item as (props: ItemProps<AriaLinkOptions> & AriaLinkOptions & { href?: string }) => JSX.Element; |
33 changes: 33 additions & 0 deletions
33
apps/site/src/app/(home)/components/brand-select/brand-select.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { tv } from 'tailwind-variants'; | ||
|
||
export const styles = tv( | ||
{ | ||
slots: { | ||
base: 'relative flex w-full flex-col', | ||
label: 'block cursor-default text-left text-sm font-medium text-text', | ||
button: | ||
'relative flex h-11 max-w-full cursor-pointer flex-row items-stretch overflow-hidden outline-none focus:focus-outline', | ||
// TODO: this is a workaround to align, but need to find a better way. | ||
popover: 'ml-[-0.75rem] w-full', | ||
// icon: 'text-primary transition-transform', | ||
iconWrapper: 'flex flex-shrink-0 items-center text-primary', | ||
textWrapper: 'flex flex-shrink items-center overflow-hidden pr-2', | ||
}, | ||
variants: { | ||
isFocusVisible: { | ||
true: { | ||
base: '', | ||
}, | ||
false: {}, | ||
}, | ||
isOpen: { | ||
true: { | ||
icon: 'rotate-90', | ||
}, | ||
false: {}, | ||
}, | ||
}, | ||
compoundSlots: [], | ||
}, | ||
{ responsiveVariants: ['xsl', 'sm', 'md', 'lg', 'xl'] }, | ||
); |
6 changes: 6 additions & 0 deletions
6
apps/site/src/app/(home)/components/brand-select/brand-select.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { AriaSelectProps } from 'react-aria'; | ||
import { type VariantProps } from 'tailwind-variants'; | ||
|
||
import { styles } from './brand-select.styles.js'; | ||
|
||
export type BrandSelectProps<T = any> = VariantProps<typeof styles> & AriaSelectProps<T>; |
2 changes: 2 additions & 0 deletions
2
apps/site/src/app/(home)/components/brand-select/components/list-box/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './list-box-option'; | ||
export * from './list-box-section'; |
2 changes: 2 additions & 0 deletions
2
...pp/(home)/components/brand-select/components/list-box/components/list-box-option/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { Option } from './list-box-option.component'; | ||
export { type OptionProps } from './list-box-option.types'; |
Oops, something went wrong.
6e7bee1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
gel-next-site – ./apps/site
gel-next-site.vercel.app
gel-next-site-git-main-westpacgel.vercel.app
gel-next-site-westpacgel.vercel.app