@payfit/unity-components 2.54.10 → 2.54.11
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/esm/components/toast/UnityToast.d.ts +1 -27
- package/dist/esm/components/toast/UnityToast.js +59 -72
- package/dist/esm/components/toast/parts/ToastContent.d.ts +1 -1
- package/dist/esm/components/toast/parts/ToastContent.js +7 -9
- package/dist/esm/components/toast/toast.js +0 -1
- package/package.json +7 -7
- package/dist/esm/components/toast/Toast.context.d.ts +0 -8
- package/dist/esm/components/toast/Toast.context.js +0 -17
|
@@ -5,14 +5,6 @@ declare const unityToast: import('tailwind-variants').TVReturnType<{
|
|
|
5
5
|
success: string;
|
|
6
6
|
error: string;
|
|
7
7
|
};
|
|
8
|
-
isInline: {
|
|
9
|
-
true: {
|
|
10
|
-
contentWrapper: string;
|
|
11
|
-
};
|
|
12
|
-
false: {
|
|
13
|
-
contentWrapper: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
8
|
}, {
|
|
17
9
|
base: string;
|
|
18
10
|
contentWrapper: string;
|
|
@@ -22,14 +14,6 @@ declare const unityToast: import('tailwind-variants').TVReturnType<{
|
|
|
22
14
|
success: string;
|
|
23
15
|
error: string;
|
|
24
16
|
};
|
|
25
|
-
isInline: {
|
|
26
|
-
true: {
|
|
27
|
-
contentWrapper: string;
|
|
28
|
-
};
|
|
29
|
-
false: {
|
|
30
|
-
contentWrapper: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
17
|
}, {
|
|
34
18
|
base: string;
|
|
35
19
|
contentWrapper: string;
|
|
@@ -39,14 +23,6 @@ declare const unityToast: import('tailwind-variants').TVReturnType<{
|
|
|
39
23
|
success: string;
|
|
40
24
|
error: string;
|
|
41
25
|
};
|
|
42
|
-
isInline: {
|
|
43
|
-
true: {
|
|
44
|
-
contentWrapper: string;
|
|
45
|
-
};
|
|
46
|
-
false: {
|
|
47
|
-
contentWrapper: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
26
|
}, {
|
|
51
27
|
base: string;
|
|
52
28
|
contentWrapper: string;
|
|
@@ -55,8 +31,6 @@ declare const unityToast: import('tailwind-variants').TVReturnType<{
|
|
|
55
31
|
export interface UnityToastProps extends Required<Pick<VariantProps<typeof unityToast>, 'variant'>> {
|
|
56
32
|
/** callback to call to close the toast*/
|
|
57
33
|
onClose: () => void;
|
|
58
|
-
/** render the toast in inline mode or not (by default true) */
|
|
59
|
-
inline?: boolean;
|
|
60
34
|
}
|
|
61
35
|
/**
|
|
62
36
|
* The `UnityToast` is the component which will contain a title, a content, and action
|
|
@@ -65,7 +39,7 @@ export interface UnityToastProps extends Required<Pick<VariantProps<typeof unity
|
|
|
65
39
|
* - `ToastAction`(optional): The action on the toast
|
|
66
40
|
*/
|
|
67
41
|
declare const UnityToast: {
|
|
68
|
-
({ children, onClose, variant,
|
|
42
|
+
({ children, onClose, variant, ...rest }: PropsWithChildren<UnityToastProps>): import("react/jsx-runtime").JSX.Element;
|
|
69
43
|
displayName: string;
|
|
70
44
|
};
|
|
71
45
|
export { UnityToast };
|
|
@@ -1,83 +1,70 @@
|
|
|
1
1
|
import { Icon as e } from "../icon/Icon.js";
|
|
2
2
|
import { IconButton as t } from "../icon-button/IconButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useIntl as u } from "react-intl";
|
|
3
|
+
import { ToastTitle as n } from "./parts/ToastTitle.js";
|
|
4
|
+
import { Children as r, Fragment as i, isValidElement as a } from "react";
|
|
5
|
+
import { uyTv as o } from "@payfit/unity-themes";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { useIntl as l } from "react-intl";
|
|
9
8
|
//#region src/components/toast/UnityToast.tsx
|
|
10
|
-
var
|
|
9
|
+
var u = o({
|
|
11
10
|
slots: {
|
|
12
11
|
base: "uy:sm:w-[416px] uy:border uy:border-solid uy:theme-legacy:rounded-150 uy:theme-rebrand:rounded-125 uy:text-content-neutral uy:bg-surface-neutral uy:shadow-300 uy:p-100 uy:flex uy:gap-125 uy:border-border-neutral",
|
|
13
|
-
contentWrapper: "uy:flex uy:grow uy:ml-125",
|
|
12
|
+
contentWrapper: "uy:flex uy:grow uy:ml-125 uy:flex-col",
|
|
14
13
|
divider: "uy:theme-legacy:border-l-[1px] uy:theme-legacy:border-solid uy:theme-legacy:border-border-neutral uy:theme-legacy:self-stretch uy:theme-rebrand:hidden"
|
|
15
14
|
},
|
|
16
|
-
variants: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ c("div", {
|
|
63
|
-
role: "presentation",
|
|
64
|
-
className: g()
|
|
15
|
+
variants: { variant: {
|
|
16
|
+
success: "",
|
|
17
|
+
error: ""
|
|
18
|
+
} }
|
|
19
|
+
}), d = (e) => {
|
|
20
|
+
let t = a(e) && e.type === i ? e.props.children : e;
|
|
21
|
+
if (r.toArray(t).filter((e) => a(e) && e.type === n).length !== 1) throw Error("UnityToast must have one ToastTitle component");
|
|
22
|
+
}, f = ({ children: n, onClose: r, variant: i, ...a }) => {
|
|
23
|
+
let o = l();
|
|
24
|
+
d(n);
|
|
25
|
+
let { base: f, contentWrapper: p, divider: m } = u({ variant: i });
|
|
26
|
+
return /* @__PURE__ */ c("div", {
|
|
27
|
+
"data-dd-privacy": "mask",
|
|
28
|
+
...a,
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
role: i === "error" ? "alert" : "status",
|
|
31
|
+
"aria-atomic": "true",
|
|
32
|
+
"aria-live": i === "error" ? "assertive" : "polite",
|
|
33
|
+
className: f(),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ c("div", {
|
|
36
|
+
className: "uy:flex uy:flex-row uy:grow",
|
|
37
|
+
children: [/* @__PURE__ */ s(e, {
|
|
38
|
+
src: i === "success" ? "CheckCircleFilled" : "WarningCircleFilled",
|
|
39
|
+
color: i === "success" ? "content.success" : "content.danger",
|
|
40
|
+
className: "uy:mt-100",
|
|
41
|
+
alt: o.formatMessage({
|
|
42
|
+
id: "unity:component:toast:icon:status",
|
|
43
|
+
defaultMessage: "Status"
|
|
44
|
+
})
|
|
45
|
+
}), /* @__PURE__ */ s("div", {
|
|
46
|
+
className: p(),
|
|
47
|
+
children: n
|
|
48
|
+
})]
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ s("div", {
|
|
51
|
+
role: "presentation",
|
|
52
|
+
className: m()
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ s(t, {
|
|
55
|
+
icon: "CloseOutlined",
|
|
56
|
+
iconRole: "presentation",
|
|
57
|
+
label: o.formatMessage({
|
|
58
|
+
id: "unity:component:common:close:label",
|
|
59
|
+
defaultMessage: "Close"
|
|
65
60
|
}),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
defaultMessage: "Close"
|
|
72
|
-
}),
|
|
73
|
-
variant: "ghost",
|
|
74
|
-
color: "neutral",
|
|
75
|
-
onClick: i
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
})
|
|
61
|
+
variant: "ghost",
|
|
62
|
+
color: "neutral",
|
|
63
|
+
onClick: r
|
|
64
|
+
})
|
|
65
|
+
]
|
|
79
66
|
});
|
|
80
67
|
};
|
|
81
|
-
|
|
68
|
+
f.displayName = "UnityToast";
|
|
82
69
|
//#endregion
|
|
83
|
-
export {
|
|
70
|
+
export { f as UnityToast };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
declare function ToastContent({ children }: PropsWithChildren<object>): import("react/jsx-runtime").JSX.Element
|
|
2
|
+
declare function ToastContent({ children }: PropsWithChildren<object>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare namespace ToastContent {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Text as e } from "../../text/Text.js";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/toast/parts/ToastContent.tsx
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
return i ? /* @__PURE__ */ n(e, {
|
|
4
|
+
function n({ children: n }) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
8
6
|
variant: "body",
|
|
9
7
|
className: "uy:mb-100",
|
|
10
|
-
children:
|
|
11
|
-
})
|
|
8
|
+
children: n
|
|
9
|
+
});
|
|
12
10
|
}
|
|
13
|
-
|
|
11
|
+
n.displayName = "ToastContent";
|
|
14
12
|
//#endregion
|
|
15
|
-
export {
|
|
13
|
+
export { n as ToastContent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.54.
|
|
3
|
+
"version": "2.54.11",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"tailwind-variants": "3.2.2",
|
|
94
94
|
"usehooks-ts": "3.1.1",
|
|
95
95
|
"zod": "4.4.3",
|
|
96
|
-
"@payfit/unity-illustrations": "2.54.
|
|
96
|
+
"@payfit/unity-illustrations": "2.54.11"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@hookform/devtools": "^4",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"react-hook-form": "^7",
|
|
106
106
|
"react-router-dom": "^5",
|
|
107
107
|
"zod": "^3 || ^4",
|
|
108
|
-
"@payfit/unity-icons": "2.54.
|
|
109
|
-
"@payfit/unity-themes": "2.54.
|
|
108
|
+
"@payfit/unity-icons": "2.54.11",
|
|
109
|
+
"@payfit/unity-themes": "2.54.11"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@figma/code-connect": "1.4.8",
|
|
@@ -156,9 +156,9 @@
|
|
|
156
156
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
157
157
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
158
158
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
159
|
-
"@payfit/unity-icons": "2.54.
|
|
160
|
-
"@payfit/unity-illustrations": "2.54.
|
|
161
|
-
"@payfit/unity-themes": "2.54.
|
|
159
|
+
"@payfit/unity-icons": "2.54.11",
|
|
160
|
+
"@payfit/unity-illustrations": "2.54.11",
|
|
161
|
+
"@payfit/unity-themes": "2.54.11",
|
|
162
162
|
"@payfit/vite-configs": "0.0.0-use.local"
|
|
163
163
|
},
|
|
164
164
|
"peerDependenciesMeta": {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
type ToastContextValue = {
|
|
3
|
-
inline: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare const ToastContext: import('react').Context<ToastContextValue>;
|
|
6
|
-
export declare function ToastProvider({ inline, children, }: PropsWithChildren<ToastContextValue>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function useToastContext(): ToastContextValue;
|
|
8
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createContext as e, useContext as t } from "react";
|
|
2
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
//#region src/components/toast/Toast.context.tsx
|
|
4
|
-
var r = e({ inline: !0 });
|
|
5
|
-
function i({ inline: e, children: t }) {
|
|
6
|
-
return /* @__PURE__ */ n(r.Provider, {
|
|
7
|
-
value: { inline: e },
|
|
8
|
-
children: t
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function a() {
|
|
12
|
-
let e = t(r);
|
|
13
|
-
if (!e) throw Error("useToastContext must be used within an ToastProvider");
|
|
14
|
-
return e;
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { i as ToastProvider, a as useToastContext };
|