-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d1335c
commit 46bd146
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@chakra-ui/next-js": minor | ||
--- | ||
|
||
Add `Image` component that supercharges the Next.js optimized image with Chakra | ||
style props. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { chakra, ChakraComponent, HTMLChakraProps } from "@chakra-ui/react" | ||
import NextImage, { ImageProps as NextImageProps } from "next/image" | ||
|
||
export type ImageProps = NextImageProps & | ||
Omit<HTMLChakraProps<"img">, keyof NextImageProps> | ||
|
||
export const Image: ChakraComponent<"img", NextImageProps> = chakra(NextImage, { | ||
shouldForwardProp: (prop) => ["width", "height", "src", "alt"].includes(prop), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export { CacheProvider } from "./emotion-cache-provider" | ||
export type { CacheProviderProps } from "./emotion-cache-provider" | ||
|
||
export { Link } from "./link" | ||
export type { LinkProps } from "./link" | ||
|
||
export { Image } from "./image" | ||
export type { ImageProps } from "./image" |
46bd146
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chakra-ui-storybook – ./
chakra-ui-storybook-git-main-chakra-ui.vercel.app
chakra-ui-storybook.vercel.app
storybook.chakra-ui.com
chakra-ui-storybook-chakra-ui.vercel.app