feat(blade-svelte): add primary variant to Alert component#3417
feat(blade-svelte): add primary variant to Alert component#3417rzp-slash[bot] wants to merge 1 commit into
Conversation
|
|
✅ PR title follows Conventional Commits specification. |
🛡️ Coverage ReportSummaryFull Coverage Details |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 64699e7:
|
Co-authored-by: rohankokane-dev <rohan.kokane@razorpay.com>
2376b2f to
64699e7
Compare
Summary
Adds a
primaryvariant (color) to the Alert component inblade-svelteandblade-core.Changes
blade-core/src/styles/Alert/alert.ts: Added'primary'toAlertColortype; addedprimarykey to the CVA color variant; updatedgetAlertIconColorTokento returninteractive.icon.primary.normalfor primary color with subtle emphasis (instead of the non-existentfeedback.icon.primary.intense).blade-core/src/styles/Alert/alert.module.css: Added compound CSS rules for.color-primary.emphasis-subtleand.color-primary.emphasis-intense.blade-svelte/src/components/Alert/types.ts: Added'primary'to theAlertColortype.blade-svelte/src/components/Alert/Alert.svelte: Addedprimaryto theintentIconMap(usesInfoIcon).blade-svelte/src/components/Alert/Alert.stories.svelte: Added'primary'to the color control options; added two new stories — Primary and Primary Intense.Design Reference
Design spec was provided via screenshot. The primary variant follows the same pattern as other feedback colors:
subtle--interactive-background-primary-fadedintense--interactive-background-primary-defaultNo accent border — the primary variant uses the same clean rounded-rectangle container as other colors.
Design Assumptions (items not shown in the spec)
InfoIconinteractive.icon.primary.normalfeedback.icon.primary.*tokensurface.icon.staticWhite.normalgetAlertTextColorTokenreturns white for intense, dark gray for subtle — both are correct for primary backgroundsrole="status"