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

alert MAT disclaimer #23

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
35 changes: 35 additions & 0 deletions libs/react-components/src/lib/components/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { Meta, StoryObj } from '@storybook/react';
import Alert from './index';
import IconButton from '../IconButton';

const meta = {
title: 'Components/Alert',
component: Alert,
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
layout: 'fullscreen',
},
args: {
icon: 'info',
titleText: 'Alert title',
descriptionText: 'Alert description',
state: 'active',
},
} satisfies Meta<typeof Alert>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Basic: Story = {};

export const ActionElements: Story = {
render: (args) => {
return (
<Alert {...args}>
<IconButton slot="action-items" icon="close" />
</Alert>
);
},
};
37 changes: 37 additions & 0 deletions libs/react-components/src/lib/components/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { CovalentAlert } from '@covalent/components/alert';
import { createComponent } from '@lit/react';
import React from 'react';
import '@covalent/components/icon';

interface AlertProps {
/**
* Icon of the alert
*/
icon: string;
/**
* Title of the alert
*/
titleText: string;
/**
* Description of the alert
*/
descriptionText: string;
/**
* State of the button
*/
state: string;
}
const AlertComponent = createComponent({
tagName: 'cv-alert',
elementClass: CovalentAlert as never,
react: React,
});

const Alert: React.FC<AlertProps> = (props) => {
return (
<AlertComponent {...props}></AlertComponent>
);
};

Alert.displayName = 'Alert';
export default Alert;
Loading