@payfit/unity-components 2.65.22 → 2.65.24

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.
@@ -50,7 +50,7 @@ var d = r({
50
50
  ...x && { "data-focused": x },
51
51
  ...y && { "data-hovered": y },
52
52
  ...g.isDisabled && { "data-disabled": g.isDisabled },
53
- ..._ && { "data-focus-visible": _ },
53
+ ...x && _ && { "data-focus-visible": _ },
54
54
  ref: r,
55
55
  children: typeof h == "function" ? h({
56
56
  isHovered: y,
@@ -8,6 +8,10 @@ export interface AppMenuHeaderProps {
8
8
  * Accessible label for the brand logo link.
9
9
  */
10
10
  brandLabel: string;
11
+ /**
12
+ * Optional help component to display while the mobile menu is open.
13
+ */
14
+ helpComponent?: ReactNode;
11
15
  /**
12
16
  * Optional notification component to display in the header.
13
17
  */
@@ -58,6 +62,7 @@ export interface AppMenuHeaderProps {
58
62
  * @param props - Component props
59
63
  * @param props.environment - The application environment (determines brand logo variant)
60
64
  * @param props.brandLabel - Accessible label for the brand logo link
65
+ * @param props.helpComponent - Optional help component displayed while the mobile menu is open
61
66
  * @param props.notificationsComponent - Optional notification component to display
62
67
  * @param props.searchComponent - Optional search component to display
63
68
  * @param props.renderLink - Optional render function for custom link implementation
@@ -88,4 +93,4 @@ export interface AppMenuHeaderProps {
88
93
  * @see Design docs in {@link https://www.payfit.design/ Payfit.design}
89
94
  * @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
90
95
  */
91
- export declare const AppMenuHeader: ({ environment, brandLabel: linkLabel, notificationsComponent, searchComponent, renderLink, }: AppMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
96
+ export declare const AppMenuHeader: ({ environment, brandLabel: linkLabel, helpComponent, notificationsComponent, searchComponent, renderLink, }: AppMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,47 +9,51 @@ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
9
  import { useIntl as u } from "react-intl";
10
10
  import { Link as d } from "react-aria-components/Link";
11
11
  //#region src/components/app-menu/parts/AppMenuHeader.tsx
12
- var f = ({ environment: f, brandLabel: p, notificationsComponent: m, searchComponent: h, renderLink: g = ({ children: e }) => /* @__PURE__ */ c(d, {
12
+ var f = ({ environment: f, brandLabel: p, helpComponent: m, notificationsComponent: h, searchComponent: g, renderLink: _ = ({ children: e }) => /* @__PURE__ */ c(d, {
13
13
  href: "/",
14
14
  children: e
15
15
  }) }) => {
16
- let { isMobileMenuOpen: _, toggleMobileMenu: v } = r(), { theme: y } = s(), b = u(), x = e(t()), S = o(() => y === "rebrand" ? x ? 36 : 78 : x ? 36 : 104, [x, y]);
16
+ let { isMobileMenuOpen: v, toggleMobileMenu: y } = r(), { theme: b } = s(), x = u(), S = e(t()), C = S && v, w = o(() => b === "rebrand" ? S ? 36 : 78 : S ? 36 : 104, [S, b]);
17
17
  return /* @__PURE__ */ l("header", {
18
18
  className: "uy:flex uy:shrink-0 uy:flex-col uy:gap-y-200 uy:pl-25 uy:pr-25",
19
19
  children: [/* @__PURE__ */ l("div", {
20
20
  className: "uy:flex uy:items-center uy:justify-between",
21
21
  children: [/* @__PURE__ */ c("div", {
22
22
  className: "uy:flex-0",
23
- children: g({ children: f === "prod" ? /* @__PURE__ */ c(i, {
23
+ children: _({ children: f === "prod" ? /* @__PURE__ */ c(i, {
24
24
  label: p,
25
- width: S,
26
- showOnlyMonogram: x
25
+ width: w,
26
+ showOnlyMonogram: S
27
27
  }) : /* @__PURE__ */ c(a, {
28
28
  label: p,
29
29
  env: f,
30
- showOnlyMonogram: x
30
+ showOnlyMonogram: S
31
31
  }) })
32
32
  }), /* @__PURE__ */ l("div", {
33
33
  className: "uy:flex uy:gap-150 uy:items-center",
34
- children: [m, /* @__PURE__ */ c("div", {
35
- className: "uy:block uy:md:hidden",
36
- children: /* @__PURE__ */ c(n, {
37
- variant: "ghost",
38
- color: "neutral",
39
- prefixIcon: _ ? "CloseOutlined" : "ListOutlined",
40
- onPress: v,
41
- "aria-expanded": _,
42
- "aria-controls": "app-menu-nav-container app-menu-profile-button",
43
- children: b.formatMessage({
44
- id: _ ? "unity:component:app-menu:header:menu-close" : "unity:component:app-menu:header:menu-open",
45
- defaultMessage: _ ? "Close navigation" : "Open navigation"
34
+ children: [
35
+ C ? m : null,
36
+ h,
37
+ /* @__PURE__ */ c("div", {
38
+ className: "uy:block uy:md:hidden",
39
+ children: /* @__PURE__ */ c(n, {
40
+ variant: "ghost",
41
+ color: "neutral",
42
+ prefixIcon: v ? "CloseOutlined" : "ListOutlined",
43
+ onPress: y,
44
+ "aria-expanded": v,
45
+ "aria-controls": "app-menu-nav-container app-menu-profile-button",
46
+ children: x.formatMessage({
47
+ id: v ? "unity:component:app-menu:header:menu-close" : "unity:component:app-menu:header:menu-open",
48
+ defaultMessage: v ? "Close navigation" : "Open navigation"
49
+ })
46
50
  })
47
51
  })
48
- })]
52
+ ]
49
53
  })]
50
54
  }), /* @__PURE__ */ c("div", {
51
55
  className: "uy:hidden uy:md:flex",
52
- children: h
56
+ children: g
53
57
  })]
54
58
  });
55
59
  };
@@ -11,15 +11,13 @@ import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
11
  var d = c({
12
12
  base: [
13
13
  "uy:transition-colors uy:rounded-75",
14
- "uy:theme-legacy:data-[hovered=true]:bg-surface-neutral-low-hover uy:theme-legacy:hover:bg-surface-neutral-low-hover",
15
- "uy:theme-rebrand:data-[hovered=true]:bg-surface-neutral-lowest-hover uy:theme-rebrand:hover:bg-surface-neutral-lowest-hover",
16
- "uy:theme-legacy:data-[pressed=true]:bg-surface-neutral-low-pressed uy:theme-legacy:active:bg-surface-neutral-low-active",
17
- "uy:theme-rebrand:data-[pressed=true]:bg-surface-neutral-lowest-pressed uy:theme-rebrand:active:bg-surface-neutral-lowest-active",
18
- "uy:focus-visible:outline-none uy:focus-visible:ring-2 uy:focus-visible:ring-utility-focus-ring uy:focus-visible:ring-offset-2"
14
+ "uy:data-[hovered=true]:bg-surface-neutral-low-hover uy:hover:bg-surface-neutral-low-hover",
15
+ "uy:data-[pressed=true]:bg-surface-neutral-low-pressed uy:active:bg-surface-neutral-low-active",
16
+ "uy:data-[focus-visible=true]:outline-none uy:data-[focus-visible=true]:ring-2 uy:data-[focus-visible=true]:ring-utility-focus-ring uy:data-[focus-visible=true]:ring-offset-2"
19
17
  ],
20
18
  variants: { variant: {
21
19
  large: "uy:w-full uy:px-150 uy:py-100",
22
- small: "uy:pr-0 uy:pl-100 uy:py-25"
20
+ small: "uy:pr-0 uy:pl-100 uy:py-50"
23
21
  } }
24
22
  }), f = c({ base: [
25
23
  "uy:transition-all uy:duration-200 uy:ease-out uy:data-[entering]:opacity-100 uy:data-[exiting]:opacity-0",
@@ -2,88 +2,125 @@ import { Icon as e } from "../../icon/Icon.js";
2
2
  import { Text as t } from "../../text/Text.js";
3
3
  import { Badge as n } from "../../badge/Badge.js";
4
4
  import { AppProfileAvatar as r, InteractiveAppProfileAvatar as i } from "./AppProfileAvatar.js";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { useIntl as s } from "react-intl";
5
+ import { uyTv as a } from "@payfit/unity-themes";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { useIntl as c } from "react-intl";
7
8
  //#region src/components/app-profile-menu-button/parts/AppProfileMenuHeader.tsx
8
- var c = ({ asMenuHeader: c = !1, avatar: l, avatarPair: u, avatarSize: d, avatarVariant: f, badgeLabel: p, description: m, labelId: h, menuTriggerDescription: g, title: _, triggerDescriptionId: v, triggerVariant: y, uploadAvatarCallback: b, uploadAvatarDescription: x, uploadAvatarLabel: S }) => {
9
- let C = s(), w = g ?? C.formatMessage({
9
+ var l = a({
10
+ slots: {
11
+ summary: "uy:flex uy:w-full uy:items-center",
12
+ avatar: "uy:flex uy:items-center",
13
+ details: "uy:min-w-0 uy:flex-grow uy:flex-col uy:text-left uy:leading-[1.25]",
14
+ disclosure: "uy:p-100",
15
+ iconWrapper: "uy:flex uy:items-center uy:p-25",
16
+ icon: ""
17
+ },
18
+ variants: {
19
+ hideResponsiveDetails: {
20
+ true: {
21
+ avatar: "uy:mr-0 uy:lg:mr-150",
22
+ details: "uy:sr-only uy:lg:not-sr-only uy:lg:flex",
23
+ disclosure: "uy:ml-50 uy:lg:ml-150"
24
+ },
25
+ false: {
26
+ avatar: "uy:mr-150",
27
+ details: "uy:flex"
28
+ }
29
+ },
30
+ triggerVariant: {
31
+ small: { icon: [
32
+ "uy:block uy:origin-center uy:transition-transform",
33
+ "uy:duration-150 uy:ease-linear",
34
+ "uy:group-aria-[expanded=true]:rotate-180"
35
+ ] },
36
+ large: {}
37
+ }
38
+ }
39
+ }), u = ({ asMenuHeader: a = !1, avatar: u, avatarPair: d, avatarSize: f, avatarVariant: p, badgeLabel: m, description: h, labelId: g, menuTriggerDescription: _, title: v, triggerDescriptionId: y, triggerVariant: b, uploadAvatarCallback: x, uploadAvatarDescription: S, uploadAvatarLabel: C }) => {
40
+ let w = c(), T = _ ?? w.formatMessage({
10
41
  id: "unity:component:app-menu:footer:profile-button:description",
11
42
  defaultMessage: "Press this button to open the profile menu."
43
+ }), { summary: E, avatar: D, details: O, disclosure: k, iconWrapper: A, icon: j } = l({
44
+ hideResponsiveDetails: !a && b === "small",
45
+ triggerVariant: b
12
46
  });
13
- return /* @__PURE__ */ o("div", {
14
- className: "uy:w-full uy:flex uy:items-center",
47
+ return /* @__PURE__ */ s("div", {
48
+ className: E(),
15
49
  "data-unity-slot": "profile-summary",
16
50
  children: [
17
- /* @__PURE__ */ a("div", {
18
- className: "uy:mr-150 uy:flex uy:items-center",
51
+ /* @__PURE__ */ o("div", {
52
+ className: D(),
19
53
  "data-unity-slot": "avatar",
20
- children: b ? /* @__PURE__ */ a(i, {
21
- avatar: l,
22
- avatarPair: u,
23
- avatarSize: d,
24
- avatarVariant: f,
25
- labelId: h,
26
- title: _,
27
- uploadAvatarCallback: b,
28
- uploadAvatarDescription: x,
29
- uploadAvatarLabel: S
30
- }) : /* @__PURE__ */ a(r, {
31
- avatar: l,
32
- avatarPair: u,
33
- avatarSize: d,
34
- avatarVariant: f,
54
+ children: x ? /* @__PURE__ */ o(i, {
55
+ avatar: u,
56
+ avatarPair: d,
57
+ avatarSize: f,
58
+ avatarVariant: p,
59
+ labelId: g,
60
+ title: v,
61
+ uploadAvatarCallback: x,
62
+ uploadAvatarDescription: S,
63
+ uploadAvatarLabel: C
64
+ }) : /* @__PURE__ */ o(r, {
65
+ avatar: u,
66
+ avatarPair: d,
67
+ avatarSize: f,
68
+ avatarVariant: p,
35
69
  isPairAvatarVisible: !0,
36
- labelId: h,
37
- title: _
70
+ labelId: g,
71
+ title: v
38
72
  })
39
73
  }),
40
- /* @__PURE__ */ o("div", {
41
- className: "uy:flex uy:flex-col uy:text-left uy:leading-[1.25] uy:min-w-0 uy:flex-grow",
74
+ /* @__PURE__ */ s("div", {
75
+ className: O(),
42
76
  "data-unity-slot": "profile-details",
43
77
  children: [
44
- /* @__PURE__ */ a(t, {
78
+ /* @__PURE__ */ o(t, {
45
79
  asElement: "span",
46
80
  className: "uy:w-full",
47
81
  color: "content.neutral",
48
82
  "data-dd-privacy": "mask",
49
- id: c ? void 0 : h,
50
- lineClamp: 1,
51
- variant: d === "md" ? "bodySmallStrong" : "bodyStrong",
52
- children: _
83
+ id: a ? void 0 : g,
84
+ isTruncated: !0,
85
+ variant: f === "md" ? "bodySmallStrong" : "bodyStrong",
86
+ children: v
53
87
  }),
54
- /* @__PURE__ */ a(t, {
88
+ /* @__PURE__ */ o(t, {
55
89
  asElement: "span",
56
90
  className: "uy:w-full",
57
91
  color: "content.neutral.low",
58
92
  "data-dd-privacy": "allow",
59
- lineClamp: 1,
93
+ isTruncated: !0,
60
94
  variant: "bodySmall",
61
- children: m
95
+ children: h
62
96
  }),
63
- !c && /* @__PURE__ */ a("span", {
64
- id: v,
97
+ !a && /* @__PURE__ */ o("span", {
98
+ id: y,
65
99
  className: "uy:sr-only",
66
- children: w
100
+ children: T
67
101
  })
68
102
  ]
69
103
  }),
70
- /* @__PURE__ */ a("div", {
71
- className: "uy:p-100",
104
+ /* @__PURE__ */ o("div", {
105
+ className: k(),
72
106
  "data-unity-slot": "disclosure",
73
- children: c ? p && /* @__PURE__ */ a(n, {
107
+ children: a ? m && /* @__PURE__ */ o(n, {
74
108
  className: "uy:capitalize",
75
109
  variant: "neutral",
76
- children: p
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,
79
- src: y === "small" ? "CaretDownOutlined" : "CaretUpDownOutlined",
80
- alt: w,
81
- size: 20,
82
- color: "content.neutral.low"
110
+ children: m
111
+ }) : /* @__PURE__ */ o("div", {
112
+ className: A(),
113
+ children: /* @__PURE__ */ o(e, {
114
+ className: j(),
115
+ src: b === "small" ? "CaretDownOutlined" : "CaretUpDownOutlined",
116
+ alt: T,
117
+ size: 20,
118
+ color: "content.neutral.low"
119
+ })
83
120
  })
84
121
  })
85
122
  ]
86
123
  });
87
124
  };
88
125
  //#endregion
89
- export { c as AppProfileMenuHeader };
126
+ export { u as AppProfileMenuHeader };
@@ -7,15 +7,15 @@ var o = "--uy-app-layout-header-sticky-offset", s = "Application top bar", c = r
7
7
  sentinel: "uy:pointer-events-none uy:h-px uy:w-full uy:-mb-px uy:opacity-0",
8
8
  header: [
9
9
  "uy:sticky uy:top-(--uy-app-layout-header-sticky-offset) uy:z-10",
10
- "uy:flex uy:min-h-7.5 uy:w-full uy:items-center uy:justify-between",
11
- "uy:gap-200 uy:bg-canvas uy:pl-150 uy:py-50 uy:pr-250",
10
+ "uy:flex uy:min-h-7.5 uy:w-full uy:items-center",
11
+ "uy:bg-canvas uy:pl-50 uy:py-50 uy:pr-250",
12
12
  "uy:transition-shadow uy:duration-200 uy:ease-out",
13
13
  "uy:[clip-path:inset(0_0_-100px_0)]",
14
14
  "uy:data-[stuck=true]:shadow-[0_2px_8px_-1px_var(--uy-color-utility-shadow-200)]"
15
15
  ],
16
- search: "uy:min-w-0 uy:shrink",
17
- actions: "uy:flex uy:min-w-0 uy:flex-1 uy:items-center uy:justify-end uy:gap-100",
18
- profile: "uy:ml-auto uy:flex uy:shrink-0 uy:items-center"
16
+ search: "uy:mr-600 uy:min-w-600 uy:max-w-[300px] uy:grow uy:shrink uy:basis-0",
17
+ actions: "uy:flex uy:min-w-0 uy:flex-1 uy:items-center uy:justify-end uy:gap-25 uy:lg:mr-[11px]",
18
+ profile: "uy:ml-auto uy:flex uy:min-w-0 uy:max-w-[250px] uy:shrink-0 uy:items-center uy:justify-end uy:*:min-w-0 uy:*:w-full"
19
19
  } }), l = (e) => {
20
20
  let t = getComputedStyle(e).getPropertyValue(o).trim(), n = Number.parseFloat(t);
21
21
  return Number.isFinite(n) ? n : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-components",
3
- "version": "2.65.22",
3
+ "version": "2.65.24",
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.1",
97
97
  "usehooks-ts": "3.1.1",
98
98
  "zod": "4.4.3",
99
- "@payfit/unity-illustrations": "2.65.22"
99
+ "@payfit/unity-illustrations": "2.65.24"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "@hookform/devtools": "^4",
@@ -108,8 +108,8 @@
108
108
  "react-hook-form": "^7",
109
109
  "react-router-dom": "^5",
110
110
  "zod": "^3 || ^4",
111
- "@payfit/unity-icons": "2.65.22",
112
- "@payfit/unity-themes": "2.65.22"
111
+ "@payfit/unity-themes": "2.65.24",
112
+ "@payfit/unity-icons": "2.65.24"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@figma/code-connect": "1.5.3",
@@ -159,11 +159,11 @@
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-addon-datadog-rum": "0.0.0-use.local",
162
- "@payfit/storybook-config": "0.0.0-use.local",
163
- "@payfit/unity-icons": "2.65.22",
164
- "@payfit/unity-illustrations": "2.65.22",
162
+ "@payfit/unity-icons": "2.65.24",
163
+ "@payfit/unity-illustrations": "2.65.24",
164
+ "@payfit/unity-themes": "2.65.24",
165
165
  "@payfit/vite-configs": "0.0.0-use.local",
166
- "@payfit/unity-themes": "2.65.22"
166
+ "@payfit/storybook-config": "0.0.0-use.local"
167
167
  },
168
168
  "peerDependenciesMeta": {
169
169
  "@hookform/devtools": {