Skip to content

Commit

Permalink
feat(docs): update callouts to include icon attribute (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
chdeskur authored Oct 4, 2024
1 parent 8b83cf9 commit 80af5e5
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions packages/ui/app/src/mdx/components/callout/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,65 +101,68 @@ export const Callout: FC<PropsWithChildren<Callout.Props>> = ({ intent: intentRa

// aliases

export function InfoCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function InfoCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="info" title={title}>
<Callout intent="info" {...props}>
{children}
</Callout>
);
}

export function WarningCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function WarningCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="warning" title={title}>
<Callout intent="warning" {...props}>
{children}
</Callout>
);
}

export function SuccessCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function SuccessCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="success" title={title}>
<Callout intent="success" {...props}>
{children}
</Callout>
);
}

export function ErrorCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function ErrorCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="error" title={title}>
<Callout intent="error" {...props}>
{children}
</Callout>
);
}

export function NoteCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function NoteCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="note" title={title}>
<Callout intent="note" {...props}>
{children}
</Callout>
);
}

export function LaunchNoteCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function LaunchNoteCallout({
children,
...props
}: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="launch" title={title}>
<Callout intent="launch" {...props}>
{children}
</Callout>
);
}

export function TipCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function TipCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="tip" title={title}>
<Callout intent="tip" {...props}>
{children}
</Callout>
);
}

export function CheckCallout({ children, title }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function CheckCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="check" title={title}>
<Callout intent="check" {...props}>
{children}
</Callout>
);
Expand Down

0 comments on commit 80af5e5

Please sign in to comment.