@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.
- package/dist/index.d.ts +21 -1
- package/dist/index.js +259 -211
- package/dist/src/index.d.ts +2 -0
- package/dist/src/shared/feature-flags/use-feature-flags.d.ts +1 -0
- package/dist/src/shared/utils/uuid.d.ts +7 -0
- package/dist/src/toast/toast-provider.d.ts +3 -0
- package/dist/src/toast/toast-provider.stories.d.ts +10 -0
- package/dist/src/toast/toast.d.ts +8 -0
- package/dist/src/toast/toast.stories.d.ts +16 -0
- package/dist/src/toast/types.d.ts +12 -0
- package/dist/src/toast/use-toast.d.ts +5 -0
- package/dist/styles.css +866 -0
- package/package.json +6 -2
package/dist/src/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -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
|
+
}
|