@toteat-eng/ds-react 2026.6.10-3 → 2026.6.10-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/StatusBanner/StatusBanner.d.ts +18 -0
- package/dist/components/StatusBanner/__stories__/StatusBanner.stories.d.ts +23 -0
- package/dist/components/StatusBanner/index.d.ts +2 -0
- package/dist/components/UserNotification/NotificationBase.d.ts +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +625 -587
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { IconNameType } from "../Icon";
|
|
3
|
+
export type StatusBannerVariant = "info" | "success" | "warning" | "error" | "neutral";
|
|
4
|
+
export interface StatusBannerProps {
|
|
5
|
+
variant?: StatusBannerVariant;
|
|
6
|
+
icon?: IconNameType;
|
|
7
|
+
action?: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
"data-testid"?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Persistent, non-dismissable status surface (e.g. POS connectivity).
|
|
14
|
+
* Shares the notification surface with UserNotification but never renders a
|
|
15
|
+
* dismiss control. Uses `aria-atomic="true"` so assistive tech re-announces the
|
|
16
|
+
* full message when its content changes.
|
|
17
|
+
*/
|
|
18
|
+
export declare function StatusBanner({ variant, icon, action, children, className, "data-testid": testId, }: StatusBannerProps): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { StatusBanner } from "../StatusBanner";
|
|
3
|
+
/**
|
|
4
|
+
* Persistent, non-dismissable status surface (e.g. POS connectivity).
|
|
5
|
+
*
|
|
6
|
+
* a11y note: when `variant="error"` the root is `role="alert"` /
|
|
7
|
+
* `aria-live="assertive"` / `aria-atomic="true"`. Do NOT mutate `children` on
|
|
8
|
+
* every render in an error/alert banner — each change re-announces the full
|
|
9
|
+
* message and floods screen-reader users. Update the text only when the
|
|
10
|
+
* underlying status actually changes.
|
|
11
|
+
*/
|
|
12
|
+
declare const meta: Meta<typeof StatusBanner>;
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof StatusBanner>;
|
|
15
|
+
export declare const Info: Story;
|
|
16
|
+
export declare const Success: Story;
|
|
17
|
+
export declare const Warning: Story;
|
|
18
|
+
export declare const Error: Story;
|
|
19
|
+
export declare const Neutral: Story;
|
|
20
|
+
export declare const WithIcon: Story;
|
|
21
|
+
export declare const WithAction: Story;
|
|
22
|
+
export declare const AllVariants: Story;
|
|
23
|
+
export declare const BothThemes: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { IconNameType } from "../Icon";
|
|
3
|
+
/**
|
|
4
|
+
* Shared presentational/ARIA shell for notification-surface primitives
|
|
5
|
+
* (UserNotification, StatusBanner). INTERNAL — never exported from any index.ts.
|
|
6
|
+
*
|
|
7
|
+
* Owns only structure + ARIA. Each caller supplies its own CSS-module root
|
|
8
|
+
* class (`rootClassName`) so visual variance (e.g. enter animation, inline-flex
|
|
9
|
+
* vs flex) lives entirely in the caller's module.css.
|
|
10
|
+
*/
|
|
11
|
+
export type NotificationVariant = "info" | "success" | "warning" | "error" | "neutral";
|
|
12
|
+
export interface NotificationBaseProps {
|
|
13
|
+
variant: NotificationVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Caller's CSS-module root class (e.g. styles.notification / styles.statusBanner).
|
|
16
|
+
* Typed loosely because CSS-module lookups widen to `string | undefined` under
|
|
17
|
+
* `noUncheckedIndexedAccess`.
|
|
18
|
+
*/
|
|
19
|
+
rootClassName: string | undefined;
|
|
20
|
+
/** Caller's content span class. */
|
|
21
|
+
contentClassName: string | undefined;
|
|
22
|
+
/** Caller's action span class. */
|
|
23
|
+
actionClassName: string | undefined;
|
|
24
|
+
icon?: IconNameType;
|
|
25
|
+
action?: React.ReactNode;
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/** Extra consumer-supplied className, merged after the module root class. */
|
|
28
|
+
className?: string;
|
|
29
|
+
"data-testid"?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Trailing control (e.g. UserNotification passes <CloseButton/>).
|
|
32
|
+
* StatusBanner omits it — no element is rendered when undefined.
|
|
33
|
+
*/
|
|
34
|
+
dismissSlot?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Adds aria-atomic="true" to the root. Opt-in so callers that must keep a
|
|
37
|
+
* frozen DOM (UserNotification) are unaffected.
|
|
38
|
+
*/
|
|
39
|
+
ariaAtomic?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare function NotificationBase({ variant, rootClassName, contentClassName, actionClassName, icon, action, children, className, "data-testid": testId, dismissSlot, ariaAtomic, }: NotificationBaseProps): React.ReactElement;
|
package/dist/index.d.ts
CHANGED
|
@@ -98,6 +98,8 @@ export type { SpinnerProps, SpinnerSize } from "./components/Spinner";
|
|
|
98
98
|
export { Spinner } from "./components/Spinner";
|
|
99
99
|
export type { StatusBadgeProps } from "./components/StatusBadge";
|
|
100
100
|
export { StatusBadge } from "./components/StatusBadge";
|
|
101
|
+
export type { StatusBannerProps, StatusBannerVariant } from "./components/StatusBanner";
|
|
102
|
+
export { StatusBanner } from "./components/StatusBanner";
|
|
101
103
|
export type { StepperProps } from "./components/Stepper";
|
|
102
104
|
export { Stepper } from "./components/Stepper";
|
|
103
105
|
export type { TabItem as SegmentedTabItem, TabProps, TabSelectedColor, TabValue, } from "./components/Tab";
|