@payfit/unity-components 2.55.17 → 2.55.19
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/task-menu/TaskGroup.context.d.ts +3 -0
- package/dist/esm/components/task-menu/TaskGroup.context.js +5 -0
- package/dist/esm/components/task-menu/TaskMenu.context.d.ts +1 -1
- package/dist/esm/components/task-menu/TaskMenu.context.js +25 -23
- package/dist/esm/components/task-menu/parts/RawSubTask.js +59 -57
- package/dist/esm/components/task-menu/parts/RawTask.js +16 -16
- package/dist/esm/components/task-menu/parts/TaskGroup.js +57 -53
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +36 -14
- package/package.json +10 -10
|
@@ -7,7 +7,7 @@ export interface CurrentTask {
|
|
|
7
7
|
}
|
|
8
8
|
type TaskMenuContextValue = {
|
|
9
9
|
currentTask: CurrentTask | null | undefined;
|
|
10
|
-
setCurrentTask: ((currentTask: CurrentTask) => void) | undefined;
|
|
10
|
+
setCurrentTask: ((currentTask: CurrentTask, taskGroupId?: string) => void) | undefined;
|
|
11
11
|
toggleTaskGroup: ((open: string) => void) | undefined;
|
|
12
12
|
expandedTaskGroup: string | null | undefined;
|
|
13
13
|
taskMenuId: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createContext as e,
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { useOverlayTriggerState as
|
|
5
|
-
import { useOverlayTrigger as
|
|
1
|
+
import { createContext as e, useCallback as t, useContext as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { useId as o } from "react-aria/useId";
|
|
4
|
+
import { useOverlayTriggerState as s } from "react-stately/useOverlayTriggerState";
|
|
5
|
+
import { useOverlayTrigger as c } from "react-aria/useOverlayTrigger";
|
|
6
6
|
//#region src/components/task-menu/TaskMenu.context.tsx
|
|
7
|
-
var
|
|
7
|
+
var l = e({
|
|
8
8
|
currentTask: void 0,
|
|
9
9
|
setCurrentTask: void 0,
|
|
10
10
|
toggleTaskGroup: void 0,
|
|
@@ -17,31 +17,33 @@ var c = e({
|
|
|
17
17
|
triggerProps: {},
|
|
18
18
|
overlayProps: {}
|
|
19
19
|
});
|
|
20
|
-
function
|
|
21
|
-
let
|
|
22
|
-
|
|
20
|
+
function u({ children: e }) {
|
|
21
|
+
let n = o(), [u, d] = i(null), [f, p] = i(null), [m, h] = i(null), g = s({}), _ = r(null), v = r(null), { triggerProps: y, overlayProps: b } = c({ type: "dialog" }, g, _), x = `task-menu-${n}`, S = t((e, t) => {
|
|
22
|
+
d(e), h(t ?? null), p(t ?? null);
|
|
23
|
+
}, []);
|
|
24
|
+
return /* @__PURE__ */ a(l.Provider, {
|
|
23
25
|
value: {
|
|
24
|
-
currentTask:
|
|
25
|
-
setCurrentTask:
|
|
26
|
+
currentTask: u,
|
|
27
|
+
setCurrentTask: S,
|
|
26
28
|
toggleTaskGroup: (e) => {
|
|
27
|
-
e ===
|
|
29
|
+
e === m ? (h(null), p(null)) : (h(e), p(f === e ? null : e));
|
|
28
30
|
},
|
|
29
|
-
expandedTaskGroup:
|
|
30
|
-
taskMenuId:
|
|
31
|
-
taskMenuContentId:
|
|
32
|
-
state:
|
|
33
|
-
triggerRef:
|
|
34
|
-
overlayRef:
|
|
35
|
-
triggerProps:
|
|
36
|
-
overlayProps:
|
|
31
|
+
expandedTaskGroup: f,
|
|
32
|
+
taskMenuId: n,
|
|
33
|
+
taskMenuContentId: x,
|
|
34
|
+
state: g,
|
|
35
|
+
triggerRef: _,
|
|
36
|
+
overlayRef: v,
|
|
37
|
+
triggerProps: y,
|
|
38
|
+
overlayProps: b
|
|
37
39
|
},
|
|
38
40
|
children: e
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
|
-
function
|
|
42
|
-
let e =
|
|
43
|
+
function d() {
|
|
44
|
+
let e = n(l);
|
|
43
45
|
if (!e) throw Error("useTaskMenuContext must be used within an TaskMenuProvider");
|
|
44
46
|
return e;
|
|
45
47
|
}
|
|
46
48
|
//#endregion
|
|
47
|
-
export {
|
|
49
|
+
export { l as TaskMenuContext, u as TaskMenuProvider, d as useTaskMenuContext };
|
|
@@ -2,17 +2,18 @@ import { Icon as e } from "../../icon/Icon.js";
|
|
|
2
2
|
import { Text as t } from "../../text/Text.js";
|
|
3
3
|
import { useRouter as n } from "../../../providers/router/RouterProvider.js";
|
|
4
4
|
import { useTaskMenuContext as r } from "../TaskMenu.context.js";
|
|
5
|
-
import i from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
5
|
+
import { useTaskGroupId as i } from "../TaskGroup.context.js";
|
|
6
|
+
import a from "./dot.js";
|
|
7
|
+
import { commonTask as o } from "./task.variants.js";
|
|
8
|
+
import { forwardRef as s, useEffect as c } from "react";
|
|
9
|
+
import { uyTv as l } from "@payfit/unity-themes";
|
|
10
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
import { FormattedMessage as p, useIntl as m } from "react-intl";
|
|
12
|
+
import { Button as h } from "react-aria-components/Button";
|
|
13
|
+
import { Link as g } from "react-aria-components/Link";
|
|
13
14
|
//#region src/components/task-menu/parts/RawSubTask.tsx
|
|
14
|
-
var
|
|
15
|
-
extend:
|
|
15
|
+
var _ = l({
|
|
16
|
+
extend: o,
|
|
16
17
|
slots: {
|
|
17
18
|
base: ["uy:gap-300 uy:py-100", "uy:md:py-50"],
|
|
18
19
|
dot: [
|
|
@@ -44,9 +45,9 @@ var g = c({
|
|
|
44
45
|
element: ["uy:rounded-50"],
|
|
45
46
|
number: ["uy:group-data-[task-status=uncompleted]/base:group-[&[data-pressed]:not([aria-current=page])]/element:bg-surface-neutral-pressed"]
|
|
46
47
|
}
|
|
47
|
-
}),
|
|
48
|
+
}), v = (t, n, r) => {
|
|
48
49
|
switch (t) {
|
|
49
|
-
case "completed": return /* @__PURE__ */
|
|
50
|
+
case "completed": return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {
|
|
50
51
|
className: r?.completed,
|
|
51
52
|
src: "CheckCircleOutlined",
|
|
52
53
|
size: 20,
|
|
@@ -55,14 +56,14 @@ var g = c({
|
|
|
55
56
|
id: "unity:component:task-menu:task:completed:label",
|
|
56
57
|
defaultMessage: "Completed"
|
|
57
58
|
})
|
|
58
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ d("span", {
|
|
59
60
|
className: "uy:sr-only",
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ d(p, {
|
|
61
62
|
id: "unity:component:task-menu:task:completed:label",
|
|
62
63
|
defaultMessage: "Completed"
|
|
63
64
|
})
|
|
64
65
|
})] });
|
|
65
|
-
case "locked": return /* @__PURE__ */
|
|
66
|
+
case "locked": return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {
|
|
66
67
|
"aria-hidden": "true",
|
|
67
68
|
className: r?.locked,
|
|
68
69
|
src: "LockOutlined",
|
|
@@ -72,70 +73,71 @@ var g = c({
|
|
|
72
73
|
id: "unity:component:task-menu:task:lock:label",
|
|
73
74
|
defaultMessage: "Locked"
|
|
74
75
|
})
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ d("span", {
|
|
76
77
|
className: "uy:sr-only",
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ d(p, {
|
|
78
79
|
id: "unity:component:task-menu:task:lock:label",
|
|
79
80
|
defaultMessage: "Locked"
|
|
80
81
|
})
|
|
81
82
|
})] });
|
|
82
83
|
default: return null;
|
|
83
84
|
}
|
|
84
|
-
},
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
e &&
|
|
88
|
-
uniqueId:
|
|
89
|
-
label:
|
|
90
|
-
});
|
|
85
|
+
}, y = s(({ href: e, label: o, taskStatus: s = "uncompleted", isExact: l, isDisabled: u, onPress: p, uniqueId: y, ...b }, x) => {
|
|
86
|
+
let S = m(), C = n(), w = i(), { currentTask: T, setCurrentTask: E, state: D } = r();
|
|
87
|
+
c(() => {
|
|
88
|
+
e && C?.isActive(e.toString(), l) && E?.({
|
|
89
|
+
uniqueId: y,
|
|
90
|
+
label: o
|
|
91
|
+
}, w ?? void 0);
|
|
91
92
|
}, [
|
|
92
93
|
e,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
l,
|
|
95
|
+
C,
|
|
96
|
+
y,
|
|
97
|
+
o,
|
|
98
|
+
E,
|
|
97
99
|
w
|
|
98
100
|
]);
|
|
99
|
-
let
|
|
100
|
-
"data-current":
|
|
101
|
-
"aria-current":
|
|
102
|
-
},
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
ref:
|
|
105
|
-
"data-task-status":
|
|
106
|
-
className:
|
|
107
|
-
...
|
|
108
|
-
...
|
|
109
|
-
children: [/* @__PURE__ */
|
|
101
|
+
let O = T?.uniqueId === y, { base: k, element: A, text: j, dot: M, lock: N } = _({ taskStatus: s }), P = {
|
|
102
|
+
"data-current": O,
|
|
103
|
+
"aria-current": O ? "page" : void 0
|
|
104
|
+
}, F = e ? g : h;
|
|
105
|
+
return /* @__PURE__ */ f("li", {
|
|
106
|
+
ref: x,
|
|
107
|
+
"data-task-status": s,
|
|
108
|
+
className: k(),
|
|
109
|
+
...O ? { "data-current": !0 } : {},
|
|
110
|
+
...b,
|
|
111
|
+
children: [/* @__PURE__ */ d(a, {
|
|
110
112
|
width: 8,
|
|
111
113
|
height: 8,
|
|
112
|
-
className:
|
|
114
|
+
className: M(),
|
|
113
115
|
role: "presentation"
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
-
className:
|
|
116
|
+
}), /* @__PURE__ */ f(F, {
|
|
117
|
+
className: A(),
|
|
116
118
|
href: e,
|
|
117
119
|
onPress: (e) => {
|
|
118
|
-
|
|
119
|
-
uniqueId:
|
|
120
|
-
label:
|
|
121
|
-
}),
|
|
120
|
+
E?.({
|
|
121
|
+
uniqueId: y,
|
|
122
|
+
label: o
|
|
123
|
+
}, w ?? void 0), D?.toggle(), p?.(e);
|
|
122
124
|
},
|
|
123
|
-
isDisabled:
|
|
124
|
-
...
|
|
125
|
-
...
|
|
126
|
-
children: [/* @__PURE__ */
|
|
125
|
+
isDisabled: u,
|
|
126
|
+
...P,
|
|
127
|
+
...b,
|
|
128
|
+
children: [/* @__PURE__ */ d(t, {
|
|
127
129
|
asElement: "span",
|
|
128
|
-
className:
|
|
129
|
-
variant:
|
|
130
|
-
children:
|
|
131
|
-
}),
|
|
132
|
-
locked:
|
|
130
|
+
className: j(),
|
|
131
|
+
variant: O ? "bodyStrong" : "body",
|
|
132
|
+
children: o
|
|
133
|
+
}), v(s, S, {
|
|
134
|
+
locked: N(),
|
|
133
135
|
completed: "uy:self-center",
|
|
134
136
|
uncompleted: ""
|
|
135
137
|
})]
|
|
136
138
|
})]
|
|
137
139
|
});
|
|
138
140
|
});
|
|
139
|
-
|
|
141
|
+
y.displayName = "RawSubTask";
|
|
140
142
|
//#endregion
|
|
141
|
-
export {
|
|
143
|
+
export { y as RawSubTask, _ as rawSubTask };
|
|
@@ -26,7 +26,7 @@ var h = s({
|
|
|
26
26
|
number: ""
|
|
27
27
|
}
|
|
28
28
|
}), g = a(({ href: i, isExact: a = !1, label: s, onPress: g, taskNumber: _, taskStatus: v = "uncompleted", children: y, uniqueId: b, ...x }, S) => {
|
|
29
|
-
let C = n(), w = f(), { currentTask: T, setCurrentTask: E, state: D
|
|
29
|
+
let C = n(), w = f(), { currentTask: T, setCurrentTask: E, state: D } = r(), O = i ? m : p;
|
|
30
30
|
o(() => {
|
|
31
31
|
i && C?.isActive(i.toString(), a) && E?.({
|
|
32
32
|
uniqueId: b,
|
|
@@ -40,30 +40,30 @@ var h = s({
|
|
|
40
40
|
b,
|
|
41
41
|
E
|
|
42
42
|
]);
|
|
43
|
-
let
|
|
44
|
-
"data-current":
|
|
45
|
-
"aria-current":
|
|
46
|
-
}, { base:
|
|
43
|
+
let k = T?.uniqueId === b, A = {
|
|
44
|
+
"data-current": k,
|
|
45
|
+
"aria-current": k ? "page" : void 0
|
|
46
|
+
}, { base: j, number: M, element: N, text: P, lock: F } = h({ taskStatus: v });
|
|
47
47
|
return /* @__PURE__ */ u("li", {
|
|
48
48
|
ref: S,
|
|
49
49
|
"data-task-status": v,
|
|
50
|
-
className:
|
|
51
|
-
...
|
|
50
|
+
className: j(),
|
|
51
|
+
...k ? { "data-current": !0 } : {},
|
|
52
52
|
...x,
|
|
53
|
-
children: [/* @__PURE__ */ u(
|
|
54
|
-
className:
|
|
53
|
+
children: [/* @__PURE__ */ u(O, {
|
|
54
|
+
className: N(),
|
|
55
55
|
href: i,
|
|
56
56
|
onPress: (e) => {
|
|
57
57
|
E?.({
|
|
58
58
|
uniqueId: b,
|
|
59
59
|
label: s
|
|
60
|
-
}), D?.toggle(),
|
|
60
|
+
}), D?.toggle(), g?.(e);
|
|
61
61
|
},
|
|
62
|
-
...
|
|
62
|
+
...A,
|
|
63
63
|
...x,
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ l("div", {
|
|
66
|
-
className:
|
|
66
|
+
className: M(),
|
|
67
67
|
children: v === "completed" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(e, {
|
|
68
68
|
size: 24,
|
|
69
69
|
"aria-hidden": "true",
|
|
@@ -80,20 +80,20 @@ var h = s({
|
|
|
80
80
|
})
|
|
81
81
|
})] }) : /* @__PURE__ */ l(t, {
|
|
82
82
|
asElement: "span",
|
|
83
|
-
variant:
|
|
83
|
+
variant: k ? "bodyStrong" : "body",
|
|
84
84
|
className: "uy:leading-[1]",
|
|
85
85
|
children: _
|
|
86
86
|
})
|
|
87
87
|
}),
|
|
88
88
|
/* @__PURE__ */ l(t, {
|
|
89
89
|
asElement: "span",
|
|
90
|
-
className:
|
|
91
|
-
variant:
|
|
90
|
+
className: P(),
|
|
91
|
+
variant: k ? "bodyStrong" : "body",
|
|
92
92
|
children: s
|
|
93
93
|
}),
|
|
94
94
|
v === "locked" && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(e, {
|
|
95
95
|
"aria-hidden": "true",
|
|
96
|
-
className:
|
|
96
|
+
className: F(),
|
|
97
97
|
src: "LockOutlined",
|
|
98
98
|
alt: w.formatMessage({
|
|
99
99
|
id: "unity:component:task-menu:task:lock:label",
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Icon as e } from "../../icon/Icon.js";
|
|
2
2
|
import { Text as t } from "../../text/Text.js";
|
|
3
3
|
import { useTaskMenuContext as n } from "../TaskMenu.context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { TaskGroupContext as r } from "../TaskGroup.context.js";
|
|
5
|
+
import { commonTask as i } from "./task.variants.js";
|
|
6
|
+
import { Children as a, cloneElement as o, forwardRef as s, isValidElement as c } from "react";
|
|
7
|
+
import { uyTv as l } from "@payfit/unity-themes";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
+
import { useIntl as f } from "react-intl";
|
|
10
|
+
import { Button as p } from "react-aria-components/Button";
|
|
11
|
+
import { useId as m } from "react-aria/useId";
|
|
11
12
|
//#region src/components/task-menu/parts/TaskGroup.tsx
|
|
12
|
-
var
|
|
13
|
-
extend:
|
|
13
|
+
var h = l({
|
|
14
|
+
extend: i,
|
|
14
15
|
slots: {
|
|
15
16
|
base: ["uy:relative uy:flex-col uy:px-200", "uy:md:px-0"],
|
|
16
17
|
element: [
|
|
@@ -33,71 +34,74 @@ var m = c({
|
|
|
33
34
|
],
|
|
34
35
|
text: ["uy:theme-legacy:group-[&[data-task-status=uncompleted][data-active-group=true]]/base:text-content-primary-active", "uy:theme-rebrand:group-[&[data-task-status=uncompleted][data-active-group=true]]/base:text-content-neutral-active"]
|
|
35
36
|
}
|
|
36
|
-
}),
|
|
37
|
-
let { currentTask:
|
|
38
|
-
if (
|
|
39
|
-
let e =
|
|
40
|
-
if (
|
|
37
|
+
}), g = (e, t) => e ? a.toArray(t).some((t) => c(t) && t.props.uniqueId === e) : !1, _ = (e) => e ? a.toArray(e).find((e) => c(e) && e.props.taskStatus !== "completed" && e.props.taskStatus !== "locked") : null, v = s(({ children: i, label: s, taskNumber: l, taskStatus: v = "uncompleted", uniqueId: y, ...b }, x) => {
|
|
38
|
+
let { currentTask: S, setCurrentTask: C, toggleTaskGroup: w, expandedTaskGroup: T } = n(), E = m(), D = f(), O = T === y, k = (e) => {
|
|
39
|
+
if (w?.(y), !e) {
|
|
40
|
+
let e = _(i);
|
|
41
|
+
if (c(e)) {
|
|
41
42
|
let { uniqueId: t, label: n } = e.props;
|
|
42
|
-
|
|
43
|
+
C?.({
|
|
43
44
|
uniqueId: t,
|
|
44
45
|
label: n
|
|
45
|
-
});
|
|
46
|
+
}, y);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
},
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
ref:
|
|
49
|
+
}, A = a.map(i, (e) => c(e) ? o(e, { isDisabled: !O }) : e), j = `${E}-toggle`, M = `${E}-content`, N = g(S?.uniqueId, i), { base: P, number: F, text: I, bar: L, element: R, containerSubTasks: z } = h({ taskStatus: v });
|
|
50
|
+
return /* @__PURE__ */ d("li", {
|
|
51
|
+
ref: x,
|
|
51
52
|
"data-group": "true",
|
|
52
|
-
"data-task-status":
|
|
53
|
-
"data-expanded":
|
|
54
|
-
"data-active-group":
|
|
55
|
-
className:
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
id:
|
|
58
|
-
className:
|
|
53
|
+
"data-task-status": v,
|
|
54
|
+
"data-expanded": O,
|
|
55
|
+
"data-active-group": N,
|
|
56
|
+
className: P(),
|
|
57
|
+
children: [/* @__PURE__ */ d(p, {
|
|
58
|
+
id: j,
|
|
59
|
+
className: R(),
|
|
59
60
|
onPress: () => {
|
|
60
|
-
O
|
|
61
|
+
k(O);
|
|
61
62
|
},
|
|
62
|
-
"aria-expanded":
|
|
63
|
-
"aria-controls":
|
|
64
|
-
...
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
-
className:
|
|
67
|
-
children:
|
|
63
|
+
"aria-expanded": O,
|
|
64
|
+
"aria-controls": M,
|
|
65
|
+
...b,
|
|
66
|
+
children: [/* @__PURE__ */ u("div", {
|
|
67
|
+
className: F(),
|
|
68
|
+
children: v === "completed" ? /* @__PURE__ */ u(e, {
|
|
68
69
|
size: 24,
|
|
69
70
|
src: "CheckOutlined",
|
|
70
|
-
alt:
|
|
71
|
+
alt: D.formatMessage({
|
|
71
72
|
id: "unity:component:task-menu:task:completed:label",
|
|
72
73
|
defaultMessage: "Completed"
|
|
73
74
|
})
|
|
74
|
-
}) : /* @__PURE__ */
|
|
75
|
+
}) : /* @__PURE__ */ u(t, {
|
|
75
76
|
asElement: "span",
|
|
76
|
-
variant:
|
|
77
|
+
variant: N ? "bodyStrong" : "body",
|
|
77
78
|
className: "uy:leading-[1]",
|
|
78
|
-
children:
|
|
79
|
+
children: l
|
|
79
80
|
})
|
|
80
|
-
}), /* @__PURE__ */
|
|
81
|
+
}), /* @__PURE__ */ u(t, {
|
|
81
82
|
asElement: "span",
|
|
82
|
-
className:
|
|
83
|
-
variant:
|
|
84
|
-
children:
|
|
83
|
+
className: I(),
|
|
84
|
+
variant: N ? "bodyStrong" : "body",
|
|
85
|
+
children: s
|
|
85
86
|
})]
|
|
86
|
-
}), /* @__PURE__ */
|
|
87
|
-
style: { maxHeight:
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
-
id:
|
|
90
|
-
"aria-labelledby":
|
|
91
|
-
"aria-hidden": !
|
|
92
|
-
className:
|
|
93
|
-
children:
|
|
94
|
-
|
|
87
|
+
}), /* @__PURE__ */ d("div", {
|
|
88
|
+
style: { maxHeight: O ? 1e3 : 0 },
|
|
89
|
+
children: [/* @__PURE__ */ u("ol", {
|
|
90
|
+
id: M,
|
|
91
|
+
"aria-labelledby": j,
|
|
92
|
+
"aria-hidden": !O,
|
|
93
|
+
className: z(),
|
|
94
|
+
children: /* @__PURE__ */ u(r.Provider, {
|
|
95
|
+
value: y,
|
|
96
|
+
children: A
|
|
97
|
+
})
|
|
98
|
+
}), O && /* @__PURE__ */ u("div", {
|
|
95
99
|
role: "presentation",
|
|
96
|
-
className:
|
|
100
|
+
className: L()
|
|
97
101
|
})]
|
|
98
102
|
})]
|
|
99
103
|
});
|
|
100
104
|
});
|
|
101
|
-
|
|
105
|
+
v.displayName = "TaskGroup";
|
|
102
106
|
//#endregion
|
|
103
|
-
export {
|
|
107
|
+
export { v as TaskGroup };
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTaskMenuContext as e } from "../../../../components/task-menu/TaskMenu.context.js";
|
|
2
|
+
import { useTaskGroupId as t } from "../../../../components/task-menu/TaskGroup.context.js";
|
|
3
|
+
import { RawSubTask as n } from "../../../../components/task-menu/parts/RawSubTask.js";
|
|
4
|
+
import { useEffect as r } from "react";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { createLink as s, useLinkProps as c } from "@tanstack/react-router";
|
|
4
7
|
//#region src/integrations/tanstack-router/components/task-menu/SubTask.tsx
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
}
|
|
8
|
+
var l = s(n);
|
|
9
|
+
function u({ label: t, taskGroupId: n, uniqueId: i }) {
|
|
10
|
+
let { setCurrentTask: a } = e();
|
|
11
|
+
return r(() => {
|
|
12
|
+
a?.({
|
|
13
|
+
uniqueId: i,
|
|
14
|
+
label: t
|
|
15
|
+
}, n ?? void 0);
|
|
16
|
+
}, [
|
|
17
|
+
t,
|
|
18
|
+
a,
|
|
19
|
+
n,
|
|
20
|
+
i
|
|
21
|
+
]), null;
|
|
14
22
|
}
|
|
15
|
-
|
|
23
|
+
function d({ subTaskProps: e }) {
|
|
24
|
+
let n = { "data-current": !0 }, r = c(e), s = t();
|
|
25
|
+
return /* @__PURE__ */ o(i, { children: [r["aria-current"] === "page" && /* @__PURE__ */ a(u, {
|
|
26
|
+
label: e.label,
|
|
27
|
+
taskGroupId: s,
|
|
28
|
+
uniqueId: e.uniqueId
|
|
29
|
+
}), /* @__PURE__ */ a(l, {
|
|
30
|
+
...e,
|
|
31
|
+
activeProps: n
|
|
32
|
+
})] });
|
|
33
|
+
}
|
|
34
|
+
function f(e) {
|
|
35
|
+
return "to" in e || "href" in e ? /* @__PURE__ */ a(d, { subTaskProps: e }) : /* @__PURE__ */ a(n, { ...e });
|
|
36
|
+
}
|
|
37
|
+
f.displayName = "SubTask";
|
|
16
38
|
//#endregion
|
|
17
|
-
export {
|
|
39
|
+
export { f as SubTask };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.55.
|
|
3
|
+
"version": "2.55.19",
|
|
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.55.
|
|
96
|
+
"@payfit/unity-illustrations": "2.55.19"
|
|
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.55.
|
|
109
|
-
"@payfit/unity-themes": "2.55.
|
|
108
|
+
"@payfit/unity-icons": "2.55.19",
|
|
109
|
+
"@payfit/unity-themes": "2.55.19"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@figma/code-connect": "1.4.8",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"react-docgen-typescript": "2.2.2",
|
|
144
144
|
"react-hot-toast": "2.5.1",
|
|
145
145
|
"storybook": "10.5.0",
|
|
146
|
-
"storybook-addon-pseudo-states": "10.
|
|
146
|
+
"storybook-addon-pseudo-states": "10.5.0",
|
|
147
147
|
"storybook-addon-tag-badges": "3.1.0",
|
|
148
148
|
"storybook-addon-test-codegen": "3.0.1",
|
|
149
149
|
"storybook-mock-date-decorator": "3.0.0",
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
"vitest": "4.1.10",
|
|
155
155
|
"@payfit/hr-app-eslint": "0.0.0-use.local",
|
|
156
156
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
157
|
-
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
158
157
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
159
|
-
"@payfit/unity-
|
|
160
|
-
"@payfit/
|
|
161
|
-
"@payfit/unity-
|
|
162
|
-
"@payfit/unity-
|
|
158
|
+
"@payfit/unity-icons": "2.55.19",
|
|
159
|
+
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
160
|
+
"@payfit/unity-illustrations": "2.55.19",
|
|
161
|
+
"@payfit/unity-themes": "2.55.19",
|
|
162
|
+
"@payfit/vite-configs": "0.0.0-use.local"
|
|
163
163
|
},
|
|
164
164
|
"peerDependenciesMeta": {
|
|
165
165
|
"@hookform/devtools": {
|