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

feat(docs): update callouts to include icon attribute #1597

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Changes from all 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: 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
Loading