@payfit/unity-components 2.63.8 → 2.63.10
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.
|
@@ -22,49 +22,55 @@ var d = c({
|
|
|
22
22
|
large: "uy:w-full uy:px-150 uy:py-100",
|
|
23
23
|
small: "uy:pr-0 uy:pl-100 uy:py-25"
|
|
24
24
|
} }
|
|
25
|
-
}), f = ({
|
|
26
|
-
|
|
25
|
+
}), f = c({ base: [
|
|
26
|
+
"uy:transition-all uy:duration-200 uy:ease-out uy:data-[entering]:opacity-100 uy:data-[exiting]:opacity-0",
|
|
27
|
+
"uy:data-[entering]:data-[placement=\"bottom\"]:-translate-y-100 uy:data-[exiting]:data-[placement=\"bottom\"]:translate-y-0",
|
|
28
|
+
"uy:data-[entering]:data-[placement=\"top\"]:translate-y-100 uy:data-[exiting]:data-[placement=\"top\"]:translate-y-0",
|
|
29
|
+
"uy:motion-reduce:transition-none"
|
|
30
|
+
] }), p = ({ avatar: c, avatarPair: p, avatarVariant: m = "square", badgeLabel: h, children: g, defaultOpen: _, description: v, isOpen: y, menuTriggerDescription: b, onOpenChange: x, placement: S, title: C, uploadAvatarCallback: w, uploadAvatarDescription: T, uploadAvatarLabel: E, variant: D = "large" }) => {
|
|
31
|
+
let O = s(null), k = o(), A = o(), j = {
|
|
27
32
|
avatar: c,
|
|
28
|
-
avatarPair:
|
|
29
|
-
avatarSize:
|
|
30
|
-
avatarVariant:
|
|
31
|
-
badgeLabel:
|
|
32
|
-
description:
|
|
33
|
-
labelId:
|
|
34
|
-
menuTriggerDescription:
|
|
35
|
-
title:
|
|
36
|
-
triggerDescriptionId:
|
|
37
|
-
triggerVariant:
|
|
38
|
-
uploadAvatarCallback:
|
|
39
|
-
uploadAvatarDescription:
|
|
40
|
-
uploadAvatarLabel:
|
|
33
|
+
avatarPair: p,
|
|
34
|
+
avatarSize: D === "small" ? "md" : "lg",
|
|
35
|
+
avatarVariant: m,
|
|
36
|
+
badgeLabel: h,
|
|
37
|
+
description: v,
|
|
38
|
+
labelId: k,
|
|
39
|
+
menuTriggerDescription: b,
|
|
40
|
+
title: C,
|
|
41
|
+
triggerDescriptionId: A,
|
|
42
|
+
triggerVariant: D,
|
|
43
|
+
uploadAvatarCallback: w,
|
|
44
|
+
uploadAvatarDescription: T,
|
|
45
|
+
uploadAvatarLabel: E
|
|
41
46
|
};
|
|
42
47
|
return /* @__PURE__ */ u(t, {
|
|
43
|
-
defaultOpen:
|
|
44
|
-
isOpen:
|
|
45
|
-
onOpenChange:
|
|
46
|
-
placement:
|
|
47
|
-
|
|
48
|
+
defaultOpen: _,
|
|
49
|
+
isOpen: y,
|
|
50
|
+
onOpenChange: x,
|
|
51
|
+
placement: S ?? (D === "small" ? "bottom right" : "top left"),
|
|
52
|
+
popoverClassName: f(),
|
|
53
|
+
triggerRef: O,
|
|
48
54
|
children: [/* @__PURE__ */ l(r, {
|
|
49
55
|
asChild: !0,
|
|
50
56
|
children: /* @__PURE__ */ l(e, {
|
|
51
|
-
ref:
|
|
52
|
-
"aria-describedby":
|
|
53
|
-
"aria-labelledby":
|
|
54
|
-
className: d({ variant:
|
|
55
|
-
children: /* @__PURE__ */ l(a, { ...
|
|
57
|
+
ref: O,
|
|
58
|
+
"aria-describedby": A,
|
|
59
|
+
"aria-labelledby": k,
|
|
60
|
+
className: d({ variant: D }),
|
|
61
|
+
children: /* @__PURE__ */ l(a, { ...j })
|
|
56
62
|
})
|
|
57
63
|
}), /* @__PURE__ */ u(n, {
|
|
58
64
|
width: 312,
|
|
59
65
|
children: [/* @__PURE__ */ l(i, {
|
|
60
66
|
className: "uy:rounded-75",
|
|
61
67
|
children: /* @__PURE__ */ l(a, {
|
|
62
|
-
...
|
|
68
|
+
...j,
|
|
63
69
|
asMenuHeader: !0
|
|
64
70
|
})
|
|
65
|
-
}),
|
|
71
|
+
}), g]
|
|
66
72
|
})]
|
|
67
73
|
});
|
|
68
74
|
};
|
|
69
75
|
//#endregion
|
|
70
|
-
export {
|
|
76
|
+
export { p as AppProfileMenuButton };
|
|
@@ -75,6 +75,7 @@ var c = ({ asMenuHeader: c = !1, avatar: l, avatarPair: u, avatarSize: d, avatar
|
|
|
75
75
|
variant: "neutral",
|
|
76
76
|
children: p
|
|
77
77
|
}) : /* @__PURE__ */ a(e, {
|
|
78
|
+
className: y === "small" ? "uy:inline-block uy:transition-transform uy:duration-150 uy:ease-linear uy:origin-center uy:group-aria-[expanded=true]:rotate-180" : void 0,
|
|
78
79
|
src: y === "small" ? "CaretDownOutlined" : "CaretUpDownOutlined",
|
|
79
80
|
alt: w,
|
|
80
81
|
size: 20,
|
|
@@ -2,9 +2,10 @@ import { MenuTriggerProps } from 'react-aria-components/Menu';
|
|
|
2
2
|
import { PopoverProps } from 'react-aria-components/Popover';
|
|
3
3
|
type MenuProps = Omit<MenuTriggerProps, 'className' | 'style'> & {
|
|
4
4
|
placement?: PopoverProps['placement'];
|
|
5
|
+
popoverClassName?: string;
|
|
5
6
|
triggerRef?: PopoverProps['triggerRef'];
|
|
6
7
|
};
|
|
7
|
-
export declare function Menu({ defaultOpen, children, triggerRef, placement, ...rest }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function Menu({ defaultOpen, children, popoverClassName, triggerRef, placement, ...rest }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export declare namespace Menu {
|
|
9
10
|
var displayName: string;
|
|
10
11
|
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { uyTv as t } from "@payfit/unity-themes";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { MenuTrigger as i, Popover as a } from "react-aria-components/Menu";
|
|
4
5
|
//#region src/components/menu/Menu.tsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
var o = t({ base: "uy:flex uy:flex-col uy:justify-end uy:items-start uy:p-100 uy:rounded-100 uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:shadow-300" });
|
|
7
|
+
function s({ defaultOpen: t, children: s, popoverClassName: c, triggerRef: l, placement: u, ...d }) {
|
|
8
|
+
let [f, p] = e.Children.toArray(s);
|
|
9
|
+
if (!f || !p) throw Error("Menu must have a trigger and a menu content");
|
|
10
|
+
return /* @__PURE__ */ r(i, {
|
|
11
|
+
defaultOpen: t,
|
|
12
|
+
...d,
|
|
13
|
+
children: [f, /* @__PURE__ */ n(a, {
|
|
14
|
+
triggerRef: l,
|
|
15
|
+
placement: u,
|
|
16
|
+
className: o({ className: c }),
|
|
15
17
|
"data-dd-privacy": "allow",
|
|
16
|
-
children:
|
|
18
|
+
children: p
|
|
17
19
|
})]
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
s.displayName = "Menu";
|
|
21
23
|
//#endregion
|
|
22
|
-
export {
|
|
24
|
+
export { s as Menu };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.63.
|
|
3
|
+
"version": "2.63.10",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"tailwind-variants": "3.3.0",
|
|
97
97
|
"usehooks-ts": "3.1.1",
|
|
98
98
|
"zod": "4.4.3",
|
|
99
|
-
"@payfit/unity-illustrations": "2.63.
|
|
99
|
+
"@payfit/unity-illustrations": "2.63.10"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@hookform/devtools": "^4",
|
|
@@ -108,11 +108,11 @@
|
|
|
108
108
|
"react-hook-form": "^7",
|
|
109
109
|
"react-router-dom": "^5",
|
|
110
110
|
"zod": "^3 || ^4",
|
|
111
|
-
"@payfit/unity-icons": "2.63.
|
|
112
|
-
"@payfit/unity-themes": "2.63.
|
|
111
|
+
"@payfit/unity-icons": "2.63.10",
|
|
112
|
+
"@payfit/unity-themes": "2.63.10"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@figma/code-connect": "1.5.
|
|
115
|
+
"@figma/code-connect": "1.5.2",
|
|
116
116
|
"@github-ui/storybook-addon-performance-panel": "1.1.4",
|
|
117
117
|
"@hookform/devtools": "4.4.0",
|
|
118
118
|
"@internationalized/date": "3.12.3",
|
|
@@ -159,9 +159,9 @@
|
|
|
159
159
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
160
160
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
161
161
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
162
|
-
"@payfit/unity-icons": "2.63.
|
|
163
|
-
"@payfit/unity-illustrations": "2.63.
|
|
164
|
-
"@payfit/unity-themes": "2.63.
|
|
162
|
+
"@payfit/unity-icons": "2.63.10",
|
|
163
|
+
"@payfit/unity-illustrations": "2.63.10",
|
|
164
|
+
"@payfit/unity-themes": "2.63.10",
|
|
165
165
|
"@payfit/vite-configs": "0.0.0-use.local"
|
|
166
166
|
},
|
|
167
167
|
"peerDependenciesMeta": {
|