diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Alto.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Alto.png new file mode 100644 index 0000000000..ed1b04484c Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Alto.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Bulletin.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Bulletin.png new file mode 100644 index 0000000000..fbd7a2b7b3 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Bulletin.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Casper.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Casper.png new file mode 100644 index 0000000000..6bb10f9fea Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Casper.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Dawn.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Dawn.png new file mode 100644 index 0000000000..3515269f64 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Dawn.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Digest.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Digest.png new file mode 100644 index 0000000000..2d3aee0e07 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Digest.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Dope.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Dope.png new file mode 100644 index 0000000000..aec283acb1 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Dope.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Ease.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Ease.png new file mode 100644 index 0000000000..cc4e567165 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Ease.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Edge.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Edge.png new file mode 100644 index 0000000000..43b1996521 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Edge.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Edition.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Edition.png new file mode 100644 index 0000000000..928fc99bb3 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Edition.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Episode.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Episode.png new file mode 100644 index 0000000000..8d4438b97c Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Episode.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Headline.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Headline.png new file mode 100644 index 0000000000..7242b626d6 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Headline.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Journal.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Journal.png new file mode 100644 index 0000000000..cd57c87926 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Journal.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/London.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/London.png new file mode 100644 index 0000000000..6ce16e12ab Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/London.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Ruby.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Ruby.png new file mode 100644 index 0000000000..571e121ed5 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Ruby.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Solo.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Solo.png new file mode 100644 index 0000000000..7abc08bcd1 Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Solo.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Taste.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Taste.png new file mode 100644 index 0000000000..a8ab120d4c Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Taste.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Wave.png b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Wave.png new file mode 100644 index 0000000000..845d5c0d2b Binary files /dev/null and b/ghost/admin-x-settings/src/admin-x-ds/assets/images/themes/Wave.png differ diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/Button.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/Button.tsx index 1d9420cb8e..9f6dc5a01b 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/Button.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/Button.tsx @@ -58,7 +58,7 @@ const Button: React.FC = ({ styles += link ? ' text-white hover:text-white' : ' bg-white text-black'; break; default: - styles += link ? ' text-black hover:text-grey-800' : ' bg-transparent text-black hover:text-grey-800'; + styles += link ? ' text-black hover:text-grey-800' : ' text-black hover:bg-grey-200'; break; } diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/ConfirmationModal.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/ConfirmationModal.tsx index ee27acf135..aa3425f46e 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/ConfirmationModal.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/ConfirmationModal.tsx @@ -13,7 +13,7 @@ export interface ConfirmationModalProps { onOk?: (modal?: { remove: () => void; }) => void; - customFooter?: React.ReactNode; + customFooter?: boolean | React.ReactNode; } const ConfirmationModal: React.FC = ({ @@ -25,7 +25,7 @@ const ConfirmationModal: React.FC = ({ okColor = 'black', onCancel, onOk, - customFooter + customFooter = false }) => { const modal = useModal(); const [taskState, setTaskState] = useState<'running' | ''>(''); @@ -33,7 +33,7 @@ const ConfirmationModal: React.FC = ({ diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.tsx index 1b0ab8c905..9f2d4f0f53 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.tsx @@ -1,6 +1,6 @@ import React from 'react'; -export type DesktopChromeHeaderSize = 'sm' | 'md'; +export type DesktopChromeHeaderSize = 'sm' | 'md' | 'lg'; interface DesktopChromeHeaderProps { size?: DesktopChromeHeaderSize; @@ -17,14 +17,32 @@ const DesktopChromeHeader: React.FC = ({ toolbarRight = '', toolbarClasses = '' }) => { - let containerSize = size === 'sm' ? 'min-h-[32px] p-2' : 'min-h-[48px] p-3'; + let containerSize; + + switch (size) { + case 'sm': + containerSize = 'h-[32px] p-2'; + break; + + case 'md': + containerSize = 'h-[48px] px-3 py-5'; + break; + + case 'lg': + containerSize = 'h-[74px] px-3 py-5'; + break; + + default: + break; + } + const trafficLightSize = size === 'sm' ? 'w-[6px] h-[6px]' : 'w-[10px] h-[10px]'; const trafficLightWidth = size === 'sm' ? 36 : 56; let trafficLightContainerStyle = size === 'sm' ? 'gap-[5px] ' : 'gap-2 '; trafficLightContainerStyle += `w-[${trafficLightWidth}px]`; const trafficLights = ( -
+
@@ -34,7 +52,7 @@ const DesktopChromeHeader: React.FC = ({ return (
{toolbarLeft ? -
+
{toolbarLeft}
: @@ -48,7 +66,7 @@ const DesktopChromeHeader: React.FC = ({ }
{toolbarRight && -
+
{toolbarRight}
} diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/Modal.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/Modal.tsx index adfedbfdd6..f79ea0f470 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/Modal.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/Modal.tsx @@ -21,7 +21,7 @@ export interface ModalProps { okColor?: string; cancelLabel?: string; leftButtonLabel?: string; - customFooter?: React.ReactNode; + footer?: boolean | React.ReactNode; noPadding?: boolean; onOk?: () => void; onCancel?: () => void; @@ -37,7 +37,7 @@ const Modal: React.FC = ({ title, okLabel = 'OK', cancelLabel = 'Cancel', - customFooter, + footer, leftButtonLabel, noPadding = false, onOk, @@ -52,7 +52,7 @@ const Modal: React.FC = ({ let buttons: IButton[] = []; - if (!customFooter) { + if (!footer) { if (cancelLabel) { buttons.push({ key: 'cancel-modal', @@ -135,10 +135,10 @@ const Modal: React.FC = ({ let contentClasses = clsx( padding, - size === 'full' && 'h-full' + ((size === 'full' || size === 'bleed') && 'grow') ); - if (!customFooter) { + if (!footer) { contentClasses += ' pb-0 '; } @@ -165,15 +165,17 @@ const Modal: React.FC = ({
); - const footer = (stickyFooter ? - - {footerContent} - - : - <> - {footerContent} - - ); + if (footer === undefined) { + footer = (stickyFooter ? + + {footerContent} + + : + <> + {footerContent} + + ); + } return (
- {customFooter ? customFooter : - footer - } + {footer}
); diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.stories.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.stories.tsx index 1f15799c29..f1184a8ab3 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.stories.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.stories.tsx @@ -4,7 +4,7 @@ import Heading from './Heading'; import NiceModal from '@ebay/nice-modal-react'; import PreviewModal from './PreviewModal'; import PreviewModalContainer from './PreviewModalContainer'; -import {SelectOption} from './Select'; +import {Tab} from './TabView'; const meta = { title: 'Global / Modal / Preview Modal', @@ -14,18 +14,24 @@ const meta = { - )] + )], + argTypes: { + sidebar: {control: 'text'}, + preview: {control: 'text'}, + sidebarButtons: {control: 'text'}, + sidebarHeader: {control: 'text'} + } } satisfies Meta; export default meta; type Story = StoryObj; -const selectOptions: SelectOption[] = [ - {value: 'homepage', label: 'Homepage'}, - {value: 'post', label: 'Post'}, - {value: 'page', label: 'Page'}, - {value: 'tag-archive', label: 'Tag archive'}, - {value: 'author-archive', label: 'Author archive'} +const previewURLs: Tab[] = [ + {id: 'homepage', title: 'Homepage'}, + {id: 'post', title: 'Post'}, + {id: 'page', title: 'Page'}, + {id: 'tag-archive', title: 'Tag archive'}, + {id: 'author-archive', title: 'Author archive'} ]; export const Default: Story = { @@ -41,7 +47,10 @@ export const Default: Story = { Sidebar area ), - previewToolbarURLs: selectOptions + previewToolbarTabs: previewURLs, + onSelectURL: (id: string) => { + alert(id); + } } }; @@ -81,3 +90,10 @@ export const CustomSidebarHeader: Story = { ) } }; + +export const FullBleed: Story = { + args: { + ...Default.args, + size: 'bleed' + } +}; \ No newline at end of file diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.tsx index 6f3d07b53e..ccacdac3f2 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/PreviewModal.tsx @@ -2,17 +2,18 @@ import ButtonGroup from './ButtonGroup'; import DesktopChromeHeader from './DesktopChromeHeader'; import Heading from './Heading'; import MobileChrome from './MobileChrome'; -import Modal from './Modal'; +import Modal, {ModalSize} from './Modal'; import NiceModal, {useModal} from '@ebay/nice-modal-react'; import React, {useState} from 'react'; -import URLSelect from './URLSelect'; +import Select, {SelectOption} from './Select'; +import TabView, {Tab} from './TabView'; import {IButton} from './Button'; -import {SelectOption} from './Select'; export interface PreviewModalProps { testId?: string; title?: string; - sidebar?: React.ReactNode; + size?: ModalSize; + sidebar?: boolean | React.ReactNode; preview?: React.ReactNode; cancelLabel?: string; okLabel?: string; @@ -21,6 +22,8 @@ export interface PreviewModalProps { previewToolbar?: boolean; previewToolbarURLs?: SelectOption[]; selectedURL?: string; + previewToolbarTabs?: Tab[]; + defaultTab?: string; sidebarButtons?: React.ReactNode; sidebarHeader?: React.ReactNode; sidebarPadding?: boolean; @@ -35,7 +38,8 @@ export interface PreviewModalProps { export const PreviewModalContent: React.FC = ({ testId, title, - sidebar, + size = 'full', + sidebar = '', preview, cancelLabel = 'Cancel', okLabel = 'OK', @@ -43,6 +47,8 @@ export const PreviewModalContent: React.FC = ({ previewToolbar = true, previewToolbarURLs, selectedURL, + previewToolbarTabs, + defaultTab, buttonsDisabled, sidebarButtons, sidebarHeader, @@ -68,11 +74,19 @@ export const PreviewModalContent: React.FC = ({ } if (previewToolbar) { - let toolbarCenter = (<>); + let toolbarLeft = (<>); if (previewToolbarURLs) { - toolbarCenter = ( - {}} /> + toolbarLeft = ( +