@payfit/unity-components 1.1.1-beta.1 → 2.0.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 (206) 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 +60 -62
  6. package/dist/esm/components/actionable/Actionable.d.ts +50 -3
  7. package/dist/esm/components/actionable/Actionable.js +58 -45
  8. package/dist/esm/components/app-layout/AppLayout.js +17 -17
  9. package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
  10. package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +86 -4
  11. package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
  12. package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
  13. package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
  14. package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
  15. package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
  16. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
  17. package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
  18. package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
  19. package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
  20. package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
  21. package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
  22. package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
  23. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
  24. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
  25. package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
  26. package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
  27. package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
  28. package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
  29. package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
  30. package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +39 -40
  31. package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
  32. package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +2 -2
  33. package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
  34. package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
  35. package/dist/esm/components/code/Code.d.ts +31 -1
  36. package/dist/esm/components/code/Code.js +39 -0
  37. package/dist/esm/components/code/copyToClipboard.js +10 -0
  38. package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
  39. package/dist/esm/components/data-table/DataTable.d.ts +76 -10
  40. package/dist/esm/components/data-table/DataTable.js +81 -78
  41. package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
  42. package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
  43. package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
  44. package/dist/esm/components/date-picker/DatePicker.js +64 -64
  45. package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
  46. package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
  47. package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
  48. package/dist/esm/components/error-state/ErrorState.d.ts +208 -0
  49. package/dist/esm/components/error-state/ErrorState.js +194 -0
  50. package/dist/esm/components/error-state/initConfig.d.ts +16 -0
  51. package/dist/esm/components/error-state/initConfig.js +149 -0
  52. package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
  53. package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
  54. package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
  55. package/dist/esm/components/fieldset/Fieldset.js +32 -26
  56. package/dist/esm/components/flex/Flex.js +52 -37
  57. package/dist/esm/components/form/Form.d.ts +15 -9
  58. package/dist/esm/components/form/Form.js +53 -50
  59. package/dist/esm/components/form-field/FormField.js +18 -17
  60. package/dist/esm/components/form-field/parts/{FormContextualLink.d.ts → RawFormContextualLink.d.ts} +2 -2
  61. package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
  62. package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
  63. package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
  64. package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
  65. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
  66. package/dist/esm/components/icon/Icon.js +23 -19
  67. package/dist/esm/components/input/Input.js +28 -28
  68. package/dist/esm/components/label/Label.js +19 -19
  69. package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
  70. package/dist/esm/components/link/{Link.variants.js → RawLink.js} +70 -4
  71. package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
  72. package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
  73. package/dist/esm/components/multi-select/MultiSelect.js +94 -94
  74. package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
  75. package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
  76. package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
  77. package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
  78. package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
  79. package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
  80. package/dist/esm/components/nav/parts/NavGroup.js +63 -52
  81. package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
  82. package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
  83. package/dist/esm/components/number-field/NumberField.d.ts +3 -3
  84. package/dist/esm/components/number-input/NumberInput.js +58 -58
  85. package/dist/esm/components/page/Page.js +1 -1
  86. package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
  87. package/dist/esm/components/page/parts/PageHeader.js +22 -20
  88. package/dist/esm/components/pagination/Pagination.d.ts +23 -44
  89. package/dist/esm/components/pagination/Pagination.js +89 -167
  90. package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
  91. package/dist/esm/components/pagination/PaginationContext.js +15 -0
  92. package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
  93. package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
  94. package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
  95. package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
  96. package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
  97. package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
  98. package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
  99. package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
  100. package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
  101. package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
  102. package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
  103. package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
  104. package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
  105. package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
  106. package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
  107. package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
  108. package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
  109. package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
  110. package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
  111. package/dist/esm/components/select/Select.js +63 -45
  112. package/dist/esm/components/select/parts/SelectOption.js +9 -9
  113. package/dist/esm/components/select-field/SelectField.d.ts +2 -2
  114. package/dist/esm/components/select-field/SelectField.js +4 -1
  115. package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
  116. package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
  117. package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
  118. package/dist/esm/components/skip-links/SkipLinks.js +1 -1
  119. package/dist/esm/components/table/Table.d.ts +1 -0
  120. package/dist/esm/components/table/Table.js +110 -98
  121. package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
  122. package/dist/esm/components/table/parts/TableBody.js +6 -6
  123. package/dist/esm/components/table/parts/TableCell.js +34 -31
  124. package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
  125. package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
  126. package/dist/esm/components/table/parts/TablePagination.js +61 -59
  127. package/dist/esm/components/table/parts/TableRow.js +21 -18
  128. package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
  129. package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
  130. package/dist/esm/components/tabs/parts/TabList.js +50 -54
  131. package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
  132. package/dist/esm/components/task-menu/parts/Content.js +24 -24
  133. package/dist/esm/components/task-menu/parts/Header.js +24 -24
  134. package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
  135. package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +74 -74
  136. package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
  137. package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +69 -69
  138. package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
  139. package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
  140. package/dist/esm/components/text/Text.js +30 -27
  141. package/dist/esm/components/text-area/TextArea.js +30 -31
  142. package/dist/esm/components/text-field/TextField.d.ts +2 -2
  143. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
  144. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
  145. package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
  146. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
  147. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
  148. package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
  149. package/dist/esm/hooks/use-container-query-level.js +33 -0
  150. package/dist/esm/hooks/use-form.d.ts +5 -5
  151. package/dist/esm/hooks/use-form.types.d.ts +2 -2
  152. package/dist/esm/hooks/use-resizable.js +13 -14
  153. package/dist/esm/index.d.ts +21 -10
  154. package/dist/esm/index.js +424 -396
  155. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
  156. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
  157. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
  158. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
  159. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
  160. package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +40 -0
  161. package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
  162. package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
  163. package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
  164. package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
  165. package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
  166. package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
  167. package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
  168. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
  169. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
  170. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
  171. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
  172. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
  173. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
  174. package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
  175. package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
  176. package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
  177. package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
  178. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
  179. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
  180. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
  181. package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
  182. package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
  183. package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
  184. package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
  185. package/dist/esm/integrations/tanstack-router/index.d.ts +16 -0
  186. package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
  187. package/dist/esm/integrations/tanstack-router.js +34 -0
  188. package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
  189. package/dist/esm/providers/router/RouterProvider.js +14 -10
  190. package/dist/esm/types/DataAttributes.d.ts +1 -1
  191. package/dist/esm/types/schema.d.ts +8 -0
  192. package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
  193. package/dist/esm/utils/createSchemaAdapter.js +13 -0
  194. package/dist/esm/utils/platform.js +2 -3
  195. package/i18n/en-GB.json +16 -0
  196. package/i18n/es-ES.json +16 -0
  197. package/i18n/fr-FR.json +16 -0
  198. package/package.json +56 -31
  199. package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
  200. package/dist/esm/components/link/Link.d.ts +0 -93
  201. package/dist/esm/components/link/Link.js +0 -68
  202. package/dist/esm/components/nav/parts/NavItem.js +0 -95
  203. /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
  204. /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
  205. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
  206. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +0 -0
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { DataAttributes } from '../../../types/DataAttributes.js';
3
- import { SubTaskProps } from './SubTask.js';
4
- import { TaskProps } from './Task.js';
3
+ import { SubTaskProps } from './RawSubTask.js';
4
+ import { TaskProps } from './RawTask.js';
5
5
  export interface TaskGroupProps extends Omit<TaskProps, 'href' | 'isExact' | 'isCurrent' | 'onPress' | 'isSelected'>, DataAttributes {
6
6
  /**
7
7
  * The subtasks that belong to this task group. Can be a single SubTask or an array of SubTask components.
@@ -19,9 +19,9 @@ export interface TaskGroupProps extends Omit<TaskProps, 'href' | 'isExact' | 'is
19
19
  * taskNumber={1}
20
20
  * taskStatus="uncompleted"
21
21
  * >
22
- * <SubTask uniqueId="profile" label="Complete Profile" href="/profile" />
23
- * <SubTask uniqueId="documents" label="Upload Documents" href="/documents" />
24
- * <SubTask uniqueId="training" label="Complete Training" href="/training" />
22
+ * <RawSubTask uniqueId="profile" label="Complete Profile" href="/profile" />
23
+ * <RawSubTask uniqueId="documents" label="Upload Documents" href="/documents" />
24
+ * <RawSubTask uniqueId="training" label="Complete Training" href="/training" />
25
25
  * </TaskGroup>
26
26
  * ```
27
27
  * @see {@link TaskGroupProps} for all available props
@@ -1,11 +1,11 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as j, Children as d, isValidElement as u, cloneElement as A } from "react";
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as j, Children as i, isValidElement as u, cloneElement as A } from "react";
3
3
  import { uyTv as V } from "@payfit/unity-themes";
4
4
  import { useId as $ } from "react-aria";
5
5
  import { Button as B } from "react-aria-components";
6
6
  import { useIntl as D } from "react-intl";
7
7
  import { Icon as F } from "../../icon/Icon.js";
8
- import { Text as g } from "../../text/Text.js";
8
+ import { Text as f } from "../../text/Text.js";
9
9
  import { useTaskMenuContext as H } from "../TaskMenu.context.js";
10
10
  import { commonTask as O } from "./task.variants.js";
11
11
  const P = V({
@@ -71,56 +71,56 @@ const P = V({
71
71
  }
72
72
  }
73
73
  ]
74
- }), R = (e, t) => e ? d.toArray(t).some(
75
- (r) => u(r) && r.props.uniqueId === e
76
- ) : !1, U = (e) => e ? d.toArray(e).find(
74
+ }), R = (e, t) => e ? i.toArray(t).some(
75
+ (s) => u(s) && s.props.uniqueId === e
76
+ ) : !1, U = (e) => e ? i.toArray(e).find(
77
77
  (t) => u(t) && t.props.taskStatus !== "completed" && t.props.taskStatus !== "locked"
78
78
  ) : null, J = j(
79
79
  ({
80
80
  children: e,
81
81
  label: t,
82
- taskNumber: r,
83
- taskStatus: p = "uncompleted",
84
- uniqueId: y,
85
- ...S
86
- }, h) => {
87
- const { currentTask: l, setCurrentTask: i, toggleTaskGroup: m, expandedTaskGroup: k } = H(), b = $(), T = D(), a = k === y, N = (o) => {
88
- if (m == null || m(y), !o) {
89
- const x = U(e);
90
- if (u(x)) {
91
- const { uniqueId: M, label: W } = x.props;
92
- i == null || i({ uniqueId: M, label: W });
82
+ taskNumber: s,
83
+ taskStatus: m = "uncompleted",
84
+ uniqueId: c,
85
+ ...g
86
+ }, k) => {
87
+ const { currentTask: v, setCurrentTask: x, toggleTaskGroup: S, expandedTaskGroup: h } = H(), d = $(), T = D(), a = h === c, N = (n) => {
88
+ if (S?.(c), !n) {
89
+ const b = U(e);
90
+ if (u(b)) {
91
+ const { uniqueId: M, label: W } = b.props;
92
+ x?.({ uniqueId: M, label: W });
93
93
  }
94
94
  }
95
- }, I = d.map(e, (o) => u(o) ? A(o, { isDisabled: !a }) : o), f = `${b}-toggle`, v = `${b}-content`, s = R(
96
- l == null ? void 0 : l.uniqueId,
95
+ }, I = i.map(e, (n) => u(n) ? A(n, { isDisabled: !a }) : n), p = `${d}-toggle`, y = `${d}-content`, o = R(
96
+ v?.uniqueId,
97
97
  e
98
- ), { base: w, number: E, text: z, bar: q, element: C, containerSubTasks: G } = P({
99
- taskStatus: p,
100
- hasSelectedSubTask: s,
98
+ ), { base: w, number: C, text: E, bar: G, element: z, containerSubTasks: q } = P({
99
+ taskStatus: m,
100
+ hasSelectedSubTask: o,
101
101
  expanded: a
102
102
  });
103
- return /* @__PURE__ */ c(
103
+ return /* @__PURE__ */ l(
104
104
  "li",
105
105
  {
106
- ref: h,
106
+ ref: k,
107
107
  "data-group": "true",
108
- "data-active-group": s,
108
+ "data-active-group": o,
109
109
  className: w(),
110
110
  children: [
111
- /* @__PURE__ */ c(
111
+ /* @__PURE__ */ l(
112
112
  B,
113
113
  {
114
- id: f,
115
- className: C(),
114
+ id: p,
115
+ className: z(),
116
116
  onPress: () => {
117
117
  N(a);
118
118
  },
119
119
  "aria-expanded": a,
120
- "aria-controls": v,
121
- ...S,
120
+ "aria-controls": y,
121
+ ...g,
122
122
  children: [
123
- /* @__PURE__ */ n("div", { className: E(), children: p === "completed" ? /* @__PURE__ */ n(
123
+ /* @__PURE__ */ r("div", { className: C(), children: m === "completed" ? /* @__PURE__ */ r(
124
124
  F,
125
125
  {
126
126
  size: 24,
@@ -130,39 +130,39 @@ const P = V({
130
130
  defaultMessage: "Completed"
131
131
  })
132
132
  }
133
- ) : /* @__PURE__ */ n(
134
- g,
133
+ ) : /* @__PURE__ */ r(
134
+ f,
135
135
  {
136
136
  asElement: "span",
137
- variant: s ? "bodyStrong" : "body",
137
+ variant: o ? "bodyStrong" : "body",
138
138
  className: "uy:leading-[1]",
139
- children: r
139
+ children: s
140
140
  }
141
141
  ) }),
142
- /* @__PURE__ */ n(
143
- g,
142
+ /* @__PURE__ */ r(
143
+ f,
144
144
  {
145
145
  asElement: "span",
146
- className: z(),
147
- variant: s ? "bodyStrong" : "body",
146
+ className: E(),
147
+ variant: o ? "bodyStrong" : "body",
148
148
  children: t
149
149
  }
150
150
  )
151
151
  ]
152
152
  }
153
153
  ),
154
- /* @__PURE__ */ c("div", { style: { maxHeight: a ? 1e3 : 0 }, children: [
155
- /* @__PURE__ */ n(
154
+ /* @__PURE__ */ l("div", { style: { maxHeight: a ? 1e3 : 0 }, children: [
155
+ /* @__PURE__ */ r(
156
156
  "ol",
157
157
  {
158
- id: v,
159
- "aria-labelledby": f,
158
+ id: y,
159
+ "aria-labelledby": p,
160
160
  "aria-hidden": !a,
161
- className: G(),
161
+ className: q(),
162
162
  children: I
163
163
  }
164
164
  ),
165
- /* @__PURE__ */ n("div", { role: "presentation", className: q() })
165
+ /* @__PURE__ */ r("div", { role: "presentation", className: G() })
166
166
  ] })
167
167
  ]
168
168
  }
@@ -1,7 +1,7 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as c } from "react";
3
- import { text as h } from "./Text.variants.js";
4
- const y = {
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { forwardRef as y, useMemo as c } from "react";
3
+ import { text as g } from "./Text.variants.js";
4
+ const b = {
5
5
  inherit: "span",
6
6
  h1: "h1",
7
7
  h2: "h2",
@@ -21,38 +21,41 @@ const y = {
21
21
  actionLarge: "span",
22
22
  actionSmall: "span",
23
23
  actionInfo: "span"
24
- }, g = c(
24
+ }, x = y(
25
25
  ({
26
- children: e,
26
+ children: l,
27
27
  variant: o,
28
- color: n,
29
- isTruncated: a,
30
- lineClamp: t,
31
- asElement: s,
32
- className: r,
33
- ...l
28
+ color: t,
29
+ isTruncated: e,
30
+ lineClamp: s,
31
+ asElement: m,
32
+ className: n,
33
+ ...r
34
34
  }, i) => {
35
- const m = h({
36
- variant: o,
37
- color: n,
38
- isTruncated: a,
39
- isLineClamped: t !== void 0,
40
- className: r
41
- }), p = y[o ?? "inherit"];
42
- return /* @__PURE__ */ d(
43
- s ?? p,
35
+ const a = s !== void 0, p = c(
36
+ () => g({
37
+ variant: o,
38
+ color: t,
39
+ isTruncated: e,
40
+ isLineClamped: a,
41
+ className: n
42
+ }),
43
+ [n, t, a, e, o]
44
+ ), d = b[o ?? "inherit"];
45
+ return /* @__PURE__ */ h(
46
+ m ?? d,
44
47
  {
45
48
  "data-dd-privacy": "mask",
46
- ...l,
49
+ ...r,
47
50
  ref: i,
48
- className: m,
49
- style: { "--uy-text-line-clamp": t },
50
- children: e
51
+ className: p,
52
+ style: { "--uy-text-line-clamp": s },
53
+ children: l
51
54
  }
52
55
  );
53
56
  }
54
57
  );
55
- g.displayName = "Text";
58
+ x.displayName = "Text";
56
59
  export {
57
- g as Text
60
+ x as Text
58
61
  };
@@ -1,15 +1,15 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as v } from "react";
3
- import { uyTv as w } from "@payfit/unity-themes";
4
- import { TextArea as M } from "react-aria-components";
5
- import { useIntl as z } from "react-intl";
6
- import { useResizable as L } from "../../hooks/use-resizable.js";
7
- import { Icon as D } from "../icon/Icon.js";
8
- import { Spinner as N } from "../spinner/Spinner.js";
9
- const W = w({
2
+ import { forwardRef as x } from "react";
3
+ import { uyTv as h } from "@payfit/unity-themes";
4
+ import { TextArea as v } from "react-aria-components";
5
+ import { useIntl as w } from "react-intl";
6
+ import { useResizable as M } from "../../hooks/use-resizable.js";
7
+ import { Icon as z } from "../icon/Icon.js";
8
+ import { Spinner as L } from "../spinner/Spinner.js";
9
+ const D = h({
10
10
  slots: {
11
- base: "uy:flex uy:border uy:border-solid uy:rounded-100 uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2 uy:active:border-border-form-active uy:overflow-hidden uy:relative",
12
- inputWrapper: "uy:flex uy:gap-50 uy:flex-grow uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-100",
11
+ base: "uy:flex uy:border uy:border-solid uy:rounded-75 uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2 uy:active:border-border-form-active uy:overflow-hidden uy:relative",
12
+ inputWrapper: "uy:flex uy:gap-50 uy:flex-grow uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-75",
13
13
  input: "uy:flex-grow uy:flex-shrink uy:outline-none uy:typography-body uy:placeholder:text-content-neutral-lowest uy:resize-none",
14
14
  state: "uy:flex uy:gap-50 uy:flex-shrink-0 uy:basis-250",
15
15
  resizeHandle: "uy:absolute uy:bottom-25 uy:right-25 uy:w-100 uy:h-100 uy:cursor-se-resize uy:flex uy:items-center uy:justify-center"
@@ -56,38 +56,38 @@ const W = w({
56
56
  isDisabled: !1,
57
57
  isReadOnly: !1
58
58
  }
59
- }), k = v(
59
+ }), N = x(
60
60
  ({
61
61
  isInvalid: n,
62
62
  isLoading: s,
63
63
  isDisabled: a,
64
64
  isReadOnly: r,
65
65
  isResizable: i = !1,
66
- ...y
67
- }, b) => {
68
- const o = z(), { containerRef: l, handleResizeStart: m } = L({
66
+ ...d
67
+ }, f) => {
68
+ const o = w(), { containerRef: l, handleResizeStart: y } = M({
69
69
  isDisabled: !i || a || r
70
- }), { base: c, inputWrapper: p, input: g, state: x, resizeHandle: h } = W({
70
+ }), { base: b, inputWrapper: m, input: c, state: p, resizeHandle: g } = D({
71
71
  isInvalid: n,
72
72
  isDisabled: a,
73
73
  isReadOnly: r
74
74
  });
75
- return /* @__PURE__ */ t("div", { ref: l, className: c(), children: [
76
- /* @__PURE__ */ t("div", { className: p(), children: [
75
+ return /* @__PURE__ */ t("div", { ref: l, className: b(), children: [
76
+ /* @__PURE__ */ t("div", { className: m(), children: [
77
77
  /* @__PURE__ */ e(
78
- M,
78
+ v,
79
79
  {
80
80
  "data-dd-privacy": "mask",
81
- ...y,
82
- ref: b,
83
- className: g(),
81
+ ...d,
82
+ ref: f,
83
+ className: c(),
84
84
  "aria-busy": s,
85
85
  readOnly: r
86
86
  }
87
87
  ),
88
- /* @__PURE__ */ t("div", { className: x(), children: [
88
+ /* @__PURE__ */ t("div", { className: p(), children: [
89
89
  s && /* @__PURE__ */ e(
90
- N,
90
+ L,
91
91
  {
92
92
  color: "inherit",
93
93
  size: "small",
@@ -98,7 +98,7 @@ const W = w({
98
98
  }
99
99
  ),
100
100
  n && /* @__PURE__ */ e(
101
- D,
101
+ z,
102
102
  {
103
103
  src: "WarningCircleOutlined",
104
104
  color: "content.form.invalid",
@@ -113,8 +113,8 @@ const W = w({
113
113
  i && !a && !r && /* @__PURE__ */ e(
114
114
  "div",
115
115
  {
116
- className: h(),
117
- onMouseDown: m,
116
+ className: g(),
117
+ onMouseDown: y,
118
118
  role: "button",
119
119
  tabIndex: 0,
120
120
  "aria-label": o.formatMessage({
@@ -122,8 +122,7 @@ const W = w({
122
122
  defaultMessage: "Resize textarea"
123
123
  }),
124
124
  onKeyDown: (u) => {
125
- var d, f;
126
- (u.key === "Enter" || u.key === " ") && (u.preventDefault(), (f = (d = l.current) == null ? void 0 : d.querySelector("textarea")) == null || f.focus());
125
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), l.current?.querySelector("textarea")?.focus());
127
126
  },
128
127
  children: /* @__PURE__ */ t(
129
128
  "svg",
@@ -156,8 +155,8 @@ const W = w({
156
155
  ] });
157
156
  }
158
157
  );
159
- k.displayName = "TextArea";
158
+ N.displayName = "TextArea";
160
159
  export {
161
- k as TextArea,
162
- W as textArea
160
+ N as TextArea,
161
+ D as textArea
163
162
  };
@@ -1,6 +1,6 @@
1
+ import { StandardSchemaV1 } from '@standard-schema/spec';
1
2
  import { ForwardedRef, HTMLAttributes, 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 { InputProps } from '../input/Input.js';
6
6
  import { LabelProps } from '../label/Label.js';
@@ -30,7 +30,7 @@ interface TextFieldWithTextAreaProps<TFieldValues extends FieldValues = FieldVal
30
30
  type?: never;
31
31
  }
32
32
  export type TextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = TextFieldWithInputProps<TFieldValues, TName> | TextFieldWithTextAreaProps<TFieldValues, TName>;
33
- type TextFieldComponent = (<TSchema extends Schema>(props: TextFieldProps<ZodInfer<TSchema>> & {
33
+ type TextFieldComponent = (<TSchema extends Schema>(props: TextFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
34
34
  ref?: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>;
35
35
  }) => JSX.Element) & {
36
36
  displayName?: string;
@@ -1,6 +1,6 @@
1
+ import { StandardSchemaV1 } from '@standard-schema/spec';
1
2
  import { ForwardedRef, JSX } 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
  interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> {
6
6
  /** The name of the field, which should match the form schema. */
@@ -23,7 +23,7 @@ interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName exten
23
23
  isLabelSrOnly?: boolean;
24
24
  }
25
25
  export type ToggleSwitchFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FieldProps<TFieldValues, TName>;
26
- type ToggleSwitchFieldComponent = (<TSchema extends Schema>(props: ToggleSwitchFieldProps<ZodInfer<TSchema>> & {
26
+ type ToggleSwitchFieldComponent = (<TSchema extends Schema>(props: ToggleSwitchFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
27
27
  ref?: ForwardedRef<HTMLLabelElement>;
28
28
  }) => JSX.Element) & {
29
29
  displayName?: string;
@@ -49,7 +49,10 @@ function y({
49
49
  );
50
50
  }
51
51
  const j = u(function(r, e) {
52
- return y(r, e);
52
+ return y(
53
+ r,
54
+ e
55
+ );
53
56
  });
54
57
  j.displayName = "ToggleSwitchField";
55
58
  export {
@@ -1,99 +1,99 @@
1
- import { jsxs as A, jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as B, useState as H, useId as J, useRef as K, useCallback as Q, isValidElement as V, cloneElement as N, Children as U } from "react";
3
- import { uyTv as W } from "@payfit/unity-themes";
4
- import { Label as X } from "../label/Label.js";
5
- import { Text as R } from "../text/Text.js";
6
- const Y = W({
1
+ import { jsxs as k, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as q, useState as z, useId as A, useRef as H, useCallback as J, isValidElement as B, cloneElement as w, Children as K } from "react";
3
+ import { uyTv as Q } from "@payfit/unity-themes";
4
+ import { Label as U } from "../label/Label.js";
5
+ import { Text as j } from "../text/Text.js";
6
+ const W = Q({
7
7
  base: "uy:flex uy:flex-col uy:gap-50"
8
8
  });
9
- function Z(n) {
10
- if (!V(n)) return !1;
11
- const r = n.props;
12
- return typeof r == "object" && r !== null && "value" in r && typeof r.value == "string";
9
+ function X(i) {
10
+ if (!B(i)) return !1;
11
+ const o = i.props;
12
+ return typeof o == "object" && o !== null && "value" in o && typeof o.value == "string";
13
13
  }
14
- const _ = B(
14
+ const Y = q(
15
15
  ({
16
- label: n,
17
- helperText: r,
18
- feedbackText: l,
19
- isDisabled: b,
20
- isReadOnly: G,
21
- isInvalid: c,
22
- isRequired: S,
23
- children: I,
24
- requiredVariant: h,
25
- value: g,
26
- defaultValue: M,
27
- onChange: a,
28
- onFocus: u,
29
- onBlur: p,
30
- onFocusChange: t,
31
- ...O
32
- }, $) => {
33
- const f = g !== void 0, [x, D] = H(
34
- M ?? []
35
- ), s = f ? g : x, w = J(), j = r ? `${w}-helper` : void 0, y = c && l ? `${w}-feedback` : void 0, L = [j, y].filter(Boolean).join(" ") || void 0, E = K(!1), P = (e) => {
36
- E.current = !0, u == null || u(e), t == null || t(!0);
37
- }, k = (e) => {
38
- E.current = !1, p == null || p(e), t == null || t(!1);
39
- }, q = Q(
16
+ label: i,
17
+ helperText: o,
18
+ feedbackText: r,
19
+ isDisabled: f,
20
+ isReadOnly: E,
21
+ isInvalid: a,
22
+ isRequired: y,
23
+ children: N,
24
+ requiredVariant: R,
25
+ value: m,
26
+ defaultValue: V,
27
+ onChange: g,
28
+ onFocus: C,
29
+ onBlur: G,
30
+ onFocusChange: h,
31
+ ...I
32
+ }, F) => {
33
+ const c = m !== void 0, [M, O] = z(
34
+ V ?? []
35
+ ), n = c ? m : M, v = A(), b = o ? `${v}-helper` : void 0, d = a && r ? `${v}-feedback` : void 0, $ = [b, d].filter(Boolean).join(" ") || void 0, S = H(!1), x = (e) => {
36
+ S.current = !0, C?.(e), h?.(!0);
37
+ }, D = (e) => {
38
+ S.current = !1, G?.(e), h?.(!1);
39
+ }, L = J(
40
40
  (e) => {
41
- let i;
42
- s.includes(e) ? i = s.filter((o) => o !== e) : i = [...s, e], f || D(i), a == null || a(i);
41
+ let l;
42
+ n.includes(e) ? l = n.filter((s) => s !== e) : l = [...n, e], c || O(l), g?.(l);
43
43
  },
44
- [s, f, a]
45
- ), z = () => U.map(I, (e, i) => {
46
- if (!Z(e)) return e;
47
- const o = e, m = o.props, v = m.value;
48
- return N(o, {
49
- key: o.key ?? i,
50
- isSelected: s.includes(v),
51
- isDisabled: b ?? m.isDisabled,
52
- isReadOnly: G ?? m.isReadOnly,
53
- value: v,
44
+ [n, c, g]
45
+ ), P = () => K.map(N, (e, l) => {
46
+ if (!X(e)) return e;
47
+ const s = e, u = s.props, p = u.value;
48
+ return w(s, {
49
+ key: s.key ?? l,
50
+ isSelected: n.includes(p),
51
+ isDisabled: f ?? u.isDisabled,
52
+ isReadOnly: E ?? u.isReadOnly,
53
+ value: p,
54
54
  onChange: () => {
55
- q(v);
55
+ L(p);
56
56
  }
57
57
  });
58
58
  });
59
- return /* @__PURE__ */ A(
59
+ return /* @__PURE__ */ k(
60
60
  "fieldset",
61
61
  {
62
- ...O,
63
- ref: $,
64
- className: Y(),
65
- "aria-describedby": L,
66
- "aria-invalid": c || void 0,
67
- "aria-required": S || void 0,
68
- disabled: b,
69
- onFocus: P,
70
- onBlur: k,
62
+ ...I,
63
+ ref: F,
64
+ className: W(),
65
+ "aria-describedby": $,
66
+ "aria-invalid": a || void 0,
67
+ "aria-required": y || void 0,
68
+ disabled: f,
69
+ onFocus: x,
70
+ onBlur: D,
71
71
  children: [
72
- /* @__PURE__ */ d("legend", { className: "uy:mb-50", children: /* @__PURE__ */ d(X, { isRequired: S, requiredVariant: h, children: n }) }),
73
- r && /* @__PURE__ */ d(
74
- R,
72
+ /* @__PURE__ */ t("legend", { className: "uy:mb-50", children: /* @__PURE__ */ t(U, { isRequired: y, requiredVariant: R, children: i }) }),
73
+ o && /* @__PURE__ */ t(
74
+ j,
75
75
  {
76
- id: j,
76
+ id: b,
77
77
  variant: "bodySmall",
78
78
  color: "content.neutral.low",
79
79
  slot: "description",
80
- children: r
80
+ children: o
81
81
  }
82
82
  ),
83
- /* @__PURE__ */ d("div", { className: "uy:mt-100 uy:flex uy:flex-col uy:gap-150 uy:py-25", children: z() }),
84
- c && l && (typeof l == "string" ? /* @__PURE__ */ d(
85
- R,
83
+ /* @__PURE__ */ t("div", { className: "uy:mt-100 uy:flex uy:flex-col uy:gap-150 uy:py-25", children: P() }),
84
+ a && r && (typeof r == "string" ? /* @__PURE__ */ t(
85
+ j,
86
86
  {
87
- id: y,
87
+ id: d,
88
88
  variant: "bodySmallStrong",
89
89
  color: "content.form.invalid",
90
90
  slot: "errorMessage",
91
- children: l
91
+ children: r
92
92
  }
93
- ) : V(l) && N(
94
- l,
93
+ ) : B(r) && w(
94
+ r,
95
95
  {
96
- id: y,
96
+ id: d,
97
97
  slot: "errorMessage"
98
98
  }
99
99
  ))
@@ -102,8 +102,8 @@ const _ = B(
102
102
  );
103
103
  }
104
104
  );
105
- _.displayName = "ToggleSwitchGroup";
105
+ Y.displayName = "ToggleSwitchGroup";
106
106
  export {
107
- _ as ToggleSwitchGroup,
108
- Y as toggleSwitchGroup
107
+ Y as ToggleSwitchGroup,
108
+ W as toggleSwitchGroup
109
109
  };
@@ -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 { LabelProps } from '../label/Label.js';
6
6
  import { ToggleSwitchGroupProps } from '../toggle-switch-group/ToggleSwitchGroup.js';
@@ -33,7 +33,7 @@ interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName exten
33
33
  onFocusChange?: (isFocused: boolean) => void;
34
34
  }
35
35
  export type ToggleSwitchGroupFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FieldProps<TFieldValues, TName>;
36
- type ToggleSwitchGroupFieldComponent = (<TSchema extends Schema>(props: ToggleSwitchGroupFieldProps<ZodInfer<TSchema>> & {
36
+ type ToggleSwitchGroupFieldComponent = (<TSchema extends Schema>(props: ToggleSwitchGroupFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
37
37
  ref?: ForwardedRef<HTMLFieldSetElement>;
38
38
  }) => JSX.Element) & {
39
39
  displayName?: string;