Skip to content

Conversation

@KenAJoh
Copy link
Collaborator

@KenAJoh KenAJoh commented Oct 14, 2025

Description

Extracted from #4085

Component Checklist 📝

  • JSDoc
  • Examples
  • Documentation / Decision Records
  • Storybook
  • Style mappings (@navikt/core/css/config/_mappings.js)
  • Component tokens (@navikt/core/css/tokens.json)
  • CSS class deprecations (@navikt/aksel-stylelint/src/deprecations.ts)
  • Exports (@navikt/core/react/src/index.ts and @navikt/core/react/package.json)
  • New component? CSS import (@navikt/core/css/index.css)
  • Breaking change? Update migration guide. Consider codemod.
  • Changeset (Format: <Component>: <gitmoji?> <Text>. E.g. "Button: ✨ Add feature xyz.")

@KenAJoh KenAJoh requested a review from Copilot October 14, 2025 12:49
@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2025

🦋 Changeset detected

Latest commit: a74c07e

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

Copy link
Contributor

Copilot AI left a 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 BaseAlert utility component designed to be shared across LocalAlert, GlobalAlert, and InfoCard components. The implementation provides a composable alert system with consistent styling and behavior patterns.

Key changes:

  • New BaseAlert compound component with Header, Title, Content, and Close subcomponents
  • i18n support for announcement variant across Norwegian Bokmål, Nynorsk, and English
  • Comprehensive CSS styling with support for moderate/strong intensity types and global positioning
  • Typography line-height corrections for large body-short text

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

File Description
@navikt/core/react/src/util/i18n/locales/ Adds "announcement" translation keys for nb, nn, and en locales
@navikt/core/react/src/alert/base-alert/ Complete BaseAlert component implementation with context, utils, and subcomponents
@navikt/core/css/ CSS styling for BaseAlert with color variants, sizing, and darkside theme support
@navikt/core/react/src/alert/alert.stories.tsx Updates legacy Alert stories title to distinguish from new BaseAlert

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

Storybook demo / Chromatic

📝 Changes to review: 16

56150700d | 102 components | 165 stories

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
font-size: var(--ax-font-size-xlarge);
letter-spacing: -0.0013em;
line-height: var(--ax-font-line-height-large);
line-height: var(--ax-font-line-height-xlarge);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this intended? 😱 If yes, it should be in a separate PR with changeset.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, seems code is out of sync with Figma. Ill make a PR 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OnlyHeader,
CloseButton,
WrappingTitle,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Not all possible permutations are included, but i guess it will be covered by the components that will be using BaseAlert anyways. (Maybe we don't need Chromatic stories here at all?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can consider removing the chromatic stories after merging the other alert variants.

KenAJoh and others added 15 commits October 21, 2025 19:43
Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
…text.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
…ls.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
* 🚚 Extracted LocalAlert from #4085

* 🏷️ Rename root

* 📝 Doc changes

* 🐛 Add button do depdendency mapping

* Update @navikt/core/react/src/alert/local-alert/close/LocalAlertClose.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/react/src/alert/local-alert/root/LocalAlertRoot.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/react/src/alert/local-alert/root/LocalAlertRoot.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/react/src/alert/local-alert/root/LocalAlertRoot.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* 🔊 LocalAlert now always an alert

* 🐛 revert closebutton change

---------

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

.aksel-base-alert__icon {
font-size: 1.5rem;
margin-top: var(--ax-space-4);
Copy link
Contributor

Choose a reason for hiding this comment

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

This might just be me, but I think the icon looks more centered with margin-top: 3px 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Think it varies a little icon by icon 🔎

KenAJoh and others added 3 commits October 23, 2025 12:47
* 🚚 Extracted InfoCard from #4085

* Update .changeset/quiet-lions-serve.md

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/css/config/_mappings.js

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

---------

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
* 🚚 Extracted GlobalAlert from #4085

* 📝 Changeset

* 🏷️ Rename root

* 🔊 GlobalAlert now always an alert

* Apply suggestion from @HalvorHaugan

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* 📝 Add button css to global alert mappings

* Apply suggestion from @HalvorHaugan

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* 📝 Docs

* Apply suggestion from @HalvorHaugan

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @HalvorHaugan

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* ♻️ Remove prop-destructuring

---------

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 🚚 Move InlineMessage PR out of #4085

* 📝 Changeset

* Update @navikt/core/react/src/inline-message/root/InlineMessage.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* 📝 Jsdoc update

* Update @navikt/core/react/src/inline-message/root/InlineMessage.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* 🔥 Removed flex-start alignment

* Update @navikt/core/react/src/inline-message/root/InlineMessage.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/react/src/inline-message/root/InlineMessage.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/react/src/inline-message/root/InlineMessage.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* Update @navikt/core/react/src/inline-message/root/InlineMessage.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* ♻️ Inline color-definitions

* ♻️ Clean up css use

* Update @navikt/core/react/src/inline-message/icon/InlineMessageIcon.tsx

Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>

* 🔥 Remove redundant display-flex

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Halvor Haugan <83693529+HalvorHaugan@users.noreply.github.com>
@KenAJoh KenAJoh changed the title [BaseAlert] Utility component meant used by LocalAlert, GlobalAlert and InfoCard [Alert] LocalAlert, GlobalAlert, InfoCard and InlineMessage components Oct 29, 2025
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.

3 participants