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(components): add warning variant for Alert #1508

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/olive-doors-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@launchpad-ui/components": patch
---

Add `warning` variant for `Alert`
1 change: 1 addition & 0 deletions packages/components/src/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const alert = cva(styles.base, {
error: styles.error,
info: styles.info,
success: styles.success,
warning: styles.warning,
},
variant: {
default: styles.default,
Expand Down
9 changes: 9 additions & 0 deletions packages/components/src/styles/Alert.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
&.success .icon {
fill: var(--lp-color-fill-feedback-success);
}

&.warning .icon {
fill: var(--lp-color-brand-orange-base);
}
}

.default {
Expand Down Expand Up @@ -47,6 +51,11 @@
--color-2: var(--lp-color-green-400);
}

&.warning {
--color-1: var(--lp-color-brand-orange-base);
--color-2: #ffb052;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be replaced with new orange primitives later.

}

&:has(.heading) {
& .icon {
transform: translateY(2px);
Expand Down
12 changes: 12 additions & 0 deletions packages/components/stories/Alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ export const Success: Story = {
},
};

export const Warning: Story = {
args: {
children: (
<>
<Heading>Heading</Heading>
<Text>Content</Text>
</>
),
status: 'warning',
},
};

export const Inline: Story = {
args: {
children: <Text>Content</Text>,
Expand Down
Loading