@payfit/unity-components 2.31.0 → 2.31.2
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/app-menu/parts/AppMenuFooter.js +114 -102
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +43 -33
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/esm/components/menu/Menu.d.ts +6 -2
- package/dist/esm/components/menu/Menu.js +26 -4
- package/dist/esm/components/menu/parts/MenuContent.d.ts +6 -0
- package/dist/esm/components/menu/parts/MenuContent.js +22 -15
- package/dist/esm/components/menu/parts/RawMenuItem.js +29 -21
- package/dist/esm/components/nav/parts/NavGroup.js +40 -30
- package/dist/esm/components/nav/parts/RawNavItem.d.ts +4 -4
- package/dist/esm/components/nav/parts/RawNavItem.js +45 -34
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +2 -0
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +33 -47
- package/dist/esm/components/radio-button-group/parts/RadioIndicator.d.ts +11 -0
- package/dist/esm/components/radio-button-group/parts/RadioIndicator.js +131 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.js +38 -28
- package/dist/esm/components/selectable-card/selectableCard.variant.js +1 -1
- package/dist/esm/index.js +4 -2
- package/i18n/en-GB.json +2 -2
- package/i18n/es-ES.json +2 -2
- package/i18n/fr-FR.json +2 -2
- package/package.json +7 -7
- package/dist/esm/components/radio-button-group/parts/radio-input-selected.svg.js +0 -5
- package/dist/esm/components/radio-button-group/parts/radio-input-unselected.svg.js +0 -5
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.d.ts +0 -8
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +0 -68
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as v, useRef as C, isValidElement as I, cloneElement as O } from "react";
|
|
3
3
|
import { uyMerge as g } from "@payfit/unity-themes";
|
|
4
4
|
import { FormattedMessage as h, useIntl as V } from "react-intl";
|
|
5
|
-
import { Actionable as
|
|
5
|
+
import { Actionable as w } from "../../actionable/Actionable.js";
|
|
6
6
|
import { Avatar as z } from "../../avatar/Avatar.js";
|
|
7
7
|
import { AvatarFallback as F } from "../../avatar/parts/AvatarFallback.js";
|
|
8
8
|
import { AvatarImage as H } from "../../avatar/parts/AvatarImage.js";
|
|
9
9
|
import { Badge as j } from "../../badge/Badge.js";
|
|
10
|
-
import { Icon as
|
|
10
|
+
import { Icon as x } from "../../icon/Icon.js";
|
|
11
11
|
import { Menu as k } from "../../menu/Menu.js";
|
|
12
12
|
import { MenuContent as E } from "../../menu/parts/MenuContent.js";
|
|
13
13
|
import { MenuHeader as S } from "../../menu/parts/MenuHeader.js";
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import { MenuTrigger as B } from "../../menu/parts/MenuTrigger.js";
|
|
15
|
+
import { useAppMenuContext as R } from "./AppMenu.context.js";
|
|
16
|
+
const M = (t) => /* @__PURE__ */ n(
|
|
16
17
|
z,
|
|
17
18
|
{
|
|
18
19
|
"aria-label": `${t.title} avatar`,
|
|
@@ -27,48 +28,48 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
27
28
|
})
|
|
28
29
|
]
|
|
29
30
|
}
|
|
30
|
-
),
|
|
31
|
+
), q = ({
|
|
31
32
|
avatar: t,
|
|
32
|
-
avatarPair:
|
|
33
|
-
title:
|
|
34
|
-
uploadAvatarCallback:
|
|
33
|
+
avatarPair: r,
|
|
34
|
+
title: u,
|
|
35
|
+
uploadAvatarCallback: d,
|
|
35
36
|
uploadAvatarLabel: s,
|
|
36
|
-
uploadAvatarDescription:
|
|
37
|
+
uploadAvatarDescription: i
|
|
37
38
|
}) => {
|
|
38
|
-
const [o,
|
|
39
|
-
|
|
40
|
-
},
|
|
39
|
+
const [o, l] = v(!0), c = V(), a = () => {
|
|
40
|
+
r && l((m) => !m);
|
|
41
|
+
}, y = g(
|
|
41
42
|
"uy:group/avatar uy:cursor-pointer uy:relative uy:leading-[0] uy:rounded-75 uy:focus-visible:outline-none uy:focus-visible:ring-2 uy:focus-visible:ring-utility-focus-ring uy:focus-visible:ring-offset-2"
|
|
42
43
|
);
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
|
|
44
|
+
return /* @__PURE__ */ n(
|
|
45
|
+
w,
|
|
45
46
|
{
|
|
46
47
|
"aria-describedby": "profile-picture-change-desc",
|
|
47
48
|
"aria-label": s || c.formatMessage({
|
|
48
49
|
id: "unity:component:app-menu:footer:profile-button:avatar:change",
|
|
49
50
|
defaultMessage: "Change profile picture"
|
|
50
51
|
}),
|
|
51
|
-
className:
|
|
52
|
-
onHoverStart:
|
|
53
|
-
onHoverEnd:
|
|
54
|
-
onFocus:
|
|
55
|
-
onBlur:
|
|
52
|
+
className: y,
|
|
53
|
+
onHoverStart: a,
|
|
54
|
+
onHoverEnd: a,
|
|
55
|
+
onFocus: a,
|
|
56
|
+
onBlur: a,
|
|
56
57
|
onPress: () => {
|
|
57
|
-
|
|
58
|
+
d?.();
|
|
58
59
|
},
|
|
59
60
|
children: [
|
|
60
61
|
/* @__PURE__ */ e(
|
|
61
|
-
|
|
62
|
+
M,
|
|
62
63
|
{
|
|
63
64
|
avatar: t,
|
|
64
|
-
avatarPair:
|
|
65
|
-
title:
|
|
65
|
+
avatarPair: r,
|
|
66
|
+
title: u,
|
|
66
67
|
isPairAvatarVisible: o
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ n("div", { className: "uy:flex uy:pointer-events-none uy:opacity-0 uy:group-hover/avatar:opacity-90 uy:group-hover/avatar:pointer-events-auto uy:group-focus-visible/avatar:opacity-90 uy:group-focus-visible/avatar:pointer-events-auto uy:bg-utility-backdrop uy:rounded-75 uy:absolute uy:top-0 uy:left-0 uy:w-full uy:h-full uy:transition-all uy:duration-200 uy:items-center uy:justify-center", children: [
|
|
70
71
|
/* @__PURE__ */ e(
|
|
71
|
-
|
|
72
|
+
x,
|
|
72
73
|
{
|
|
73
74
|
alt: "Camera",
|
|
74
75
|
color: "content.inverted",
|
|
@@ -76,7 +77,7 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
76
77
|
src: "CameraOutlined"
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
|
-
/* @__PURE__ */ e("span", { className: "uy:sr-only", id: "profile-picture-change-desc", children:
|
|
80
|
+
/* @__PURE__ */ e("span", { className: "uy:sr-only", id: "profile-picture-change-desc", children: i || /* @__PURE__ */ e(
|
|
80
81
|
h,
|
|
81
82
|
{
|
|
82
83
|
id: "unity:component:app-menu:footer:profile-button:avatar:change-description",
|
|
@@ -89,36 +90,36 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
89
90
|
);
|
|
90
91
|
}, b = ({
|
|
91
92
|
asMenuHeader: t = !1,
|
|
92
|
-
avatar:
|
|
93
|
-
avatarPair:
|
|
94
|
-
badgeLabel:
|
|
93
|
+
avatar: r,
|
|
94
|
+
avatarPair: u,
|
|
95
|
+
badgeLabel: d,
|
|
95
96
|
description: s,
|
|
96
|
-
menuTriggerDescription:
|
|
97
|
+
menuTriggerDescription: i,
|
|
97
98
|
title: o,
|
|
98
|
-
uploadAvatarCallback:
|
|
99
|
+
uploadAvatarCallback: l,
|
|
99
100
|
uploadAvatarLabel: c,
|
|
100
|
-
uploadAvatarDescription:
|
|
101
|
-
}) => /* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */ e("div", { className: "uy:mr-150 uy:flex uy:items-center", children:
|
|
103
|
-
|
|
101
|
+
uploadAvatarDescription: a
|
|
102
|
+
}) => /* @__PURE__ */ n("div", { className: "uy:min-w-[240px] uy:w-full uy:flex uy:items-center", children: [
|
|
103
|
+
/* @__PURE__ */ e("div", { className: "uy:mr-150 uy:flex uy:items-center", children: l ? /* @__PURE__ */ e(
|
|
104
|
+
q,
|
|
104
105
|
{
|
|
105
|
-
avatar:
|
|
106
|
-
avatarPair:
|
|
106
|
+
avatar: r,
|
|
107
|
+
avatarPair: u,
|
|
107
108
|
title: o,
|
|
108
109
|
uploadAvatarLabel: c,
|
|
109
|
-
uploadAvatarDescription:
|
|
110
|
-
uploadAvatarCallback:
|
|
110
|
+
uploadAvatarDescription: a,
|
|
111
|
+
uploadAvatarCallback: l
|
|
111
112
|
}
|
|
112
113
|
) : /* @__PURE__ */ e(
|
|
113
|
-
|
|
114
|
+
M,
|
|
114
115
|
{
|
|
115
|
-
avatar:
|
|
116
|
-
avatarPair:
|
|
116
|
+
avatar: r,
|
|
117
|
+
avatarPair: u,
|
|
117
118
|
title: o,
|
|
118
119
|
isPairAvatarVisible: !0
|
|
119
120
|
}
|
|
120
121
|
) }),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ n("div", { className: "uy:flex uy:flex-col uy:text-left uy:leading-[1.25] uy:min-w-[50%] uy:flex-grow", children: [
|
|
122
123
|
/* @__PURE__ */ e(
|
|
123
124
|
"span",
|
|
124
125
|
{
|
|
@@ -136,7 +137,7 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
136
137
|
children: s
|
|
137
138
|
}
|
|
138
139
|
),
|
|
139
|
-
!t && /* @__PURE__ */ e("span", { id: "profile-button-description", className: "uy:sr-only", children:
|
|
140
|
+
!t && /* @__PURE__ */ e("span", { id: "profile-button-description", className: "uy:sr-only", children: i || /* @__PURE__ */ e(
|
|
140
141
|
h,
|
|
141
142
|
{
|
|
142
143
|
id: "unity:component:app-menu:footer:profile-button:description",
|
|
@@ -144,8 +145,8 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
144
145
|
}
|
|
145
146
|
) })
|
|
146
147
|
] }),
|
|
147
|
-
/* @__PURE__ */ e("div", { className: "uy:p-100", children: t ? /* @__PURE__ */ e(j, { className: "uy:capitalize", variant: "neutral", children:
|
|
148
|
-
|
|
148
|
+
/* @__PURE__ */ e("div", { className: "uy:p-100", children: t ? /* @__PURE__ */ e(j, { className: "uy:capitalize", variant: "neutral", children: d }) : /* @__PURE__ */ e(
|
|
149
|
+
x,
|
|
149
150
|
{
|
|
150
151
|
src: "CaretUpDownOutlined",
|
|
151
152
|
alt: "open",
|
|
@@ -153,27 +154,27 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
153
154
|
color: "content.neutral.low"
|
|
154
155
|
}
|
|
155
156
|
) })
|
|
156
|
-
] }),
|
|
157
|
+
] }), te = ({
|
|
157
158
|
avatar: t,
|
|
158
|
-
avatarPair:
|
|
159
|
-
badgeLabel:
|
|
160
|
-
children:
|
|
159
|
+
avatarPair: r,
|
|
160
|
+
badgeLabel: u,
|
|
161
|
+
children: d,
|
|
161
162
|
computeSlot: s,
|
|
162
|
-
description:
|
|
163
|
+
description: i,
|
|
163
164
|
title: o,
|
|
164
|
-
menuTriggerDescription:
|
|
165
|
+
menuTriggerDescription: l,
|
|
165
166
|
uploadAvatarCallback: c,
|
|
166
|
-
uploadAvatarLabel:
|
|
167
|
-
uploadAvatarDescription:
|
|
168
|
-
updateNotificationSlot:
|
|
167
|
+
uploadAvatarLabel: a,
|
|
168
|
+
uploadAvatarDescription: y,
|
|
169
|
+
updateNotificationSlot: m
|
|
169
170
|
}) => {
|
|
170
|
-
const { isMobileMenuOpen: N } =
|
|
171
|
+
const { isMobileMenuOpen: N } = R(), [P, f] = v(!1), p = C(null), A = g(
|
|
171
172
|
"uy:fixed uy:bottom-0 uy:left-0 uy:right-0 uy:z-10 uy:bg-canvas",
|
|
172
173
|
"uy:p-150",
|
|
173
174
|
"uy:md:static uy:md:mt-auto uy:md:p-0 uy:md:bg-[transparent]",
|
|
174
175
|
"uy:data-[mobile-open=false]:hidden uy:md:data-[mobile-open=false]:block uy:data-[mobile-open=true]:block"
|
|
175
176
|
);
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ n(
|
|
177
178
|
"aside",
|
|
178
179
|
{
|
|
179
180
|
className: A,
|
|
@@ -181,55 +182,66 @@ const w = (t) => /* @__PURE__ */ l(
|
|
|
181
182
|
id: "app-menu-profile-button",
|
|
182
183
|
children: [
|
|
183
184
|
s,
|
|
184
|
-
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
185
|
+
m,
|
|
186
|
+
/* @__PURE__ */ n(
|
|
187
|
+
k,
|
|
187
188
|
{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
189
|
+
isOpen: P,
|
|
190
|
+
onOpenChange: f,
|
|
191
|
+
placement: "top left",
|
|
192
|
+
triggerRef: p,
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ e(B, { asChild: !0, children: /* @__PURE__ */ e(
|
|
195
|
+
w,
|
|
196
|
+
{
|
|
197
|
+
ref: p,
|
|
198
|
+
className: "uy:transition-colors uy:rounded-75 uy:px-150 uy:py-100 uy:w-full uy:theme-legacy:not-aria-disabled:hover:bg-surface-neutral-low-hover uy:theme-rebrand:not-aria-disabled:hover:bg-surface-neutral-lowest-hover uy:theme-legacy:not-aria-disabled:active:bg-surface-neutral-low-active uy:theme-rebrand:not-aria-disabled:active:bg-surface-neutral-lowest-active uy:theme-legacy:not-aria-disabled:data-[pressed=true]:bg-surface-neutral-low-pressed uy:theme-rebrand:not-aria-disabled:data-[pressed=true]:bg-surface-neutral-lowest-pressed uy:not-aria-disabled:focus-visible:outline-none uy:not-aria-disabled:focus-visible:ring-2 uy:not-aria-disabled:focus-visible:ring-utility-focus-ring uy:not-aria-disabled:focus-visible:ring-offset-2",
|
|
199
|
+
"aria-labelledby": "profile-button-label",
|
|
200
|
+
"aria-describedby": "profile-button-description",
|
|
201
|
+
onPress: () => {
|
|
202
|
+
f(!0);
|
|
203
|
+
},
|
|
204
|
+
children: /* @__PURE__ */ e(
|
|
205
|
+
b,
|
|
206
|
+
{
|
|
207
|
+
avatar: t,
|
|
208
|
+
avatarPair: r,
|
|
209
|
+
badgeLabel: u,
|
|
210
|
+
description: i,
|
|
211
|
+
menuTriggerDescription: l,
|
|
212
|
+
title: o,
|
|
213
|
+
uploadAvatarCallback: c,
|
|
214
|
+
uploadAvatarLabel: a,
|
|
215
|
+
uploadAvatarDescription: y
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
) }),
|
|
220
|
+
/* @__PURE__ */ n(E, { width: 312, children: [
|
|
221
|
+
/* @__PURE__ */ e(S, { className: "uy:rounded-75", children: /* @__PURE__ */ e(
|
|
222
|
+
b,
|
|
223
|
+
{
|
|
224
|
+
asMenuHeader: !0,
|
|
225
|
+
avatar: t,
|
|
226
|
+
avatarPair: r,
|
|
227
|
+
badgeLabel: u,
|
|
228
|
+
description: i,
|
|
229
|
+
menuTriggerDescription: l,
|
|
230
|
+
title: o,
|
|
231
|
+
uploadAvatarCallback: c,
|
|
232
|
+
uploadAvatarLabel: a,
|
|
233
|
+
uploadAvatarDescription: y
|
|
234
|
+
}
|
|
235
|
+
) }),
|
|
236
|
+
d
|
|
237
|
+
] })
|
|
238
|
+
]
|
|
209
239
|
}
|
|
210
|
-
)
|
|
211
|
-
/* @__PURE__ */ e(k, { isOpen: P, onOpenChange: p, children: /* @__PURE__ */ l(E, { width: 312, placement: "top left", triggerRef: m, children: [
|
|
212
|
-
/* @__PURE__ */ e(S, { className: "uy:rounded-75", children: /* @__PURE__ */ e(
|
|
213
|
-
b,
|
|
214
|
-
{
|
|
215
|
-
asMenuHeader: !0,
|
|
216
|
-
avatar: t,
|
|
217
|
-
avatarPair: a,
|
|
218
|
-
badgeLabel: n,
|
|
219
|
-
description: r,
|
|
220
|
-
menuTriggerDescription: u,
|
|
221
|
-
title: o,
|
|
222
|
-
uploadAvatarCallback: c,
|
|
223
|
-
uploadAvatarLabel: i,
|
|
224
|
-
uploadAvatarDescription: d
|
|
225
|
-
}
|
|
226
|
-
) }),
|
|
227
|
-
y
|
|
228
|
-
] }) })
|
|
240
|
+
)
|
|
229
241
|
]
|
|
230
242
|
}
|
|
231
243
|
);
|
|
232
244
|
};
|
|
233
245
|
export {
|
|
234
|
-
|
|
246
|
+
te as AppMenuFooter
|
|
235
247
|
};
|
|
@@ -1,41 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Link as m } from "react-aria-components/Link";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { useIntl as c } from "react-intl";
|
|
4
|
+
import { useBreakpointListener as y, isMobileBreakpoint as f } from "../../../hooks/use-breakpoint-listener.js";
|
|
5
|
+
import { Button as h } from "../../button/Button.js";
|
|
6
|
+
import { PayFitBrand as b } from "../../payfit-brand/PayFitBrand.js";
|
|
7
|
+
import { PayFitBrandPreprod as g } from "../../payfit-brand/PayFitPreprod.js";
|
|
8
|
+
import { useAppMenuContext as x } from "./AppMenu.context.js";
|
|
9
|
+
const j = ({
|
|
10
|
+
environment: r,
|
|
11
|
+
brandLabel: i,
|
|
11
12
|
notificationsComponent: t,
|
|
12
|
-
searchComponent:
|
|
13
|
-
renderLink:
|
|
13
|
+
searchComponent: l,
|
|
14
|
+
renderLink: s = ({ children: n }) => /* @__PURE__ */ e(m, { href: "/", children: n })
|
|
14
15
|
}) => {
|
|
15
|
-
const { isMobileMenuOpen:
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
const { isMobileMenuOpen: n, toggleMobileMenu: p } = x(), d = c(), u = y(), a = f(u);
|
|
17
|
+
return /* @__PURE__ */ o("header", { className: "uy:flex uy:flex-col uy:gap-y-200 uy:pl-25 uy:pr-25", children: [
|
|
18
|
+
/* @__PURE__ */ o("div", { className: "uy:flex uy:items-center", children: [
|
|
19
|
+
/* @__PURE__ */ e("div", { className: "uy:flex-1", children: s({ children: r === "prod" ? /* @__PURE__ */ e(
|
|
20
|
+
b,
|
|
21
|
+
{
|
|
22
|
+
label: i,
|
|
23
|
+
width: a ? 36 : 104,
|
|
24
|
+
showOnlyMonogram: a
|
|
25
|
+
}
|
|
26
|
+
) : /* @__PURE__ */ e(g, { label: i, env: r }) }) }),
|
|
27
|
+
/* @__PURE__ */ o("div", { className: "uy:flex uy:gap-150", children: [
|
|
28
|
+
t,
|
|
29
|
+
/* @__PURE__ */ e("div", { className: "uy:block uy:md:hidden", children: /* @__PURE__ */ e(
|
|
30
|
+
h,
|
|
31
|
+
{
|
|
32
|
+
variant: "ghost",
|
|
33
|
+
color: "neutral",
|
|
34
|
+
prefixIcon: n ? "CloseOutlined" : "ListOutlined",
|
|
35
|
+
onPress: p,
|
|
36
|
+
"aria-expanded": n,
|
|
37
|
+
"aria-controls": "app-menu-nav-container app-menu-profile-button",
|
|
38
|
+
children: d.formatMessage({
|
|
39
|
+
id: n ? "unity:component:app-menu:header:menu-close" : "unity:component:app-menu:header:menu-open",
|
|
40
|
+
defaultMessage: n ? "Close navigation" : "Open navigation"
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
) })
|
|
44
|
+
] })
|
|
35
45
|
] }),
|
|
36
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ e("div", { className: "uy:hidden uy:md:flex", children: l })
|
|
37
47
|
] });
|
|
38
48
|
};
|
|
39
49
|
export {
|
|
40
|
-
|
|
50
|
+
j as AppMenuHeader
|
|
41
51
|
};
|
|
@@ -58,7 +58,7 @@ function G({
|
|
|
58
58
|
triggerAriaLabel: o
|
|
59
59
|
}) {
|
|
60
60
|
return /* @__PURE__ */ b(R, { className: n, children: [
|
|
61
|
-
/* @__PURE__ */ b(T, { children: [
|
|
61
|
+
/* @__PURE__ */ b(T, { placement: "bottom start", children: [
|
|
62
62
|
/* @__PURE__ */ a(K, { asChild: !0, children: /* @__PURE__ */ a(
|
|
63
63
|
$,
|
|
64
64
|
{
|
|
@@ -75,7 +75,7 @@ function G({
|
|
|
75
75
|
)
|
|
76
76
|
}
|
|
77
77
|
) }),
|
|
78
|
-
/* @__PURE__ */ a(H, { width: 248,
|
|
78
|
+
/* @__PURE__ */ a(H, { width: 248, children: r.map((e) => /* @__PURE__ */ a(
|
|
79
79
|
L,
|
|
80
80
|
{
|
|
81
81
|
...e.menuItemProps,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { MenuTriggerProps } from 'react-aria-components/Menu';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { PopoverProps } from 'react-aria-components/Popover';
|
|
3
|
+
type MenuProps = Omit<MenuTriggerProps, 'className' | 'style'> & {
|
|
4
|
+
placement?: PopoverProps['placement'];
|
|
5
|
+
triggerRef?: PopoverProps['triggerRef'];
|
|
6
|
+
};
|
|
7
|
+
export declare function Menu({ defaultOpen, children, triggerRef, placement, ...rest }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
4
8
|
export declare namespace Menu {
|
|
5
9
|
var displayName: string;
|
|
6
10
|
}
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { MenuTrigger as l, Popover as s } from "react-aria-components/Menu";
|
|
4
|
+
function m({
|
|
5
|
+
defaultOpen: u,
|
|
6
|
+
children: o,
|
|
7
|
+
triggerRef: t,
|
|
8
|
+
placement: n,
|
|
9
|
+
...a
|
|
10
|
+
}) {
|
|
11
|
+
const [r, e] = y.Children.toArray(o);
|
|
12
|
+
if (!r || !e)
|
|
13
|
+
throw new Error("Menu must have a trigger and a menu content");
|
|
14
|
+
return /* @__PURE__ */ d(l, { defaultOpen: u, ...a, children: [
|
|
15
|
+
r,
|
|
16
|
+
/* @__PURE__ */ i(
|
|
17
|
+
s,
|
|
18
|
+
{
|
|
19
|
+
triggerRef: t,
|
|
20
|
+
placement: n,
|
|
21
|
+
className: "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",
|
|
22
|
+
"data-dd-privacy": "allow",
|
|
23
|
+
children: e
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
5
27
|
}
|
|
6
28
|
m.displayName = "Menu";
|
|
7
29
|
export {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { PopoverProps } from 'react-aria-components/Popover';
|
|
3
3
|
interface MenuContent {
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated move it to the root Menu component
|
|
6
|
+
*/
|
|
4
7
|
placement?: PopoverProps['placement'];
|
|
5
8
|
width?: number;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated move it to the root Menu component
|
|
11
|
+
*/
|
|
6
12
|
triggerRef?: PopoverProps['triggerRef'];
|
|
7
13
|
}
|
|
8
14
|
export declare function MenuContent({ children, placement, width, triggerRef, }: PropsWithChildren<MenuContent>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { uyTv as u } from "@payfit/unity-themes";
|
|
3
|
+
import { Menu as o } from "react-aria-components/Menu";
|
|
4
|
+
const m = u({
|
|
5
|
+
base: [
|
|
6
|
+
"uy:outline-none",
|
|
7
|
+
"uy:w-(--uy-menu-content-width) uy:min-w-(--uy-menu-content-min-width)"
|
|
8
|
+
]
|
|
9
|
+
});
|
|
10
|
+
function i({
|
|
11
|
+
children: t,
|
|
12
|
+
placement: r,
|
|
13
|
+
width: n,
|
|
14
|
+
triggerRef: c
|
|
8
15
|
}) {
|
|
9
|
-
const n = u ? `uy:w-[${u}px] uy:min-w-[${u}px]` : "";
|
|
10
16
|
return /* @__PURE__ */ e(
|
|
11
|
-
|
|
17
|
+
o,
|
|
12
18
|
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
className: m(),
|
|
20
|
+
style: {
|
|
21
|
+
"--uy-menu-content-width": n ? `${n}px` : "auto",
|
|
22
|
+
"--uy-menu-content-min-width": n ? "" : "calc(var(--uy-spacing) * 40)"
|
|
23
|
+
},
|
|
24
|
+
children: t
|
|
18
25
|
}
|
|
19
26
|
);
|
|
20
27
|
}
|
|
21
|
-
|
|
28
|
+
i.displayName = "MenuContent";
|
|
22
29
|
export {
|
|
23
|
-
|
|
30
|
+
i as MenuContent
|
|
24
31
|
};
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { MenuItem as
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as l } from "@payfit/unity-themes";
|
|
3
|
+
import { MenuItem as d } from "react-aria-components/Menu";
|
|
4
|
+
const y = l({
|
|
5
|
+
base: [
|
|
6
|
+
"uy:cursor-pointer",
|
|
7
|
+
"uy:flex uy:p-100 uy:items-start uy:gap-100 uy:rounded-25 uy:typography-body uy:text-content-neutral",
|
|
8
|
+
"uy:not-aria-disabled:data-[hovered=true]:bg-surface-neutral-hover",
|
|
9
|
+
"uy:not-aria-disabled:data-[pressed=true]:bg-surface-neutral-pressed",
|
|
10
|
+
"uy:active:bg-surface-neutral-active",
|
|
11
|
+
"uy:focus-visible:outline-none uy:data-[focus-visible=true]:outline-2 uy:data-[focus-visible=true]:outline-offset-2 uy:data-[focus-visible=true]:outline-utility-focus-ring",
|
|
12
|
+
"uy:aria-disabled:text-content-neutral-disabled uy:aria-disabled:cursor-not-allowed"
|
|
13
|
+
]
|
|
14
|
+
});
|
|
4
15
|
function c({
|
|
5
16
|
prefix: e,
|
|
6
|
-
children:
|
|
7
|
-
href:
|
|
8
|
-
onAction:
|
|
9
|
-
className:
|
|
10
|
-
isDisabled:
|
|
11
|
-
...
|
|
17
|
+
children: t,
|
|
18
|
+
href: u,
|
|
19
|
+
onAction: a,
|
|
20
|
+
className: r,
|
|
21
|
+
isDisabled: o,
|
|
22
|
+
...s
|
|
12
23
|
}) {
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
24
|
+
return /* @__PURE__ */ i(
|
|
25
|
+
d,
|
|
15
26
|
{
|
|
16
|
-
href:
|
|
17
|
-
isDisabled:
|
|
18
|
-
onAction:
|
|
19
|
-
className:
|
|
20
|
-
|
|
21
|
-
a
|
|
22
|
-
),
|
|
23
|
-
...o,
|
|
27
|
+
href: u,
|
|
28
|
+
isDisabled: o,
|
|
29
|
+
onAction: a,
|
|
30
|
+
className: y({ className: r }),
|
|
31
|
+
...s,
|
|
24
32
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
33
|
+
/* @__PURE__ */ n("div", { className: "uy:text-content-neutral-low", children: e || null }),
|
|
34
|
+
t
|
|
27
35
|
]
|
|
28
36
|
}
|
|
29
37
|
);
|