@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,42 +1,42 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { useState as v, useRef as I, isValidElement as O, cloneElement as V } from "react";
2
+ import { useState as v, useRef as A, isValidElement as C, cloneElement as I } from "react";
3
3
  import { uyMerge as g } from "@payfit/unity-themes";
4
- import { FormattedMessage as h, useIntl as z } from "react-intl";
4
+ import { FormattedMessage as h, useIntl as O } from "react-intl";
5
5
  import { Actionable as x } from "../../actionable/Actionable.js";
6
- import { Avatar as F } from "../../avatar/Avatar.js";
7
- import { AvatarFallback as H } from "../../avatar/parts/AvatarFallback.js";
8
- import { AvatarImage as j } from "../../avatar/parts/AvatarImage.js";
9
- import { Badge as A } from "../../badge/Badge.js";
6
+ import { Avatar as V } from "../../avatar/Avatar.js";
7
+ import { AvatarFallback as z } from "../../avatar/parts/AvatarFallback.js";
8
+ import { AvatarImage as F } from "../../avatar/parts/AvatarImage.js";
9
+ import { Badge as H } from "../../badge/Badge.js";
10
10
  import { Icon as M } from "../../icon/Icon.js";
11
- import { Menu as E } from "../../menu/Menu.js";
12
- import { MenuContent as S } from "../../menu/parts/MenuContent.js";
13
- import { MenuHeader as B } from "../../menu/parts/MenuHeader.js";
14
- import { useAppMenuContext as C } from "./AppMenu.context.js";
11
+ import { Menu as j } from "../../menu/Menu.js";
12
+ import { MenuContent as k } from "../../menu/parts/MenuContent.js";
13
+ import { MenuHeader as E } from "../../menu/parts/MenuHeader.js";
14
+ import { useAppMenuContext as S } from "./AppMenu.context.js";
15
15
  const N = (t) => /* @__PURE__ */ l(
16
- F,
16
+ V,
17
17
  {
18
18
  "aria-label": `${t.title} avatar`,
19
19
  size: "md",
20
20
  variant: "square",
21
21
  "aria-labelledby": "profile-button-label",
22
22
  children: [
23
- /* @__PURE__ */ e(j, { src: t.avatar, alt: t.title ?? "" }),
24
- /* @__PURE__ */ e(H, { variant: "initials", delayMs: 100, children: t.title }),
25
- t.avatarPair && O(t.avatarPair) && V(t.avatarPair, {
23
+ /* @__PURE__ */ e(F, { src: t.avatar, alt: t.title ?? "" }),
24
+ /* @__PURE__ */ e(z, { variant: "initials", delayMs: 100, children: t.title }),
25
+ t.avatarPair && C(t.avatarPair) && I(t.avatarPair, {
26
26
  isHidden: !t.isPairAvatarVisible
27
27
  })
28
28
  ]
29
29
  }
30
- ), R = ({
30
+ ), B = ({
31
31
  avatar: t,
32
- avatarPair: r,
32
+ avatarPair: a,
33
33
  title: o,
34
- uploadAvatarCallback: u,
35
- uploadAvatarLabel: c,
36
- uploadAvatarDescription: a
34
+ uploadAvatarCallback: y,
35
+ uploadAvatarLabel: s,
36
+ uploadAvatarDescription: r
37
37
  }) => {
38
- const [n, s] = v(!0), y = z(), i = () => {
39
- r && s((f) => !f);
38
+ const [n, u] = v(!0), c = O(), i = () => {
39
+ a && u((f) => !f);
40
40
  }, d = g(
41
41
  "uy:group/avatar uy:cursor-pointer uy:relative uy:leading-[0] uy:rounded-75 uy:focus-visible:outline-none uy:focus-visible:ring-2 uy:focus-visible:ring-utility-focus-ring uy:focus-visible:ring-offset-2"
42
42
  );
@@ -44,7 +44,7 @@ const N = (t) => /* @__PURE__ */ l(
44
44
  x,
45
45
  {
46
46
  "aria-describedby": "profile-picture-change-desc",
47
- "aria-label": c || y.formatMessage({
47
+ "aria-label": s || c.formatMessage({
48
48
  id: "unity:component:app-menu:footer:profile-button:avatar:change",
49
49
  defaultMessage: "Change profile picture"
50
50
  }),
@@ -54,19 +54,19 @@ const N = (t) => /* @__PURE__ */ l(
54
54
  onFocus: i,
55
55
  onBlur: i,
56
56
  onPress: () => {
57
- u == null || u();
57
+ y?.();
58
58
  },
59
59
  children: [
60
60
  /* @__PURE__ */ e(
61
61
  N,
62
62
  {
63
63
  avatar: t,
64
- avatarPair: r,
64
+ avatarPair: a,
65
65
  title: o,
66
66
  isPairAvatarVisible: n
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ l("div", { className: "uy:flex uy:pointer-events-none uy:opacity-0 uy:group-hover/avatar:opacity-70 uy:group-hover/avatar:pointer-events-auto uy:group-focus-visible/avatar:opacity-70 uy:group-focus-visible/avatar:pointer-events-auto uy:bg-utility-backdrop uy:rounded-circle uy:absolute uy:top-0 uy:left-0 uy:w-full uy:h-full uy:transition-all uy:duration-200 uy:items-center uy:justify-center", children: [
69
+ /* @__PURE__ */ l("div", { className: "uy:flex uy:pointer-events-none uy:opacity-0 uy:group-hover/avatar:opacity-90 uy:group-hover/avatar:pointer-events-auto uy:group-focus-visible/avatar:opacity-90 uy:group-focus-visible/avatar:pointer-events-auto uy:bg-utility-backdrop uy:rounded-75 uy:absolute uy:top-0 uy:left-0 uy:w-full uy:h-full uy:transition-all uy:duration-200 uy:items-center uy:justify-center", children: [
70
70
  /* @__PURE__ */ e(
71
71
  M,
72
72
  {
@@ -76,7 +76,7 @@ const N = (t) => /* @__PURE__ */ l(
76
76
  src: "CameraOutlined"
77
77
  }
78
78
  ),
79
- /* @__PURE__ */ e("span", { className: "uy:sr-only", id: "profile-picture-change-desc", children: a || /* @__PURE__ */ e(
79
+ /* @__PURE__ */ e("span", { className: "uy:sr-only", id: "profile-picture-change-desc", children: r || /* @__PURE__ */ e(
80
80
  h,
81
81
  {
82
82
  id: "unity:component:app-menu:footer:profile-button:avatar:change-description",
@@ -89,30 +89,30 @@ const N = (t) => /* @__PURE__ */ l(
89
89
  );
90
90
  }, b = ({
91
91
  asMenuHeader: t = !1,
92
- avatar: r,
92
+ avatar: a,
93
93
  avatarPair: o,
94
- badgeLabel: u,
95
- description: c,
96
- menuTriggerDescription: a,
94
+ badgeLabel: y,
95
+ description: s,
96
+ menuTriggerDescription: r,
97
97
  title: n,
98
- uploadAvatarCallback: s,
99
- uploadAvatarLabel: y,
98
+ uploadAvatarCallback: u,
99
+ uploadAvatarLabel: c,
100
100
  uploadAvatarDescription: i
101
101
  }) => /* @__PURE__ */ l("div", { className: "uy:min-w-[240px] uy:w-full uy:flex uy:items-center", children: [
102
- /* @__PURE__ */ e("div", { className: "uy:mr-150 uy:flex uy:items-center", children: s ? /* @__PURE__ */ e(
103
- R,
102
+ /* @__PURE__ */ e("div", { className: "uy:mr-150 uy:flex uy:items-center", children: u ? /* @__PURE__ */ e(
103
+ B,
104
104
  {
105
- avatar: r,
105
+ avatar: a,
106
106
  avatarPair: o,
107
107
  title: n,
108
- uploadAvatarLabel: y,
108
+ uploadAvatarLabel: c,
109
109
  uploadAvatarDescription: i,
110
- uploadAvatarCallback: s
110
+ uploadAvatarCallback: u
111
111
  }
112
112
  ) : /* @__PURE__ */ e(
113
113
  N,
114
114
  {
115
- avatar: r,
115
+ avatar: a,
116
116
  avatarPair: o,
117
117
  title: n,
118
118
  isPairAvatarVisible: !0
@@ -133,10 +133,10 @@ const N = (t) => /* @__PURE__ */ l(
133
133
  {
134
134
  className: "uy:typography-body-small uy:text-content-neutral-low",
135
135
  "data-dd-privacy": "allow",
136
- children: c
136
+ children: s
137
137
  }
138
138
  ),
139
- !t && /* @__PURE__ */ e("span", { id: "profile-button-description", className: "uy:sr-only", children: a || /* @__PURE__ */ e(
139
+ !t && /* @__PURE__ */ e("span", { id: "profile-button-description", className: "uy:sr-only", children: r || /* @__PURE__ */ e(
140
140
  h,
141
141
  {
142
142
  id: "unity:component:app-menu:footer:profile-button:description",
@@ -144,7 +144,7 @@ const N = (t) => /* @__PURE__ */ l(
144
144
  }
145
145
  ) })
146
146
  ] }),
147
- /* @__PURE__ */ e("div", { className: "uy:p-100", children: t ? /* @__PURE__ */ e(A, { className: "uy:capitalize", variant: "neutral", children: u }) : /* @__PURE__ */ e(
147
+ /* @__PURE__ */ e("div", { className: "uy:p-100", children: t ? /* @__PURE__ */ e(H, { className: "uy:capitalize", variant: "neutral", children: y }) : /* @__PURE__ */ e(
148
148
  M,
149
149
  {
150
150
  src: "CaretUpDownOutlined",
@@ -155,18 +155,18 @@ const N = (t) => /* @__PURE__ */ l(
155
155
  ) })
156
156
  ] }), D = ({
157
157
  avatar: t,
158
- avatarPair: r,
158
+ avatarPair: a,
159
159
  badgeLabel: o,
160
- children: u,
161
- computeSlot: c,
162
- description: a,
160
+ children: y,
161
+ computeSlot: s,
162
+ description: r,
163
163
  title: n,
164
- menuTriggerDescription: s,
165
- uploadAvatarCallback: y,
164
+ menuTriggerDescription: u,
165
+ uploadAvatarCallback: c,
166
166
  uploadAvatarLabel: i,
167
167
  uploadAvatarDescription: d
168
168
  }) => {
169
- const { isMobileMenuOpen: f } = C(), [w, m] = v(!1), p = I(null), P = g(
169
+ const { isMobileMenuOpen: f } = S(), [w, p] = v(!1), m = A(null), P = g(
170
170
  "uy:fixed uy:bottom-0 uy:left-0 uy:right-0 uy:z-10 uy:bg-canvas",
171
171
  "uy:p-150",
172
172
  "uy:md:static uy:md:mt-auto uy:md:p-0 uy:md:bg-[transparent]",
@@ -179,50 +179,50 @@ const N = (t) => /* @__PURE__ */ l(
179
179
  "data-mobile-open": f,
180
180
  id: "app-menu-profile-button",
181
181
  children: [
182
- c,
182
+ s,
183
183
  /* @__PURE__ */ e(
184
184
  x,
185
185
  {
186
- ref: p,
187
- className: "uy:rounded-75 uy:px-150 uy:py-100 uy:w-full uy:not-aria-disabled:hover:bg-surface-neutral-hover uy:not-aria-disabled:active:bg-surface-neutral-active uy:not-aria-disabled:data-[pressed]:bg-surface-neutral-active uy:not-aria-disabled:focus-visible:outline-none uy:not-aria-disabled:focus-visible:ring-2 uy:not-aria-disabled:focus-visible:ring-utility-focus-ring uy:not-aria-disabled:focus-visible:ring-offset-2",
186
+ ref: m,
187
+ className: "uy:transition-colors uy:rounded-75 uy:px-150 uy:py-100 uy:w-full uy:not-aria-disabled:hover:bg-surface-neutral-hover uy:not-aria-disabled:active:bg-surface-neutral-active uy:not-aria-disabled:data-[pressed=true]:bg-surface-neutral-active uy:not-aria-disabled:focus-visible:outline-none uy:not-aria-disabled:focus-visible:ring-2 uy:not-aria-disabled:focus-visible:ring-utility-focus-ring uy:not-aria-disabled:focus-visible:ring-offset-2",
188
188
  "aria-labelledby": "profile-button-label",
189
189
  "aria-describedby": "profile-button-description",
190
190
  onPress: () => {
191
- m(!0);
191
+ p(!0);
192
192
  },
193
193
  children: /* @__PURE__ */ e(
194
194
  b,
195
195
  {
196
196
  avatar: t,
197
- avatarPair: r,
197
+ avatarPair: a,
198
198
  badgeLabel: o,
199
- description: a,
200
- menuTriggerDescription: s,
199
+ description: r,
200
+ menuTriggerDescription: u,
201
201
  title: n,
202
- uploadAvatarCallback: y,
202
+ uploadAvatarCallback: c,
203
203
  uploadAvatarLabel: i,
204
204
  uploadAvatarDescription: d
205
205
  }
206
206
  )
207
207
  }
208
208
  ),
209
- /* @__PURE__ */ e(E, { isOpen: w, onOpenChange: m, children: /* @__PURE__ */ l(S, { width: 312, placement: "top left", triggerRef: p, children: [
210
- /* @__PURE__ */ e(B, { className: "uy:rounded-75", children: /* @__PURE__ */ e(
209
+ /* @__PURE__ */ e(j, { isOpen: w, onOpenChange: p, children: /* @__PURE__ */ l(k, { width: 312, placement: "top left", triggerRef: m, children: [
210
+ /* @__PURE__ */ e(E, { className: "uy:rounded-75", children: /* @__PURE__ */ e(
211
211
  b,
212
212
  {
213
213
  asMenuHeader: !0,
214
214
  avatar: t,
215
- avatarPair: r,
215
+ avatarPair: a,
216
216
  badgeLabel: o,
217
- description: a,
218
- menuTriggerDescription: s,
217
+ description: r,
218
+ menuTriggerDescription: u,
219
219
  title: n,
220
- uploadAvatarCallback: y,
220
+ uploadAvatarCallback: c,
221
221
  uploadAvatarLabel: i,
222
222
  uploadAvatarDescription: d
223
223
  }
224
224
  ) }),
225
- u
225
+ y
226
226
  ] }) })
227
227
  ]
228
228
  }
@@ -2,16 +2,16 @@ import { jsx as l } from "react/jsx-runtime";
2
2
  import { useContext as u } from "react";
3
3
  import { uyMerge as m } from "@payfit/unity-themes";
4
4
  import { ComboBoxStateContext as a } from "react-aria-components";
5
- import { useIntl as i } from "react-intl";
6
- import { CircularIconButton as s } from "../../icon-button/CircularIconButton.js";
5
+ import { useIntl as s } from "react-intl";
6
+ import { CircularIconButton as i } from "../../icon-button/CircularIconButton.js";
7
7
  const c = ({
8
8
  className: e,
9
9
  isReadOnly: o,
10
10
  isDisabled: n
11
11
  }) => {
12
- const t = u(a), r = i();
13
- return !(t != null && t.inputValue) || o || n ? null : /* @__PURE__ */ l(
14
- s,
12
+ const t = u(a), r = s();
13
+ return !t?.inputValue || o || n ? null : /* @__PURE__ */ l(
14
+ i,
15
15
  {
16
16
  slot: null,
17
17
  title: r.formatMessage({
@@ -1,10 +1,10 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useRef as b, useContext as g } from "react";
3
- import { uyTv as x } from "@payfit/unity-themes";
4
- import { useDrag as D } from "@use-gesture/react";
5
- import { OverlayTriggerStateContext as v } from "react-aria-components";
6
- import { useBreakpointListener as S } from "../../../hooks/use-breakpoint-listener.js";
7
- const T = x({
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useRef as h, useContext as b } from "react";
3
+ import { uyTv as g } from "@payfit/unity-themes";
4
+ import { useDrag as x } from "@use-gesture/react";
5
+ import { OverlayTriggerStateContext as D } from "react-aria-components";
6
+ import { useBreakpointListener as v } from "../../../hooks/use-breakpoint-listener.js";
7
+ const S = g({
8
8
  slots: {
9
9
  base: [
10
10
  "uy:md:hidden uy:mx-auto uy:py-100 uy:w-500",
@@ -12,25 +12,24 @@ const T = x({
12
12
  ],
13
13
  indicator: "uy:h-50 uy:rounded-pill uy:bg-content-neutral-lowest"
14
14
  }
15
- }), I = 100;
16
- function N() {
17
- const r = b(null), o = g(v), n = S(), { base: i, indicator: l } = T(), m = n === "xs" || n === "sm", u = D(
18
- (c) => {
19
- var s;
15
+ }), T = 100;
16
+ function I() {
17
+ const r = h(null), o = b(D), n = v(), { base: a, indicator: i } = S(), l = n === "xs" || n === "sm", m = x(
18
+ (u) => {
20
19
  const {
21
- movement: [B, e],
22
- direction: [E, d],
23
- intentional: f,
24
- cancel: y,
25
- last: p,
26
- event: h
27
- } = c;
28
- if (!m) {
29
- y();
20
+ movement: [N, e],
21
+ direction: [B, c],
22
+ intentional: d,
23
+ cancel: f,
24
+ last: y,
25
+ event: p
26
+ } = u;
27
+ if (!l) {
28
+ f();
30
29
  return;
31
30
  }
32
- h.preventDefault();
33
- const t = (s = r.current) == null ? void 0 : s.closest(
31
+ p.preventDefault();
32
+ const t = r.current?.closest(
34
33
  "[data-unity-bottom-sheet]"
35
34
  );
36
35
  if (t) {
@@ -38,7 +37,7 @@ function N() {
38
37
  t.style.transform = "translate3d(0, 0, 0)";
39
38
  return;
40
39
  }
41
- t.style.transform = `translate3d(0, ${e}px, 0)`, t.style.transition = "none", p && f && (e > I || d > 0 ? o && setTimeout(() => {
40
+ t.style.transform = `translate3d(0, ${e}px, 0)`, t.style.transition = "none", y && d && (e > T || c > 0 ? o && setTimeout(() => {
42
41
  o.close();
43
42
  }, 50) : (t.style.transform = "translate3d(0, 0, 0)", t.style.transition = "transform 0.3s ease"));
44
43
  }
@@ -49,19 +48,19 @@ function N() {
49
48
  threshold: 5
50
49
  }
51
50
  );
52
- return /* @__PURE__ */ a(
51
+ return /* @__PURE__ */ s(
53
52
  "div",
54
53
  {
55
- className: i(),
54
+ className: a(),
56
55
  "aria-hidden": "true",
57
56
  ref: r,
58
- ...u(),
59
- children: /* @__PURE__ */ a("div", { className: l() })
57
+ ...m(),
58
+ children: /* @__PURE__ */ s("div", { className: i() })
60
59
  }
61
60
  );
62
61
  }
63
- N.displayName = "BottomSheetDragIndicator";
62
+ I.displayName = "BottomSheetDragIndicator";
64
63
  export {
65
- N as BottomSheetDragIndicator,
66
- T as bottomSheetDragIndicator
64
+ I as BottomSheetDragIndicator,
65
+ S as bottomSheetDragIndicator
67
66
  };
@@ -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
  interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Pick<LabelProps, 'isRequired' | 'requiredVariant'> {
@@ -24,7 +24,7 @@ interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName exten
24
24
  isLoading?: boolean;
25
25
  }
26
26
  export type CheckboxFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FieldProps<TFieldValues, TName>;
27
- type CheckboxFieldComponent = (<TSchema extends Schema>(props: CheckboxFieldProps<ZodInfer<TSchema>> & {
27
+ type CheckboxFieldComponent = (<TSchema extends Schema>(props: CheckboxFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
28
28
  ref?: ForwardedRef<HTMLLabelElement>;
29
29
  }) => JSX.Element) & {
30
30
  displayName?: string;
@@ -1,13 +1,14 @@
1
- import { jsxs as k, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as k, jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as C, useMemo as y } from "react";
3
3
  import { useFormContext as R } from "react-hook-form";
4
- import { Checkbox as q } from "../checkbox/Checkbox.js";
5
- import { FormField as P } from "../form-field/FormField.js";
4
+ import { createSchemaAdapter as q } from "../../utils/createSchemaAdapter.js";
5
+ import { Checkbox as P } from "../checkbox/Checkbox.js";
6
+ import { FormField as S } from "../form-field/FormField.js";
6
7
  import { FormControl as j } from "../form-field/parts/FormControl.js";
7
8
  import { FormFeedbackText as v } from "../form-field/parts/FormFeedbackText.js";
8
9
  import { isFieldRequired as w } from "../form-field/utils/isFieldRequired.js";
9
10
  import { useUnityFormProvider as N } from "../form/Form.context.js";
10
- function S({
11
+ function T({
11
12
  name: o,
12
13
  children: e,
13
14
  defaultSelected: r,
@@ -21,12 +22,12 @@ function S({
21
22
  requiredVariant: p,
22
23
  ...u
23
24
  }, x) {
24
- const { control: F, watch: h } = R(), { schema: m } = N(), a = y(
25
- () => w(m, o),
26
- [m, o]
27
- ), b = h(o);
25
+ const { control: F, watch: a } = R(), { schema: i } = N(), h = y(
26
+ () => w(q(i), o),
27
+ [i, o]
28
+ ), b = a(o);
28
29
  return /* @__PURE__ */ k(
29
- P,
30
+ S,
30
31
  {
31
32
  control: F,
32
33
  name: o,
@@ -38,17 +39,17 @@ function S({
38
39
  isReadOnly: f
39
40
  },
40
41
  children: [
41
- /* @__PURE__ */ i(j, { children: /* @__PURE__ */ i(
42
- q,
42
+ /* @__PURE__ */ m(j, { children: /* @__PURE__ */ m(
43
+ P,
43
44
  {
44
45
  ref: x,
45
46
  defaultSelected: r,
46
47
  isSelected: b,
47
48
  requiredVariant: p,
48
49
  helperText: t,
49
- feedbackText: /* @__PURE__ */ i(v, {}),
50
+ feedbackText: /* @__PURE__ */ m(v, {}),
50
51
  ...u,
51
- isRequired: a ?? s,
52
+ isRequired: h ?? s,
52
53
  children: e
53
54
  }
54
55
  ) }),
@@ -57,10 +58,10 @@ function S({
57
58
  }
58
59
  );
59
60
  }
60
- const T = C(function(e, r) {
61
- return S(e, r);
61
+ const U = C(function(e, r) {
62
+ return T(e, r);
62
63
  });
63
- T.displayName = "CheckboxField";
64
+ U.displayName = "CheckboxField";
64
65
  export {
65
- T as CheckboxField
66
+ U as CheckboxField
66
67
  };
@@ -1,6 +1,6 @@
1
+ import { StandardSchemaV1 } from '@standard-schema/spec';
1
2
  import { ForwardedRef, JSX, PropsWithChildren, 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 { CheckboxGroupProps } from '../checkbox-group/CheckboxGroup.js';
6
6
  import { LabelProps } from '../label/Label.js';
@@ -40,7 +40,7 @@ interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName exten
40
40
  onFocusChange?: (isFocused: boolean) => void;
41
41
  }
42
42
  export type CheckboxGroupFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FieldProps<TFieldValues, TName>;
43
- type CheckboxGroupFieldComponent = (<TSchema extends Schema>(props: CheckboxGroupFieldProps<ZodInfer<TSchema>> & {
43
+ type CheckboxGroupFieldComponent = (<TSchema extends Schema>(props: CheckboxGroupFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
44
44
  ref?: ForwardedRef<HTMLDivElement>;
45
45
  }) => JSX.Element) & {
46
46
  displayName?: string;
@@ -46,7 +46,10 @@ function P({
46
46
  ] });
47
47
  }
48
48
  const T = C(function(r, e) {
49
- return P(r, e);
49
+ return P(
50
+ r,
51
+ e
52
+ );
50
53
  });
51
54
  T.displayName = "CheckboxGroupField";
52
55
  export {
@@ -0,0 +1,37 @@
1
+ import { VariantProps } from '@payfit/unity-themes';
2
+ export declare const code: import('tailwind-variants').TVReturnType<{
3
+ [key: string]: {
4
+ [key: string]: import('tailwind-merge').ClassNameValue | {
5
+ base?: import('tailwind-merge').ClassNameValue;
6
+ pre?: import('tailwind-merge').ClassNameValue;
7
+ };
8
+ };
9
+ } | {
10
+ [x: string]: {
11
+ [x: string]: import('tailwind-merge').ClassNameValue | {
12
+ base?: import('tailwind-merge').ClassNameValue;
13
+ pre?: import('tailwind-merge').ClassNameValue;
14
+ };
15
+ };
16
+ } | {}, {
17
+ base: string[];
18
+ pre: string;
19
+ }, undefined, {
20
+ [key: string]: {
21
+ [key: string]: import('tailwind-merge').ClassNameValue | {
22
+ base?: import('tailwind-merge').ClassNameValue;
23
+ pre?: import('tailwind-merge').ClassNameValue;
24
+ };
25
+ };
26
+ } | {}, {
27
+ base: string[];
28
+ pre: string;
29
+ }, import('tailwind-variants').TVReturnType<unknown, {
30
+ base: string[];
31
+ pre: string;
32
+ }, undefined, unknown, unknown, undefined>>;
33
+ export interface CodeProps extends VariantProps<typeof code> {
34
+ children: string;
35
+ }
36
+ declare const Code: import('react').ForwardRefExoticComponent<CodeProps & import('react').RefAttributes<HTMLDivElement>>;
37
+ export { Code };
@@ -0,0 +1,39 @@
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import { uyTv as i } from "@payfit/unity-themes";
4
+ import { useIntl as c } from "react-intl";
5
+ import { CircularIconButton as p } from "../icon-button/CircularIconButton.js";
6
+ import { copyToClipboard as y } from "./copyToClipboard.js";
7
+ const m = i({
8
+ slots: {
9
+ base: [
10
+ "uy:group uy:flex uy:p-100 uy:self-stretch uy:content-end uy:gap-100 uy:font-mono uy:rounded-100 uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral-lowest"
11
+ ],
12
+ pre: "uy:grow uy:text-wrap"
13
+ }
14
+ }), f = n(
15
+ ({ children: o, ...e }, t) => {
16
+ const a = c(), { base: d, pre: s } = m(), u = () => {
17
+ y(o);
18
+ };
19
+ return /* @__PURE__ */ l("code", { ref: t, "data-dd-privacy": "allow", className: d(), ...e, children: [
20
+ /* @__PURE__ */ r("pre", { className: s(), children: o }),
21
+ /* @__PURE__ */ r(
22
+ p,
23
+ {
24
+ title: a.formatMessage({
25
+ id: "unity:command:code:icon:title",
26
+ defaultMessage: "Copy to clipboard"
27
+ }),
28
+ icon: "ClipboardOutlined",
29
+ onClick: u
30
+ }
31
+ )
32
+ ] });
33
+ }
34
+ );
35
+ f.displayName = "Code";
36
+ export {
37
+ f as Code,
38
+ m as code
39
+ };
@@ -0,0 +1 @@
1
+ export declare function copyToClipboard(text: string): Promise<boolean>;
@@ -0,0 +1,10 @@
1
+ async function a(r) {
2
+ try {
3
+ return await navigator.clipboard.writeText(r), !0;
4
+ } catch {
5
+ return !1;
6
+ }
7
+ }
8
+ export {
9
+ a as copyToClipboard
10
+ };
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DisclosureProps } from 'react-aria-components';
3
- export interface CollapsibleProps extends Omit<DisclosureProps, 'isDisabled' | 'defaultExpanded' | 'className'> {
3
+ export interface CollapsibleProps extends Omit<DisclosureProps, 'isDisabled' | 'className'> {
4
4
  /**
5
5
  * The content of the collapsible component.
6
6
  * Typically includes a CollapsibleTitle and CollapsibleContent.
@@ -1,8 +1,8 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as u } from "react";
3
- import { uyTv as e } from "@payfit/unity-themes";
4
- import { Disclosure as l } from "react-aria-components";
5
- const r = e({
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as e } from "react";
3
+ import { uyTv as l } from "@payfit/unity-themes";
4
+ import { Disclosure as r } from "react-aria-components";
5
+ const n = l({
6
6
  base: [
7
7
  "uy:w-full uy:rounded-50",
8
8
  "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-2",
@@ -10,20 +10,21 @@ const r = e({
10
10
  "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-offset-2",
11
11
  "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-utility-focus-ring"
12
12
  ]
13
- }), n = u(
14
- ({ children: i, isExpanded: t, ...o }, s) => /* @__PURE__ */ a(
15
- l,
13
+ }), f = e(
14
+ ({ children: i, isExpanded: t, defaultExpanded: o, ...s }, a) => /* @__PURE__ */ u(
15
+ r,
16
16
  {
17
17
  "data-dd-privacy": "allow",
18
- ...o,
19
- className: r(),
20
- ref: s,
18
+ ...s,
19
+ className: n(),
20
+ ref: a,
21
+ defaultExpanded: o,
21
22
  isExpanded: t,
22
23
  children: i
23
24
  }
24
25
  )
25
26
  );
26
- n.displayName = "Collapsible";
27
+ f.displayName = "Collapsible";
27
28
  export {
28
- n as Collapsible
29
+ f as Collapsible
29
30
  };