@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,170 +1,166 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useOverlayTriggerState as
|
|
7
|
-
import { usePagination as
|
|
8
|
-
import { PaginationEllipsis as
|
|
9
|
-
import { PaginationJumpDialog as
|
|
10
|
-
import { PaginationLink as
|
|
11
|
-
import { PaginationNavButton as
|
|
12
|
-
import { generatePaginationWithWindow as
|
|
13
|
-
const
|
|
1
|
+
import { jsxs as I, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x, useRef as M, useMemo as T } from "react";
|
|
3
|
+
import { uyTv as q } from "@payfit/unity-themes";
|
|
4
|
+
import { useId as E } from "react-aria";
|
|
5
|
+
import { useIntl as R } from "react-intl";
|
|
6
|
+
import { useOverlayTriggerState as W } from "react-stately";
|
|
7
|
+
import { usePagination as $ } from "./hooks/use-pagination.js";
|
|
8
|
+
import { PaginationEllipsis as j } from "./parts/PaginationEllipsis.js";
|
|
9
|
+
import { PaginationJumpDialog as J } from "./parts/PaginationJumpDialog.js";
|
|
10
|
+
import { PaginationLink as K } from "./parts/PaginationLink.js";
|
|
11
|
+
import { PaginationNavButton as y } from "./parts/PaginationNavButton.js";
|
|
12
|
+
import { generatePaginationWithWindow as O } from "./utils/pagination-window.js";
|
|
13
|
+
const S = q({
|
|
14
14
|
slots: {
|
|
15
15
|
base: "uy:flex uy:gap-100 uy:relative",
|
|
16
16
|
pagesList: "uy:flex uy:gap-100 uy:list-none uy:m-0 uy:p-0"
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
18
|
+
}), H = 7, _ = x(
|
|
19
19
|
({
|
|
20
|
-
pageCount:
|
|
21
|
-
defaultPage:
|
|
22
|
-
currentPage:
|
|
23
|
-
onPageHover:
|
|
24
|
-
onPageChange:
|
|
25
|
-
onNextPress:
|
|
26
|
-
onPreviousPress:
|
|
27
|
-
...
|
|
28
|
-
},
|
|
29
|
-
const
|
|
30
|
-
pageCount:
|
|
31
|
-
initialPage:
|
|
32
|
-
onPageChange:
|
|
33
|
-
isControlled:
|
|
34
|
-
}),
|
|
35
|
-
() =>
|
|
36
|
-
|
|
20
|
+
pageCount: t,
|
|
21
|
+
defaultPage: c,
|
|
22
|
+
currentPage: u,
|
|
23
|
+
onPageHover: b,
|
|
24
|
+
onPageChange: f,
|
|
25
|
+
onNextPress: P,
|
|
26
|
+
onPreviousPress: w,
|
|
27
|
+
...D
|
|
28
|
+
}, A) => {
|
|
29
|
+
const p = E(), l = R(), v = u !== void 0 && f !== void 0 && c === void 0, { currentPage: s, goToPage: i } = $({
|
|
30
|
+
pageCount: t,
|
|
31
|
+
initialPage: v ? u : c,
|
|
32
|
+
onPageChange: f,
|
|
33
|
+
isControlled: v
|
|
34
|
+
}), m = W({}), r = M(/* @__PURE__ */ new Map()), L = T(
|
|
35
|
+
() => O(
|
|
36
|
+
t,
|
|
37
37
|
s,
|
|
38
|
-
|
|
38
|
+
H
|
|
39
39
|
),
|
|
40
|
-
[
|
|
41
|
-
),
|
|
40
|
+
[t, s]
|
|
41
|
+
), h = new Intl.NumberFormat(l.locale, {
|
|
42
42
|
notation: "standard"
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
43
|
+
}), k = (e) => {
|
|
44
|
+
i(e), m.close(), requestAnimationFrame(() => {
|
|
45
|
+
const a = r.current.get(e);
|
|
46
|
+
a && a.focus();
|
|
47
47
|
});
|
|
48
|
-
},
|
|
49
|
-
switch (
|
|
48
|
+
}, d = (e, a) => {
|
|
49
|
+
switch (e.key) {
|
|
50
50
|
case "ArrowLeft":
|
|
51
51
|
case "ArrowUp":
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(t = r.current.get(e - 1)) == null || t.focus();
|
|
52
|
+
e.preventDefault(), a > 1 && (i(a - 1), requestAnimationFrame(() => {
|
|
53
|
+
r.current.get(a - 1)?.focus();
|
|
55
54
|
}));
|
|
56
55
|
break;
|
|
57
56
|
case "ArrowRight":
|
|
58
57
|
case "ArrowDown":
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(t = r.current.get(e + 1)) == null || t.focus();
|
|
58
|
+
e.preventDefault(), a < t && (i(a + 1), requestAnimationFrame(() => {
|
|
59
|
+
r.current.get(a + 1)?.focus();
|
|
62
60
|
}));
|
|
63
61
|
break;
|
|
64
62
|
case "Home":
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(t = r.current.get(1)) == null || t.focus();
|
|
63
|
+
e.preventDefault(), i(1), requestAnimationFrame(() => {
|
|
64
|
+
r.current.get(1)?.focus();
|
|
68
65
|
});
|
|
69
66
|
break;
|
|
70
67
|
case "End":
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(t = r.current.get(i)) == null || t.focus();
|
|
68
|
+
e.preventDefault(), i(t), requestAnimationFrame(() => {
|
|
69
|
+
r.current.get(t)?.focus();
|
|
74
70
|
});
|
|
75
71
|
break;
|
|
76
72
|
}
|
|
77
|
-
},
|
|
78
|
-
paginationLabel:
|
|
73
|
+
}, g = {
|
|
74
|
+
paginationLabel: l.formatMessage({
|
|
79
75
|
id: "unity:component:pagination:label",
|
|
80
76
|
defaultMessage: "Pagination"
|
|
81
77
|
}),
|
|
82
|
-
pageListLabel:
|
|
78
|
+
pageListLabel: l.formatMessage(
|
|
83
79
|
{
|
|
84
80
|
id: "unity:component:pagination:page-list:label",
|
|
85
81
|
defaultMessage: "Page {current} of {total}"
|
|
86
82
|
},
|
|
87
83
|
{
|
|
88
84
|
current: s,
|
|
89
|
-
total:
|
|
85
|
+
total: t
|
|
90
86
|
}
|
|
91
87
|
)
|
|
92
|
-
}, { base:
|
|
93
|
-
return /* @__PURE__ */
|
|
88
|
+
}, { base: N, pagesList: F } = S();
|
|
89
|
+
return /* @__PURE__ */ I(
|
|
94
90
|
"nav",
|
|
95
91
|
{
|
|
96
92
|
"data-dd-privacy": "allow",
|
|
97
|
-
...
|
|
98
|
-
ref:
|
|
99
|
-
className:
|
|
100
|
-
"aria-labelledby":
|
|
93
|
+
...D,
|
|
94
|
+
ref: A,
|
|
95
|
+
className: N(),
|
|
96
|
+
"aria-labelledby": g.paginationLabel,
|
|
101
97
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
98
|
+
/* @__PURE__ */ n(
|
|
99
|
+
J,
|
|
104
100
|
{
|
|
105
|
-
pageCount:
|
|
106
|
-
onJumpToPage:
|
|
107
|
-
state:
|
|
101
|
+
pageCount: t,
|
|
102
|
+
onJumpToPage: k,
|
|
103
|
+
state: m
|
|
108
104
|
}
|
|
109
105
|
),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
106
|
+
/* @__PURE__ */ n(
|
|
107
|
+
y,
|
|
112
108
|
{
|
|
113
109
|
variant: "previous",
|
|
114
110
|
isDisabled: s === 1,
|
|
115
111
|
onClick: () => {
|
|
116
|
-
|
|
112
|
+
i("previous"), w?.();
|
|
117
113
|
}
|
|
118
114
|
}
|
|
119
115
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
(
|
|
116
|
+
/* @__PURE__ */ n("ul", { className: F(), "aria-label": g.pageListLabel, children: L.map(
|
|
117
|
+
(e, a) => e.type === "page" ? /* @__PURE__ */ n(
|
|
122
118
|
"li",
|
|
123
119
|
{
|
|
124
|
-
"aria-setsize":
|
|
125
|
-
"aria-posinset":
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
|
|
120
|
+
"aria-setsize": t,
|
|
121
|
+
"aria-posinset": e.value,
|
|
122
|
+
children: /* @__PURE__ */ n(
|
|
123
|
+
K,
|
|
128
124
|
{
|
|
129
|
-
ref: (
|
|
130
|
-
|
|
125
|
+
ref: (o) => {
|
|
126
|
+
o ? r.current.set(e.value, o) : r.current.delete(e.value);
|
|
131
127
|
},
|
|
132
128
|
onPress: () => {
|
|
133
|
-
|
|
129
|
+
i(e.value);
|
|
134
130
|
},
|
|
135
|
-
onHoverChange: (
|
|
136
|
-
|
|
131
|
+
onHoverChange: (o) => {
|
|
132
|
+
o && b?.(e.value);
|
|
137
133
|
},
|
|
138
|
-
onKeyDown: (
|
|
139
|
-
|
|
134
|
+
onKeyDown: (o) => {
|
|
135
|
+
d(o, e.value);
|
|
140
136
|
},
|
|
141
|
-
isActive:
|
|
142
|
-
value:
|
|
143
|
-
children:
|
|
137
|
+
isActive: e.value === s,
|
|
138
|
+
value: e.value,
|
|
139
|
+
children: h.format(e.value)
|
|
144
140
|
}
|
|
145
141
|
)
|
|
146
142
|
},
|
|
147
|
-
`pagination-${
|
|
148
|
-
) : /* @__PURE__ */
|
|
149
|
-
|
|
143
|
+
`pagination-${p}-item-${a}`
|
|
144
|
+
) : /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
145
|
+
j,
|
|
150
146
|
{
|
|
151
|
-
value:
|
|
152
|
-
onKeyDown: (
|
|
153
|
-
|
|
147
|
+
value: e.value,
|
|
148
|
+
onKeyDown: (o) => {
|
|
149
|
+
d(o, -1);
|
|
154
150
|
},
|
|
155
151
|
onPress: () => {
|
|
156
|
-
|
|
152
|
+
m.open();
|
|
157
153
|
}
|
|
158
154
|
}
|
|
159
|
-
) }, `pagination-${
|
|
155
|
+
) }, `pagination-${p}-item-${a}`)
|
|
160
156
|
) }),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
|
|
157
|
+
/* @__PURE__ */ n(
|
|
158
|
+
y,
|
|
163
159
|
{
|
|
164
160
|
variant: "next",
|
|
165
|
-
isDisabled: s ===
|
|
161
|
+
isDisabled: s === t,
|
|
166
162
|
onClick: () => {
|
|
167
|
-
|
|
163
|
+
i("next"), P?.();
|
|
168
164
|
}
|
|
169
165
|
}
|
|
170
166
|
)
|
|
@@ -173,8 +169,8 @@ const _ = R({
|
|
|
173
169
|
);
|
|
174
170
|
}
|
|
175
171
|
);
|
|
176
|
-
|
|
172
|
+
_.displayName = "Pagination";
|
|
177
173
|
export {
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
_ as Pagination,
|
|
175
|
+
S as pagination
|
|
180
176
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
1
|
+
import { jsxs as n, Fragment as F, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as l } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useOverlayTrigger as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { Label as
|
|
9
|
-
const
|
|
3
|
+
import { uyTv as N } from "@payfit/unity-themes";
|
|
4
|
+
import { useOverlayTrigger as O, useButton as P, useOverlay as D } from "react-aria";
|
|
5
|
+
import { useIntl as B } from "react-intl";
|
|
6
|
+
import { Button as y } from "../../button/Button.js";
|
|
7
|
+
import { Icon as I } from "../../icon/Icon.js";
|
|
8
|
+
import { Label as J } from "../../label/Label.js";
|
|
9
|
+
const R = N({
|
|
10
10
|
slots: {
|
|
11
11
|
jumpButton: "uy:sr-only uy:outline-none uy:focus:not-sr-only uy:focus:absolute uy:focus:bottom-full uy:focus:z-10 uy:focus:m-100 uy:focus:rounded-50 uy:focus:underline uy:focus:bg-transparent uy:focus:text-content-primary uy:focus:typography-action uy:focus:ring-2 uy:focus:ring-offset-2 uy:focus:ring-utility-focus-ring",
|
|
12
12
|
jumpPopover: "uy:fixed uy:top-1/2 uy:left-1/2 uy:z-20 uy:transform uy:-translate-x-1/2 uy:-translate-y-1/2 uy:bg-surface-neutral uy:p-200 uy:rounded-200 uy:shadow-floating",
|
|
@@ -17,25 +17,25 @@ const k = O({
|
|
|
17
17
|
jumpActions: "uy:flex uy:gap-150 uy:justify-end uy:mt-100"
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
function
|
|
20
|
+
function W({
|
|
21
21
|
pageCount: t,
|
|
22
|
-
onJumpToPage:
|
|
22
|
+
onJumpToPage: c,
|
|
23
23
|
state: e
|
|
24
24
|
}) {
|
|
25
|
-
const u =
|
|
25
|
+
const u = B(), i = l(null), p = l(null), m = l(null), { triggerProps: f } = O(
|
|
26
26
|
{ type: "dialog" },
|
|
27
27
|
e,
|
|
28
28
|
i
|
|
29
|
-
), { buttonProps:
|
|
29
|
+
), { buttonProps: d } = P(
|
|
30
30
|
{
|
|
31
|
-
...
|
|
31
|
+
...f,
|
|
32
32
|
"aria-label": u.formatMessage({
|
|
33
33
|
id: "unity:component:pagination:jump-dialog:button:text",
|
|
34
34
|
defaultMessage: "Jump to page"
|
|
35
35
|
})
|
|
36
36
|
},
|
|
37
37
|
i
|
|
38
|
-
), { overlayProps: a } =
|
|
38
|
+
), { overlayProps: a } = D(
|
|
39
39
|
{
|
|
40
40
|
isOpen: e.isOpen,
|
|
41
41
|
onClose: e.close.bind(e),
|
|
@@ -43,27 +43,26 @@ function $({
|
|
|
43
43
|
isDismissable: !0
|
|
44
44
|
},
|
|
45
45
|
p
|
|
46
|
-
),
|
|
47
|
-
var y;
|
|
46
|
+
), g = (r) => {
|
|
48
47
|
r.preventDefault();
|
|
49
|
-
const s = parseInt(
|
|
50
|
-
s >= 1 && s <= t && (
|
|
48
|
+
const s = parseInt(m.current?.value || "", 10);
|
|
49
|
+
s >= 1 && s <= t && (c(s), e.close());
|
|
51
50
|
}, {
|
|
52
|
-
jumpButton:
|
|
53
|
-
jumpPopover:
|
|
54
|
-
jumpForm:
|
|
55
|
-
jumpFieldLabel:
|
|
56
|
-
jumpFieldWrapper:
|
|
57
|
-
jumpInput:
|
|
58
|
-
jumpActions:
|
|
59
|
-
} =
|
|
60
|
-
return /* @__PURE__ */ n(
|
|
51
|
+
jumpButton: b,
|
|
52
|
+
jumpPopover: j,
|
|
53
|
+
jumpForm: h,
|
|
54
|
+
jumpFieldLabel: v,
|
|
55
|
+
jumpFieldWrapper: x,
|
|
56
|
+
jumpInput: w,
|
|
57
|
+
jumpActions: M
|
|
58
|
+
} = R();
|
|
59
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
61
60
|
/* @__PURE__ */ o(
|
|
62
61
|
"button",
|
|
63
62
|
{
|
|
64
|
-
...
|
|
63
|
+
...d,
|
|
65
64
|
ref: i,
|
|
66
|
-
className:
|
|
65
|
+
className: b(),
|
|
67
66
|
"aria-expanded": e.isOpen ? "true" : "false",
|
|
68
67
|
children: u.formatMessage({
|
|
69
68
|
id: "unity:component:pagination:jump-dialog:button:text",
|
|
@@ -76,16 +75,16 @@ function $({
|
|
|
76
75
|
{
|
|
77
76
|
...a,
|
|
78
77
|
ref: p,
|
|
79
|
-
className:
|
|
78
|
+
className: j(),
|
|
80
79
|
"aria-label": u.formatMessage({
|
|
81
80
|
id: "unity:component:pagination:jump-dialog:overlay:label",
|
|
82
81
|
defaultMessage: "Jump to page"
|
|
83
82
|
}),
|
|
84
|
-
children: /* @__PURE__ */ n("form", { onSubmit:
|
|
83
|
+
children: /* @__PURE__ */ n("form", { onSubmit: g, className: h(), children: [
|
|
85
84
|
/* @__PURE__ */ o(
|
|
86
|
-
|
|
85
|
+
J,
|
|
87
86
|
{
|
|
88
|
-
className:
|
|
87
|
+
className: v(),
|
|
89
88
|
htmlFor: `jump-to-page-${a.id}-input`,
|
|
90
89
|
children: u.formatMessage(
|
|
91
90
|
{
|
|
@@ -96,7 +95,7 @@ function $({
|
|
|
96
95
|
)
|
|
97
96
|
}
|
|
98
97
|
),
|
|
99
|
-
/* @__PURE__ */ n("div", { className:
|
|
98
|
+
/* @__PURE__ */ n("div", { className: x(), children: [
|
|
100
99
|
/* @__PURE__ */ o(
|
|
101
100
|
"input",
|
|
102
101
|
{
|
|
@@ -104,7 +103,7 @@ function $({
|
|
|
104
103
|
type: "number",
|
|
105
104
|
min: 1,
|
|
106
105
|
max: t,
|
|
107
|
-
className:
|
|
106
|
+
className: w(),
|
|
108
107
|
id: `jump-to-page-${a.id}-input`,
|
|
109
108
|
autoFocus: !0,
|
|
110
109
|
onKeyDown: (r) => {
|
|
@@ -113,7 +112,7 @@ function $({
|
|
|
113
112
|
}
|
|
114
113
|
),
|
|
115
114
|
/* @__PURE__ */ o(
|
|
116
|
-
|
|
115
|
+
I,
|
|
117
116
|
{
|
|
118
117
|
src: "CaretUpDownOutlined",
|
|
119
118
|
role: "presentation",
|
|
@@ -123,12 +122,12 @@ function $({
|
|
|
123
122
|
}
|
|
124
123
|
)
|
|
125
124
|
] }),
|
|
126
|
-
/* @__PURE__ */ n("div", { className:
|
|
127
|
-
/* @__PURE__ */ o(
|
|
125
|
+
/* @__PURE__ */ n("div", { className: M(), children: [
|
|
126
|
+
/* @__PURE__ */ o(y, { variant: "ghost", onPress: e.close.bind(e), children: u.formatMessage({
|
|
128
127
|
id: "unity:component:pagination:jump-dialog:action:cancel",
|
|
129
128
|
defaultMessage: "Cancel"
|
|
130
129
|
}) }),
|
|
131
|
-
/* @__PURE__ */ o(
|
|
130
|
+
/* @__PURE__ */ o(y, { type: "submit", variant: "primary", children: u.formatMessage({
|
|
132
131
|
id: "unity:component:pagination:jump-dialog:action:go",
|
|
133
132
|
defaultMessage: "Go"
|
|
134
133
|
}) })
|
|
@@ -139,5 +138,5 @@ function $({
|
|
|
139
138
|
] });
|
|
140
139
|
}
|
|
141
140
|
export {
|
|
142
|
-
|
|
141
|
+
W as PaginationJumpDialog
|
|
143
142
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as u, useContext as y } from "react";
|
|
3
3
|
import { uyTv as d } from "@payfit/unity-themes";
|
|
4
4
|
import { OverlayTriggerStateContext as p, Heading as f } from "react-aria-components";
|
|
@@ -22,20 +22,20 @@ const v = d({
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}), b = u(
|
|
25
|
-
({ title:
|
|
26
|
-
const
|
|
25
|
+
({ title: o, isTitleSrOnly: t, displayCloseButton: n }, a) => {
|
|
26
|
+
const r = y(p), s = g(), { base: l, heading: i, iconButton: c } = v({ isTitleSrOnly: t });
|
|
27
27
|
return /* @__PURE__ */ m("div", { className: l(), children: [
|
|
28
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ e(
|
|
29
29
|
f,
|
|
30
30
|
{
|
|
31
|
-
ref:
|
|
31
|
+
ref: a,
|
|
32
32
|
slot: "title",
|
|
33
33
|
className: i(),
|
|
34
34
|
"data-dd-privacy": "allow",
|
|
35
|
-
children:
|
|
35
|
+
children: o
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
|
|
38
|
+
n && /* @__PURE__ */ e(
|
|
39
39
|
h,
|
|
40
40
|
{
|
|
41
41
|
variant: "ghost",
|
|
@@ -46,7 +46,7 @@ const v = d({
|
|
|
46
46
|
defaultMessage: "Close"
|
|
47
47
|
}),
|
|
48
48
|
icon: "CloseOutlined",
|
|
49
|
-
onClick: () =>
|
|
49
|
+
onClick: () => r?.close()
|
|
50
50
|
}
|
|
51
51
|
)
|
|
52
52
|
] });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
1
|
+
import { jsxs as a, jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as b, useContext as f, useMemo as p } from "react";
|
|
3
3
|
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
4
|
import { RadioGroupStateContext as v, Radio as x } from "react-aria-components";
|
|
@@ -30,33 +30,33 @@ const F = g({
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}), N = b(
|
|
33
|
-
({ children:
|
|
34
|
-
const { base:
|
|
33
|
+
({ children: d, value: l, isDisabled: i, helperText: t, ...u }, n) => {
|
|
34
|
+
const { base: s, label: c } = F(), o = f(v), y = p(() => o?.isReadOnly ? {
|
|
35
35
|
"--radio-fill-color": "var(--uy-color-border-form-read-only)",
|
|
36
36
|
"--radio-border-color": "var(--uy-color-border-form-disabled)"
|
|
37
37
|
} : {
|
|
38
38
|
"--radio-fill-color": "var(--uy-color-surface-primary-active)",
|
|
39
39
|
"--radio-border-color": "var(--uy-color-border-form-active)"
|
|
40
|
-
}, [
|
|
40
|
+
}, [o?.isReadOnly]);
|
|
41
41
|
return /* @__PURE__ */ a(R, { direction: "col", gap: "50", children: [
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r(
|
|
43
43
|
x,
|
|
44
44
|
{
|
|
45
45
|
...u,
|
|
46
46
|
value: l,
|
|
47
47
|
isDisabled: i,
|
|
48
|
-
className: ({ isFocusVisible: e }) =>
|
|
48
|
+
className: ({ isFocusVisible: e }) => s({ isFocusVisible: e }),
|
|
49
49
|
ref: n,
|
|
50
50
|
children: ({ isSelected: e }) => /* @__PURE__ */ a(m, { children: [
|
|
51
|
-
e ? /* @__PURE__ */
|
|
51
|
+
e ? /* @__PURE__ */ r(
|
|
52
52
|
B,
|
|
53
53
|
{
|
|
54
54
|
style: y
|
|
55
55
|
}
|
|
56
|
-
) : /* @__PURE__ */
|
|
56
|
+
) : /* @__PURE__ */ r(
|
|
57
57
|
h,
|
|
58
58
|
{
|
|
59
|
-
style:
|
|
59
|
+
style: o?.isReadOnly ? {
|
|
60
60
|
// @ts-expect-error – annoying TS
|
|
61
61
|
"--radio-border-color": "var(--uy-color-border-form-disabled)"
|
|
62
62
|
} : {
|
|
@@ -64,11 +64,11 @@ const F = g({
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ r(S, { variant: "body", className: c(), children: d })
|
|
68
68
|
] })
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
|
|
71
|
+
t ? /* @__PURE__ */ r(w, { children: t }) : null
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
74
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
1
2
|
import { ForwardedRef, JSX, ReactNode } from 'react';
|
|
2
3
|
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { infer as ZodInfer } from 'zod';
|
|
4
4
|
import { Schema } from '../../hooks/use-form.types.js';
|
|
5
5
|
import { LabelProps } from '../label/Label.js';
|
|
6
6
|
import { SelectProps } from '../select/Select.js';
|
|
@@ -14,7 +14,7 @@ interface SelectFieldProps<TItems extends object, TFieldValues extends FieldValu
|
|
|
14
14
|
/** Feedback text to display below the text field. */
|
|
15
15
|
feedbackText?: ReactNode;
|
|
16
16
|
}
|
|
17
|
-
type SelectFieldComponent = (<TItems extends object, TSchema extends Schema>(props: SelectFieldProps<TItems,
|
|
17
|
+
type SelectFieldComponent = (<TItems extends object, TSchema extends Schema>(props: SelectFieldProps<TItems, StandardSchemaV1.InferOutput<TSchema>> & {
|
|
18
18
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
19
19
|
}) => JSX.Element) & {
|
|
20
20
|
displayName?: string;
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useToggleButtonGroup as
|
|
5
|
-
import { useToggleGroupState as
|
|
6
|
-
import { SelectableButtonGroupContext as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c, useRef as s } from "react";
|
|
3
|
+
import { uyTv as d } from "@payfit/unity-themes";
|
|
4
|
+
import { useToggleButtonGroup as m, mergeProps as f } from "react-aria";
|
|
5
|
+
import { useToggleGroupState as g } from "react-stately";
|
|
6
|
+
import { SelectableButtonGroupContext as v } from "./SelectableButtonGroup.context.js";
|
|
7
|
+
const y = d({
|
|
8
8
|
base: "uy:flex uy:gap-100"
|
|
9
|
-
}),
|
|
10
|
-
const t =
|
|
9
|
+
}), G = c((e, l) => {
|
|
10
|
+
const t = s(null), o = g({
|
|
11
11
|
...e,
|
|
12
12
|
selectedKeys: e.value,
|
|
13
13
|
defaultSelectedKeys: e.defaultValue,
|
|
14
|
-
onSelectionChange: (
|
|
15
|
-
|
|
16
|
-
(l = e.onChange) == null || l.call(e, Array.from(c));
|
|
14
|
+
onSelectionChange: (i) => {
|
|
15
|
+
e.onChange?.(Array.from(i));
|
|
17
16
|
}
|
|
18
|
-
}), { groupProps:
|
|
19
|
-
return /* @__PURE__ */
|
|
17
|
+
}), { groupProps: r } = m(e, o, t), n = y({ className: e.className }), { ref: u } = f({ ref: t }, { ref: l });
|
|
18
|
+
return /* @__PURE__ */ a(
|
|
20
19
|
"div",
|
|
21
20
|
{
|
|
22
|
-
...
|
|
23
|
-
className:
|
|
24
|
-
ref:
|
|
21
|
+
...r,
|
|
22
|
+
className: n,
|
|
23
|
+
ref: u,
|
|
25
24
|
"data-dd-privacy": "allow",
|
|
26
25
|
"aria-invalid": e.isInvalid,
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
|
|
26
|
+
children: /* @__PURE__ */ a(
|
|
27
|
+
v.Provider,
|
|
29
28
|
{
|
|
30
|
-
value: { state:
|
|
29
|
+
value: { state: o, isInvalid: e.isInvalid },
|
|
31
30
|
children: e.children
|
|
32
31
|
}
|
|
33
32
|
)
|
|
34
33
|
}
|
|
35
34
|
);
|
|
36
35
|
});
|
|
37
|
-
|
|
36
|
+
G.displayName = "SelectableButtonGroup";
|
|
38
37
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
G as SelectableButtonGroup,
|
|
39
|
+
y as selectableButtonGroup
|
|
41
40
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
1
2
|
import { ForwardedRef, JSX, ReactNode } from 'react';
|
|
2
3
|
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { infer as ZodInfer } from 'zod';
|
|
4
4
|
import { Schema } from '../../hooks/use-form.types.js';
|
|
5
5
|
import { SelectableButtonGroupProps } from '../selectable-button-group/SelectableButtonGroup.js';
|
|
6
6
|
import { LabelProps } from '../label/Label.js';
|
|
@@ -24,7 +24,7 @@ export type SelectableButtonGroupFieldProps<TFieldValues extends FieldValues = F
|
|
|
24
24
|
/** The options to render as SelectableButton children. */
|
|
25
25
|
children: ReactNode;
|
|
26
26
|
};
|
|
27
|
-
type SelectableButtonGroupFieldComponent = (<TSchema extends Schema>(props: SelectableButtonGroupFieldProps<
|
|
27
|
+
type SelectableButtonGroupFieldComponent = (<TSchema extends Schema>(props: SelectableButtonGroupFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
|
|
28
28
|
ref?: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>;
|
|
29
29
|
}) => JSX.Element) & {
|
|
30
30
|
displayName?: string;
|