Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/toast-component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hashintel/ds-components": patch
---

Add `Toast` and `Toaster`, toast notifications with two APIs: wrap the app in a `Toaster`, then either render a `Toast` declaratively (with `Toast.Title`, `Toast.Body`, `Toast.Actions`) or call the `toaster` functions (`create`, `promise`, `update`, `close`) from anywhere, in Banner's tones and variants.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Children, isValidElement } from "react";

import { cx } from "@hashintel/ds-helpers/css";

import { defaultToneIcon } from "../../util/default-tone-icon";
import { Button, type ButtonProps } from "../Button/button";
import { Icon, type IconName } from "../Icon/icon";
import { styles } from "./banner.recipe";
Expand All @@ -10,15 +11,6 @@ import type { Tone } from "../../util/form-shared";

type BannerVariant = "solid" | "soft" | "outline";

/** The default leading icon shown when `icon` is `true`, keyed by tone. */
const defaultToneIcon: Record<Tone, IconName> = {
neutral: "info",
brand: "info",
warning: "warning",
error: "diamondExclamation",
success: "circleCheck",
};

export type BannerRootProps = {
className?: string;
children: React.ReactNode;
Expand Down
Loading
Loading