Skip to content

Commit a150cf7

Browse files
chore(callout): change to horizontal alignment (#4127)
* chore(calliout): change to horizontal alignment * chore(callout): changeset * chore(callout): updated stylings to match Figma * fix(callout): update for even padding Co-authored-by: Sarah <[email protected]> * fix(callout): lineHeight on content --------- Co-authored-by: Sarah <[email protected]>
1 parent 69d8d7c commit a150cf7

File tree

4 files changed

+19
-26
lines changed

4 files changed

+19
-26
lines changed

.changeset/two-eyes-pay.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@twilio-paste/callout": patch
3+
"@twilio-paste/core": patch
4+
---
5+
6+
[Callout] changed layout so elements align horizontally reducing vertical space used

packages/paste-core/components/callout/src/Callout.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,33 +129,28 @@ export const Callout = React.forwardRef<HTMLDivElement, CalloutProps>(
129129
ref={ref}
130130
element={element}
131131
display="flex"
132-
flexDirection="column"
133132
marginY={marginY}
134-
rowGap="space50"
135-
paddingTop="space70"
136-
paddingLeft="space70"
137-
paddingRight="space70"
138-
paddingBottom="space90"
133+
padding="space70"
139134
borderLeftStyle="solid"
140135
borderLeftWidth="borderWidth20"
141136
variant={variant}
137+
alignItems="start"
138+
columnGap="space50"
142139
{...variantStyles[variant]}
143140
>
144-
<Box display="flex" justifyContent="space-between">
145-
<Box element={`${element}_ICON`}>
146-
{IconComponent}
147-
<ScreenReaderOnly>{iconLabel}</ScreenReaderOnly>
148-
</Box>
149-
{onDismiss && typeof onDismiss === "function" && (
150-
<Button onClick={onDismiss} variant="secondary_icon" size="reset" element={`${element}_DISMISS_BUTTON`}>
151-
<CloseIcon element={`${element}_DISMISS_ICON`} decorative size="sizeIcon20" />
152-
<ScreenReaderOnly>{i18nDismissLabel}</ScreenReaderOnly>
153-
</Button>
154-
)}
141+
<Box element={`${element}_ICON`}>
142+
{IconComponent}
143+
<ScreenReaderOnly>{iconLabel}</ScreenReaderOnly>
155144
</Box>
156145
<Box display="flex" flexDirection="column" rowGap="space30" flex="1">
157146
{children}
158147
</Box>
148+
{onDismiss && typeof onDismiss === "function" && (
149+
<Button onClick={onDismiss} variant="secondary_icon" size="reset" element={`${element}_DISMISS_BUTTON`}>
150+
<CloseIcon element={`${element}_DISMISS_ICON`} decorative size="sizeIcon20" />
151+
<ScreenReaderOnly>{i18nDismissLabel}</ScreenReaderOnly>
152+
</Button>
153+
)}
159154
</Box>
160155
);
161156
},

packages/paste-core/components/callout/src/CalloutHeading.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const CalloutHeading = React.forwardRef<HTMLHeadingElement, CalloutHeadin
3131
ref={ref}
3232
element={element}
3333
color="currentColor"
34-
lineHeight="lineHeight40"
3534
fontWeight="fontWeightSemibold"
3635
>
3736
{children}

packages/paste-core/components/callout/src/CalloutText.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@ export interface CalloutTextProps extends HTMLPasteProps<"p"> {
1717

1818
export const CalloutText = React.forwardRef<HTMLParagraphElement, CalloutTextProps>(
1919
({ element = "CALLOUT_TEXT", children, ...props }, ref) => (
20-
<Text
21-
{...safelySpreadTextProps(props)}
22-
as="p"
23-
ref={ref}
24-
element={element}
25-
color="currentColor"
26-
lineHeight="lineHeight40"
27-
>
20+
<Text {...safelySpreadTextProps(props)} as="p" ref={ref} element={element} color="currentColor">
2821
{children}
2922
</Text>
3023
),

0 commit comments

Comments
 (0)