Skip to content

Commit

Permalink
feat(blockquote): add bottom margin
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrantz committed Dec 2, 2024
1 parent 1afe45f commit d8bc778
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/rare-gifts-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/blockquote": minor
"@twilio-paste/core": minor
---

[Blockquote] add default bottom margin of space-70 to Blockquote, add marginBottom prop for the option to remove bottom margin when necessary.
9 changes: 8 additions & 1 deletion packages/paste-core/components/blockquote/src/Blockquote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ export interface BlockquoteProps extends HTMLPasteProps<"div"> {
* @memberof BlockquoteProps
*/
url?: string;
/**
* Remove the bottom margin
* @type {"space0" | "space70"}
* @memberof BlockquoteProps
*/
marginBottom?: "space0" | "space70";
}

export const Blockquote = React.forwardRef<HTMLDivElement, BlockquoteProps>(
({ children, element = "BLOCKQUOTE", url, ...props }, ref) => {
({ children, element = "BLOCKQUOTE", url, marginBottom = "space70", ...props }, ref) => {
return (
<Box
{...safelySpreadBoxProps(props)}
Expand All @@ -34,6 +40,7 @@ export const Blockquote = React.forwardRef<HTMLDivElement, BlockquoteProps>(
alignItems="flex-start"
lineHeight="lineHeight30"
fontSize="fontSize30"
marginBottom={marginBottom}
element={element}
>
<BlockquoteIcon element={`${element}_ICON`} decorative={true} color="colorTextIcon" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ export const WithoutSource: StoryFn = () => (
</Box>
);

export const BottomMargin: StoryFn = () => (
<Box display="flex" flexDirection="column" rowGap="space60">
<Box maxWidth="600px" borderStyle="solid">
<Blockquote url="#">
<BlockquoteContent>
With AI-driven products, the design process is no longer just about aesthetics. It’s about designing for the
human experience as a whole.
</BlockquoteContent>
<BlockquoteCitation author="Google" source="People + AI Guidebook" />
</Blockquote>
</Box>
<Box maxWidth="600px" borderStyle="solid">
<Blockquote url="#" marginBottom="space0">
<BlockquoteContent>
With AI-driven products, the design process is no longer just about aesthetics. It’s about designing for the
human experience as a whole.
</BlockquoteContent>
<BlockquoteCitation author="Google" source="People + AI Guidebook" />
</Blockquote>
</Box>
</Box>
);

export const CustomizationBlockquote: StoryFn = (_args, { parameters: { isTestEnvironment } }) => {
const currentTheme = useTheme();
return (
Expand Down

0 comments on commit d8bc778

Please sign in to comment.