Skip to content
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
@@ -0,0 +1,87 @@
import { Illustration } from './illustration';
import {
brand,
neutral,
surface,
surfaceWeak,
stroke,
muted,
r,
} from './palette';

/** A page frame: full-height sidebar, header with one primary action, content. */
export const AdminUIIllustration = () => (
<Illustration>
<clipPath id="package-cards-admin-ui-frame">
<rect x="40" y="20" width="240" height="120" style={ r.lg } />
</clipPath>
<rect
x="40"
y="20"
width="240"
height="120"
style={ r.lg }
fill={ surface }
/>
<g clipPath="url(#package-cards-admin-ui-frame)">
<rect x="40" y="20" width="60" height="120" fill={ surfaceWeak } />
</g>
<line x1="100" x2="100" y1="20" y2="140" stroke={ muted } />
<line x1="100" x2="280" y1="46" y2="46" stroke={ muted } />
<rect x="52" y="30" width="24" height="8" rx="4" fill={ neutral } />
{ [ 0, 1, 2, 3 ].map( ( i ) => (
<rect
key={ i }
x="52"
y={ 58 + i * 18 }
width="36"
height="6"
rx="3"
fill={ neutral }
opacity={ i === 0 ? 0.7 : 0.35 }
/>
) ) }
<rect
x="112"
y="30"
width="56"
height="8"
rx="4"
fill={ neutral }
opacity="0.6"
/>
<rect
x="244"
y="28"
width="24"
height="12"
style={ r.sm }
fill={ brand }
/>
<rect
x="112"
y="58"
width="156"
height="28"
style={ r.sm }
fill={ surfaceWeak }
/>
<rect
x="112"
y="96"
width="156"
height="32"
style={ r.sm }
fill={ surfaceWeak }
/>
<rect
x="40"
y="20"
width="240"
height="120"
style={ r.lg }
fill="none"
stroke={ stroke }
/>
</Illustration>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { Illustration } from './illustration';
import { brand, neutral, surface, stroke, r } from './palette';

/** A button, a text field, a toggle and a checkbox. */
export const ComponentsIllustration = () => (
<Illustration>
<rect
x="40"
y="32"
width="96"
height="32"
style={ r.sm }
fill={ brand }
/>
<rect
x="148"
y="32"
width="96"
height="32"
style={ r.sm }
fill={ surface }
stroke={ stroke }
/>
<rect
x="160"
y="45"
width="72"
height="6"
rx="3"
fill={ neutral }
opacity="0.5"
/>
<rect
x="40"
y="80"
width="204"
height="32"
style={ r.sm }
fill={ surface }
stroke={ stroke }
/>
<rect
x="52"
y="93"
width="80"
height="6"
rx="3"
fill={ neutral }
opacity="0.5"
/>
<rect x="256" y="40" width="32" height="18" rx="9" fill={ brand } />
<circle cx="279" cy="49" r="6" fill={ surface } />
<rect
x="256"
y="86"
width="20"
height="20"
style={ r.xs }
fill={ brand }
/>
<path
d="M261 96l4 4 7-8"
fill="none"
stroke={ surface }
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</Illustration>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { Illustration } from './illustration';
import { brand, neutral, surface, stroke, muted, r } from './palette';

/** A table with a filter bar and selectable rows. */
export const DataViewsIllustration = () => (
<Illustration>
<rect
x="40"
y="24"
width="240"
height="112"
style={ r.lg }
fill={ surface }
stroke={ stroke }
/>
<rect
x="52"
y="36"
width="64"
height="14"
style={ r.sm }
fill={ surface }
stroke={ stroke }
/>
<rect
x="124"
y="36"
width="40"
height="14"
style={ r.sm }
fill={ brand }
/>
{ [ 0, 1, 2, 3 ].map( ( i ) => {
const top = 62 + i * 18;
return (
<g key={ i }>
<line
x1="40"
x2="280"
y1={ top }
y2={ top }
stroke={ muted }
/>
<rect
x="52"
y={ top + 5 }
width="8"
height="8"
style={ r.xs }
fill={ i === 1 ? brand : 'none' }
stroke={ i === 1 ? brand : stroke }
/>
<rect
x="74"
y={ top + 6 }
width={ 70 + ( ( i * 23 ) % 40 ) }
height="6"
rx="3"
fill={ neutral }
opacity="0.5"
/>
<rect
x="200"
y={ top + 6 }
width="60"
height="6"
rx="3"
fill={ neutral }
opacity="0.25"
/>
</g>
);
} ) }
</Illustration>
);
71 changes: 71 additions & 0 deletions storybook/stories/design-system/intro-cards/icons-illustration.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import {
Icon,
bell,
calendar,
check,
cog,
comment,
globe,
home,
image,
link as linkIcon,
lock,
media,
page,
pencil,
plus,
search,
starFilled,
tag,
trash,
} from '@wordpress/icons';
import { Illustration } from './illustration';
import { brand, surface, foreground, muted, r } from './palette';

const glyphs = [
pencil,
plus,
trash,
cog,
image,
page,
home,
search,
starFilled,
check,
comment,
linkIcon,
tag,
calendar,
lock,
media,
bell,
globe,
];

/** A grid of real icons from the library. */
export const IconsIllustration = () => (
<Illustration>
{ glyphs.map( ( glyph, i ) => {
const x = 44 + ( i % 6 ) * 40;
const y = 24 + Math.floor( i / 6 ) * 40;
return (
<g key={ i } transform={ `translate(${ x } ${ y })` }>
<rect
width="32"
height="32"
style={ r.sm }
fill={ surface }
stroke={ muted }
/>
<g
transform="translate(4 4)"
style={ { color: i === 3 ? brand : foreground } }
>
<Icon icon={ glyph } size={ 24 } />
</g>
</g>
);
} ) }
</Illustration>
);
15 changes: 15 additions & 0 deletions storybook/stories/design-system/intro-cards/illustration.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styles from './style.module.scss';
import { surfaceWeak } from './palette';

export const Illustration = ( { children }: { children: React.ReactNode } ) => (
<svg
viewBox="0 0 320 160"
preserveAspectRatio="xMidYMid slice"
className={ styles.illustration }
aria-hidden="true"
focusable="false"
>
<rect width="320" height="160" fill={ surfaceWeak } />
{ children }
</svg>
);
4 changes: 4 additions & 0 deletions storybook/stories/design-system/intro-cards/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { PackageCard } from './package-card';
export { PackageCards } from './package-cards';
export { PrincipleCard } from './principle-card';
export { PrincipleCards } from './principle-cards';
Loading
Loading