diff --git a/projects/packages/seo/_inc/components/dashboard-load-error.module.scss b/projects/packages/seo/_inc/components/dashboard-load-error.module.scss new file mode 100644 index 000000000000..0d396a017283 --- /dev/null +++ b/projects/packages/seo/_inc/components/dashboard-load-error.module.scss @@ -0,0 +1,10 @@ +.root { + padding-block: 64px; + padding-inline: 24px; + text-align: center; +} + +.body { + margin-block-end: var(--wpds-dimension-gap-sm); + color: var(--wpds-color-foreground-content-neutral-weak); +} diff --git a/projects/packages/seo/_inc/components/dashboard-load-error.scss b/projects/packages/seo/_inc/components/dashboard-load-error.scss deleted file mode 100644 index 7243ab26f335..000000000000 --- a/projects/packages/seo/_inc/components/dashboard-load-error.scss +++ /dev/null @@ -1,20 +0,0 @@ -.jetpack-seo-load-error { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - gap: 8px; - padding: 64px 24px; - text-align: center; - - &__title { - margin: 0; - font-size: 20px; - font-weight: 600; - } - - &__body { - margin: 0 0 8px; - color: #757575; - } -} diff --git a/projects/packages/seo/_inc/components/dashboard-load-error.tsx b/projects/packages/seo/_inc/components/dashboard-load-error.tsx index deb9b416ef9f..15293c731401 100644 --- a/projects/packages/seo/_inc/components/dashboard-load-error.tsx +++ b/projects/packages/seo/_inc/components/dashboard-load-error.tsx @@ -1,6 +1,6 @@ import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/ui'; -import './dashboard-load-error.scss'; +import { Button, Stack, Text } from '@wordpress/ui'; +import styles from './dashboard-load-error.module.scss'; import type { FC } from 'react'; interface Props { @@ -18,15 +18,15 @@ interface Props { * @return The load-error state. */ const DashboardLoadError: FC< Props > = ( { onRetry } ) => ( -
-

+ + }> { __( 'We couldn’t load this page', 'jetpack-seo' ) } -

-

+ + } className={ styles.body }> { __( 'This is usually temporary. Give it another try.', 'jetpack-seo' ) } -

+ -
+ ); export default DashboardLoadError; diff --git a/projects/packages/seo/_inc/components/dashboard-skeleton.module.scss b/projects/packages/seo/_inc/components/dashboard-skeleton.module.scss new file mode 100644 index 000000000000..0c5af5d9f7ee --- /dev/null +++ b/projects/packages/seo/_inc/components/dashboard-skeleton.module.scss @@ -0,0 +1,34 @@ +.line { + block-size: var(--wpds-dimension-size-3xs); + border-radius: var(--wpds-border-radius-md); + background: var(--wpds-color-background-track-neutral); + animation: dashboard-skeleton-pulse var(--wpds-motion-duration-xl) var(--wpds-motion-easing-balanced) infinite; +} + +.title { + inline-size: 40%; + block-size: var(--wpds-dimension-size-2xs); +} + +.short { + inline-size: 60%; +} + +@keyframes dashboard-skeleton-pulse { + + 0%, + 100% { + opacity: 1; + } + + 50% { + opacity: 0.4; + } +} + +@media ( prefers-reduced-motion: reduce ) { + + .line { + animation: none; + } +} diff --git a/projects/packages/seo/_inc/components/dashboard-skeleton.scss b/projects/packages/seo/_inc/components/dashboard-skeleton.scss deleted file mode 100644 index 7dad2f95d1e6..000000000000 --- a/projects/packages/seo/_inc/components/dashboard-skeleton.scss +++ /dev/null @@ -1,63 +0,0 @@ -.jetpack-seo-skeleton { - display: flex; - flex-direction: column; - gap: 16px; - - // Visually hidden, but announced by screen readers via the role="status". - &__label { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip-path: inset(50%); - white-space: nowrap; - border: 0; - } - - &__card { - display: flex; - flex-direction: column; - gap: 12px; - padding: 24px; - background: #fff; - border: 1px solid #e0e0e0; - border-radius: 4px; - } - - &__line { - height: 12px; - border-radius: 4px; - background: #e0e0e0; - animation: jetpack-seo-skeleton-pulse 1.4s ease-in-out infinite; - - &--title { - width: 40%; - height: 16px; - } - - &--short { - width: 60%; - } - } -} - -@keyframes jetpack-seo-skeleton-pulse { - - 0%, - 100% { - opacity: 1; - } - - 50% { - opacity: 0.4; - } -} - -@media ( prefers-reduced-motion: reduce ) { - - .jetpack-seo-skeleton__line { - animation: none; - } -} diff --git a/projects/packages/seo/_inc/components/dashboard-skeleton.tsx b/projects/packages/seo/_inc/components/dashboard-skeleton.tsx index 3dd66aea199b..f8a92754f553 100644 --- a/projects/packages/seo/_inc/components/dashboard-skeleton.tsx +++ b/projects/packages/seo/_inc/components/dashboard-skeleton.tsx @@ -1,5 +1,6 @@ import { __ } from '@wordpress/i18n'; -import './dashboard-skeleton.scss'; +import { Card, Stack, VisuallyHidden } from '@wordpress/ui'; +import styles from './dashboard-skeleton.module.scss'; import type { FC } from 'react'; /** @@ -11,16 +12,20 @@ import type { FC } from 'react'; * @return The skeleton placeholder. */ const DashboardSkeleton: FC = () => ( -
- { __( 'Loading…', 'jetpack-seo' ) } + + { __( 'Loading…', 'jetpack-seo' ) } { [ 0, 1, 2 ].map( index => ( -