From 8820efa80ba35efd0cf2889b600153286a02dacd Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Wed, 14 Jun 2023 08:35:05 +0200 Subject: [PATCH] AdminX Design System component structure cleanup refs. https://github.com/TryGhost/Team/issues/3432 --- ghost/admin-x-settings/.storybook/preview.tsx | 3 ++- .../src/admin-x-ds/global/PageHeader.tsx | 0 .../{ => chrome}/DesktopChromeHeader.stories.tsx | 8 ++++---- .../global/{ => chrome}/DesktopChromeHeader.tsx | 0 .../global/{ => chrome}/MobileChrome.stories.tsx | 0 .../global/{ => chrome}/MobileChrome.tsx | 0 .../global/{ => form}/Checkbox.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/Checkbox.tsx | 8 ++++---- .../global/{ => form}/FileUpload.stories.tsx | 2 +- .../admin-x-ds/global/{ => form}/FileUpload.tsx | 0 .../global/{ => form}/ImageUpload.stories.tsx | 2 +- .../admin-x-ds/global/{ => form}/ImageUpload.tsx | 2 +- .../global/{ => form}/MultiSelect.stories.tsx | 2 +- .../admin-x-ds/global/{ => form}/MultiSelect.tsx | 4 ++-- .../admin-x-ds/global/{ => form}/Radio.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/Radio.tsx | 8 ++++---- .../global/{ => form}/Select.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/Select.tsx | 4 ++-- .../global/{ => form}/TextArea.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/TextArea.tsx | 4 ++-- .../global/{ => form}/TextField.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/TextField.tsx | 4 ++-- .../global/{ => form}/Toggle.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/Toggle.tsx | 2 +- .../global/{ => form}/URLSelect.stories.tsx | 2 +- .../src/admin-x-ds/global/{ => form}/URLSelect.tsx | 0 .../{ => modal}/ConfirmationModal.stories.tsx | 0 .../global/{ => modal}/ConfirmationModal.tsx | 0 .../{ => modal}/ConfirmationModalContainer.tsx | 2 +- .../global/{ => modal}/Modal.stories.tsx | 0 .../src/admin-x-ds/global/{ => modal}/Modal.tsx | 8 ++++---- .../global/{ => modal}/ModalContainer.tsx | 2 +- .../global/{ => modal}/PreviewModal.stories.tsx | 4 ++-- .../admin-x-ds/global/{ => modal}/PreviewModal.tsx | 14 +++++++------- .../global/{ => modal}/PreviewModalContainer.tsx | 2 +- .../settings/SettingGroupContent.stories.tsx | 4 ++-- .../settings/email/DefaultRecipients.tsx | 4 ++-- .../src/components/settings/email/Mailgun.tsx | 4 ++-- .../src/components/settings/general/Facebook.tsx | 6 +++--- .../settings/general/InviteUserModal.tsx | 6 +++--- .../src/components/settings/general/LockSite.tsx | 4 ++-- .../src/components/settings/general/Metadata.tsx | 2 +- .../settings/general/PublicationLanguage.tsx | 2 +- .../components/settings/general/SocialAccounts.tsx | 2 +- .../src/components/settings/general/TimeZone.tsx | 2 +- .../settings/general/TitleAndDescription.tsx | 4 ++-- .../src/components/settings/general/Twitter.tsx | 6 +++--- .../settings/general/UserDetailModal.tsx | 12 ++++++------ .../src/components/settings/membership/Access.tsx | 4 ++-- .../components/settings/membership/Analytics.tsx | 2 +- .../src/components/settings/site/DesignModal.tsx | 4 ++-- .../src/components/settings/site/ThemeModal.tsx | 8 ++++---- .../site/designAndBranding/BrandSettings.tsx | 4 ++-- .../site/designAndBranding/ThemeSettings.tsx | 8 ++++---- 54 files changed, 94 insertions(+), 93 deletions(-) create mode 100644 ghost/admin-x-settings/src/admin-x-ds/global/PageHeader.tsx rename ghost/admin-x-settings/src/admin-x-ds/global/{ => chrome}/DesktopChromeHeader.stories.tsx (90%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => chrome}/DesktopChromeHeader.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => chrome}/MobileChrome.stories.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => chrome}/MobileChrome.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Checkbox.stories.tsx (95%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Checkbox.tsx (94%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/FileUpload.stories.tsx (95%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/FileUpload.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/ImageUpload.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/ImageUpload.tsx (99%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/MultiSelect.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/MultiSelect.tsx (98%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Radio.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Radio.tsx (95%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Select.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Select.tsx (98%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/TextArea.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/TextArea.tsx (96%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/TextField.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/TextField.tsx (96%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Toggle.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/Toggle.tsx (98%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/URLSelect.stories.tsx (93%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => form}/URLSelect.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/ConfirmationModal.stories.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/ConfirmationModal.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/ConfirmationModalContainer.tsx (93%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/Modal.stories.tsx (100%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/Modal.tsx (96%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/ModalContainer.tsx (95%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/PreviewModal.stories.tsx (97%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/PreviewModal.tsx (94%) rename ghost/admin-x-settings/src/admin-x-ds/global/{ => modal}/PreviewModalContainer.tsx (92%) diff --git a/ghost/admin-x-settings/.storybook/preview.tsx b/ghost/admin-x-settings/.storybook/preview.tsx index 5369ddc369..e3e26685c8 100644 --- a/ghost/admin-x-settings/.storybook/preview.tsx +++ b/ghost/admin-x-settings/.storybook/preview.tsx @@ -14,7 +14,8 @@ const preview: Preview = { }, options: { storySort: { - order: ['Global', 'Settings', 'Experimental'], + mathod: 'alphabetical', + order: ['Global', ['Chrome', 'Form', 'Modal', 'List', '*'], 'Settings', ['Setting Section', 'Setting Group', '*'], 'Experimental'], }, }, }, diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/PageHeader.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/PageHeader.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.stories.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/chrome/DesktopChromeHeader.stories.tsx similarity index 90% rename from ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.stories.tsx rename to ghost/admin-x-settings/src/admin-x-ds/global/chrome/DesktopChromeHeader.stories.tsx index 708d6d8867..ce9fd80de7 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.stories.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/chrome/DesktopChromeHeader.stories.tsx @@ -1,10 +1,10 @@ import type {Meta, StoryObj} from '@storybook/react'; -import Button from './Button'; -import ButtonGroup from './ButtonGroup'; +import Button from '../Button'; +import ButtonGroup from '../ButtonGroup'; import DesktopChromeHeader from './DesktopChromeHeader'; -import URLSelect from './URLSelect'; -import {SelectOption} from './Select'; +import URLSelect from '../form/URLSelect'; +import {SelectOption} from '../form/Select'; const meta = { title: 'Global / Chrome / Desktop Header', diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/chrome/DesktopChromeHeader.tsx similarity index 100% rename from ghost/admin-x-settings/src/admin-x-ds/global/DesktopChromeHeader.tsx rename to ghost/admin-x-settings/src/admin-x-ds/global/chrome/DesktopChromeHeader.tsx diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/MobileChrome.stories.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/chrome/MobileChrome.stories.tsx similarity index 100% rename from ghost/admin-x-settings/src/admin-x-ds/global/MobileChrome.stories.tsx rename to ghost/admin-x-settings/src/admin-x-ds/global/chrome/MobileChrome.stories.tsx diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/MobileChrome.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/chrome/MobileChrome.tsx similarity index 100% rename from ghost/admin-x-settings/src/admin-x-ds/global/MobileChrome.tsx rename to ghost/admin-x-settings/src/admin-x-ds/global/chrome/MobileChrome.tsx diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/Checkbox.stories.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/form/Checkbox.stories.tsx similarity index 95% rename from ghost/admin-x-settings/src/admin-x-ds/global/Checkbox.stories.tsx rename to ghost/admin-x-settings/src/admin-x-ds/global/form/Checkbox.stories.tsx index 28d6616803..f7f3e43caa 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/Checkbox.stories.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/form/Checkbox.stories.tsx @@ -3,7 +3,7 @@ import type {Meta, StoryObj} from '@storybook/react'; import Checkbox from './Checkbox'; const meta = { - title: 'Global / Checkbox', + title: 'Global / Form / Checkbox', component: Checkbox, tags: ['autodocs'], decorators: [(_story: any) => (
{_story()}
)], diff --git a/ghost/admin-x-settings/src/admin-x-ds/global/Checkbox.tsx b/ghost/admin-x-settings/src/admin-x-ds/global/form/Checkbox.tsx similarity index 94% rename from ghost/admin-x-settings/src/admin-x-ds/global/Checkbox.tsx rename to ghost/admin-x-settings/src/admin-x-ds/global/form/Checkbox.tsx index 5924f17485..bdc6beefdc 100644 --- a/ghost/admin-x-settings/src/admin-x-ds/global/Checkbox.tsx +++ b/ghost/admin-x-settings/src/admin-x-ds/global/form/Checkbox.tsx @@ -1,7 +1,7 @@ -import Heading from './Heading'; -import Hint from './Hint'; +import Heading from '../Heading'; +import Hint from '../Hint'; import React, {useEffect, useState} from 'react'; -import Separator from './Separator'; +import Separator from '../Separator'; interface CheckboxProps { id: string; @@ -33,7 +33,7 @@ const Checkbox: React.FC = ({id, title, label, value, onChange, e
{title && {title}}