@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.
Files changed (104) hide show
  1. package/dist/esm/adapters/standardSchemaAdapter.d.ts +7 -0
  2. package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
  3. package/dist/esm/adapters/zodAdapter.d.ts +13 -0
  4. package/dist/esm/adapters/zodAdapter.js +74 -0
  5. package/dist/esm/components/action-bar/ActionBar.js +62 -64
  6. package/dist/esm/components/actionable/Actionable.d.ts +50 -3
  7. package/dist/esm/components/actionable/Actionable.js +49 -39
  8. package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
  9. package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
  10. package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
  11. package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
  12. package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
  13. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
  14. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
  15. package/dist/esm/components/code/Code.d.ts +37 -0
  16. package/dist/esm/components/code/Code.js +39 -0
  17. package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
  18. package/dist/esm/components/code/copyToClipboard.js +10 -0
  19. package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
  20. package/dist/esm/components/collapsible/Collapsible.js +14 -13
  21. package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
  22. package/dist/esm/components/data-table/DataTable.d.ts +76 -10
  23. package/dist/esm/components/data-table/DataTable.js +81 -78
  24. package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
  25. package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
  26. package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
  27. package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
  28. package/dist/esm/components/date-picker/DatePicker.js +64 -64
  29. package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
  30. package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
  31. package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
  32. package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
  33. package/dist/esm/components/error-state/ErrorState.js +153 -0
  34. package/dist/esm/components/error-state/initConfig.d.ts +16 -0
  35. package/dist/esm/components/error-state/initConfig.js +149 -0
  36. package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
  37. package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
  38. package/dist/esm/components/form/Form.d.ts +15 -9
  39. package/dist/esm/components/form/Form.js +53 -50
  40. package/dist/esm/components/form-field/FormField.js +24 -23
  41. package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
  42. package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
  43. package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
  44. package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
  45. package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
  46. package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
  47. package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
  48. package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
  49. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
  50. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
  51. package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
  52. package/dist/esm/components/input/Input.js +28 -28
  53. package/dist/esm/components/label/Label.js +19 -19
  54. package/dist/esm/components/multi-select/MultiSelect.js +94 -94
  55. package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
  56. package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
  57. package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
  58. package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
  59. package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
  60. package/dist/esm/components/nav/parts/NavGroup.js +21 -21
  61. package/dist/esm/components/number-field/NumberField.d.ts +3 -3
  62. package/dist/esm/components/number-input/NumberInput.js +58 -58
  63. package/dist/esm/components/pagination/Pagination.js +97 -101
  64. package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
  65. package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
  66. package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
  67. package/dist/esm/components/select-field/SelectField.d.ts +2 -2
  68. package/dist/esm/components/select-field/SelectField.js +4 -1
  69. package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
  70. package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
  71. package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
  72. package/dist/esm/components/skip-links/SkipLinks.js +50 -43
  73. package/dist/esm/components/table/Table.js +79 -76
  74. package/dist/esm/components/table/parts/TableBody.js +6 -6
  75. package/dist/esm/components/table/parts/TableCell.js +25 -25
  76. package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
  77. package/dist/esm/components/table/parts/TablePagination.js +61 -59
  78. package/dist/esm/components/table/parts/TableRow.js +16 -16
  79. package/dist/esm/components/tabs/parts/TabList.js +50 -54
  80. package/dist/esm/components/task-menu/parts/Content.js +24 -24
  81. package/dist/esm/components/task-menu/parts/Header.js +24 -24
  82. package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
  83. package/dist/esm/components/task-menu/parts/Task.js +69 -69
  84. package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
  85. package/dist/esm/components/text-area/TextArea.js +30 -31
  86. package/dist/esm/components/text-field/TextField.d.ts +2 -2
  87. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
  88. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
  89. package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
  90. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
  91. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
  92. package/dist/esm/hooks/use-form.d.ts +5 -5
  93. package/dist/esm/hooks/use-form.types.d.ts +2 -2
  94. package/dist/esm/hooks/use-resizable.js +13 -14
  95. package/dist/esm/index.d.ts +1 -0
  96. package/dist/esm/index.js +22 -19
  97. package/dist/esm/types/schema.d.ts +8 -0
  98. package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
  99. package/dist/esm/utils/createSchemaAdapter.js +13 -0
  100. package/dist/esm/utils/platform.js +2 -3
  101. package/i18n/en-GB.json +16 -0
  102. package/i18n/es-ES.json +16 -0
  103. package/i18n/fr-FR.json +16 -0
  104. package/package.json +25 -19
@@ -1,170 +1,166 @@
1
- import { jsxs as T, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as q, useRef as E, useMemo as N } from "react";
3
- import { uyTv as R } from "@payfit/unity-themes";
4
- import { useId as W } from "react-aria";
5
- import { useIntl as $ } from "react-intl";
6
- import { useOverlayTriggerState as j } from "react-stately";
7
- import { usePagination as J } from "./hooks/use-pagination.js";
8
- import { PaginationEllipsis as K } from "./parts/PaginationEllipsis.js";
9
- import { PaginationJumpDialog as O } from "./parts/PaginationJumpDialog.js";
10
- import { PaginationLink as S } from "./parts/PaginationLink.js";
11
- import { PaginationNavButton as D } from "./parts/PaginationNavButton.js";
12
- import { generatePaginationWithWindow as x } from "./utils/pagination-window.js";
13
- const _ = R({
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
- }), z = 7, B = q(
18
+ }), H = 7, _ = x(
19
19
  ({
20
- pageCount: i,
21
- defaultPage: p,
22
- currentPage: d,
23
- onPageHover: l,
24
- onPageChange: g,
25
- onNextPress: m,
26
- onPreviousPress: c,
27
- ...A
28
- }, L) => {
29
- const v = W(), u = $(), y = d !== void 0 && g !== void 0 && p === void 0, { currentPage: s, goToPage: n } = J({
30
- pageCount: i,
31
- initialPage: y ? d : p,
32
- onPageChange: g,
33
- isControlled: y
34
- }), f = j({}), r = E(/* @__PURE__ */ new Map()), h = N(
35
- () => x(
36
- i,
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
- z
38
+ H
39
39
  ),
40
- [i, s]
41
- ), k = new Intl.NumberFormat(u.locale, {
40
+ [t, s]
41
+ ), h = new Intl.NumberFormat(l.locale, {
42
42
  notation: "standard"
43
- }), F = (a) => {
44
- n(a), f.close(), requestAnimationFrame(() => {
45
- const e = r.current.get(a);
46
- e && e.focus();
43
+ }), k = (e) => {
44
+ i(e), m.close(), requestAnimationFrame(() => {
45
+ const a = r.current.get(e);
46
+ a && a.focus();
47
47
  });
48
- }, b = (a, e) => {
49
- switch (a.key) {
48
+ }, d = (e, a) => {
49
+ switch (e.key) {
50
50
  case "ArrowLeft":
51
51
  case "ArrowUp":
52
- a.preventDefault(), e > 1 && (n(e - 1), requestAnimationFrame(() => {
53
- var t;
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
- a.preventDefault(), e < i && (n(e + 1), requestAnimationFrame(() => {
60
- var t;
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
- a.preventDefault(), n(1), requestAnimationFrame(() => {
66
- var t;
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
- a.preventDefault(), n(i), requestAnimationFrame(() => {
72
- var t;
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
- }, w = {
78
- paginationLabel: u.formatMessage({
73
+ }, g = {
74
+ paginationLabel: l.formatMessage({
79
75
  id: "unity:component:pagination:label",
80
76
  defaultMessage: "Pagination"
81
77
  }),
82
- pageListLabel: u.formatMessage(
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: i
85
+ total: t
90
86
  }
91
87
  )
92
- }, { base: I, pagesList: M } = _();
93
- return /* @__PURE__ */ T(
88
+ }, { base: N, pagesList: F } = S();
89
+ return /* @__PURE__ */ I(
94
90
  "nav",
95
91
  {
96
92
  "data-dd-privacy": "allow",
97
- ...A,
98
- ref: L,
99
- className: I(),
100
- "aria-labelledby": w.paginationLabel,
93
+ ...D,
94
+ ref: A,
95
+ className: N(),
96
+ "aria-labelledby": g.paginationLabel,
101
97
  children: [
102
- /* @__PURE__ */ o(
103
- O,
98
+ /* @__PURE__ */ n(
99
+ J,
104
100
  {
105
- pageCount: i,
106
- onJumpToPage: F,
107
- state: f
101
+ pageCount: t,
102
+ onJumpToPage: k,
103
+ state: m
108
104
  }
109
105
  ),
110
- /* @__PURE__ */ o(
111
- D,
106
+ /* @__PURE__ */ n(
107
+ y,
112
108
  {
113
109
  variant: "previous",
114
110
  isDisabled: s === 1,
115
111
  onClick: () => {
116
- n("previous"), c == null || c();
112
+ i("previous"), w?.();
117
113
  }
118
114
  }
119
115
  ),
120
- /* @__PURE__ */ o("ul", { className: M(), "aria-label": w.pageListLabel, children: h.map(
121
- (a, e) => a.type === "page" ? /* @__PURE__ */ o(
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": i,
125
- "aria-posinset": a.value,
126
- children: /* @__PURE__ */ o(
127
- S,
120
+ "aria-setsize": t,
121
+ "aria-posinset": e.value,
122
+ children: /* @__PURE__ */ n(
123
+ K,
128
124
  {
129
- ref: (t) => {
130
- t ? r.current.set(a.value, t) : r.current.delete(a.value);
125
+ ref: (o) => {
126
+ o ? r.current.set(e.value, o) : r.current.delete(e.value);
131
127
  },
132
128
  onPress: () => {
133
- n(a.value);
129
+ i(e.value);
134
130
  },
135
- onHoverChange: (t) => {
136
- t && (l == null || l(a.value));
131
+ onHoverChange: (o) => {
132
+ o && b?.(e.value);
137
133
  },
138
- onKeyDown: (t) => {
139
- b(t, a.value);
134
+ onKeyDown: (o) => {
135
+ d(o, e.value);
140
136
  },
141
- isActive: a.value === s,
142
- value: a.value,
143
- children: k.format(a.value)
137
+ isActive: e.value === s,
138
+ value: e.value,
139
+ children: h.format(e.value)
144
140
  }
145
141
  )
146
142
  },
147
- `pagination-${v}-item-${e}`
148
- ) : /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
149
- K,
143
+ `pagination-${p}-item-${a}`
144
+ ) : /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
145
+ j,
150
146
  {
151
- value: a.value,
152
- onKeyDown: (t) => {
153
- b(t, -1);
147
+ value: e.value,
148
+ onKeyDown: (o) => {
149
+ d(o, -1);
154
150
  },
155
151
  onPress: () => {
156
- f.open();
152
+ m.open();
157
153
  }
158
154
  }
159
- ) }, `pagination-${v}-item-${e}`)
155
+ ) }, `pagination-${p}-item-${a}`)
160
156
  ) }),
161
- /* @__PURE__ */ o(
162
- D,
157
+ /* @__PURE__ */ n(
158
+ y,
163
159
  {
164
160
  variant: "next",
165
- isDisabled: s === i,
161
+ isDisabled: s === t,
166
162
  onClick: () => {
167
- n("next"), m == null || m();
163
+ i("next"), P?.();
168
164
  }
169
165
  }
170
166
  )
@@ -173,8 +169,8 @@ const _ = R({
173
169
  );
174
170
  }
175
171
  );
176
- B.displayName = "Pagination";
172
+ _.displayName = "Pagination";
177
173
  export {
178
- B as Pagination,
179
- _ as pagination
174
+ _ as Pagination,
175
+ S as pagination
180
176
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as n, Fragment as N, jsx as o } from "react/jsx-runtime";
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 O } from "@payfit/unity-themes";
4
- import { useOverlayTrigger as P, useButton as D, useOverlay as B } from "react-aria";
5
- import { useIntl as I } from "react-intl";
6
- import { Button as c } from "../../button/Button.js";
7
- import { Icon as J } from "../../icon/Icon.js";
8
- import { Label as R } from "../../label/Label.js";
9
- const k = O({
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: f,
22
+ onJumpToPage: c,
23
23
  state: e
24
24
  }) {
25
- const u = I(), i = l(null), p = l(null), m = l(null), { triggerProps: d } = P(
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: g } = D(
29
+ ), { buttonProps: d } = P(
30
30
  {
31
- ...d,
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 } = B(
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
- ), b = (r) => {
47
- var y;
46
+ ), g = (r) => {
48
47
  r.preventDefault();
49
- const s = parseInt(((y = m.current) == null ? void 0 : y.value) || "", 10);
50
- s >= 1 && s <= t && (f(s), e.close());
48
+ const s = parseInt(m.current?.value || "", 10);
49
+ s >= 1 && s <= t && (c(s), e.close());
51
50
  }, {
52
- jumpButton: j,
53
- jumpPopover: h,
54
- jumpForm: v,
55
- jumpFieldLabel: x,
56
- jumpFieldWrapper: w,
57
- jumpInput: M,
58
- jumpActions: F
59
- } = k();
60
- return /* @__PURE__ */ n(N, { children: [
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
- ...g,
63
+ ...d,
65
64
  ref: i,
66
- className: j(),
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: h(),
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: b, className: v(), children: [
83
+ children: /* @__PURE__ */ n("form", { onSubmit: g, className: h(), children: [
85
84
  /* @__PURE__ */ o(
86
- R,
85
+ J,
87
86
  {
88
- className: x(),
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: w(), children: [
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: M(),
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
- J,
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: F(), children: [
127
- /* @__PURE__ */ o(c, { variant: "ghost", onPress: e.close.bind(e), children: u.formatMessage({
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(c, { type: "submit", variant: "primary", children: u.formatMessage({
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
- $ as PaginationJumpDialog
141
+ W as PaginationJumpDialog
143
142
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
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: t, isTitleSrOnly: n, displayCloseButton: a }, r) => {
26
- const e = y(p), s = g(), { base: l, heading: i, iconButton: c } = v({ isTitleSrOnly: n });
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__ */ o(
28
+ /* @__PURE__ */ e(
29
29
  f,
30
30
  {
31
- ref: r,
31
+ ref: a,
32
32
  slot: "title",
33
33
  className: i(),
34
34
  "data-dd-privacy": "allow",
35
- children: t
35
+ children: o
36
36
  }
37
37
  ),
38
- a && /* @__PURE__ */ o(
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: () => e == null ? void 0 : e.close()
49
+ onClick: () => r?.close()
50
50
  }
51
51
  )
52
52
  ] });
@@ -1,4 +1,4 @@
1
- import { jsxs as a, jsx as o, Fragment as m } from "react/jsx-runtime";
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: t, value: l, isDisabled: i, helperText: d, ...u }, n) => {
34
- const { base: c, label: s } = F(), r = f(v), y = p(() => r != null && r.isReadOnly ? {
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
- }, [r == null ? void 0 : r.isReadOnly]);
40
+ }, [o?.isReadOnly]);
41
41
  return /* @__PURE__ */ a(R, { direction: "col", gap: "50", children: [
42
- /* @__PURE__ */ o(
42
+ /* @__PURE__ */ r(
43
43
  x,
44
44
  {
45
45
  ...u,
46
46
  value: l,
47
47
  isDisabled: i,
48
- className: ({ isFocusVisible: e }) => c({ 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__ */ o(
51
+ e ? /* @__PURE__ */ r(
52
52
  B,
53
53
  {
54
54
  style: y
55
55
  }
56
- ) : /* @__PURE__ */ o(
56
+ ) : /* @__PURE__ */ r(
57
57
  h,
58
58
  {
59
- style: r != null && r.isReadOnly ? {
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__ */ o(S, { variant: "body", className: s(), children: t })
67
+ /* @__PURE__ */ r(S, { variant: "body", className: c(), children: d })
68
68
  ] })
69
69
  }
70
70
  ),
71
- d ? /* @__PURE__ */ o(w, { children: d }) : null
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, ZodInfer<TSchema>> & {
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;
@@ -57,7 +57,10 @@ const v = h({
57
57
  }
58
58
  );
59
59
  }, H = S(function(e, r) {
60
- return w(e, r);
60
+ return w(
61
+ e,
62
+ r
63
+ );
61
64
  });
62
65
  H.displayName = "SelectField";
63
66
  export {
@@ -1,41 +1,40 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as d, useRef as m } from "react";
3
- import { uyTv as f } from "@payfit/unity-themes";
4
- import { useToggleButtonGroup as s, mergeProps as g } from "react-aria";
5
- import { useToggleGroupState as v } from "react-stately";
6
- import { SelectableButtonGroupContext as y } from "./SelectableButtonGroup.context.js";
7
- const G = f({
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
- }), S = d((e, r) => {
10
- const t = m(null), a = v({
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: (c) => {
15
- var l;
16
- (l = e.onChange) == null || l.call(e, Array.from(c));
14
+ onSelectionChange: (i) => {
15
+ e.onChange?.(Array.from(i));
17
16
  }
18
- }), { groupProps: n } = s(e, a, t), u = G({ className: e.className }), { ref: i } = g({ ref: t }, { ref: r });
19
- return /* @__PURE__ */ o(
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
- ...n,
23
- className: u,
24
- ref: i,
21
+ ...r,
22
+ className: n,
23
+ ref: u,
25
24
  "data-dd-privacy": "allow",
26
25
  "aria-invalid": e.isInvalid,
27
- children: /* @__PURE__ */ o(
28
- y.Provider,
26
+ children: /* @__PURE__ */ a(
27
+ v.Provider,
29
28
  {
30
- value: { state: a, isInvalid: e.isInvalid },
29
+ value: { state: o, isInvalid: e.isInvalid },
31
30
  children: e.children
32
31
  }
33
32
  )
34
33
  }
35
34
  );
36
35
  });
37
- S.displayName = "SelectableButtonGroup";
36
+ G.displayName = "SelectableButtonGroup";
38
37
  export {
39
- S as SelectableButtonGroup,
40
- G as selectableButtonGroup
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<ZodInfer<TSchema>> & {
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;