Skip to content

Commit

Permalink
feat: add Blockquote component
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeliatf committed Sep 17, 2024
1 parent 16243cc commit 5766210
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions components/Blockquote/Blockquote.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Meta, StoryFn } from '@storybook/react';
import React from 'react';

import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory';
import { Blockquote, BlockquoteProps, BlockquoteVariants } from './Blockquote';

const BaseBlockquote = (props: BlockquoteProps): JSX.Element => <Blockquote {...props} />;

const BlockquoteForStory = modifyVariantsForStory<BlockquoteVariants, BlockquoteProps>(
BaseBlockquote,
);

const Component: Meta<typeof BlockquoteForStory> = {
title: 'Components/Blockquote',
component: BlockquoteForStory,
};

const Template: StoryFn<typeof BlockquoteForStory> = (args) => (
<Blockquote {...args}>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Blockquote>
);

export const Basic: StoryFn<typeof BlockquoteForStory> = Template.bind({});

export default Component;
10 changes: 10 additions & 0 deletions components/Blockquote/Blockquote.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { CSS, styled, VariantProps } from '../../stitches.config';
import { Text } from '../Text';

export const Blockquote = styled(Text, {
borderLeft: '2px solid $textDefault',
p: '$2 $3',
});

export type BlockquoteVariants = VariantProps<typeof Blockquote>;
export type BlockquoteProps = BlockquoteVariants & { css?: CSS };
1 change: 1 addition & 0 deletions components/Blockquote/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Blockquote';
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export {
} from './components/AriaTable';
export { Avatar } from './components/Avatar';
export { Badge } from './components/Badge';
export { Blockquote } from './components/Blockquote';
export { Box } from './components/Box';
export { Bubble } from './components/Bubble';
export { Button } from './components/Button';
Expand Down

0 comments on commit 5766210

Please sign in to comment.