From 7f451b26279cced47413d6c5782cb1c2a4394b5b Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Thu, 23 Nov 2023 08:18:41 +0100 Subject: [PATCH] Admin X demo detail page (#19105) refs. https://github.com/TryGhost/Product/issues/4169 - the detail page for the Admin X proto app was empty - the asc/desc selector of the SortMenu component in the design system needed a bit of refinement - page toolbar was not set --- apps/admin-x-demo/src/DetailPage.tsx | 141 +++++++++++++++++- apps/admin-x-demo/src/ListPage.tsx | 16 +- .../admin-x-demo/src/components/DemoModal.tsx | 1 + .../src/global/Avatar.tsx | 6 +- .../admin-x-design-system/src/global/List.tsx | 2 +- .../src/global/SortMenu.tsx | 4 +- .../src/global/layout/Page.tsx | 2 +- .../src/global/layout/PageHeader.tsx | 2 +- .../src/global/layout/ViewContainer.tsx | 2 +- .../admin-x-design-system/tailwind.config.cjs | 1 + 10 files changed, 162 insertions(+), 15 deletions(-) diff --git a/apps/admin-x-demo/src/DetailPage.tsx b/apps/admin-x-demo/src/DetailPage.tsx index 36f1f82f15..d93365cda8 100644 --- a/apps/admin-x-demo/src/DetailPage.tsx +++ b/apps/admin-x-demo/src/DetailPage.tsx @@ -1,10 +1,147 @@ -import {Button} from '@tryghost/admin-x-design-system'; +import {Avatar, Breadcrumbs, Button, Heading, Page, Toggle, ViewContainer} from '@tryghost/admin-x-design-system'; import {useRouting} from '@tryghost/admin-x-framework/routing'; const DetailPage: React.FC = () => { const {updateRoute} = useRouting(); - return <>Detail page : null} diff --git a/apps/admin-x-design-system/src/global/layout/Page.tsx b/apps/admin-x-design-system/src/global/layout/Page.tsx index 77921b0212..72e657906d 100644 --- a/apps/admin-x-design-system/src/global/layout/Page.tsx +++ b/apps/admin-x-design-system/src/global/layout/Page.tsx @@ -138,7 +138,7 @@ const Page: React.FC = ({ ); pageToolbarClassName = clsx( - 'sticky top-0 z-50 flex h-18 w-full items-center justify-between gap-5 bg-white p-6 dark:bg-black', + 'sticky top-0 z-50 flex h-22 min-h-[92px] w-full items-center justify-between gap-5 bg-white p-8 dark:bg-black', !fullBleedToolbar && 'mx-auto max-w-7xl', pageToolbarClassName ); diff --git a/apps/admin-x-design-system/src/global/layout/PageHeader.tsx b/apps/admin-x-design-system/src/global/layout/PageHeader.tsx index 1c494859e4..8ccbd7745c 100644 --- a/apps/admin-x-design-system/src/global/layout/PageHeader.tsx +++ b/apps/admin-x-design-system/src/global/layout/PageHeader.tsx @@ -28,7 +28,7 @@ const PageHeader: React.FC = ({ children }) => { const containerClasses = clsx( - 'z-50 h-[72px] p-5 px-7', + 'z-50 h-22 min-h-[92px] p-8 px-6 tablet:px-12', !children && 'flex items-center justify-between gap-3', sticky && 'sticky top-0', containerClassName diff --git a/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx b/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx index 83340f42ef..f7878b71db 100644 --- a/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx +++ b/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx @@ -173,7 +173,7 @@ const ViewContainer: React.FC = ({ toolbarWrapperClassName = clsx( 'z-50', type === 'page' && 'mx-auto w-full max-w-7xl bg-white px-[4vw] dark:bg-black tablet:px-12', - (type === 'page' && stickyHeader) && (firstOnPage ? 'sticky top-0 pt-8' : 'sticky top-18 pt-[3vmin]'), + (type === 'page' && stickyHeader) && (firstOnPage ? 'sticky top-0 pt-8' : 'sticky top-22 pt-[3vmin]'), toolbarContainerClassName ); diff --git a/apps/admin-x-design-system/tailwind.config.cjs b/apps/admin-x-design-system/tailwind.config.cjs index 8067b1e455..3bbfe96de5 100644 --- a/apps/admin-x-design-system/tailwind.config.cjs +++ b/apps/admin-x-design-system/tailwind.config.cjs @@ -219,6 +219,7 @@ module.exports = { 16: '6.4rem', 18: '7.2rem', 20: '8rem', + 22: '9.2rem', 24: '9.6rem', 28: '11.2rem', 32: '12.8rem',