-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): added new components empty state and skeleton
- Loading branch information
Showing
12 changed files
with
279 additions
and
157 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
20 changes: 20 additions & 0 deletions
20
frontend/src/components/v2/EmptyState/EmptyState.stories.tsx
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,20 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { EmptyState } from './EmptyState'; | ||
|
||
const meta: Meta<typeof EmptyState> = { | ||
title: 'Components/EmptyState', | ||
component: EmptyState, | ||
tags: ['v2'], | ||
argTypes: {}, | ||
args: { | ||
title: 'No members found' | ||
} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof EmptyState>; | ||
|
||
export const Basic: Story = { | ||
render: (args) => <EmptyState {...args} /> | ||
}; |
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,21 @@ | ||
import { ReactNode } from 'react'; | ||
import { faCubesStacked, IconDefinition } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
type Props = { | ||
title: ReactNode; | ||
className?: string; | ||
children?: ReactNode; | ||
icon?: IconDefinition; | ||
}; | ||
|
||
export const EmptyState = ({ title, className, children, icon = faCubesStacked }: Props) => ( | ||
<div className={twMerge('flex w-full flex-col items-center p-8 text-mineshaft-50', className)}> | ||
<div className="mb-4"> | ||
<FontAwesomeIcon icon={icon} size="3x" /> | ||
</div> | ||
<div className="mb-8 text-gray-300">{title}</div> | ||
<div>{children}</div> | ||
</div> | ||
); |
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 @@ | ||
export { EmptyState } from './EmptyState'; |
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,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Skeleton } from './Skeleton'; | ||
|
||
const meta: Meta<typeof Skeleton> = { | ||
title: 'Components/Skeleton', | ||
component: Skeleton, | ||
tags: ['v2'], | ||
argTypes: {} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Skeleton>; | ||
|
||
export const Basic: Story = { | ||
render: (args) => <Skeleton {...args} /> | ||
}; |
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,12 @@ | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
export type Props = { | ||
className?: string; | ||
}; | ||
|
||
// To show something is coming up | ||
// Can be used with cards | ||
// Tables etc | ||
export const Skeleton = ({ className }: Props) => ( | ||
<div className={twMerge('h-6 w-full animate-pulse rounded-md bg-mineshaft-800', className)} /> | ||
); |
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 @@ | ||
export { Skeleton } from './Skeleton'; |
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
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
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
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
Oops, something went wrong.