-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-4738] feat: add Skeleton component with respective stories in propel #7704
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
26b2dd3
✨ feat: add Skeleton component with respective stories in propel
JayashTripathy 2e564db
🚨 fix: lint issues
JayashTripathy 864cc46
♻️ refactor : enhance Skeleton component with improved props and stru…
JayashTripathy e1c0629
✨ feat: add Skeleton component entry to package.json
JayashTripathy c3f2a0a
🚨 fix: lint
JayashTripathy 8e0abd6
♻️ refactor: rename Skeleton to skeleton
JayashTripathy 5728efe
fix: rename fixes
sriramveeraghanta fc05679
♻️ refactor: rename skeleton
JayashTripathy 5eebcbc
Merge branch 'preview' of https://github.com/makeplane/plane into fea…
JayashTripathy 578137e
🚨 fix: lint
JayashTripathy 8ebac75
♻️ refactor: add skeleton entry to tsdown config and package.json
JayashTripathy 6bfe500
♻️ refactor: sorted propel exports
JayashTripathy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
| export * from "./root"; | ||
This file contains hidden or 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,36 @@ | ||
| import React from "react"; | ||
| // helpers | ||
| import { cn } from "../utils/classname"; | ||
|
|
||
| type SkeletonProps = { | ||
| children: React.ReactNode; | ||
| className?: string; | ||
| ariaLabel?: string; | ||
| }; | ||
|
|
||
| const SkeletonRoot = ({ children, className = "", ariaLabel = "Loading content" }: SkeletonProps) => ( | ||
| <div data-slot="skeleton" className={cn("animate-pulse", className)} role="status" aria-label={ariaLabel}> | ||
| {children} | ||
| </div> | ||
| ); | ||
|
|
||
| type ItemProps = { | ||
| height?: string; | ||
| width?: string; | ||
| className?: string; | ||
| }; | ||
|
|
||
| const SkeletonItem: React.FC<ItemProps> = ({ height = "auto", width = "auto", className = "" }) => ( | ||
| <div | ||
| data-slot="skeleton-item" | ||
| className={cn("rounded-md bg-custom-background-80", className)} | ||
| style={{ height, width }} | ||
| /> | ||
| ); | ||
|
|
||
| const Skeleton = Object.assign(SkeletonRoot, { Item: SkeletonItem }); | ||
|
|
||
| SkeletonRoot.displayName = "plane-ui-skeleton"; | ||
| SkeletonItem.displayName = "plane-ui-skeleton-item"; | ||
|
|
||
| export { Skeleton }; |
This file contains hidden or 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,33 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react-vite"; | ||
| import { Skeleton } from "./index"; | ||
|
|
||
| const meta: Meta<typeof Skeleton> = { | ||
| title: "Components/Skeleton", | ||
| component: Skeleton, | ||
| parameters: { | ||
| layout: "centered", | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| render: () => ( | ||
| <Skeleton className="w-80 flex flex-col gap-2"> | ||
| <Skeleton.Item height="40px" width="100%" /> | ||
| </Skeleton> | ||
| ), | ||
| }; | ||
|
|
||
| export const Card: Story = { | ||
| render: () => ( | ||
| <Skeleton className="w-80 flex flex-col gap-4"> | ||
| <Skeleton.Item height="200px" width="100%" /> | ||
| <div className="flex flex-col gap-2"> | ||
| <Skeleton.Item height="20px" width="50%" /> | ||
| <Skeleton.Item height="20px" width="30%" /> | ||
| </div> | ||
| </Skeleton> | ||
| ), | ||
| }; |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.