Skip to content

Add inline-simple alert variant#436

Open
aadi704 wants to merge 1 commit into
stagingfrom
alert-inline-simple
Open

Add inline-simple alert variant#436
aadi704 wants to merge 1 commit into
stagingfrom
alert-inline-simple

Conversation

@aadi704
Copy link
Copy Markdown

@aadi704 aadi704 commented Apr 13, 2026

Summary

  • added a new inline-simple alert design to the Alert component
  • added support for five inline-simple variants: neutral, info, success, warning, and danger
  • added a Storybook preview covering all inline-simple variants

What Changed

  • updated src/components/alert/alert.tsx to support a new design="inline-simple" rendering path
  • added danger as a supported alert variant and mapped it to the existing error token treatment
  • implemented the inline-simple layout with Force UI utility classes and existing tokenized styles
  • applied the requested spacing for inline-simple: px-3, py-3, and gap-2
  • kept the existing inline and stack alert designs intact
  • added InlineSimpleVariants story in src/components/alert/alert.stories.tsx to show neutral, info, success, warning, and danger states

Notes

  • this implementation uses existing Force UI color tokens and shared alert/toaster helpers where applicable
  • exact Figma node inspection was not available in-session due MCP tool timeouts, so the layout was aligned using the shared image and the spacing values you provided

Validation

  • reviewed the diff to confirm changes are limited to the alert component and its stories

Comment thread src/components/alert/alert.stories.tsx Outdated
@@ -139,3 +139,70 @@ export const WithCustomIcon: Story = {
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What: Consider extracting Alert component properties into a variable to avoid repetition.

Why: This change improves maintainability and readability of the code. It also reduces the chances of inconsistent updates to the Alert properties in the future.

How: You can define a common object for the Alert properties and then spread it in the Alert component calls. For example:

const alertProps = {
    title: 'Title',
    content: 'Alert message will be here..',
    onClose: fn(),
    action: {
        label: 'Action',
        onClick: () => {},
        type: 'link',
    },
};

<Alert design="inline-simple" variant="neutral" {...alertProps} />
<Alert design="inline-simple" variant="info" {...alertProps} />
// and so on for other variants

Comment thread src/components/alert/alert.stories.tsx Outdated
@@ -139,3 +139,70 @@ export const WithCustomIcon: Story = {
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What: Use meaningful content placeholders instead of just 'Alert message will be here..'.

Why: Using more descriptive placeholders helps clarify intent and functionality to other developers who may later read this code. It can also assist in understanding the variant-specific functions/case for the Alert message.

How: Replace the content string with variant-specific messages, e.g., content="This is a neutral alert" for each variant.

Comment thread src/components/alert/alert.stories.tsx Outdated
@@ -139,3 +139,70 @@ export const WithCustomIcon: Story = {
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What: Each Alert component appears to receive the same title and content, consider if this is the desired behavior.

Why: If different variants of alerts should convey different messages, keeping them the same may lead to confusion during usage. Clearly defined messages assist in distinguishing the alerts during notifications or UI presentation.

How: Review if the application logic requires these variants to share the same title and content; if not, assign varying text for titles and contents to each Alert according to their purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant