@payfit/unity-components 1.1.0 → 1.2.0
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/adapters/standardSchemaAdapter.d.ts +7 -0
- package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
- package/dist/esm/adapters/zodAdapter.d.ts +13 -0
- package/dist/esm/adapters/zodAdapter.js +74 -0
- package/dist/esm/components/action-bar/ActionBar.js +62 -64
- package/dist/esm/components/actionable/Actionable.d.ts +50 -3
- package/dist/esm/components/actionable/Actionable.js +49 -39
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
- package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
- package/dist/esm/components/code/Code.d.ts +37 -0
- package/dist/esm/components/code/Code.js +39 -0
- package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
- package/dist/esm/components/code/copyToClipboard.js +10 -0
- package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
- package/dist/esm/components/collapsible/Collapsible.js +14 -13
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
- package/dist/esm/components/data-table/DataTable.d.ts +76 -10
- package/dist/esm/components/data-table/DataTable.js +81 -78
- package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
- package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
- package/dist/esm/components/date-picker/DatePicker.js +64 -64
- package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
- package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
- package/dist/esm/components/error-state/ErrorState.js +153 -0
- package/dist/esm/components/error-state/initConfig.d.ts +16 -0
- package/dist/esm/components/error-state/initConfig.js +149 -0
- package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
- package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
- package/dist/esm/components/form/Form.d.ts +15 -9
- package/dist/esm/components/form/Form.js +53 -50
- package/dist/esm/components/form-field/FormField.js +24 -23
- package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
- package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
- package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
- package/dist/esm/components/input/Input.js +28 -28
- package/dist/esm/components/label/Label.js +19 -19
- package/dist/esm/components/multi-select/MultiSelect.js +94 -94
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
- package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
- package/dist/esm/components/nav/parts/NavGroup.js +21 -21
- package/dist/esm/components/number-field/NumberField.d.ts +3 -3
- package/dist/esm/components/number-input/NumberInput.js +58 -58
- package/dist/esm/components/pagination/Pagination.js +97 -101
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
- package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
- package/dist/esm/components/select-field/SelectField.d.ts +2 -2
- package/dist/esm/components/select-field/SelectField.js +4 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
- package/dist/esm/components/skip-links/SkipLinks.js +50 -43
- package/dist/esm/components/table/Table.js +79 -76
- package/dist/esm/components/table/parts/TableBody.js +6 -6
- package/dist/esm/components/table/parts/TableCell.js +25 -25
- package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
- package/dist/esm/components/table/parts/TablePagination.js +61 -59
- package/dist/esm/components/table/parts/TableRow.js +16 -16
- package/dist/esm/components/tabs/parts/TabList.js +50 -54
- package/dist/esm/components/task-menu/parts/Content.js +24 -24
- package/dist/esm/components/task-menu/parts/Header.js +24 -24
- package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
- package/dist/esm/components/task-menu/parts/Task.js +69 -69
- package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
- package/dist/esm/components/text-area/TextArea.js +30 -31
- package/dist/esm/components/text-field/TextField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
- package/dist/esm/hooks/use-form.d.ts +5 -5
- package/dist/esm/hooks/use-form.types.d.ts +2 -2
- package/dist/esm/hooks/use-resizable.js +13 -14
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +22 -19
- package/dist/esm/types/schema.d.ts +8 -0
- package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
- package/dist/esm/utils/createSchemaAdapter.js +13 -0
- package/dist/esm/utils/platform.js +2 -3
- package/i18n/en-GB.json +16 -0
- package/i18n/es-ES.json +16 -0
- package/i18n/fr-FR.json +16 -0
- package/package.json +25 -19
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { Text as
|
|
9
|
-
import { useTaskMenuContext as
|
|
10
|
-
import
|
|
11
|
-
import { commonTask as
|
|
12
|
-
const
|
|
13
|
-
extend:
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as L, useEffect as j } from "react";
|
|
3
|
+
import { uyTv as O } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as z, Button as E } from "react-aria-components";
|
|
5
|
+
import { useIntl as F, FormattedMessage as i } from "react-intl";
|
|
6
|
+
import { useRouter as P } from "../../../providers/router/RouterProvider.js";
|
|
7
|
+
import { Icon as p } from "../../icon/Icon.js";
|
|
8
|
+
import { Text as R } from "../../text/Text.js";
|
|
9
|
+
import { useTaskMenuContext as A } from "../TaskMenu.context.js";
|
|
10
|
+
import D from "./dot.svg.js";
|
|
11
|
+
import { commonTask as I } from "./task.variants.js";
|
|
12
|
+
const V = O({
|
|
13
|
+
extend: I,
|
|
14
14
|
slots: {
|
|
15
15
|
base: ["uy:gap-300 uy:py-100", "uy:md:py-50"],
|
|
16
16
|
dot: ["uy:self-center"],
|
|
@@ -71,25 +71,25 @@ const J = E({
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
]
|
|
74
|
-
}),
|
|
75
|
-
switch (
|
|
74
|
+
}), B = (t, o, n) => {
|
|
75
|
+
switch (t) {
|
|
76
76
|
case "completed":
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
77
|
+
return /* @__PURE__ */ a(d, { children: [
|
|
78
|
+
/* @__PURE__ */ e(
|
|
79
|
+
p,
|
|
80
80
|
{
|
|
81
|
-
className:
|
|
81
|
+
className: n?.completed,
|
|
82
82
|
src: "CheckCircleOutlined",
|
|
83
83
|
size: 20,
|
|
84
84
|
color: "content.success",
|
|
85
|
-
alt:
|
|
85
|
+
alt: o.formatMessage({
|
|
86
86
|
id: "unity:component:task-menu:task:completed:label",
|
|
87
87
|
defaultMessage: "Completed"
|
|
88
88
|
})
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
91
|
+
/* @__PURE__ */ e("span", { className: "uy:sr-only", children: /* @__PURE__ */ e(
|
|
92
|
+
i,
|
|
93
93
|
{
|
|
94
94
|
id: "unity:component:task-menu:task:completed:label",
|
|
95
95
|
defaultMessage: "Completed"
|
|
@@ -97,23 +97,23 @@ const J = E({
|
|
|
97
97
|
) })
|
|
98
98
|
] });
|
|
99
99
|
case "locked":
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
100
|
+
return /* @__PURE__ */ a(d, { children: [
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
p,
|
|
103
103
|
{
|
|
104
104
|
"aria-hidden": "true",
|
|
105
|
-
className:
|
|
105
|
+
className: n?.locked,
|
|
106
106
|
src: "LockOutlined",
|
|
107
107
|
size: 20,
|
|
108
108
|
color: "content.neutral.lowest",
|
|
109
|
-
alt:
|
|
109
|
+
alt: o.formatMessage({
|
|
110
110
|
id: "unity:component:task-menu:task:lock:label",
|
|
111
111
|
defaultMessage: "Locked"
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
115
|
+
/* @__PURE__ */ e("span", { className: "uy:sr-only", children: /* @__PURE__ */ e(
|
|
116
|
+
i,
|
|
117
117
|
{
|
|
118
118
|
id: "unity:component:task-menu:task:lock:label",
|
|
119
119
|
defaultMessage: "Locked"
|
|
@@ -123,63 +123,63 @@ const J = E({
|
|
|
123
123
|
default:
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, G = L(
|
|
127
127
|
({
|
|
128
|
-
href:
|
|
129
|
-
label:
|
|
130
|
-
taskStatus:
|
|
131
|
-
isExact:
|
|
132
|
-
isDisabled:
|
|
133
|
-
onPress:
|
|
128
|
+
href: t,
|
|
129
|
+
label: o,
|
|
130
|
+
taskStatus: n = "uncompleted",
|
|
131
|
+
isExact: l,
|
|
132
|
+
isDisabled: y,
|
|
133
|
+
onPress: f,
|
|
134
134
|
uniqueId: r,
|
|
135
|
-
...
|
|
136
|
-
},
|
|
137
|
-
const k =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}, [
|
|
141
|
-
const
|
|
142
|
-
isSelected:
|
|
143
|
-
taskStatus:
|
|
144
|
-
}),
|
|
135
|
+
...c
|
|
136
|
+
}, g) => {
|
|
137
|
+
const k = F(), u = P(), { currentTask: b, setCurrentTask: m, state: h } = A();
|
|
138
|
+
j(() => {
|
|
139
|
+
t && u?.isActive(t.toString(), l) && m?.({ uniqueId: r, label: o });
|
|
140
|
+
}, [t, l, u, r, o]);
|
|
141
|
+
const s = b?.uniqueId === r, { base: v, element: S, text: x, dot: N, lock: M } = V({
|
|
142
|
+
isSelected: s,
|
|
143
|
+
taskStatus: n
|
|
144
|
+
}), T = Object.assign(
|
|
145
145
|
{},
|
|
146
|
-
|
|
147
|
-
"data-current":
|
|
148
|
-
"aria-current":
|
|
146
|
+
s !== void 0 && {
|
|
147
|
+
"data-current": s,
|
|
148
|
+
"aria-current": s ? "page" : void 0
|
|
149
149
|
}
|
|
150
|
-
),
|
|
151
|
-
return /* @__PURE__ */
|
|
150
|
+
), w = t ? z : E;
|
|
151
|
+
return /* @__PURE__ */ a(
|
|
152
152
|
"li",
|
|
153
153
|
{
|
|
154
|
-
ref:
|
|
154
|
+
ref: g,
|
|
155
155
|
className: v(),
|
|
156
|
-
...
|
|
157
|
-
...
|
|
156
|
+
...s ? { "data-current": !0 } : {},
|
|
157
|
+
...c,
|
|
158
158
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
159
|
+
/* @__PURE__ */ e(D, { width: 8, height: 8, className: N(), role: "presentation" }),
|
|
160
|
+
/* @__PURE__ */ a(
|
|
161
|
+
w,
|
|
162
162
|
{
|
|
163
|
-
className:
|
|
164
|
-
href:
|
|
165
|
-
onPress: (
|
|
166
|
-
|
|
163
|
+
className: S(),
|
|
164
|
+
href: t,
|
|
165
|
+
onPress: (C) => {
|
|
166
|
+
m?.({ uniqueId: r, label: o }), h?.toggle(), f?.(C);
|
|
167
167
|
},
|
|
168
|
-
isDisabled:
|
|
169
|
-
...
|
|
170
|
-
...
|
|
168
|
+
isDisabled: y,
|
|
169
|
+
...T,
|
|
170
|
+
...c,
|
|
171
171
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
R,
|
|
174
174
|
{
|
|
175
175
|
asElement: "span",
|
|
176
|
-
className:
|
|
177
|
-
variant:
|
|
178
|
-
children:
|
|
176
|
+
className: x(),
|
|
177
|
+
variant: s ? "bodyStrong" : "body",
|
|
178
|
+
children: o
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
|
|
182
|
-
locked:
|
|
181
|
+
B(n, k, {
|
|
182
|
+
locked: M(),
|
|
183
183
|
completed: "uy:self-center"
|
|
184
184
|
})
|
|
185
185
|
]
|
|
@@ -190,8 +190,8 @@ const J = E({
|
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
|
-
|
|
193
|
+
G.displayName = "SubTask";
|
|
194
194
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
G as SubTask,
|
|
196
|
+
V as subTask
|
|
197
197
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { Text as
|
|
9
|
-
import { useTaskMenuContext as
|
|
10
|
-
import { commonTask as
|
|
11
|
-
const
|
|
12
|
-
extend:
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as G, useEffect as P } from "react";
|
|
3
|
+
import { uyTv as R } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as w, Button as z } from "react-aria-components";
|
|
5
|
+
import { useIntl as A, FormattedMessage as g } from "react-intl";
|
|
6
|
+
import { useRouter as B } from "../../../providers/router/RouterProvider.js";
|
|
7
|
+
import { Icon as y } from "../../icon/Icon.js";
|
|
8
|
+
import { Text as k } from "../../text/Text.js";
|
|
9
|
+
import { useTaskMenuContext as V } from "../TaskMenu.context.js";
|
|
10
|
+
import { commonTask as D } from "./task.variants.js";
|
|
11
|
+
const H = R({
|
|
12
|
+
extend: D,
|
|
13
13
|
slots: {
|
|
14
14
|
base: [],
|
|
15
15
|
element: ["uy:p-200", "uy:md:p-0"],
|
|
@@ -55,103 +55,103 @@ const I = A({
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
|
-
}),
|
|
58
|
+
}), I = G(
|
|
59
59
|
({
|
|
60
|
-
href:
|
|
61
|
-
isExact:
|
|
62
|
-
label:
|
|
63
|
-
onPress:
|
|
64
|
-
taskNumber:
|
|
65
|
-
taskStatus:
|
|
66
|
-
children:
|
|
67
|
-
uniqueId:
|
|
68
|
-
...
|
|
69
|
-
},
|
|
70
|
-
const
|
|
71
|
-
currentTask:
|
|
72
|
-
setCurrentTask:
|
|
73
|
-
state:
|
|
74
|
-
expandedTaskGroup:
|
|
75
|
-
toggleTaskGroup:
|
|
76
|
-
} =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
const
|
|
60
|
+
href: s,
|
|
61
|
+
isExact: l = !1,
|
|
62
|
+
label: a,
|
|
63
|
+
onPress: f,
|
|
64
|
+
taskNumber: b,
|
|
65
|
+
taskStatus: o = "uncompleted",
|
|
66
|
+
children: h,
|
|
67
|
+
uniqueId: n,
|
|
68
|
+
...u
|
|
69
|
+
}, v) => {
|
|
70
|
+
const c = B(), m = A(), {
|
|
71
|
+
currentTask: x,
|
|
72
|
+
setCurrentTask: d,
|
|
73
|
+
state: N,
|
|
74
|
+
expandedTaskGroup: i,
|
|
75
|
+
toggleTaskGroup: T
|
|
76
|
+
} = V(), S = s ? w : z;
|
|
77
|
+
P(() => {
|
|
78
|
+
s && c?.isActive(s.toString(), l) && d?.({ uniqueId: n, label: a });
|
|
79
|
+
}, [s, l, c, a, n]);
|
|
80
|
+
const t = x?.uniqueId === n, M = Object.assign(
|
|
81
81
|
{},
|
|
82
|
-
|
|
83
|
-
"data-current":
|
|
84
|
-
"aria-current":
|
|
82
|
+
t !== void 0 && {
|
|
83
|
+
"data-current": t,
|
|
84
|
+
"aria-current": t ? "page" : void 0
|
|
85
85
|
}
|
|
86
|
-
), { base:
|
|
87
|
-
isSelected:
|
|
88
|
-
taskStatus:
|
|
86
|
+
), { base: C, number: L, element: j, text: E, lock: O } = H({
|
|
87
|
+
isSelected: t,
|
|
88
|
+
taskStatus: o
|
|
89
89
|
});
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
90
|
+
return /* @__PURE__ */ r("li", { ref: v, className: C(), ...u, children: [
|
|
91
|
+
/* @__PURE__ */ r(
|
|
92
|
+
S,
|
|
93
93
|
{
|
|
94
|
-
className:
|
|
95
|
-
href:
|
|
96
|
-
onPress: (
|
|
97
|
-
|
|
94
|
+
className: j(),
|
|
95
|
+
href: s,
|
|
96
|
+
onPress: (F) => {
|
|
97
|
+
d?.({ uniqueId: n, label: a }), N?.toggle(), i && T?.(i), f?.(F);
|
|
98
98
|
},
|
|
99
|
-
...
|
|
100
|
-
...
|
|
99
|
+
...M,
|
|
100
|
+
...u,
|
|
101
101
|
children: [
|
|
102
|
-
/* @__PURE__ */ e("div", { className:
|
|
102
|
+
/* @__PURE__ */ e("div", { className: L(), children: o === "completed" ? /* @__PURE__ */ r(p, { children: [
|
|
103
103
|
/* @__PURE__ */ e(
|
|
104
|
-
|
|
104
|
+
y,
|
|
105
105
|
{
|
|
106
106
|
size: 24,
|
|
107
107
|
"aria-hidden": "true",
|
|
108
108
|
src: "CheckOutlined",
|
|
109
|
-
alt:
|
|
109
|
+
alt: m.formatMessage({
|
|
110
110
|
id: "unity:component:task-menu:task:completed:label",
|
|
111
111
|
defaultMessage: "Completed"
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
115
|
/* @__PURE__ */ e("span", { className: "uy:sr-only", children: /* @__PURE__ */ e(
|
|
116
|
-
|
|
116
|
+
g,
|
|
117
117
|
{
|
|
118
118
|
id: "unity:component:task-menu:task:completed:label",
|
|
119
119
|
defaultMessage: "Completed"
|
|
120
120
|
}
|
|
121
121
|
) })
|
|
122
122
|
] }) : /* @__PURE__ */ e(
|
|
123
|
-
|
|
123
|
+
k,
|
|
124
124
|
{
|
|
125
125
|
asElement: "span",
|
|
126
|
-
variant:
|
|
126
|
+
variant: t ? "bodyStrong" : "body",
|
|
127
127
|
className: "uy:leading-[1]",
|
|
128
|
-
children:
|
|
128
|
+
children: b
|
|
129
129
|
}
|
|
130
130
|
) }),
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
|
-
|
|
132
|
+
k,
|
|
133
133
|
{
|
|
134
134
|
asElement: "span",
|
|
135
|
-
className:
|
|
136
|
-
variant:
|
|
137
|
-
children:
|
|
135
|
+
className: E(),
|
|
136
|
+
variant: t ? "bodyStrong" : "body",
|
|
137
|
+
children: a
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
|
|
140
|
+
o === "locked" && /* @__PURE__ */ r(p, { children: [
|
|
141
141
|
/* @__PURE__ */ e(
|
|
142
|
-
|
|
142
|
+
y,
|
|
143
143
|
{
|
|
144
144
|
"aria-hidden": "true",
|
|
145
|
-
className:
|
|
145
|
+
className: O(),
|
|
146
146
|
src: "LockOutlined",
|
|
147
|
-
alt:
|
|
147
|
+
alt: m.formatMessage({
|
|
148
148
|
id: "unity:component:task-menu:task:lock:label",
|
|
149
149
|
defaultMessage: "Locked"
|
|
150
150
|
})
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
153
|
/* @__PURE__ */ e("span", { className: "uy:sr-only", children: /* @__PURE__ */ e(
|
|
154
|
-
|
|
154
|
+
g,
|
|
155
155
|
{
|
|
156
156
|
id: "unity:component:task-menu:task:lock:label",
|
|
157
157
|
defaultMessage: "Locked"
|
|
@@ -161,12 +161,12 @@ const I = A({
|
|
|
161
161
|
]
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
|
-
|
|
164
|
+
h
|
|
165
165
|
] });
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
|
-
|
|
168
|
+
I.displayName = "Task";
|
|
169
169
|
export {
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
I as Task,
|
|
171
|
+
H as task
|
|
172
172
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as j, Children as
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as j, Children as i, isValidElement as u, cloneElement as A } from "react";
|
|
3
3
|
import { uyTv as V } from "@payfit/unity-themes";
|
|
4
4
|
import { useId as $ } from "react-aria";
|
|
5
5
|
import { Button as B } from "react-aria-components";
|
|
6
6
|
import { useIntl as D } from "react-intl";
|
|
7
7
|
import { Icon as F } from "../../icon/Icon.js";
|
|
8
|
-
import { Text as
|
|
8
|
+
import { Text as f } from "../../text/Text.js";
|
|
9
9
|
import { useTaskMenuContext as H } from "../TaskMenu.context.js";
|
|
10
10
|
import { commonTask as O } from "./task.variants.js";
|
|
11
11
|
const P = V({
|
|
@@ -71,56 +71,56 @@ const P = V({
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
]
|
|
74
|
-
}), R = (e, t) => e ?
|
|
75
|
-
(
|
|
76
|
-
) : !1, U = (e) => e ?
|
|
74
|
+
}), R = (e, t) => e ? i.toArray(t).some(
|
|
75
|
+
(s) => u(s) && s.props.uniqueId === e
|
|
76
|
+
) : !1, U = (e) => e ? i.toArray(e).find(
|
|
77
77
|
(t) => u(t) && t.props.taskStatus !== "completed" && t.props.taskStatus !== "locked"
|
|
78
78
|
) : null, J = j(
|
|
79
79
|
({
|
|
80
80
|
children: e,
|
|
81
81
|
label: t,
|
|
82
|
-
taskNumber:
|
|
83
|
-
taskStatus:
|
|
84
|
-
uniqueId:
|
|
85
|
-
...
|
|
86
|
-
},
|
|
87
|
-
const { currentTask:
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
if (u(
|
|
91
|
-
const { uniqueId: M, label: W } =
|
|
92
|
-
|
|
82
|
+
taskNumber: s,
|
|
83
|
+
taskStatus: m = "uncompleted",
|
|
84
|
+
uniqueId: c,
|
|
85
|
+
...g
|
|
86
|
+
}, k) => {
|
|
87
|
+
const { currentTask: v, setCurrentTask: x, toggleTaskGroup: S, expandedTaskGroup: h } = H(), d = $(), T = D(), a = h === c, N = (n) => {
|
|
88
|
+
if (S?.(c), !n) {
|
|
89
|
+
const b = U(e);
|
|
90
|
+
if (u(b)) {
|
|
91
|
+
const { uniqueId: M, label: W } = b.props;
|
|
92
|
+
x?.({ uniqueId: M, label: W });
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
}, I =
|
|
96
|
-
|
|
95
|
+
}, I = i.map(e, (n) => u(n) ? A(n, { isDisabled: !a }) : n), p = `${d}-toggle`, y = `${d}-content`, o = R(
|
|
96
|
+
v?.uniqueId,
|
|
97
97
|
e
|
|
98
|
-
), { base: w, number:
|
|
99
|
-
taskStatus:
|
|
100
|
-
hasSelectedSubTask:
|
|
98
|
+
), { base: w, number: C, text: E, bar: G, element: z, containerSubTasks: q } = P({
|
|
99
|
+
taskStatus: m,
|
|
100
|
+
hasSelectedSubTask: o,
|
|
101
101
|
expanded: a
|
|
102
102
|
});
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ l(
|
|
104
104
|
"li",
|
|
105
105
|
{
|
|
106
|
-
ref:
|
|
106
|
+
ref: k,
|
|
107
107
|
"data-group": "true",
|
|
108
|
-
"data-active-group":
|
|
108
|
+
"data-active-group": o,
|
|
109
109
|
className: w(),
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ l(
|
|
112
112
|
B,
|
|
113
113
|
{
|
|
114
|
-
id:
|
|
115
|
-
className:
|
|
114
|
+
id: p,
|
|
115
|
+
className: z(),
|
|
116
116
|
onPress: () => {
|
|
117
117
|
N(a);
|
|
118
118
|
},
|
|
119
119
|
"aria-expanded": a,
|
|
120
|
-
"aria-controls":
|
|
121
|
-
...
|
|
120
|
+
"aria-controls": y,
|
|
121
|
+
...g,
|
|
122
122
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ r("div", { className: C(), children: m === "completed" ? /* @__PURE__ */ r(
|
|
124
124
|
F,
|
|
125
125
|
{
|
|
126
126
|
size: 24,
|
|
@@ -130,39 +130,39 @@ const P = V({
|
|
|
130
130
|
defaultMessage: "Completed"
|
|
131
131
|
})
|
|
132
132
|
}
|
|
133
|
-
) : /* @__PURE__ */
|
|
134
|
-
|
|
133
|
+
) : /* @__PURE__ */ r(
|
|
134
|
+
f,
|
|
135
135
|
{
|
|
136
136
|
asElement: "span",
|
|
137
|
-
variant:
|
|
137
|
+
variant: o ? "bodyStrong" : "body",
|
|
138
138
|
className: "uy:leading-[1]",
|
|
139
|
-
children:
|
|
139
|
+
children: s
|
|
140
140
|
}
|
|
141
141
|
) }),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
/* @__PURE__ */ r(
|
|
143
|
+
f,
|
|
144
144
|
{
|
|
145
145
|
asElement: "span",
|
|
146
|
-
className:
|
|
147
|
-
variant:
|
|
146
|
+
className: E(),
|
|
147
|
+
variant: o ? "bodyStrong" : "body",
|
|
148
148
|
children: t
|
|
149
149
|
}
|
|
150
150
|
)
|
|
151
151
|
]
|
|
152
152
|
}
|
|
153
153
|
),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ l("div", { style: { maxHeight: a ? 1e3 : 0 }, children: [
|
|
155
|
+
/* @__PURE__ */ r(
|
|
156
156
|
"ol",
|
|
157
157
|
{
|
|
158
|
-
id:
|
|
159
|
-
"aria-labelledby":
|
|
158
|
+
id: y,
|
|
159
|
+
"aria-labelledby": p,
|
|
160
160
|
"aria-hidden": !a,
|
|
161
|
-
className:
|
|
161
|
+
className: q(),
|
|
162
162
|
children: I
|
|
163
163
|
}
|
|
164
164
|
),
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ r("div", { role: "presentation", className: G() })
|
|
166
166
|
] })
|
|
167
167
|
]
|
|
168
168
|
}
|