/* * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import { ButtonProps } from "../button/types.js"; import { NoticeEventTypes } from "./events.js"; import { UniqueId } from "@accelint/core"; import { Payload, StructuredCloneableData } from "@accelint/bus"; import { ToastListProps } from "react-aria-components/Toast"; //#region src/components/notice/types.d.ts /** * Color variant for notices indicating severity level. */ type NoticeColor = 'info' | 'advisory' | 'normal' | 'serious' | 'critical'; type ActionButtonProps = Pick & { children: string; }; /** * Data structure for notice content in the queue. */ type NoticeContent = { /** Unique identifier for the notice. */ id: UniqueId; /** Message text to display. */ message: string; /** Color variant indicating severity. */ color?: NoticeColor; /** Primary action button configuration. */ primary?: ActionButtonProps; /** Secondary action button configuration. */ secondary?: ActionButtonProps; /** Auto-dismiss timeout in milliseconds. */ timeout?: number; /** Target NoticeList ID for routing. */ target?: UniqueId; /** Custom metadata for filtering and matching. */ metadata?: Record; }; /** * Props for the NoticeIcon component. */ type NoticeIconProps = { /** Color variant determining which icon to display. */ color?: NoticeColor; /** Size of the icon. */ size: 'small' | 'medium'; }; /** * Props for the NoticeList component. */ type NoticeListProps = { /** Unique identifier for targeting notices to this list. */ id?: UniqueId; /** Position of the notice list on screen. */ placement?: 'top left' | 'top' | 'top right' | 'right' | 'bottom right' | 'bottom' | 'bottom left' | 'left'; /** Maximum number of visible notices. */ limit?: number; /** Default color for notices without explicit color. */ defaultColor?: NoticeColor; /** Default timeout for notices without explicit timeout. */ defaultTimeout?: number; /** Whether to hide the "Clear All" button. */ hideClearAll?: boolean; /** Size variant for notices in the list. */ size?: 'small' | 'medium'; /** Whether to use global ToastRegion for portal rendering. */ global?: boolean; /** CSS class names for list elements. */ classNames?: { /** Class name for the region container. */ region?: string; /** Class name for the toast list. */ list?: ToastListProps['className']; /** Class name for the clear all button. */ button?: ButtonProps['className']; /** Class names for individual notices. */ notice?: NoticeProps['classNames']; }; }; /** * Props for the Notice component. */ type NoticeProps = Omit & { /** Unique identifier for the notice. */ id: UniqueId; /** CSS class names for notice elements. */ classNames?: { /** Class name for the notice container. */ notice?: string; /** Class name for the content wrapper. */ content?: string; /** Class name for the message text. */ message?: string; /** Class name for the actions container. */ actions?: string; }; /** Whether to hide the status icon. */ hideIcon?: boolean; /** Whether to show the close button. */ showClose?: boolean; /** Whether to close the notice when an action button is pressed. */ shouldCloseOnAction?: boolean; /** Size variant for the notice. */ size?: 'small' | 'medium'; /** Callback when primary action button is pressed. */ onPrimaryAction?: () => void; /** Callback when secondary action button is pressed. */ onSecondaryAction?: () => void; /** Callback when the notice is closed. */ onClose?: () => void; }; /** * Event payload for queuing a new notice via the bus. */ type NoticeQueueEvent = Payload & { id?: UniqueId; }>; /** * Event payload for removing notices from the queue via the bus. */ type NoticeDequeueEvent = Payload; }>; /** * Event payload for notice action events via the bus. */ type NoticeActionEvent = Payload; //#endregion export { NoticeActionEvent, NoticeColor, NoticeContent, NoticeDequeueEvent, NoticeIconProps, NoticeListProps, NoticeProps, NoticeQueueEvent }; //# sourceMappingURL=types.d.ts.map