@sonic-equipment/ui 0.0.91 → 0.0.93

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.
@@ -71,6 +71,8 @@ export * from './pages/product-listing-page/product-listing-page';
71
71
  export * from './pages/search-result-page/search-results-page';
72
72
  export * from './sidebar/sidebar';
73
73
  export * from './sidebar/sidebar-provider';
74
+ export * from './toast/toast-provider';
75
+ export * from './toast/use-toast';
74
76
  export * from './algolia/algolia-intialization';
75
77
  export * from './algolia/algolia-active-categories';
76
78
  export * from './algolia/algolia-categories-filters';
@@ -1,4 +1,5 @@
1
1
  declare const features: {
2
+ readonly language: "language";
2
3
  readonly pdp: "pdpV2";
3
4
  readonly pdpv1: "pdpV1";
4
5
  readonly plpv1: "plpV1";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Create UUID according to
3
+ * https://www.ietf.org/rfc/rfc4122.txt.
4
+ *
5
+ * @returns Generated UUID.
6
+ */
7
+ export declare function createUUID(): string;
@@ -0,0 +1,3 @@
1
+ import { ToastContainerProps } from 'react-toastify';
2
+ import 'react-toastify/dist/ReactToastify.css';
3
+ export declare function ToastProvider(props?: ToastContainerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { ToastProvider } from './toast-provider';
3
+ declare const meta: {
4
+ component: typeof ToastProvider;
5
+ parameters: {};
6
+ title: string;
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
@@ -0,0 +1,8 @@
1
+ import { ToastMessage } from './types';
2
+ export interface ToastProps {
3
+ className?: string;
4
+ id: string;
5
+ onClose?: (id: string) => void;
6
+ toastMessage: ToastMessage;
7
+ }
8
+ export declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ component: React.ForwardRefExoticComponent<import("./toast").ToastProps & React.RefAttributes<HTMLDivElement>>;
4
+ parameters: {
5
+ layout: string;
6
+ };
7
+ tags: string[];
8
+ title: string;
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Info: Story;
13
+ export declare const Error: Story;
14
+ export declare const Success: Story;
15
+ export declare const Warning: Story;
16
+ export declare const Dismissable: Story;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToastOptions } from 'react-toastify';
3
+ export type ToastMessageBody = ReactNode | string;
4
+ export type MessageType = 'success' | 'danger' | 'info' | 'warning';
5
+ export interface ToastMessage {
6
+ body: ToastMessageBody;
7
+ isUserDismissable?: boolean;
8
+ messageType?: MessageType;
9
+ }
10
+ export interface AddToastFunction {
11
+ (toast: ToastMessage, toastOptions?: Omit<ToastOptions<unknown>, 'toastId'>): void;
12
+ }
@@ -0,0 +1,5 @@
1
+ import { AddToastFunction } from './types';
2
+ export interface UseToastReturnType {
3
+ addToast: AddToastFunction;
4
+ }
5
+ export declare function useToast(): UseToastReturnType;