@flipdish/portal-library 1.0.76 → 1.0.78
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/custom-hooks/useToasts.cjs.js +2 -0
- package/dist/components/custom-hooks/useToasts.cjs.js.map +1 -0
- package/dist/components/custom-hooks/useToasts.d.ts +59 -0
- package/dist/components/custom-hooks/useToasts.js +2 -0
- package/dist/components/custom-hooks/useToasts.js.map +1 -0
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/providers/ToastProvider.cjs.js +2 -0
- package/dist/providers/ToastProvider.cjs.js.map +1 -0
- package/dist/providers/ToastProvider.d.ts +26 -0
- package/dist/providers/ToastProvider.js +2 -0
- package/dist/providers/ToastProvider.js.map +1 -0
- package/package.json +17 -12
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=require("notistack");module.exports=()=>{const{enqueueSnackbar:o,closeSnackbar:r}=s.useSnackbar(),a=(s,r,a=void 0)=>o(s,{autoHideDuration:a?.durationMs,persist:a?.persist,variant:r});return{dismissAllToasts:()=>{r()},dismissToast:s=>{r(s)},showDefaultToast:(s,o=void 0)=>a(s,"default",o),showSuccessToast:(s,o=void 0)=>a(s,"success",o),showErrorToast:(s,o=void 0)=>a(s,"error",o)}};
|
|
2
|
+
//# sourceMappingURL=useToasts.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToasts.cjs.js","sources":["../../../src/components/custom-hooks/useToasts.tsx"],"sourcesContent":["import { useSnackbar, type SnackbarKey, type VariantType } from 'notistack';\n\n/**\n * Configuration options for toast notifications\n * @interface ToastOptions\n * @property {boolean} [persist] - If true, the toast will not auto-dismiss\n * @property {number} [durationMs] - Duration in milliseconds before the toast auto-dismisses\n */\nexport interface ToastOptions {\n /** If true, the toast will not auto-dismiss */\n persist?: boolean;\n /** Duration in milliseconds before the toast auto-dismisses */\n durationMs?: number;\n}\n\n/**\n * Type alias for toast notification keys\n * Used to uniquely identify toast notifications for dismissal\n */\nexport type ToastKey = SnackbarKey;\n\n/**\n * Interface defining the return value of the useToasts hook\n */\nexport interface UseToastsReturn {\n /** Dismisses all active toast notifications */\n dismissAllToasts: () => void;\n /** Dismisses a specific toast by its key */\n dismissToast: (key: string) => void;\n /** Shows a default toast notification */\n showDefaultToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows a success toast notification */\n showSuccessToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows an error toast notification */\n showErrorToast: (message: string, options?: ToastOptions) => ToastKey;\n}\n\n/**\n * Custom hook for managing toast notifications\n * Provides methods to show different types of toasts (default, success, error)\n * and dismiss them individually or all at once\n *\n * @example\n * ```tsx\n * const { showSuccessToast, showErrorToast, dismissAllToasts } = useToasts();\n *\n * // Show a success toast that auto-dismisses after 3 seconds\n * const toastKey = showSuccessToast('Operation successful', { durationMs: 3000 });\n *\n * // Show a persistent error toast\n * const errorToastKey = showErrorToast('Error occurred', { persist: true });\n *\n * // Later, dismiss a specific toast using its key\n * dismissToast(toastKey);\n *\n * // Or dismiss all toasts\n * dismissAllToasts();\n * ```\n */\nconst useToasts = (): UseToastsReturn => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n /**\n * Dismisses all currently active toast notifications\n */\n const dismissAllToasts = () => {\n closeSnackbar();\n };\n\n /**\n * Dismisses a specific toast notification by its key\n * @param {string} key - Unique identifier of the toast to dismiss\n */\n const dismissToast = (key: string) => {\n closeSnackbar(key);\n };\n\n /**\n * Internal method to show a toast notification with specified variant and options\n * @param {string} message - The message to display in the toast\n * @param {VariantType} variant - The type of toast (default, success, error)\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showToast = (message: string, variant: VariantType, options: ToastOptions | undefined = undefined): ToastKey => {\n return enqueueSnackbar(message, {\n autoHideDuration: options?.durationMs,\n persist: options?.persist,\n variant,\n });\n };\n\n /**\n * Shows a default toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showDefaultToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'default', options);\n };\n\n /**\n * Shows a success toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showSuccessToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'success', options);\n };\n\n /**\n * Shows an error toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showErrorToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'error', options);\n };\n\n return { dismissAllToasts, dismissToast, showDefaultToast, showSuccessToast, showErrorToast };\n};\n\nexport default useToasts;\n"],"names":["enqueueSnackbar","closeSnackbar","useSnackbar","showToast","message","variant","options","undefined","autoHideDuration","durationMs","persist","dismissAllToasts","dismissToast","key","showDefaultToast","showSuccessToast","showErrorToast"],"mappings":"uDA2DkB,KACd,MAAMA,gBAAEA,EAAeC,cAAEA,GAAkBC,EAAWA,cAwBhDC,EAAY,CAACC,EAAiBC,EAAsBC,OAAoCC,IACnFP,EAAgBI,EAAS,CAC5BI,iBAAkBF,GAASG,WAC3BC,QAASJ,GAASI,QAClBL,YAkCR,MAAO,CAAEM,iBAzDgB,KACrBV,GAAe,EAwDQW,aAjDLC,IAClBZ,EAAcY,EAAI,EAgDmBC,iBAxBhB,CAACV,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAuBkBS,iBAdlC,CAACX,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAaoCU,eAJtD,CAACZ,EAAiBE,OAAoCC,IAClEJ,EAAUC,EAAS,QAASE,GAGsD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SnackbarKey } from 'notistack';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for toast notifications
|
|
5
|
+
* @interface ToastOptions
|
|
6
|
+
* @property {boolean} [persist] - If true, the toast will not auto-dismiss
|
|
7
|
+
* @property {number} [durationMs] - Duration in milliseconds before the toast auto-dismisses
|
|
8
|
+
*/
|
|
9
|
+
interface ToastOptions {
|
|
10
|
+
/** If true, the toast will not auto-dismiss */
|
|
11
|
+
persist?: boolean;
|
|
12
|
+
/** Duration in milliseconds before the toast auto-dismisses */
|
|
13
|
+
durationMs?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Type alias for toast notification keys
|
|
17
|
+
* Used to uniquely identify toast notifications for dismissal
|
|
18
|
+
*/
|
|
19
|
+
type ToastKey = SnackbarKey;
|
|
20
|
+
/**
|
|
21
|
+
* Interface defining the return value of the useToasts hook
|
|
22
|
+
*/
|
|
23
|
+
interface UseToastsReturn {
|
|
24
|
+
/** Dismisses all active toast notifications */
|
|
25
|
+
dismissAllToasts: () => void;
|
|
26
|
+
/** Dismisses a specific toast by its key */
|
|
27
|
+
dismissToast: (key: string) => void;
|
|
28
|
+
/** Shows a default toast notification */
|
|
29
|
+
showDefaultToast: (message: string, options?: ToastOptions) => ToastKey;
|
|
30
|
+
/** Shows a success toast notification */
|
|
31
|
+
showSuccessToast: (message: string, options?: ToastOptions) => ToastKey;
|
|
32
|
+
/** Shows an error toast notification */
|
|
33
|
+
showErrorToast: (message: string, options?: ToastOptions) => ToastKey;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Custom hook for managing toast notifications
|
|
37
|
+
* Provides methods to show different types of toasts (default, success, error)
|
|
38
|
+
* and dismiss them individually or all at once
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* const { showSuccessToast, showErrorToast, dismissAllToasts } = useToasts();
|
|
43
|
+
*
|
|
44
|
+
* // Show a success toast that auto-dismisses after 3 seconds
|
|
45
|
+
* const toastKey = showSuccessToast('Operation successful', { durationMs: 3000 });
|
|
46
|
+
*
|
|
47
|
+
* // Show a persistent error toast
|
|
48
|
+
* const errorToastKey = showErrorToast('Error occurred', { persist: true });
|
|
49
|
+
*
|
|
50
|
+
* // Later, dismiss a specific toast using its key
|
|
51
|
+
* dismissToast(toastKey);
|
|
52
|
+
*
|
|
53
|
+
* // Or dismiss all toasts
|
|
54
|
+
* dismissAllToasts();
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare const useToasts: () => UseToastsReturn;
|
|
58
|
+
|
|
59
|
+
export { type ToastKey, type ToastOptions, type UseToastsReturn, useToasts as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useSnackbar as s}from"notistack";const o=()=>{const{enqueueSnackbar:o,closeSnackbar:t}=s(),a=(s,t,a=void 0)=>o(s,{autoHideDuration:a?.durationMs,persist:a?.persist,variant:t});return{dismissAllToasts:()=>{t()},dismissToast:s=>{t(s)},showDefaultToast:(s,o=void 0)=>a(s,"default",o),showSuccessToast:(s,o=void 0)=>a(s,"success",o),showErrorToast:(s,o=void 0)=>a(s,"error",o)}};export{o as default};
|
|
2
|
+
//# sourceMappingURL=useToasts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToasts.js","sources":["../../../src/components/custom-hooks/useToasts.tsx"],"sourcesContent":["import { useSnackbar, type SnackbarKey, type VariantType } from 'notistack';\n\n/**\n * Configuration options for toast notifications\n * @interface ToastOptions\n * @property {boolean} [persist] - If true, the toast will not auto-dismiss\n * @property {number} [durationMs] - Duration in milliseconds before the toast auto-dismisses\n */\nexport interface ToastOptions {\n /** If true, the toast will not auto-dismiss */\n persist?: boolean;\n /** Duration in milliseconds before the toast auto-dismisses */\n durationMs?: number;\n}\n\n/**\n * Type alias for toast notification keys\n * Used to uniquely identify toast notifications for dismissal\n */\nexport type ToastKey = SnackbarKey;\n\n/**\n * Interface defining the return value of the useToasts hook\n */\nexport interface UseToastsReturn {\n /** Dismisses all active toast notifications */\n dismissAllToasts: () => void;\n /** Dismisses a specific toast by its key */\n dismissToast: (key: string) => void;\n /** Shows a default toast notification */\n showDefaultToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows a success toast notification */\n showSuccessToast: (message: string, options?: ToastOptions) => ToastKey;\n /** Shows an error toast notification */\n showErrorToast: (message: string, options?: ToastOptions) => ToastKey;\n}\n\n/**\n * Custom hook for managing toast notifications\n * Provides methods to show different types of toasts (default, success, error)\n * and dismiss them individually or all at once\n *\n * @example\n * ```tsx\n * const { showSuccessToast, showErrorToast, dismissAllToasts } = useToasts();\n *\n * // Show a success toast that auto-dismisses after 3 seconds\n * const toastKey = showSuccessToast('Operation successful', { durationMs: 3000 });\n *\n * // Show a persistent error toast\n * const errorToastKey = showErrorToast('Error occurred', { persist: true });\n *\n * // Later, dismiss a specific toast using its key\n * dismissToast(toastKey);\n *\n * // Or dismiss all toasts\n * dismissAllToasts();\n * ```\n */\nconst useToasts = (): UseToastsReturn => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n /**\n * Dismisses all currently active toast notifications\n */\n const dismissAllToasts = () => {\n closeSnackbar();\n };\n\n /**\n * Dismisses a specific toast notification by its key\n * @param {string} key - Unique identifier of the toast to dismiss\n */\n const dismissToast = (key: string) => {\n closeSnackbar(key);\n };\n\n /**\n * Internal method to show a toast notification with specified variant and options\n * @param {string} message - The message to display in the toast\n * @param {VariantType} variant - The type of toast (default, success, error)\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showToast = (message: string, variant: VariantType, options: ToastOptions | undefined = undefined): ToastKey => {\n return enqueueSnackbar(message, {\n autoHideDuration: options?.durationMs,\n persist: options?.persist,\n variant,\n });\n };\n\n /**\n * Shows a default toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showDefaultToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'default', options);\n };\n\n /**\n * Shows a success toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showSuccessToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'success', options);\n };\n\n /**\n * Shows an error toast notification\n * @param {string} message - The message to display\n * @param {ToastOptions} [options] - Configuration options for the toast\n * @returns {ToastKey} A unique key that can be used to dismiss this toast later\n */\n const showErrorToast = (message: string, options: ToastOptions | undefined = undefined): ToastKey => {\n return showToast(message, 'error', options);\n };\n\n return { dismissAllToasts, dismissToast, showDefaultToast, showSuccessToast, showErrorToast };\n};\n\nexport default useToasts;\n"],"names":["useToasts","enqueueSnackbar","closeSnackbar","useSnackbar","showToast","message","variant","options","undefined","autoHideDuration","durationMs","persist","dismissAllToasts","dismissToast","key","showDefaultToast","showSuccessToast","showErrorToast"],"mappings":"wCA2DM,MAAAA,EAAY,KACd,MAAMC,gBAAEA,EAAeC,cAAEA,GAAkBC,IAwBrCC,EAAY,CAACC,EAAiBC,EAAsBC,OAAoCC,IACnFP,EAAgBI,EAAS,CAC5BI,iBAAkBF,GAASG,WAC3BC,QAASJ,GAASI,QAClBL,YAkCR,MAAO,CAAEM,iBAzDgB,KACrBV,GAAe,EAwDQW,aAjDLC,IAClBZ,EAAcY,EAAI,EAgDmBC,iBAxBhB,CAACV,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAuBkBS,iBAdlC,CAACX,EAAiBE,OAAoCC,IACpEJ,EAAUC,EAAS,UAAWE,GAaoCU,eAJtD,CAACZ,EAAiBE,OAAoCC,IAClEJ,EAAUC,EAAS,QAASE,GAGsD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),i=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),r=require("./ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js"),t=require("./ui/PageLayout/PageLayout.cjs.js"),
|
|
1
|
+
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),i=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),r=require("./ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js"),t=require("./ui/PageLayout/PageLayout.cjs.js"),s=require("./ui/PortalMock/PortalMock.cjs.js"),o=require("./ui/LazyComponent/LazyComponent.cjs.js"),c=require("./ui/Spacer/Spacer.cjs.js"),u=require("./ui/Chip/Chip.cjs.js"),a=require("./ui/Switch/Switch.cjs.js"),n=require("./ui/Tooltip/Tooltip.cjs.js"),d=require("./ui/Form/utilities/formValidation.cjs.js"),l=require("./ui/Form/GenericAutocompleteField.cjs.js"),p=require("./ui/Form/GenericFormContainer.cjs.js"),j=require("./ui/Form/GenericTextField.cjs.js"),x=require("./ui/Form/PaginatedAutocompleteField.cjs.js"),m=require("./ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js"),T=require("./ui/GenericDatePickerField/GenericDatePickerField.cjs.js"),q=require("./ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js"),F=require("./ui/GenericRadioButtons/GenericRadioButtons.cjs.js"),L=require("./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.cjs.js"),G=require("./ui/GenericTable/GenericTable.cjs.js"),h=require("./ui/GenericTableBody/GenericTableBody.cjs.js"),g=require("./ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js"),P=require("./ui/GenericTableTitle/GenericTableTitle.cjs.js"),k=require("./ui/ListItemLink/ListItemLink.cjs.js"),b=require("./ui/ListItemLinkButton/ListItemLinkButton.cjs.js"),I=require("./ui/NoResults/NoResults.cjs.js"),y=require("@mui/icons-material/Search"),f=require("@mui/icons-material/CalendarToday"),B=require("@mui/icons-material/AccessTime"),C=require("@mui/icons-material/Done"),R=require("./custom-hooks/useRenderValidText.cjs.js"),S=require("./custom-hooks/useMicroFrontendAttributes.cjs.js"),A=require("./custom-hooks/useToasts.cjs.js"),D=require("./renderUtilities/renderUtilities.cjs.js"),z=require("./genericUtilities/index.cjs.js"),v=require("../providers/ToastProvider.cjs.js");exports.flipdishPublicTheme=e,exports.NotFoundPage=i,exports.FlipdishStaffContainer=r,exports.PageLayout=t.default,exports.PortalMock=s,exports.LazyComponent=o,exports.Spacer=c,exports.Chip=u.default,exports.Switch=a,exports.Tooltip=n,exports.formikValidate=d.formikValidate,exports.GenericAutocompleteField=l,exports.GenericFormContainer=p,exports.GenericTextField=j,exports.PaginatedAutocompleteField=x,exports.FlipdishLogoLoader=m,exports.GenericDatePickerField=T,exports.GenericDateTimePickerField=q,exports.GenericRadioButtons=F,exports.DateTimeLocalizationProvider=L,exports.GenericTable=G,exports.GenericTableBody=h,exports.GenericTableBodyRow=g,exports.GenericTableTitle=P,exports.ListItemLink=k,exports.ListItemLinkButton=b.ListItemLinkButton,exports.NoResults=I,exports.SearchIcon=y,exports.CalendarTodayIcon=f,exports.AccessTimeIcon=B,exports.DoneIcon=C,exports.useRenderValidText=R,exports.useMicroFrontendAttributes=S,exports.useToasts=A,exports.getAppId=D.getAppId,exports.getBrandId=D.getBrandId,exports.getIsFlipdishStaff=D.getIsFlipdishStaff,exports.getMicroFrontendAttribute=D.getMicroFrontendAttribute,exports.getOrgId=D.getOrgId,exports.lazyWithRetry=D.lazyWithRetry,exports.debounce=z.debounce,exports.ToastProvider=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -32,5 +32,7 @@ export { default as AccessTimeIcon } from '@mui/icons-material/AccessTime';
|
|
|
32
32
|
export { default as DoneIcon } from '@mui/icons-material/Done';
|
|
33
33
|
export { default as useRenderValidText } from './custom-hooks/useRenderValidText.js';
|
|
34
34
|
export { default as useMicroFrontendAttributes } from './custom-hooks/useMicroFrontendAttributes.js';
|
|
35
|
+
export { default as useToasts } from './custom-hooks/useToasts.js';
|
|
35
36
|
export { getAppId, getBrandId, getIsFlipdishStaff, getMicroFrontendAttribute, getOrgId, lazyWithRetry } from './renderUtilities/renderUtilities.js';
|
|
36
37
|
export { debounce } from './genericUtilities/index.js';
|
|
38
|
+
export { default as ToastProvider } from '../providers/ToastProvider.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as FlipdishStaffContainer}from"./ui/FlipdishStaffContainer/FlipdishStaffContainer.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";export{default as Chip}from"./ui/Chip/Chip.js";export{default as Switch}from"./ui/Switch/Switch.js";export{default as Tooltip}from"./ui/Tooltip/Tooltip.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericAutocompleteField}from"./ui/Form/GenericAutocompleteField.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as PaginatedAutocompleteField}from"./ui/Form/PaginatedAutocompleteField.js";export{default as FlipdishLogoLoader}from"./ui/FlipdishLogoLoader/FlipdishLogoLoader.js";export{default as GenericDatePickerField}from"./ui/GenericDatePickerField/GenericDatePickerField.js";export{default as GenericDateTimePickerField}from"./ui/GenericDateTimePickerField/GenericDateTimePickerField.js";export{default as GenericRadioButtons}from"./ui/GenericRadioButtons/GenericRadioButtons.js";export{default as DateTimeLocalizationProvider}from"./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";export{default as ListItemLink}from"./ui/ListItemLink/ListItemLink.js";export{ListItemLinkButton}from"./ui/ListItemLinkButton/ListItemLinkButton.js";export{default as NoResults}from"./ui/NoResults/NoResults.js";export{default as SearchIcon}from"@mui/icons-material/Search";export{default as CalendarTodayIcon}from"@mui/icons-material/CalendarToday";export{default as AccessTimeIcon}from"@mui/icons-material/AccessTime";export{default as DoneIcon}from"@mui/icons-material/Done";export{default as useRenderValidText}from"./custom-hooks/useRenderValidText.js";export{default as useMicroFrontendAttributes}from"./custom-hooks/useMicroFrontendAttributes.js";export{getAppId,getBrandId,getIsFlipdishStaff,getMicroFrontendAttribute,getOrgId,lazyWithRetry}from"./renderUtilities/renderUtilities.js";export{debounce}from"./genericUtilities/index.js";
|
|
1
|
+
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as FlipdishStaffContainer}from"./ui/FlipdishStaffContainer/FlipdishStaffContainer.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";export{default as Chip}from"./ui/Chip/Chip.js";export{default as Switch}from"./ui/Switch/Switch.js";export{default as Tooltip}from"./ui/Tooltip/Tooltip.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericAutocompleteField}from"./ui/Form/GenericAutocompleteField.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as PaginatedAutocompleteField}from"./ui/Form/PaginatedAutocompleteField.js";export{default as FlipdishLogoLoader}from"./ui/FlipdishLogoLoader/FlipdishLogoLoader.js";export{default as GenericDatePickerField}from"./ui/GenericDatePickerField/GenericDatePickerField.js";export{default as GenericDateTimePickerField}from"./ui/GenericDateTimePickerField/GenericDateTimePickerField.js";export{default as GenericRadioButtons}from"./ui/GenericRadioButtons/GenericRadioButtons.js";export{default as DateTimeLocalizationProvider}from"./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";export{default as ListItemLink}from"./ui/ListItemLink/ListItemLink.js";export{ListItemLinkButton}from"./ui/ListItemLinkButton/ListItemLinkButton.js";export{default as NoResults}from"./ui/NoResults/NoResults.js";export{default as SearchIcon}from"@mui/icons-material/Search";export{default as CalendarTodayIcon}from"@mui/icons-material/CalendarToday";export{default as AccessTimeIcon}from"@mui/icons-material/AccessTime";export{default as DoneIcon}from"@mui/icons-material/Done";export{default as useRenderValidText}from"./custom-hooks/useRenderValidText.js";export{default as useMicroFrontendAttributes}from"./custom-hooks/useMicroFrontendAttributes.js";export{default as useToasts}from"./custom-hooks/useToasts.js";export{getAppId,getBrandId,getIsFlipdishStaff,getMicroFrontendAttribute,getOrgId,lazyWithRetry}from"./renderUtilities/renderUtilities.js";export{debounce}from"./genericUtilities/index.js";export{default as ToastProvider}from"../providers/ToastProvider.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("notistack");const n=t.styled(r.MaterialDesignContent)((({theme:e})=>({"&.notistack-MuiContent-default":{backgroundColor:e.palette.black.main},"&.notistack-MuiContent-success":{backgroundColor:e.palette.success.main},"&.notistack-MuiContent-error":{backgroundColor:e.palette.error.main}})));module.exports=({children:t})=>e.jsx(r.SnackbarProvider,{maxSnack:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},Components:{success:n,error:n,default:n},children:t});
|
|
2
|
+
//# sourceMappingURL=ToastProvider.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.cjs.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.black.main,\n },\n '&.notistack-MuiContent-success': {\n backgroundColor: theme.palette.success.main,\n },\n '&.notistack-MuiContent-error': {\n backgroundColor: theme.palette.error.main,\n },\n}));\n\n/**\n * ToastProvider component that wraps the application with notistack's SnackbarProvider.\n * Provides a centralized toast notification system with custom styling.\n *\n * Features:\n * - Maximum of 3 notifications displayed simultaneously\n * - Notifications appear at the bottom center of the scree\n *\n * @param {Object} props - Component props\n * @param {React.ReactNode} props.children - Child components to be wrapped by the provider\n * @returns {JSX.Element} ToastProvider component\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n * ```\n */\nconst ToastProvider = ({ children }: { children: React.ReactNode }) => {\n return (\n <SnackbarProvider\n maxSnack={3}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n Components={{\n success: StyledMaterialDesignContent,\n error: StyledMaterialDesignContent,\n default: StyledMaterialDesignContent,\n }}\n >\n {children}\n </SnackbarProvider>\n );\n};\n\nexport default ToastProvider;\n"],"names":["StyledMaterialDesignContent","styled","MaterialDesignContent","theme","backgroundColor","palette","black","main","success","error","children","_jsx","SnackbarProvider","maxSnack","anchorOrigin","vertical","horizontal","Components","default"],"mappings":"yGAGA,MAAMA,EAA8BC,EAAAA,OAAOC,EAAAA,sBAAPD,EAA8B,EAAGE,YAAa,CAC9E,iCAAkC,CAC9BC,gBAAiBD,EAAME,QAAQC,MAAMC,MAEzC,iCAAkC,CAC9BH,gBAAiBD,EAAME,QAAQG,QAAQD,MAE3C,+BAAgC,CAC5BH,gBAAiBD,EAAME,QAAQI,MAAMF,yBAuBvB,EAAGG,cAEjBC,MAACC,EAAgBA,iBAAA,CACbC,SAAU,EACVC,aAAc,CACVC,SAAU,SACVC,WAAY,UAEhBC,WAAY,CACRT,QAASR,EACTS,MAAOT,EACPkB,QAASlB,GAGZU,SAAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ToastProvider component that wraps the application with notistack's SnackbarProvider.
|
|
5
|
+
* Provides a centralized toast notification system with custom styling.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Maximum of 3 notifications displayed simultaneously
|
|
9
|
+
* - Notifications appear at the bottom center of the scree
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} props - Component props
|
|
12
|
+
* @param {React.ReactNode} props.children - Child components to be wrapped by the provider
|
|
13
|
+
* @returns {JSX.Element} ToastProvider component
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <ToastProvider>
|
|
18
|
+
* <App />
|
|
19
|
+
* </ToastProvider>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const ToastProvider: ({ children }: {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { ToastProvider as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{styled as o}from"@mui/material/styles";import{MaterialDesignContent as r,SnackbarProvider as e}from"notistack";const n=o(r)((({theme:t})=>({"&.notistack-MuiContent-default":{backgroundColor:t.palette.black.main},"&.notistack-MuiContent-success":{backgroundColor:t.palette.success.main},"&.notistack-MuiContent-error":{backgroundColor:t.palette.error.main}}))),a=({children:o})=>t(e,{maxSnack:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},Components:{success:n,error:n,default:n},children:o});export{a as default};
|
|
2
|
+
//# sourceMappingURL=ToastProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.black.main,\n },\n '&.notistack-MuiContent-success': {\n backgroundColor: theme.palette.success.main,\n },\n '&.notistack-MuiContent-error': {\n backgroundColor: theme.palette.error.main,\n },\n}));\n\n/**\n * ToastProvider component that wraps the application with notistack's SnackbarProvider.\n * Provides a centralized toast notification system with custom styling.\n *\n * Features:\n * - Maximum of 3 notifications displayed simultaneously\n * - Notifications appear at the bottom center of the scree\n *\n * @param {Object} props - Component props\n * @param {React.ReactNode} props.children - Child components to be wrapped by the provider\n * @returns {JSX.Element} ToastProvider component\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n * ```\n */\nconst ToastProvider = ({ children }: { children: React.ReactNode }) => {\n return (\n <SnackbarProvider\n maxSnack={3}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n Components={{\n success: StyledMaterialDesignContent,\n error: StyledMaterialDesignContent,\n default: StyledMaterialDesignContent,\n }}\n >\n {children}\n </SnackbarProvider>\n );\n};\n\nexport default ToastProvider;\n"],"names":["StyledMaterialDesignContent","styled","MaterialDesignContent","theme","backgroundColor","palette","black","main","success","error","ToastProvider","children","_jsx","SnackbarProvider","maxSnack","anchorOrigin","vertical","horizontal","Components","default"],"mappings":"8JAGA,MAAMA,EAA8BC,EAAOC,EAAPD,EAA8B,EAAGE,YAAa,CAC9E,iCAAkC,CAC9BC,gBAAiBD,EAAME,QAAQC,MAAMC,MAEzC,iCAAkC,CAC9BH,gBAAiBD,EAAME,QAAQG,QAAQD,MAE3C,+BAAgC,CAC5BH,gBAAiBD,EAAME,QAAQI,MAAMF,UAuBvCG,EAAgB,EAAGC,cAEjBC,EAACC,EAAgB,CACbC,SAAU,EACVC,aAAc,CACVC,SAAU,SACVC,WAAY,UAEhBC,WAAY,CACRV,QAASR,EACTS,MAAOT,EACPmB,QAASnB,GAGZW,SAAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipdish/portal-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -15,27 +15,32 @@
|
|
|
15
15
|
"formik": "^2.4.6",
|
|
16
16
|
"lodash.debounce": "^4.0.8",
|
|
17
17
|
"moment": "^2.30.1",
|
|
18
|
+
"notistack": "^3.0.2",
|
|
18
19
|
"react": "18.3.1",
|
|
19
20
|
"react-dom": "18.3.1",
|
|
20
21
|
"react-error-boundary": "^4.0.13",
|
|
21
22
|
"react-router-dom": "^6.22.3"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@chromatic-com/storybook": "^3.2.
|
|
25
|
+
"@chromatic-com/storybook": "^3.2.5",
|
|
25
26
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
26
27
|
"@rollup/plugin-json": "^6.1.0",
|
|
27
28
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
28
29
|
"@rollup/plugin-terser": "^0.4.4",
|
|
29
30
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
30
31
|
"@rollup/plugin-url": "^8.0.2",
|
|
31
|
-
"@storybook/addon-
|
|
32
|
-
"@storybook/addon-
|
|
33
|
-
"@storybook/addon-
|
|
34
|
-
"@storybook/addon-
|
|
35
|
-
"@storybook/
|
|
36
|
-
"@storybook/
|
|
37
|
-
"@storybook/
|
|
38
|
-
"@storybook/
|
|
32
|
+
"@storybook/addon-a11y": "^8.6.0",
|
|
33
|
+
"@storybook/addon-essentials": "^8.6.0",
|
|
34
|
+
"@storybook/addon-interactions": "^8.6.0",
|
|
35
|
+
"@storybook/addon-links": "^8.6.0",
|
|
36
|
+
"@storybook/addon-measure": "^8.6.0",
|
|
37
|
+
"@storybook/addon-onboarding": "^8.6.0",
|
|
38
|
+
"@storybook/addon-outline": "^8.6.0",
|
|
39
|
+
"@storybook/addon-viewport": "^8.6.0",
|
|
40
|
+
"@storybook/blocks": "^8.6.0",
|
|
41
|
+
"@storybook/react": "^8.6.0",
|
|
42
|
+
"@storybook/react-vite": "^8.6.0",
|
|
43
|
+
"@storybook/test": "^8.6.0",
|
|
39
44
|
"@tanstack/react-query": "^5.62.0",
|
|
40
45
|
"@testing-library/jest-dom": "6.6.2",
|
|
41
46
|
"@testing-library/react": "15.0.7",
|
|
@@ -49,7 +54,7 @@
|
|
|
49
54
|
"eslint": "9.12.0",
|
|
50
55
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
51
56
|
"eslint-plugin-react-refresh": "0.4.12",
|
|
52
|
-
"eslint-plugin-storybook": "^0.11.
|
|
57
|
+
"eslint-plugin-storybook": "^0.11.3",
|
|
53
58
|
"jsdom": "24.1.3",
|
|
54
59
|
"lodash.debounce": "^4.0.8",
|
|
55
60
|
"prompt-sync": "^4.2.0",
|
|
@@ -58,7 +63,7 @@
|
|
|
58
63
|
"rollup-plugin-multi-input": "^1.5.0",
|
|
59
64
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
60
65
|
"rollup-plugin-postcss": "^4.0.2",
|
|
61
|
-
"storybook": "^8.
|
|
66
|
+
"storybook": "^8.6.0",
|
|
62
67
|
"tslib": "^2.8.0",
|
|
63
68
|
"typescript": "5.4.5",
|
|
64
69
|
"vite": "5.4.9",
|