Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/style fixes #908

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function Address() {
Review and submit
</CustomHeading>
<ReviewSection baseEditRoute="/credit-cards" sections={SECTION_ITEMS} />
<div className="border-t-[1px] border-t-border pt-5">
<div className="border-t border-t-border pt-5">
<PhoneIcon color="primary" size="large" className="mb-5" />
<h3 className="typography-body-8 pb-5 font-bold text-heading">Help protect your application</h3>
<p>Before continuing we’ll send you a one-time passcode to your mobile for added security.</p>
Expand Down
4 changes: 2 additions & 2 deletions apps/protoform/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SidebarContextProvider } from '@/components/sidebar/context';
import { Sidebar } from '@/components/sidebar/sidebar';

export const metadata: Metadata = {
title: 'Create Next App',
title: 'Protoform',
description: 'Generated by create next app',
};

Expand All @@ -20,7 +20,7 @@ export default function RootLayout({
return (
<html lang="en" data-theme="wbc">
<body>
<main className="m-auto max-w-[1922px] border border-white">
<main className="m-auto max-w-[1923px] border border-border border-y-0 overscroll-y-none">
<CustomHeader />
<SidebarContextProvider>
<Sidebar />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ContentWrapper({ children }: { children: ReactNode }) {
return (
<section
className={clsx(
'min-h-screen before:pointer-events-none before:sticky before:inset-x-auto before:top-[66px] before:z-10 before:block before:h-1 before:bg-gradient-to-b before:from-black/[.2] before:from-0% before:opacity-0 before:transition-[opacity] before:duration-200 before:will-change-[opacity]',
'min-h-[90vh] before:pointer-events-none before:sticky before:inset-x-auto before:top-[66px] before:z-10 before:block before:h-1 before:bg-gradient-to-b before:from-black/[.2] before:from-0% before:opacity-0 before:transition-[opacity] before:duration-200 before:will-change-[opacity]',
{
'md:mr-[300px] before:right-[300px]': open,
'md:before:opacity-100': scrolled,
Expand All @@ -42,7 +42,7 @@ export function ContentWrapper({ children }: { children: ReactNode }) {
<GridContainer>
<Grid>
<GridItem span={{ initial: 12, sm: 8, md: 8, lg: 6 }} start={{ initial: 1, sm: 3, md: 3, lg: 4 }}>
<div className="md:h-10"></div>
<div className="md:h-10 overscroll-x-none"></div>
{children}
</GridItem>
</Grid>
Expand Down
28 changes: 14 additions & 14 deletions apps/protoform/src/components/custom-footer/custom-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ export function CustomFooter() {
return (
<Footer
brand="wbc"
className={clsx('relative bottom-0 z-[58] w-full border-t-border bg-white pb-0', {
className={clsx('relative bottom-0 z-10 w-full border-t-border bg-white pb-0', {
'md:w-[calc(100%-301px)]': open,
})}
hideLogo
>
<div className="flex">
<SecurityIcon
size={{ initial: 'small', md: 'medium' }}
className="float-left shrink-0 max-md:mr-1 md:mr-2"
color="borderDark"
/>
<p className="typography-body-10 text-muted">
Our site and your transactions are secure. You can read our{' '}
<Link href="#" type="inline">
security information
</Link>
. <br /> © 2024 Westpac Banking Corporation ABN 33 007 457 141 AFSL and Australian credit licence 233714.
</p>
<div className="relative">
<div className="float-left flex-none">
<SecurityIcon size="small" className="float-left mr-1 shrink-0" color="muted" />
</div>
<div className="flex">
<p className="relative flex-1 typography-body-10 text-muted">
Our site and your transactions are secure. You can read our{' '}
<Link href="#" type="inline">
security information
</Link>
. <br /> © 2023 Westpac Banking Corporation ABN 33 007 457 141 AFSL and Australian credit licence 233714.
</p>
</div>
</div>
</Footer>
);
Expand Down
7 changes: 4 additions & 3 deletions apps/protoform/src/components/custom-header/custom-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import { Button, Header } from '@westpac/ui';
import { BREAKPOINTS } from '@westpac/ui/themes-constants';
import { useRouter } from 'next/navigation';
import { usePathname, useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';

export function CustomHeader() {
const router = useRouter();
const pathname = usePathname();
const [isMobile, setIsMobile] = useState(true);

const updateSize = () => {
Expand All @@ -22,10 +23,10 @@ export function CustomHeader() {
return (
<Header
brand="wbc"
leftIcon={isMobile ? 'arrow' : undefined}
leftIcon={'arrow'}
leftOnClick={() => router.back()}
logoLink="/"
className="z-[100] m-auto max-w-[1922px] md:fixed md:top-0 w-full"
className="z-[100] m-auto max-w-[1921px] md:fixed md:top-0 w-full"
>
<Button look="faint" size={{ initial: 'small', sm: 'medium' }} soft>
Sign Out
Expand Down
6 changes: 3 additions & 3 deletions apps/protoform/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client';

import { Button, ProgressRope } from '@westpac/ui';
import { CloseIcon, MoreVertIcon } from '@westpac/ui/icon';
import { BREAKPOINTS } from '@westpac/ui/themes-constants';
import { clsx } from 'clsx';
import throttle from 'lodash.throttle';
import { usePathname } from 'next/navigation';
import React from 'react';
import { ReactNode, useCallback, useEffect, useRef, useState } from 'react';

import { useSidebar } from './context';
Expand Down Expand Up @@ -84,7 +84,7 @@ export function Sidebar({ children }: { children?: ReactNode }) {
<>
<div
className={clsx(
'items-center sticky top-0 z-10 flex h-9 justify-between bg-white px-2 py-3 after:pointer-events-none after:absolute after:inset-x-0 after:top-full after:z-10 after:block after:h-1 after:bg-gradient-to-b after:from-black/[.2] after:from-0% after:opacity-0 after:transition-all after:duration-200 after:will-change-[opacity] xsl:px-4 sm:px-5 md:hidden',
'sticky top-0 flex h-9 justify-between bg-white px-2 py-3 after:pointer-events-none after:absolute after:inset-x-0 after:top-full after:z-10 after:block after:h-1 after:bg-gradient-to-b after:from-black/[.2] after:from-0% after:opacity-0 after:transition-all after:duration-200 after:will-change-[opacity] xsl:px-4 sm:px-5 md:hidden',
{ 'after:opacity-100': scrolled },
)}
>
Expand All @@ -105,7 +105,7 @@ export function Sidebar({ children }: { children?: ReactNode }) {
<>
<div
className={clsx(
'fixed inset-y-0 w-[300px] overflow-auto border-l-[1px] border-t-[1px] border-border bg-white transition-transform duration-500 ease-[cubic-bezier(0.23,1,0.32,1)] before:pointer-events-none before:sticky before:inset-x-0 before:top-0 before:z-50 before:block before:h-1 before:bg-gradient-to-b before:from-black/[.2] before:from-0% before:opacity-0 before:transition-all before:duration-200 before:will-change-[opacity] max-md:z-[100] md:mt-11',
'fixed inset-y-0 w-[300px] overflow-auto border-l-[1px] border-border bg-white transition-transform duration-500 ease-[cubic-bezier(0.23,1,0.32,1)] before:pointer-events-none before:sticky before:inset-x-0 before:top-0 before:z-50 before:block before:h-1 before:bg-gradient-to-b before:from-black/[.2] before:from-0% before:opacity-0 before:transition-all before:duration-200 before:will-change-[opacity] max-md:z-[100] md:mt-11 overscroll-contain',
{
'before:opacity-100': sidebarScrolled,
'max-md:translate-x-full': !open,
Expand Down
2 changes: 1 addition & 1 deletion apps/site/src/app/design-system/[brand]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default async function DesignSystemLayout({
<SkipLink href="#content" className="z-[100]">
Skip to content
</SkipLink>
<div className="text-text active-theme-stg:text-heading flex min-h-screen flex-col">
<div className="flex min-h-screen flex-col text-text active-theme-stg:text-heading">
<SidebarContextProvider>
<Suspense>
<Sidebar items={formattedItems} brand={brand} />
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/badge/badge.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Badge', () => {
const style = styles({ color: 'primary', type: 'pill' });
// TODO: use some variants for test
expect(style).toBe(
'whitespace-nowrap border text-center border-primary bg-primary text-white typography-body-10 flex h-4 items-center rounded-xl px-[0.4375rem] font-medium leading-none',
'whitespace-nowrap border text-center border-primary bg-primary text-white typography-body-10 flex h-4 w-fit items-center rounded-xl px-[0.4375rem] font-medium leading-none',
);
});
});
4 changes: 2 additions & 2 deletions packages/ui/src/components/badge/badge.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { tv } from 'tailwind-variants';

export const styles = tv(
{
base: 'inline-block whitespace-nowrap border text-center',
base: 'inline-block w-fit whitespace-nowrap border text-center',
variants: {
color: {
danger: 'border-danger bg-danger text-white',
Expand All @@ -24,7 +24,7 @@ export const styles = tv(
'warning-inverted': 'border-none bg-white text-warning',
},
type: {
pill: 'typography-body-10 flex h-4 items-center rounded-xl px-[0.4375rem] font-medium leading-none',
pill: 'typography-body-10 flex h-4 w-fit items-center rounded-xl px-[0.4375rem] font-medium leading-none',
default: 'h-[1.25rem] rounded-sm px-1 text-[0.75rem] leading-[1.125rem]',
},
soft: {
Expand Down
Loading