@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,15 +1,15 @@
1
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as W } from "react";
3
- import { uyTv as m } from "@payfit/unity-themes";
4
- import { DatePicker as I, Group as P, Button as U, Popover as j, Dialog as E } from "react-aria-components";
5
- import { useIntl as M } from "react-intl";
6
- import { DateCalendar as O } from "../date-calendar/DateCalendar.js";
7
- import { Icon as R } from "../icon/Icon.js";
8
- import { DateInput as G } from "./parts/DateInput.js";
9
- const T = m({
1
+ import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as V } from "react";
3
+ import { uyTv as b } from "@payfit/unity-themes";
4
+ import { DatePicker as N, Group as O, Button as W, Popover as I, Dialog as U } from "react-aria-components";
5
+ import { useIntl as B } from "react-intl";
6
+ import { DateCalendar as j } from "../date-calendar/DateCalendar.js";
7
+ import { Icon as E } from "../icon/Icon.js";
8
+ import { DateInput as M } from "./parts/DateInput.js";
9
+ const R = b({
10
10
  slots: {
11
11
  base: [
12
- "uy:group uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-100",
12
+ "uy:group uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-75",
13
13
  "uy:active:border-border-form-active uy:data-[focus-visible]:border-border-form-active"
14
14
  ],
15
15
  inputWrapper: [
@@ -20,7 +20,7 @@ const T = m({
20
20
  "uy:group-[:has(button:focus)]:data-[focus-within]:outline-none uy:group-[:has(button:focus)]:data-[focus-within]:outline-offset-0 uy:group-[:has(button:focus)]:data-[focus-within]:outline-transparent"
21
21
  ],
22
22
  suffix: [
23
- "uy:flex-grow-0 uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-l uy:border-solid uy:rounded-r-100 uy:text-content-neutral-low",
23
+ "uy:flex-grow-0 uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-l uy:border-solid uy:rounded-r-75 uy:text-content-neutral-low",
24
24
  "uy:hover:bg-surface-neutral-hover uy:active:bg-surface-neutral-pressed uy:active:border-border-form-active uy:data-[pressed]:bg-surface-neutral-pressed uy:data-[pressed]:border-border-form-active",
25
25
  "uy:focus-visible:outline-2 uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-[3px]"
26
26
  ]
@@ -58,7 +58,7 @@ const T = m({
58
58
  }
59
59
  }
60
60
  ]
61
- }), $ = m({
61
+ }), G = b({
62
62
  base: "uy:overflow-auto uy:shadow-floating uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:rounded-75",
63
63
  variants: {
64
64
  isEntering: {
@@ -68,68 +68,68 @@ const T = m({
68
68
  true: "uy:animate-out uy:fade-out uy:data-[placement-bottom]:slide-out-to-top-1 uy:data-[placement-top]:slide-out-to-bottom-1 uy:duration-150 uy:ease-in"
69
69
  }
70
70
  }
71
- }), q = W(
71
+ }), T = V(
72
72
  ({
73
- value: f,
74
- defaultValue: n,
75
- isInvalid: b,
76
- isLoading: p,
77
- isDisabled: t,
78
- isReadOnly: u,
79
- onClearButtonPress: d,
80
- onBlur: o,
81
- onFocus: i,
82
- onChange: s,
83
- onOpenChange: l,
84
- id: v,
73
+ value: u,
74
+ defaultValue: i,
75
+ isInvalid: n,
76
+ isLoading: y,
77
+ isDisabled: o,
78
+ isReadOnly: t,
79
+ onClearButtonPress: c,
80
+ onBlur: s,
81
+ onFocus: d,
82
+ onChange: m,
83
+ onOpenChange: p,
84
+ id: g,
85
85
  ...e
86
- }, z) => {
87
- const g = M(), { base: x, inputWrapper: h, suffix: D } = T({
88
- isInvalid: !!b,
89
- isReadOnly: !!u,
90
- isDisabled: !!t
91
- }), y = (r) => {
92
- s == null || s(r);
86
+ }, $) => {
87
+ const h = B(), { base: v, inputWrapper: x, suffix: D } = R({
88
+ isInvalid: !!n,
89
+ isReadOnly: !!t,
90
+ isDisabled: !!o
91
+ }), l = (r) => {
92
+ m?.(r);
93
93
  }, w = (r) => {
94
- l == null || l(r), r ? i == null || i() : o == null || o();
95
- }, k = (r) => e.isDateUnavailable ? e.isDateUnavailable(r) : !1, V = () => {
96
- d == null || d();
94
+ p?.(r), r ? d?.() : s?.();
95
+ }, k = (r) => e.isDateUnavailable ? e.isDateUnavailable(r) : !1, C = () => {
96
+ c?.();
97
97
  };
98
- return /* @__PURE__ */ c(
99
- I,
98
+ return /* @__PURE__ */ f(
99
+ N,
100
100
  {
101
101
  "data-dd-privacy": "mask",
102
102
  ...e,
103
- className: x(),
104
- value: f,
105
- defaultValue: n,
103
+ className: v(),
104
+ value: u,
105
+ defaultValue: i,
106
106
  minValue: e.minValue,
107
107
  maxValue: e.maxValue,
108
- isReadOnly: !!u,
109
- isDisabled: !!t,
110
- onChange: y,
111
- onFocus: i,
112
- onBlur: o,
108
+ isReadOnly: !!t,
109
+ isDisabled: !!o,
110
+ onChange: l,
111
+ onFocus: d,
112
+ onBlur: s,
113
113
  onOpenChange: w,
114
114
  isDateUnavailable: k,
115
115
  children: [
116
- /* @__PURE__ */ c(P, { className: h(), id: v, children: [
116
+ /* @__PURE__ */ f(O, { className: x(), id: g, children: [
117
117
  /* @__PURE__ */ a(
118
- G,
118
+ M,
119
119
  {
120
- isLoading: p,
121
- isDisabled: t,
122
- isReadOnly: u,
123
- isInvalid: b,
124
- onClearButtonPress: V
120
+ isLoading: y,
121
+ isDisabled: o,
122
+ isReadOnly: t,
123
+ isInvalid: n,
124
+ onClearButtonPress: C
125
125
  }
126
126
  ),
127
- /* @__PURE__ */ a(U, { className: D(), isDisabled: u || t, children: /* @__PURE__ */ a(
128
- R,
127
+ /* @__PURE__ */ a(W, { className: D(), isDisabled: t || o, children: /* @__PURE__ */ a(
128
+ E,
129
129
  {
130
130
  src: "CalendarBlankOutlined",
131
131
  color: "inherit",
132
- alt: g.formatMessage({
132
+ alt: h.formatMessage({
133
133
  id: "unity:component:form-field:date-picker:calendar-button",
134
134
  defaultMessage: "Open Calendar"
135
135
  })
@@ -137,17 +137,17 @@ const T = m({
137
137
  ) })
138
138
  ] }),
139
139
  /* @__PURE__ */ a(
140
- j,
140
+ I,
141
141
  {
142
- className: ({ isEntering: r, isExiting: N }) => $({ isEntering: r, isExiting: N }),
143
- children: /* @__PURE__ */ a(E, { className: "uy:p-150", "data-dd-privacy": "mask", children: /* @__PURE__ */ a(
144
- O,
142
+ className: ({ isEntering: r, isExiting: P }) => G({ isEntering: r, isExiting: P }),
143
+ children: /* @__PURE__ */ a(U, { className: "uy:p-150", "data-dd-privacy": "mask", children: /* @__PURE__ */ a(
144
+ j,
145
145
  {
146
- value: f,
147
- defaultValue: n,
146
+ value: u,
147
+ defaultValue: i,
148
148
  minValue: e.minValue,
149
149
  maxValue: e.maxValue,
150
- onChange: y,
150
+ onChange: l,
151
151
  firstDayOfWeek: e.firstDayOfWeek
152
152
  }
153
153
  ) })
@@ -158,7 +158,7 @@ const T = m({
158
158
  );
159
159
  }
160
160
  );
161
- q.displayName = "DatePicker";
161
+ T.displayName = "DatePicker";
162
162
  export {
163
- q as DatePicker
163
+ T as DatePicker
164
164
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import { useContext as b } from "react";
3
- import { uyTv as d } from "@payfit/unity-themes";
3
+ import { uyTv as i } from "@payfit/unity-themes";
4
4
  import { DatePickerStateContext as g, DateInput as x, DateSegment as v } from "react-aria-components";
5
5
  import { useIntl as I } from "react-intl";
6
6
  import { CircularIconButton as h } from "../../icon-button/CircularIconButton.js";
7
7
  import { Icon as D } from "../../icon/Icon.js";
8
- import { Spinner as M } from "../../spinner/Spinner.js";
9
- const N = d({
8
+ import { Spinner as C } from "../../spinner/Spinner.js";
9
+ const M = i({
10
10
  base: "uy:group uy:box-content uy:rounded-25 uy:px-25 uy:text-end uy:tabular-nums! uy:outline-none uy:typography-body uy:focus:bg-surface-form-active uy:focus:rounded-25 uy:focus:text-content-inverted uy:data-[disabled]:text-content-form-disabled",
11
11
  variants: {
12
12
  isPlaceholder: {
@@ -18,7 +18,7 @@ const N = d({
18
18
  false: ""
19
19
  }
20
20
  }
21
- }), w = d({
21
+ }), N = i({
22
22
  slots: {
23
23
  base: "uy:flex uy:gap-50 uy:flex-grow uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-100",
24
24
  input: "uy:flex uy:gap-25 uy:w-fit uy:grow",
@@ -54,47 +54,47 @@ const N = d({
54
54
  }
55
55
  ]
56
56
  });
57
- function O({
58
- isLoading: n,
59
- isInvalid: u,
60
- isReadOnly: s,
61
- isDisabled: l,
62
- onClearButtonPress: a
57
+ function P({
58
+ isLoading: r,
59
+ isInvalid: o,
60
+ isReadOnly: n,
61
+ isDisabled: s,
62
+ onClearButtonPress: d
63
63
  }) {
64
- const o = I(), t = b(g), { dateValue: c } = t, { base: m, input: y, state: f } = w({
65
- isInvalid: !!u,
66
- isReadOnly: !!s,
67
- isDisabled: !!l
68
- }), p = c && !n && !s && !l;
69
- return /* @__PURE__ */ i("div", { className: m(), children: [
70
- /* @__PURE__ */ e(x, { className: y(), children: (r) => /* @__PURE__ */ e(
64
+ const t = I(), u = b(g), { dateValue: c } = u, { base: m, input: y, state: f } = N({
65
+ isInvalid: !!o,
66
+ isReadOnly: !!n,
67
+ isDisabled: !!s
68
+ }), p = c && !r && !n && !s;
69
+ return /* @__PURE__ */ l("div", { className: m(), children: [
70
+ /* @__PURE__ */ e(x, { className: y(), children: (a) => /* @__PURE__ */ e(
71
71
  v,
72
72
  {
73
- segment: r,
74
- className: N({
75
- isPlaceholder: r.isPlaceholder,
76
- isLiteral: r.type === "literal"
73
+ segment: a,
74
+ className: M({
75
+ isPlaceholder: a.isPlaceholder,
76
+ isLiteral: a.type === "literal"
77
77
  })
78
78
  }
79
79
  ) }),
80
- /* @__PURE__ */ i("div", { className: f(), children: [
81
- n && /* @__PURE__ */ e(
82
- M,
80
+ /* @__PURE__ */ l("div", { className: f(), children: [
81
+ r && /* @__PURE__ */ e(
82
+ C,
83
83
  {
84
84
  color: "inherit",
85
85
  size: "small",
86
- label: o.formatMessage({
86
+ label: t.formatMessage({
87
87
  id: "unity:component:common:loading:label",
88
88
  defaultMessage: "Loading..."
89
89
  })
90
90
  }
91
91
  ),
92
- u && /* @__PURE__ */ e(
92
+ o && /* @__PURE__ */ e(
93
93
  D,
94
94
  {
95
95
  src: "WarningCircleOutlined",
96
96
  color: "content.form.invalid",
97
- alt: o.formatMessage({
97
+ alt: t.formatMessage({
98
98
  id: "unity:component:form-field:form-input:error:alt",
99
99
  defaultMessage: "Error"
100
100
  })
@@ -104,21 +104,21 @@ function O({
104
104
  h,
105
105
  {
106
106
  slot: null,
107
- title: o.formatMessage({
107
+ title: t.formatMessage({
108
108
  id: "unity:component:common:clear:title",
109
109
  defaultMessage: "Clear"
110
110
  }),
111
111
  icon: "CloseOutlined",
112
112
  onPress: () => {
113
- t == null || t.setValue(null), a == null || a();
113
+ u?.setValue(null), d?.();
114
114
  }
115
115
  }
116
116
  )
117
117
  ] })
118
118
  ] });
119
119
  }
120
- O.displayName = "DateInput";
120
+ P.displayName = "DateInput";
121
121
  export {
122
- O as DateInput,
123
- w as dateInput
122
+ P as DateInput,
123
+ N as dateInput
124
124
  };
@@ -1,7 +1,7 @@
1
1
  import { CalendarDate } from '@internationalized/date';
2
+ import { StandardSchemaV1 } from '@standard-schema/spec';
2
3
  import { ForwardedRef, ReactNode } from 'react';
3
4
  import { FieldPath, FieldValues } from 'react-hook-form';
4
- import { infer as ZodInfer } from 'zod';
5
5
  import { Schema } from '../../hooks/use-form.types.js';
6
6
  import { DatePickerProps } from '../date-picker/DatePicker.js';
7
7
  import { LabelProps } from '../label/Label.js';
@@ -45,7 +45,7 @@ export type TypedDatePickerFieldProps<TFieldValues extends FieldValues = FieldVa
45
45
  name: TName;
46
46
  };
47
47
  type DatePickerFieldComponent = {
48
- <TSchema extends Schema>(props: TypedDatePickerFieldProps<ZodInfer<TSchema>> & {
48
+ <TSchema extends Schema>(props: TypedDatePickerFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
49
49
  ref?: ForwardedRef<HTMLDivElement>;
50
50
  }): React.JSX.Element;
51
51
  displayName?: string;
@@ -1,34 +1,34 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { useContext as p } from "react";
3
3
  import { OverlayTriggerStateContext as u } from "react-aria-components";
4
- import { Button as m } from "../../../button/Button.js";
5
- const l = ({
4
+ import { Button as i } from "../../../button/Button.js";
5
+ const x = ({
6
6
  children: e,
7
- variant: s,
7
+ variant: f,
8
8
  onPress: r,
9
9
  isLoading: c,
10
10
  icon: o,
11
11
  ...a
12
12
  }) => {
13
- const i = p(u);
14
- switch (s) {
13
+ const s = p(u);
14
+ switch (f) {
15
15
  case "close":
16
- const f = r;
16
+ const m = r;
17
17
  return /* @__PURE__ */ n(
18
- m,
18
+ i,
19
19
  {
20
20
  ...a,
21
21
  prefixIcon: o,
22
22
  variant: "secondary",
23
23
  onPress: (t) => {
24
- f && f(t), i == null || i.close();
24
+ m && m(t), s?.close();
25
25
  },
26
26
  children: e
27
27
  }
28
28
  );
29
29
  case "confirm":
30
30
  return /* @__PURE__ */ n(
31
- m,
31
+ i,
32
32
  {
33
33
  ...a,
34
34
  prefixIcon: o,
@@ -42,7 +42,7 @@ const l = ({
42
42
  );
43
43
  case "danger":
44
44
  return /* @__PURE__ */ n(
45
- m,
45
+ i,
46
46
  {
47
47
  ...a,
48
48
  variant: "primary",
@@ -57,7 +57,7 @@ const l = ({
57
57
  );
58
58
  }
59
59
  };
60
- l.displayName = "DialogButton";
60
+ x.displayName = "DialogButton";
61
61
  export {
62
- l as DialogButton
62
+ x as DialogButton
63
63
  };
@@ -0,0 +1,208 @@
1
+ import { UnityIcon } from '@payfit/unity-icons';
2
+ import { UnityIllustrationAsset } from '@payfit/unity-illustrations';
3
+ import { ReactNode } from 'react';
4
+ export declare const errorState: import('tailwind-variants').TVReturnType<{
5
+ [key: string]: {
6
+ [key: string]: import('tailwind-merge').ClassNameValue | {
7
+ h1?: import('tailwind-merge').ClassNameValue;
8
+ h2?: import('tailwind-merge').ClassNameValue;
9
+ h3?: import('tailwind-merge').ClassNameValue;
10
+ h4?: import('tailwind-merge').ClassNameValue;
11
+ container?: import('tailwind-merge').ClassNameValue;
12
+ base?: import('tailwind-merge').ClassNameValue;
13
+ icon?: import('tailwind-merge').ClassNameValue;
14
+ description?: import('tailwind-merge').ClassNameValue;
15
+ wrapper?: import('tailwind-merge').ClassNameValue;
16
+ illustration?: import('tailwind-merge').ClassNameValue;
17
+ informationContainer?: import('tailwind-merge').ClassNameValue;
18
+ information?: import('tailwind-merge').ClassNameValue;
19
+ informationComponent?: import('tailwind-merge').ClassNameValue;
20
+ };
21
+ };
22
+ } | {
23
+ [x: string]: {
24
+ [x: string]: import('tailwind-merge').ClassNameValue | {
25
+ h1?: import('tailwind-merge').ClassNameValue;
26
+ h2?: import('tailwind-merge').ClassNameValue;
27
+ h3?: import('tailwind-merge').ClassNameValue;
28
+ h4?: import('tailwind-merge').ClassNameValue;
29
+ container?: import('tailwind-merge').ClassNameValue;
30
+ base?: import('tailwind-merge').ClassNameValue;
31
+ icon?: import('tailwind-merge').ClassNameValue;
32
+ description?: import('tailwind-merge').ClassNameValue;
33
+ wrapper?: import('tailwind-merge').ClassNameValue;
34
+ illustration?: import('tailwind-merge').ClassNameValue;
35
+ informationContainer?: import('tailwind-merge').ClassNameValue;
36
+ information?: import('tailwind-merge').ClassNameValue;
37
+ informationComponent?: import('tailwind-merge').ClassNameValue;
38
+ };
39
+ };
40
+ } | {}, {
41
+ container: string[];
42
+ wrapper: string[];
43
+ base: string[];
44
+ illustration: string[];
45
+ icon: string[];
46
+ informationContainer: string[];
47
+ information: string[];
48
+ informationComponent: string[];
49
+ h1: string[];
50
+ h2: string[];
51
+ h3: string[];
52
+ h4: string[];
53
+ description: string[];
54
+ }, undefined, {
55
+ [key: string]: {
56
+ [key: string]: import('tailwind-merge').ClassNameValue | {
57
+ h1?: import('tailwind-merge').ClassNameValue;
58
+ h2?: import('tailwind-merge').ClassNameValue;
59
+ h3?: import('tailwind-merge').ClassNameValue;
60
+ h4?: import('tailwind-merge').ClassNameValue;
61
+ container?: import('tailwind-merge').ClassNameValue;
62
+ base?: import('tailwind-merge').ClassNameValue;
63
+ icon?: import('tailwind-merge').ClassNameValue;
64
+ description?: import('tailwind-merge').ClassNameValue;
65
+ wrapper?: import('tailwind-merge').ClassNameValue;
66
+ illustration?: import('tailwind-merge').ClassNameValue;
67
+ informationContainer?: import('tailwind-merge').ClassNameValue;
68
+ information?: import('tailwind-merge').ClassNameValue;
69
+ informationComponent?: import('tailwind-merge').ClassNameValue;
70
+ };
71
+ };
72
+ } | {}, {
73
+ container: string[];
74
+ wrapper: string[];
75
+ base: string[];
76
+ illustration: string[];
77
+ icon: string[];
78
+ informationContainer: string[];
79
+ information: string[];
80
+ informationComponent: string[];
81
+ h1: string[];
82
+ h2: string[];
83
+ h3: string[];
84
+ h4: string[];
85
+ description: string[];
86
+ }, import('tailwind-variants').TVReturnType<unknown, {
87
+ container: string[];
88
+ wrapper: string[];
89
+ base: string[];
90
+ illustration: string[];
91
+ icon: string[];
92
+ informationContainer: string[];
93
+ information: string[];
94
+ informationComponent: string[];
95
+ h1: string[];
96
+ h2: string[];
97
+ h3: string[];
98
+ h4: string[];
99
+ description: string[];
100
+ }, undefined, unknown, unknown, undefined>>;
101
+ interface ErrorStateBaseProps {
102
+ /**
103
+ * Callback function triggered when the main action button is pressed.
104
+ */
105
+ onButtonPress: () => void;
106
+ /**
107
+ * Custom label for the main action button. If not provided, uses default label from configuration.
108
+ * @default: Go to dashboard
109
+ */
110
+ buttonLabel?: string;
111
+ /**
112
+ * Custom main title for the error state. If not provided, uses default title from configuration.
113
+ * @default: Something went wrong
114
+ */
115
+ mainTitle?: ReactNode;
116
+ /**
117
+ * Custom main description for the error state. If not provided, uses default description from configuration.
118
+ */
119
+ mainDescription?: ReactNode;
120
+ /**
121
+ * Custom main description specifically for component-level display. If not provided, uses default from configuration.
122
+ * @default: Please refresh the page or check your connection. We’ve been notified of the issue and are working to resolve it as quickly as possible.
123
+ */
124
+ mainDescriptionComponent?: ReactNode;
125
+ /**
126
+ * Custom illustration to display. If not provided, uses default illustration from configuration.
127
+ * @default: Please refresh the page or try signing in again. We’ve been notified of the issue and are working to resolve it as quickly as possible.
128
+ */
129
+ illustration?: UnityIllustrationAsset;
130
+ /**
131
+ * Custom icon to display. If not provided, uses default icon from configuration.
132
+ */
133
+ icon?: UnityIcon;
134
+ /**
135
+ * ARIA role for the error state container.
136
+ * @default "status"
137
+ */
138
+ role?: string;
139
+ }
140
+ interface KnownErrorStateProps extends ErrorStateBaseProps {
141
+ /**
142
+ * The error object containing the error message to display.
143
+ */
144
+ error: Error;
145
+ /**
146
+ * Additional description text to display alongside the error details.
147
+ * @default: Here's the technical error detail. If the problem continues, you can send it to <Link>our customer support</Link> so we can help unblock you:
148
+ */
149
+ detailDescription?: ReactNode;
150
+ /**
151
+ * Type identifier for known errors.
152
+ */
153
+ type: 'generic';
154
+ }
155
+ interface UnknownErrorStateProps extends ErrorStateBaseProps {
156
+ /**
157
+ * Custom label for the back button. If not provided, uses default label from configuration.
158
+ * @default: Back to dashboard
159
+ */
160
+ backButtonLabel?: ReactNode;
161
+ /**
162
+ * Must be undefined for unknown error states.
163
+ */
164
+ error: undefined;
165
+ /**
166
+ * Type identifier for unknown errors.
167
+ */
168
+ type: 'generic';
169
+ }
170
+ interface _404ErrorStateProps extends ErrorStateBaseProps {
171
+ /**
172
+ * Type identifier for 404 errors.
173
+ */
174
+ type: '404';
175
+ /**
176
+ * No error object needed for 404 states.
177
+ */
178
+ error?: never;
179
+ }
180
+ export type ErrorStateProps = KnownErrorStateProps | UnknownErrorStateProps | _404ErrorStateProps;
181
+ /**
182
+ * The `ErrorState` component displays error information with contextual messaging and actions.
183
+ * It provides a consistent way to handle different types of errors (generic, 404) with appropriate visual feedback and user actions.
184
+ * The component adapts its layout based on container size and error type, supporting multiple breakpoints for optimal user experience.
185
+ * @param {ErrorStateProps} props - The props for the `ErrorState` component
186
+ * @see {@link ErrorStateProps} for all available props
187
+ * @example
188
+ * ```tsx
189
+ * import { ErrorState } from '@payfit/unity-components'
190
+ *
191
+ * function Example() {
192
+ * return (
193
+ * <ErrorState
194
+ * type="generic"
195
+ * error={new Error('Something went wrong')}
196
+ * onButtonPress={() => window.location.reload()}
197
+ * buttonLabel="Retry"
198
+ * mainTitle="Oops! Something went wrong"
199
+ * mainDescription="We encountered an unexpected error. Please try again."
200
+ * />
201
+ * )
202
+ * }
203
+ * ```
204
+ * @remarks
205
+ * [API](https://unity-components.payfit.io/?path=/docs/feedback-errorstate--docs) • [Design docs](https://www.payfit.design/)
206
+ */
207
+ declare const ErrorState: import('react').ForwardRefExoticComponent<ErrorStateProps & import('react').RefAttributes<HTMLDivElement>>;
208
+ export { ErrorState };