forked from asyncapi/studio
-
Notifications
You must be signed in to change notification settings - Fork 0
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
fd80a54
commit 5ddfed4
Showing
4 changed files
with
66 additions
and
1 deletion.
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,24 @@ | ||
import { StoryObj, Meta } from '@storybook/react' | ||
|
||
import { AppCard } from '@asyncapi/studio-ui' | ||
|
||
const meta: Meta<typeof AppCard> = { | ||
component: AppCard, | ||
parameters: { | ||
layout: 'centered', | ||
backgrounds: { | ||
default: 'dark' | ||
} | ||
}, | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof AppCard> | ||
export const CodeEditor: Story = { | ||
args: { | ||
isActive: true, | ||
name: 'User Registration', | ||
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere fermentum urna, eu condimentum mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere fermentum urna, eucondimentum mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere fermentumurna, eu condimentum mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuerefermentum urna, eu condimentum maur", | ||
protocols: ['http', 'kafka', 'websocket'], | ||
}, | ||
} |
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,33 @@ | ||
import { Protocol, ProtocolBadge } from './ProtocolBadge'; | ||
|
||
interface AppCardProps { | ||
isActive?: boolean; | ||
name: string; | ||
description: string; | ||
protocols: Protocol[] | ||
className?: string; | ||
} | ||
|
||
export const AppCard = ({isActive = false, name, description, protocols, className}:AppCardProps) => { | ||
return ( | ||
<> | ||
<div | ||
className={`bg-gray-800 border-gray-800 rounded-lg w-[523px] border-2 ${className} ${ | ||
isActive ? ' border-pink-800/30 shadow-service-card' : '' | ||
}`} | ||
> | ||
<div className="flex flex-col gap-2 px-5 py-3"> | ||
<h3 className="text-base font-medium text-gray-100">{name}</h3> | ||
<div className='flex gap-1'> | ||
{protocols.map((protocol, index) => (<ProtocolBadge protocol={protocol} key={index} />))} | ||
</div> | ||
</div> | ||
<div className="w-full h-px bg-gray-700"></div> | ||
<div className="px-5 py-[14px]"> | ||
<p className="text-sm text-gray-400 line-clamp-6">{description} | ||
</p> | ||
</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
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,6 +1,13 @@ | ||
const sharedConfig = require('tailwind-config/tailwind.config.js'); | ||
import sharedConfig from 'tailwind-config/tailwind.config.js'; | ||
|
||
module.exports = { | ||
content: ['./components/**/*.tsx'], | ||
presets: [sharedConfig], | ||
theme: { | ||
extend: { | ||
boxShadow: { | ||
'service-card': '0px 0px 29px 0px rgba(190, 24, 93, 0.50)', | ||
}, | ||
}, | ||
} | ||
}; |