@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,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { memo as x, forwardRef as g } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Actionable as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
const
|
|
3
|
+
import { uyTv as w } from "@payfit/unity-themes";
|
|
4
|
+
import { Actionable as C } from "../../actionable/Actionable.js";
|
|
5
|
+
import { useTableContext as T } from "../Table.context.js";
|
|
6
|
+
const d = w({
|
|
7
7
|
base: [
|
|
8
8
|
"uy:align-middle uy:leading-[1.00]",
|
|
9
9
|
"uy:px-200 uy:py-100 uy:typography-action uy:text-content-neutral",
|
|
@@ -17,62 +17,62 @@ const c = C({
|
|
|
17
17
|
right: "uy:text-right"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
}),
|
|
20
|
+
}), D = x(
|
|
21
21
|
g(
|
|
22
22
|
({
|
|
23
|
-
children:
|
|
24
|
-
colIndex:
|
|
25
|
-
rowIndex:
|
|
26
|
-
align:
|
|
27
|
-
onKeyDown:
|
|
28
|
-
onFocus:
|
|
29
|
-
className:
|
|
30
|
-
isFocusable:
|
|
31
|
-
...
|
|
32
|
-
},
|
|
33
|
-
const { keyboardNavigation: b } =
|
|
34
|
-
e.key !== "Tab" && (v(e),
|
|
23
|
+
children: r,
|
|
24
|
+
colIndex: t = 0,
|
|
25
|
+
rowIndex: m = 0,
|
|
26
|
+
align: l,
|
|
27
|
+
onKeyDown: f,
|
|
28
|
+
onFocus: i,
|
|
29
|
+
className: u,
|
|
30
|
+
isFocusable: o = !0,
|
|
31
|
+
...a
|
|
32
|
+
}, s) => {
|
|
33
|
+
const { keyboardNavigation: b } = T(), { isCellFocused: h, handleCellKeyDown: v, handleCellFocus: c } = b, p = o && h(m, t), y = (e) => {
|
|
34
|
+
e.key !== "Tab" && (v(e), f?.(
|
|
35
35
|
e
|
|
36
36
|
));
|
|
37
37
|
};
|
|
38
|
-
return "onPress" in
|
|
38
|
+
return "onPress" in a ? /* @__PURE__ */ n(
|
|
39
39
|
"th",
|
|
40
40
|
{
|
|
41
|
-
ref:
|
|
41
|
+
ref: s,
|
|
42
42
|
role: "columnheader",
|
|
43
|
-
"aria-colindex":
|
|
44
|
-
"data-focusable":
|
|
45
|
-
className:
|
|
43
|
+
"aria-colindex": t + 1,
|
|
44
|
+
"data-focusable": o,
|
|
45
|
+
className: d({ align: l, className: u }),
|
|
46
46
|
"data-dd-privacy": "allow",
|
|
47
|
-
onKeyDown:
|
|
47
|
+
onKeyDown: y,
|
|
48
48
|
onFocus: (e) => {
|
|
49
|
-
|
|
49
|
+
c(e), i?.(e);
|
|
50
50
|
},
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ n(C, { ...a, children: r })
|
|
52
52
|
}
|
|
53
|
-
) : /* @__PURE__ */
|
|
53
|
+
) : /* @__PURE__ */ n(
|
|
54
54
|
"th",
|
|
55
55
|
{
|
|
56
|
-
ref:
|
|
56
|
+
ref: s,
|
|
57
57
|
role: "columnheader",
|
|
58
|
-
"aria-colindex":
|
|
58
|
+
"aria-colindex": t + 1,
|
|
59
59
|
tabIndex: p ? 0 : -1,
|
|
60
|
-
"data-focusable":
|
|
61
|
-
className:
|
|
62
|
-
onKeyDown:
|
|
60
|
+
"data-focusable": o,
|
|
61
|
+
className: d({ align: l, className: u }),
|
|
62
|
+
onKeyDown: y,
|
|
63
63
|
onFocus: (e) => {
|
|
64
|
-
|
|
64
|
+
c(e), i?.(e);
|
|
65
65
|
},
|
|
66
66
|
"data-dd-privacy": "allow",
|
|
67
|
-
...
|
|
68
|
-
children:
|
|
67
|
+
...a,
|
|
68
|
+
children: r
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
)
|
|
73
73
|
);
|
|
74
|
-
|
|
74
|
+
D.displayName = "TableColumnHeader";
|
|
75
75
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
D as TableColumnHeader,
|
|
77
|
+
d as tableColumnHeader
|
|
78
78
|
};
|
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I, useState as j } from "react";
|
|
3
|
+
import { uyTv as C } from "@payfit/unity-themes";
|
|
4
4
|
import { useId as L } from "react-aria";
|
|
5
5
|
import { useIntl as T } from "react-intl";
|
|
6
6
|
import { Pagination as O } from "../../pagination/Pagination.js";
|
|
7
7
|
import { SelectOption as R } from "../../select/parts/SelectOption.js";
|
|
8
|
-
import { Select as
|
|
9
|
-
const
|
|
8
|
+
import { Select as E } from "../../select/Select.js";
|
|
9
|
+
const _ = C({
|
|
10
10
|
base: [
|
|
11
11
|
"uy:bg-surface-neutral-lowest",
|
|
12
12
|
"uy:sticky uy:bottom-0",
|
|
13
13
|
"uy:grid uy:grid-cols-3 uy:items-center",
|
|
14
14
|
"uy:ps-200 uy:py-100 uy:pe-100"
|
|
15
15
|
]
|
|
16
|
-
}),
|
|
16
|
+
}), k = [
|
|
17
17
|
{ value: "10", label: "10" },
|
|
18
18
|
{ value: "50", label: "50" },
|
|
19
19
|
{ value: "100", label: "100" },
|
|
20
20
|
{ value: "200", label: "200" }
|
|
21
|
-
],
|
|
22
|
-
(
|
|
21
|
+
], A = I(
|
|
22
|
+
(b, y) => {
|
|
23
23
|
const {
|
|
24
|
-
pageCount:
|
|
25
|
-
rowCount:
|
|
26
|
-
currentPage:
|
|
27
|
-
rowsPerPage:
|
|
28
|
-
defaultPage:
|
|
29
|
-
pageSizeOptions:
|
|
30
|
-
defaultPageSize:
|
|
31
|
-
onPageChange:
|
|
32
|
-
onNextPress:
|
|
33
|
-
onPreviousPress:
|
|
34
|
-
onPageSizeChange:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
pageCount: i,
|
|
25
|
+
rowCount: n,
|
|
26
|
+
currentPage: r,
|
|
27
|
+
rowsPerPage: s = 10,
|
|
28
|
+
defaultPage: u,
|
|
29
|
+
pageSizeOptions: f = k,
|
|
30
|
+
defaultPageSize: h = s,
|
|
31
|
+
onPageChange: P,
|
|
32
|
+
onNextPress: v,
|
|
33
|
+
onPreviousPress: N,
|
|
34
|
+
onPageSizeChange: z,
|
|
35
|
+
onPageHover: S,
|
|
36
|
+
itemLabel: g = "unity:component:table:pagination:item",
|
|
37
|
+
...w
|
|
38
|
+
} = b, a = L(), t = T(), [M, $] = j(h), x = {
|
|
39
|
+
pageCount: i,
|
|
40
|
+
defaultPage: u,
|
|
41
|
+
currentPage: r,
|
|
42
|
+
onPageChange: P,
|
|
43
|
+
onNextPress: v,
|
|
44
|
+
onPreviousPress: N,
|
|
45
|
+
onPageHover: S
|
|
46
|
+
}, o = Math.max(((r ?? u ?? 1) - 1) * s + 1, 1), p = Math.min(o + s - 1, n), c = {
|
|
47
|
+
singular: t.formatMessage(
|
|
46
48
|
{
|
|
47
|
-
id:
|
|
49
|
+
id: g,
|
|
48
50
|
defaultMessage: "items"
|
|
49
51
|
},
|
|
50
52
|
{ count: 1 }
|
|
51
53
|
),
|
|
52
|
-
plural:
|
|
54
|
+
plural: t.formatMessage(
|
|
53
55
|
{
|
|
54
|
-
id:
|
|
56
|
+
id: g,
|
|
55
57
|
defaultMessage: "items"
|
|
56
58
|
},
|
|
57
59
|
{ count: 2 }
|
|
58
60
|
)
|
|
59
61
|
};
|
|
60
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ d(
|
|
61
63
|
"div",
|
|
62
64
|
{
|
|
63
65
|
"data-dd-privacy": "allow",
|
|
64
|
-
...
|
|
65
|
-
ref:
|
|
66
|
-
className:
|
|
66
|
+
...w,
|
|
67
|
+
ref: y,
|
|
68
|
+
className: _(),
|
|
67
69
|
"data-unity-slot": "table-pagination",
|
|
68
70
|
children: [
|
|
69
71
|
/* @__PURE__ */ e("div", { className: "uy:justify-self-start", children: /* @__PURE__ */ e(
|
|
@@ -71,59 +73,59 @@ const E = j({
|
|
|
71
73
|
{
|
|
72
74
|
id: `table-pagination-${a}-label`,
|
|
73
75
|
className: "uy:typography-body uy:text-content-neutral",
|
|
74
|
-
children:
|
|
76
|
+
children: t.formatMessage(
|
|
75
77
|
{
|
|
76
78
|
id: "unity:component:table:pagination:label",
|
|
77
|
-
defaultMessage: `${
|
|
79
|
+
defaultMessage: `${o}-${p} out of ${n} items`
|
|
78
80
|
},
|
|
79
81
|
{
|
|
80
|
-
pageCount:
|
|
81
|
-
startRow:
|
|
82
|
-
endRow:
|
|
83
|
-
totalRows:
|
|
84
|
-
itemLabel:
|
|
82
|
+
pageCount: i,
|
|
83
|
+
startRow: o,
|
|
84
|
+
endRow: p,
|
|
85
|
+
totalRows: n,
|
|
86
|
+
itemLabel: c.plural
|
|
85
87
|
}
|
|
86
88
|
)
|
|
87
89
|
}
|
|
88
90
|
) }),
|
|
89
|
-
/* @__PURE__ */ e("div", { className: "uy:justify-self-center", children:
|
|
91
|
+
/* @__PURE__ */ e("div", { className: "uy:justify-self-center", children: i > 1 && /* @__PURE__ */ e(
|
|
90
92
|
O,
|
|
91
93
|
{
|
|
92
|
-
...
|
|
94
|
+
...x,
|
|
93
95
|
"aria-labelledby": `table-pagination-${a}-label`
|
|
94
96
|
}
|
|
95
97
|
) }),
|
|
96
|
-
/* @__PURE__ */ e("div", { className: "uy:justify-self-end", children: /* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ e("div", { className: "uy:justify-self-end", children: /* @__PURE__ */ d("form", { className: "uy:flex uy:gap-100 uy:items-center", children: [
|
|
97
99
|
/* @__PURE__ */ e(
|
|
98
100
|
"label",
|
|
99
101
|
{
|
|
100
102
|
className: "uy:shrink-0",
|
|
101
103
|
id: `table-pagination-${a}-pagesize-label`,
|
|
102
104
|
htmlFor: `table-pagination-${a}-pagesize-select`,
|
|
103
|
-
children:
|
|
105
|
+
children: t.formatMessage(
|
|
104
106
|
{
|
|
105
107
|
id: "unity:component:table:pagination:page-size-control-label",
|
|
106
108
|
defaultMessage: "Items per page"
|
|
107
109
|
},
|
|
108
110
|
{
|
|
109
|
-
itemLabel:
|
|
111
|
+
itemLabel: c.plural
|
|
110
112
|
}
|
|
111
113
|
)
|
|
112
114
|
}
|
|
113
115
|
),
|
|
114
116
|
/* @__PURE__ */ e("div", { className: "uy:grow-0 uy:w-1000", children: /* @__PURE__ */ e(
|
|
115
|
-
|
|
117
|
+
E,
|
|
116
118
|
{
|
|
117
119
|
id: `table-pagination-${a}-pagesize-select`,
|
|
118
|
-
items:
|
|
120
|
+
items: f,
|
|
119
121
|
placeholder: "",
|
|
120
|
-
value: `${
|
|
121
|
-
onChange: (
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
value: `${M}`,
|
|
123
|
+
onChange: (l) => {
|
|
124
|
+
const m = parseInt(l, 10);
|
|
125
|
+
z?.(m), $(m);
|
|
124
126
|
},
|
|
125
127
|
"aria-labelledby": `table-pagination-${a}-pagesize-label`,
|
|
126
|
-
children: (
|
|
128
|
+
children: (l) => /* @__PURE__ */ e(R, { id: l.value, children: l.label })
|
|
127
129
|
}
|
|
128
130
|
) })
|
|
129
131
|
] }) })
|
|
@@ -132,8 +134,8 @@ const E = j({
|
|
|
132
134
|
);
|
|
133
135
|
}
|
|
134
136
|
);
|
|
135
|
-
|
|
137
|
+
A.displayName = "TablePagination";
|
|
136
138
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
A as TablePagination,
|
|
140
|
+
_ as tablePagination
|
|
139
141
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import d, { memo as y, forwardRef as c, useMemo as f, Children as m, cloneElement as p } from "react";
|
|
3
3
|
import { uyTv as v } from "@payfit/unity-themes";
|
|
4
|
-
const
|
|
4
|
+
const w = v({
|
|
5
5
|
base: [
|
|
6
6
|
"uy:group uy:h-500",
|
|
7
7
|
"uy:bg-surface-neutral uy:border-b uy:border-solid uy:border-b-border-neutral-enabled",
|
|
@@ -10,30 +10,30 @@ const g = v({
|
|
|
10
10
|
"uy:aria-[selected=true]:bg-surface-neutral-selected uy:aria-[selected=true]:border-b-border-neutral-selected",
|
|
11
11
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-offset-[-2px] uy:focus-visible:outline-utility-focus-ring"
|
|
12
12
|
]
|
|
13
|
-
}),
|
|
14
|
-
|
|
15
|
-
({ children: o, className:
|
|
16
|
-
const i = f(() => m.map(o, (e,
|
|
13
|
+
}), g = y(
|
|
14
|
+
c(
|
|
15
|
+
({ children: o, className: t, rowIndex: r = 0, onKeyDown: a, isSelected: u, ...s }, l) => {
|
|
16
|
+
const i = f(() => m.map(o, (e, n) => d.isValidElement(e) ? p(
|
|
17
17
|
e,
|
|
18
18
|
{
|
|
19
19
|
rowIndex: r,
|
|
20
|
-
colIndex:
|
|
20
|
+
colIndex: n,
|
|
21
21
|
...e.props
|
|
22
22
|
}
|
|
23
23
|
) : e), [o, r]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ b(
|
|
25
25
|
"tr",
|
|
26
26
|
{
|
|
27
27
|
ref: l,
|
|
28
28
|
role: "row",
|
|
29
|
-
className:
|
|
29
|
+
className: w({ className: t }),
|
|
30
30
|
"aria-rowindex": r + 1,
|
|
31
|
-
"aria-selected":
|
|
31
|
+
"aria-selected": u,
|
|
32
32
|
onKeyDown: (e) => {
|
|
33
|
-
|
|
33
|
+
a?.(e);
|
|
34
34
|
},
|
|
35
35
|
"data-dd-privacy": "mask",
|
|
36
|
-
"data-selectable":
|
|
36
|
+
"data-selectable": u !== void 0,
|
|
37
37
|
...s,
|
|
38
38
|
children: i
|
|
39
39
|
}
|
|
@@ -41,8 +41,8 @@ const g = v({
|
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
);
|
|
44
|
-
|
|
44
|
+
g.displayName = "TableRow";
|
|
45
45
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
g as TableRow,
|
|
47
|
+
w as tableRow
|
|
48
48
|
};
|
|
@@ -1,87 +1,83 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { TabList as
|
|
4
|
-
import { useResizeObserver as
|
|
5
|
-
import { useTabsContext as
|
|
6
|
-
import { tabsVariant as
|
|
7
|
-
import { NavigationButton as
|
|
8
|
-
const
|
|
9
|
-
({ children:
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
const { scrollLeft:
|
|
13
|
-
|
|
1
|
+
import { jsxs as A, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useRef as B, useState as d, useCallback as j } from "react";
|
|
3
|
+
import { TabList as L } from "react-aria-components";
|
|
4
|
+
import { useResizeObserver as q } from "usehooks-ts";
|
|
5
|
+
import { useTabsContext as w } from "../Tabs.context.js";
|
|
6
|
+
import { tabsVariant as z } from "../Tabs.variant.js";
|
|
7
|
+
import { NavigationButton as g } from "./NavigationButton.js";
|
|
8
|
+
const P = C(
|
|
9
|
+
({ children: i }, f) => {
|
|
10
|
+
const t = B(null), [p, S] = d(!1), [R, v] = d(!1), { variant: y, scrollable: u } = w(), { tabList: b, scroller: W } = z({ variant: y, scrollable: u }), m = j(() => {
|
|
11
|
+
if (!t.current) return;
|
|
12
|
+
const { scrollLeft: r, scrollWidth: s, clientWidth: e } = t.current;
|
|
13
|
+
S(r > 0), v(r + e < s);
|
|
14
14
|
}, []);
|
|
15
|
-
|
|
16
|
-
ref:
|
|
17
|
-
onResize:
|
|
15
|
+
q({
|
|
16
|
+
ref: t,
|
|
17
|
+
onResize: m
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const { scrollLeft: s } = r.current, e = Array.from(t);
|
|
19
|
+
const N = (r) => {
|
|
20
|
+
m();
|
|
21
|
+
}, T = () => {
|
|
22
|
+
const r = t.current?.querySelectorAll("[role=tab]");
|
|
23
|
+
if (!t.current || !r) return 0;
|
|
24
|
+
const { scrollLeft: s } = t.current, e = Array.from(r);
|
|
26
25
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
return -
|
|
26
|
+
const l = e[o];
|
|
27
|
+
if (l.offsetLeft < s)
|
|
28
|
+
return -l.offsetWidth;
|
|
30
29
|
}
|
|
31
30
|
return 0;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return i.offsetWidth;
|
|
31
|
+
}, x = () => {
|
|
32
|
+
const r = t.current?.querySelectorAll("[role=tab]");
|
|
33
|
+
if (!t.current || !r) return 0;
|
|
34
|
+
const { scrollLeft: s, clientWidth: e } = t.current, o = Array.from(r), l = s + e;
|
|
35
|
+
for (let n = 0; n < o.length - 1; n++) {
|
|
36
|
+
const a = o[n], h = a.offsetLeft + a.offsetWidth;
|
|
37
|
+
if (h > l || h < l)
|
|
38
|
+
return a.offsetWidth;
|
|
41
39
|
}
|
|
42
40
|
return 0;
|
|
43
41
|
};
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
return u ? /* @__PURE__ */ A("div", { className: "uy:relative", children: [
|
|
43
|
+
p && /* @__PURE__ */ c(
|
|
44
|
+
g,
|
|
47
45
|
{
|
|
48
46
|
direction: "left",
|
|
49
47
|
onPress: () => {
|
|
50
|
-
|
|
51
|
-
(t = r.current) == null || t.scrollBy({
|
|
48
|
+
t.current?.scrollBy({
|
|
52
49
|
behavior: "smooth",
|
|
53
|
-
left:
|
|
50
|
+
left: T()
|
|
54
51
|
});
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
54
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ c(
|
|
59
56
|
"div",
|
|
60
57
|
{
|
|
61
|
-
ref:
|
|
58
|
+
ref: t,
|
|
62
59
|
"data-testid": "scrollable-tab-list",
|
|
63
|
-
className:
|
|
64
|
-
onScroll:
|
|
65
|
-
children: /* @__PURE__ */
|
|
60
|
+
className: W(),
|
|
61
|
+
onScroll: N,
|
|
62
|
+
children: /* @__PURE__ */ c(L, { ref: f, className: b(), children: i })
|
|
66
63
|
}
|
|
67
64
|
),
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
R && /* @__PURE__ */ c(
|
|
66
|
+
g,
|
|
70
67
|
{
|
|
71
68
|
direction: "right",
|
|
72
69
|
onPress: () => {
|
|
73
|
-
|
|
74
|
-
(t = r.current) == null || t.scrollBy({
|
|
70
|
+
t.current?.scrollBy({
|
|
75
71
|
behavior: "smooth",
|
|
76
|
-
left:
|
|
72
|
+
left: x()
|
|
77
73
|
});
|
|
78
74
|
}
|
|
79
75
|
}
|
|
80
76
|
)
|
|
81
|
-
] }) : /* @__PURE__ */
|
|
77
|
+
] }) : /* @__PURE__ */ c(L, { ref: f, className: b(), children: i });
|
|
82
78
|
}
|
|
83
79
|
);
|
|
84
|
-
|
|
80
|
+
P.displayName = "TabList";
|
|
85
81
|
export {
|
|
86
|
-
|
|
82
|
+
P as TabList
|
|
87
83
|
};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { uyTv as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
3
3
|
import { FocusScope as p, useOverlay as f, mergeProps as b } from "react-aria";
|
|
4
4
|
import { useBreakpointListener as i } from "../../../hooks/use-breakpoint-listener.js";
|
|
5
5
|
import { useTaskMenuContext as r } from "../TaskMenu.context.js";
|
|
6
|
-
const v =
|
|
6
|
+
const v = m({
|
|
7
7
|
base: [
|
|
8
8
|
"uy:flex uy:flex-col uy:mt-100",
|
|
9
9
|
"uy:flex uy:md:flex-col uy:md:gap-200 uy:md:list-none uy:md:mt-0",
|
|
10
10
|
"uy:focus-visible:outline-2 uy:focus-visible:outline uy:focus-visible:outline-offset-2 uy:focus-visible:outline-utility-focus-ring"
|
|
11
11
|
]
|
|
12
|
-
}), l = ({ children:
|
|
12
|
+
}), l = ({ children: e }) => {
|
|
13
13
|
const {
|
|
14
|
-
taskMenuContentId:
|
|
15
|
-
state:
|
|
16
|
-
overlayProps:
|
|
17
|
-
overlayRef:
|
|
18
|
-
} = r(), u = i(),
|
|
14
|
+
taskMenuContentId: o,
|
|
15
|
+
state: t,
|
|
16
|
+
overlayProps: a,
|
|
17
|
+
overlayRef: n
|
|
18
|
+
} = r(), u = i(), c = u === "xs" || u === "sm", { overlayProps: y } = f(
|
|
19
19
|
{
|
|
20
|
-
onClose: () =>
|
|
21
|
-
isOpen:
|
|
20
|
+
onClose: () => t?.close(),
|
|
21
|
+
isOpen: t?.isOpen,
|
|
22
22
|
isDismissable: !1
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
n
|
|
25
25
|
);
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ s(
|
|
27
27
|
"ol",
|
|
28
28
|
{
|
|
29
|
-
...b(
|
|
30
|
-
ref:
|
|
29
|
+
...b(y, a),
|
|
30
|
+
ref: n,
|
|
31
31
|
className: v(),
|
|
32
|
-
id:
|
|
33
|
-
...
|
|
34
|
-
children:
|
|
32
|
+
id: o,
|
|
33
|
+
...c && { "data-mobile-open": t?.isOpen },
|
|
34
|
+
children: e
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
|
-
}, d = ({ children:
|
|
38
|
-
const { state:
|
|
39
|
-
return !!
|
|
40
|
-
}, x = ({ children:
|
|
41
|
-
const
|
|
42
|
-
return
|
|
37
|
+
}, d = ({ children: e }) => {
|
|
38
|
+
const { state: o } = r();
|
|
39
|
+
return !!o?.isOpen && /* @__PURE__ */ s("div", { className: "uy:absolute uy:z-9 uy:top-full uy:inset-x-0 uy:h-[100dvh] uy:bg-surface-neutral", children: /* @__PURE__ */ s(p, { contain: !0, restoreFocus: !0, autoFocus: !0, children: /* @__PURE__ */ s(l, { children: e }) }) });
|
|
40
|
+
}, x = ({ children: e }) => {
|
|
41
|
+
const o = i();
|
|
42
|
+
return o === "xs" || o === "sm" ? /* @__PURE__ */ s(d, { children: e }) : /* @__PURE__ */ s(l, { children: e });
|
|
43
43
|
};
|
|
44
44
|
x.displayName = "TaskMenuContent";
|
|
45
45
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
1
|
+
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { uyTv as m } from "@payfit/unity-themes";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { IconButton as
|
|
3
|
+
import { useIntl as c } from "react-intl";
|
|
4
|
+
import { IconButton as p } from "../../icon-button/IconButton.js";
|
|
5
5
|
import { Text as f } from "../../text/Text.js";
|
|
6
6
|
import { useTaskMenuContext as y } from "../TaskMenu.context.js";
|
|
7
7
|
const h = m({
|
|
@@ -11,40 +11,40 @@ const h = m({
|
|
|
11
11
|
}
|
|
12
12
|
}), g = () => {
|
|
13
13
|
const {
|
|
14
|
-
currentTask:
|
|
15
|
-
taskMenuId:
|
|
16
|
-
taskMenuContentId:
|
|
14
|
+
currentTask: t,
|
|
15
|
+
taskMenuId: a,
|
|
16
|
+
taskMenuContentId: n,
|
|
17
17
|
state: e,
|
|
18
|
-
triggerProps:
|
|
19
|
-
triggerRef:
|
|
20
|
-
} = y(),
|
|
21
|
-
return /* @__PURE__ */ d("div", { className:
|
|
22
|
-
/* @__PURE__ */
|
|
18
|
+
triggerProps: r,
|
|
19
|
+
triggerRef: o
|
|
20
|
+
} = y(), i = c(), { header: l, headerSelectedTask: u } = h();
|
|
21
|
+
return /* @__PURE__ */ d("div", { className: l(), children: [
|
|
22
|
+
/* @__PURE__ */ s(
|
|
23
23
|
f,
|
|
24
24
|
{
|
|
25
25
|
asElement: "span",
|
|
26
26
|
className: u(),
|
|
27
|
-
"aria-describedby":
|
|
28
|
-
children:
|
|
27
|
+
"aria-describedby": a,
|
|
28
|
+
children: t?.label
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
/* @__PURE__ */ s(
|
|
32
|
+
p,
|
|
33
33
|
{
|
|
34
|
-
...
|
|
35
|
-
ref:
|
|
34
|
+
...r,
|
|
35
|
+
ref: o,
|
|
36
36
|
variant: "ghost",
|
|
37
37
|
color: "neutral",
|
|
38
|
-
icon: e
|
|
39
|
-
label:
|
|
40
|
-
id: e
|
|
41
|
-
defaultMessage: e
|
|
38
|
+
icon: e?.isOpen ? "CloseOutlined" : "ListOutlined",
|
|
39
|
+
label: i.formatMessage({
|
|
40
|
+
id: e?.isOpen ? "unity:component:task-menu:header:menu-close" : "unity:component:task-menu:header:menu-open",
|
|
41
|
+
defaultMessage: e?.isOpen ? "Close task menu" : "Open task menu"
|
|
42
42
|
}),
|
|
43
43
|
onClick: () => {
|
|
44
|
-
e
|
|
44
|
+
e?.toggle();
|
|
45
45
|
},
|
|
46
|
-
"aria-expanded": !!
|
|
47
|
-
"aria-controls":
|
|
46
|
+
"aria-expanded": !!e?.isOpen,
|
|
47
|
+
"aria-controls": n
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
] });
|