- 
                Notifications
    
You must be signed in to change notification settings  - Fork 43
 
[New component] GlobalAlert #4188
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
Conversation
          🦋 Changeset detectedLatest commit: c6c099f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new GlobalAlert component as a replacement for <Alert fullWidth>, featuring built-in content centering and a compound component pattern with Header, Title, Content, and Close subcomponents.
- Adds GlobalAlert as a new compound component with TypeScript types and comprehensive Storybook examples
 - Updates package exports and style mappings to include the new component
 - Creates a changeset documenting the minor version bump for both ds-react and ds-css packages
 
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
@navikt/core/react/src/index.ts | 
Exports GlobalAlert component and all related types | 
@navikt/core/react/src/alert/global-alert/root/GlobalAlert.tsx | 
Main component implementation with compound component pattern | 
@navikt/core/react/src/alert/global-alert/index.ts | 
Barrel export file for GlobalAlert module | 
@navikt/core/react/src/alert/global-alert/title/GlobalAlertTitle.tsx | 
Title subcomponent wrapper around BaseAlert.Title | 
@navikt/core/react/src/alert/global-alert/header/GlobalAlertHeader.tsx | 
Header subcomponent wrapper around BaseAlert.Header | 
@navikt/core/react/src/alert/global-alert/content/GlobalAlertContent.tsx | 
Content subcomponent wrapper around BaseAlert.Content | 
@navikt/core/react/src/alert/global-alert/close/GlobalAlertClose.tsx | 
Close button subcomponent wrapper around BaseAlert.Close | 
@navikt/core/react/src/alert/global-alert/GlobalAlert.stories.tsx | 
Comprehensive Storybook stories for all component variants | 
@navikt/core/react/package.json | 
Adds package export path for GlobalAlert | 
@navikt/core/css/config/_mappings.js | 
Adds style mapping configuration for GlobalAlert | 
.changeset/eighty-deer-brake.md | 
Documents the new component addition | 
        
          
                @navikt/core/react/src/alert/global-alert/root/GlobalAlertRoot.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                @navikt/core/react/src/alert/global-alert/root/GlobalAlertRoot.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                @navikt/core/react/src/alert/global-alert/root/GlobalAlertRoot.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                @navikt/core/react/src/alert/global-alert/root/GlobalAlertRoot.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
      Co-authored-by: Halvor Haugan <[email protected]>
Co-authored-by: Halvor Haugan <[email protected]>
Co-authored-by: Halvor Haugan <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Halvor Haugan <[email protected]>
Description
Extracted from #4085
Component Checklist 📝
@navikt/core/css/config/_mappings.js)@navikt/core/css/tokens.json)@navikt/aksel-stylelint/src/deprecations.ts)@navikt/core/react/src/index.tsand@navikt/core/react/package.json)@navikt/core/css/index.css)<Component>: <gitmoji?> <Text>.E.g. "Button: ✨ Add feature xyz.")