Skip to content

Commit

Permalink
feat(components): add warning variant for Alert (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niznikr authored Dec 11, 2024
1 parent f7c4b37 commit 714abcf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
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;
}

&: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

0 comments on commit 714abcf

Please sign in to comment.