@emporix/component-library 1.5.3 → 1.6.1

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.
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToastErrorMessage, ToastSeverity } from './types';
3
+ export interface ToastProviderProps {
4
+ children: ReactNode;
5
+ }
6
+ interface ToastContextValue {
7
+ showSuccess: (title: string, message?: string | JSX.Element, life?: number) => void;
8
+ showError: (title: string, message?: ToastErrorMessage, life?: number) => void;
9
+ showToast: (title: string, message: string | JSX.Element, severity: ToastSeverity) => void;
10
+ }
11
+ export declare const useToast: () => ToastContextValue;
12
+ export declare const ToastProvider: (props: ToastProviderProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=ToastProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EAIV,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAK/D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAID,UAAU,iBAAiB;IACzB,WAAW,EAAE,CACX,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,EAC9B,IAAI,CAAC,EAAE,MAAM,KACV,IAAI,CAAA;IACT,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9E,SAAS,EAAE,CACT,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,EAC7B,QAAQ,EAAE,aAAa,KACpB,IAAI,CAAA;CACV;AAQD,eAAO,MAAM,QAAQ,yBAAiC,CAAA;AAEtD,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CAqGtD,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToastSeverity } from './types';
3
+ export interface ToastTemplateProps {
4
+ title: string;
5
+ message?: string | ReactNode;
6
+ type?: ToastSeverity;
7
+ }
8
+ export declare const ToastTemplate: (props: ToastTemplateProps) => import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=ToastTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/toast/ToastTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAS5C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CA2BtD,CAAA"}
@@ -0,0 +1,6 @@
1
+ export { ToastProvider, useToast } from './ToastProvider';
2
+ export type { ToastProviderProps } from './ToastProvider';
3
+ export { ToastTemplate } from './ToastTemplate';
4
+ export type { ToastTemplateProps } from './ToastTemplate';
5
+ export type { ToastErrorItem, ToastErrorMessage, ToastSeverity } from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { ToastMessageOptions } from 'primereact/toast';
2
+ import { ReactNode } from 'react';
3
+ /** PrimeReact toast severity (aligned with `ToastMessageOptions`) */
4
+ export type ToastSeverity = NonNullable<ToastMessageOptions['severity']>;
5
+ /** API / form error shape often passed to `showError` */
6
+ export interface ToastErrorItem {
7
+ message: string;
8
+ field?: string;
9
+ }
10
+ export type ToastErrorMessage = string | string[] | ToastErrorItem[] | ReactNode | undefined;
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,qEAAqE;AACrE,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAA;AAExE,yDAAyD;AACzD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,MAAM,EAAE,GACR,cAAc,EAAE,GAChB,SAAS,GACT,SAAS,CAAA"}
package/dist/index.d.ts CHANGED
@@ -24,4 +24,6 @@ export { AccordionTab } from './components/accordion/AccordionTab';
24
24
  export type { AccordionTabProps } from './components/accordion/AccordionTab';
25
25
  export { SelectButton } from './components/selectbutton/SelectButton';
26
26
  export type { SelectButtonProps, SelectButtonOption, SelectButtonChangeEvent, } from './components/selectbutton/SelectButton';
27
+ export { ToastProvider, useToast, ToastTemplate } from './components/toast';
28
+ export type { ToastProviderProps, ToastTemplateProps, ToastErrorItem, ToastErrorMessage, ToastSeverity, } from './components/toast';
27
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAClE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAEhF,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,YAAY,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,wCAAwC,CAAA;AAG/C,OAAO,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;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