Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use placehold.co to generate placeholder images #1656

Merged
merged 1 commit into from
Aug 12, 2024
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
8 changes: 4 additions & 4 deletions src/components/data/test/AspectRatio-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ describe('AspectRatio', () => {

it('applies bottom-padding to container based on `ratio` value', () => {
const wrapper16_9 = createComponent(AspectRatio, {
children: <img src="https://placekitten.com/400/400" alt="kitty" />,
children: <img src="https://placehold.co/400x400" alt="placeholder" />,
});

const wrapper4_3 = createComponent(AspectRatio, {
children: <img src="https://placekitten.com/400/400" alt="kitty" />,
children: <img src="https://placehold.co/400x400" alt="placeholder" />,
ratio: '4/3',
});

Expand All @@ -41,8 +41,8 @@ describe('AspectRatio', () => {
const wrapper = createComponent(AspectRatio, {
children: (
<img
src="https://placekitten.com/400/400"
alt="kitty"
src="https://placehold.co/400x400"
alt="placeholder"
className="object-top"
/>
),
Expand Down
2 changes: 1 addition & 1 deletion src/components/data/test/Thumbnail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Thumbnail', () => {

it('sets ratio on content', () => {
const wrapper = createComponent(Thumbnail, {
children: <img src="https://placekitten.com/300/300" alt="kitty" />,
children: <img src="https://placehold.co/300x300" alt="placeholder" />,
ratio: '4/3',
});

Expand Down
16 changes: 8 additions & 8 deletions src/pattern-library/components/patterns/data/AspectRatioPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function AspectRatioPage() {
<Library.Demo title="Basic AspectRatio" withSource>
<div className="w-[350px]">
<AspectRatio>
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</AspectRatio>
</div>
</Library.Demo>
Expand Down Expand Up @@ -75,8 +75,8 @@ export default function AspectRatioPage() {
<div className="w-[350px]">
<AspectRatio>
<img
src="https://placekitten.com/400/400"
alt="kitty"
src="https://placehold.co/400x400"
alt="placeholder"
className="object-top"
/>
</AspectRatio>
Expand Down Expand Up @@ -137,39 +137,39 @@ export default function AspectRatioPage() {
<Library.Demo title="objectFit:'cover' (default)" withSource>
<div className="w-[350px] border rounded-md">
<AspectRatio objectFit="cover">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</AspectRatio>
</div>
</Library.Demo>

<Library.Demo title="objectFit:'contain'" withSource>
<div className="w-[350px] border rounded-md">
<AspectRatio objectFit="contain">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</AspectRatio>
</div>
</Library.Demo>

<Library.Demo title="objectFit:'fill'" withSource>
<div className="w-[350px] border rounded-md">
<AspectRatio objectFit="fill">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</AspectRatio>
</div>
</Library.Demo>

<Library.Demo title="objectFit:'scale-down'" withSource>
<div className="w-[350px] border rounded-md">
<AspectRatio objectFit="scale-down">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</AspectRatio>
</div>
</Library.Demo>

<Library.Demo title="objectFit:'none'" withSource>
<div className="w-[350px] border rounded-md">
<AspectRatio objectFit="none">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</AspectRatio>
</div>
</Library.Demo>
Expand Down
20 changes: 10 additions & 10 deletions src/pattern-library/components/patterns/data/ThumbnailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function ThumbnailPage() {
<Library.Demo title="Basic Thumbnail" withSource>
<div className="w-[250px]">
<Thumbnail>
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>
</Library.Demo>
Expand All @@ -35,7 +35,7 @@ export default function ThumbnailPage() {
<Library.Demo withSource title="Loading state">
<div className="w-[250px]">
<Thumbnail loading>
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>
</Library.Demo>
Expand All @@ -57,7 +57,7 @@ export default function ThumbnailPage() {
<Library.Demo title="Extra available vertical space" withSource>
<div className="w-[250px] h-[300px]">
<Thumbnail>
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>
</Library.Demo>
Expand All @@ -72,9 +72,9 @@ export default function ThumbnailPage() {
<div className="w-[350px] h-[150px]">
<Thumbnail>
<img
src="https://placekitten.com/400/400"
src="https://placehold.co/400x400"
className="object-top"
alt="kitty"
alt="placeholder"
/>
</Thumbnail>
</div>
Expand Down Expand Up @@ -110,7 +110,7 @@ export default function ThumbnailPage() {
<div className="space-y-4">
<div className="w-[200px]">
<Thumbnail borderless>
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>
<div className="w-[200px]">
Expand Down Expand Up @@ -195,7 +195,7 @@ export default function ThumbnailPage() {
<Library.Demo title="ratio: '4/3'" withSource>
<div className="w-[250px]">
<Thumbnail ratio="4/3">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>
</Library.Demo>
Expand Down Expand Up @@ -224,7 +224,7 @@ export default function ThumbnailPage() {
<div className="flex gap-x-4">
<div className="w-[200px]">
<Thumbnail size="sm">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>

Expand All @@ -242,7 +242,7 @@ export default function ThumbnailPage() {
<div className="flex gap-x-4">
<div className="w-[200px]">
<Thumbnail size="md">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>

Expand All @@ -260,7 +260,7 @@ export default function ThumbnailPage() {
<div className="flex gap-x-4">
<div className="w-[200px]">
<Thumbnail size="lg">
<img src="https://placekitten.com/400/400" alt="kitty" />
<img src="https://placehold.co/400x400" alt="placeholder" />
</Thumbnail>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/pattern-library/components/patterns/layout/CardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default function CardPage() {
<Card>
<img
className="rounded-t-[inherit]"
src="https://placekitten.com/1000/250"
alt="kitty"
src="https://placehold.co/1000/250"
alt="placeholder"
/>
<CardContent>
<LoremIpsum size="xs" />
Expand Down