@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,30 +1,41 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as m, Fragment as d } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as d, Fragment as m } from "react";
3
3
  import { Breadcrumbs as p } from "react-aria-components";
4
4
  import { useBreakpointListener as u } from "../../hooks/use-breakpoint-listener.js";
5
- import { BreadcrumbsProvider as f } from "./Breadcrumbs.context.js";
6
- import { breadcrumbsVariant as l } from "./Breadcrumbs.variant.js";
7
- const b = (o, r, t) => o ? r.length === 0 ? null : t(r.at(r.length === 1 ? 0 : -2)) : r.map((a) => /* @__PURE__ */ e(d, { children: t(a) }, `${a.label}${a.href}`)), w = m(({ items: o, children: r, wrap: t = "nowrap", ...a }, i) => {
8
- const { base: c } = l({ wrap: t }), n = u(), s = n === "xs" || n === "sm";
9
- return /* @__PURE__ */ e(
10
- f,
5
+ import { BreadcrumbsProvider as l } from "./Breadcrumbs.context.js";
6
+ import { breadcrumbsVariant as f } from "./Breadcrumbs.variant.js";
7
+ const b = (a, o, n) => a ? o.length === 0 ? null : n(o.at(o.length === 1 ? 0 : -2)) : o.map((r, t) => {
8
+ const e = "id" in r && r.id && typeof r.id == "string" ? r.id : `${r.label}-${t}`;
9
+ return /* @__PURE__ */ s(m, { children: n(r) }, e);
10
+ });
11
+ function B({
12
+ items: a,
13
+ children: o,
14
+ wrap: n = "nowrap",
15
+ ...r
16
+ }, t) {
17
+ const { base: e } = f({ wrap: n }), i = u(), c = i === "xs" || i === "sm";
18
+ return /* @__PURE__ */ s(
19
+ l,
11
20
  {
12
- wrap: t,
13
- isMobile: s,
14
- isStaticApi: o === void 0,
15
- children: /* @__PURE__ */ e(
21
+ wrap: n,
22
+ isMobile: c,
23
+ isStaticApi: a === void 0,
24
+ children: /* @__PURE__ */ s(
16
25
  p,
17
26
  {
18
27
  "data-dd-privacy": "allow",
19
- ref: i,
20
- className: c(),
21
- ...a,
22
- children: o ? b(s, o, r) : r
28
+ ref: t,
29
+ className: e(),
30
+ ...r,
31
+ children: a ? b(c, a, o) : o
23
32
  }
24
33
  )
25
34
  }
26
35
  );
27
- });
36
+ }
37
+ const y = d(B);
38
+ y.displayName = "Breadcrumbs";
28
39
  export {
29
- w as Breadcrumbs
40
+ y as Breadcrumbs
30
41
  };
@@ -1,9 +1,34 @@
1
+ import { ComponentPropsWithoutRef, ReactElement } from 'react';
1
2
  import { BreadcrumbProps as AriaBreadcrumbProps } from 'react-aria-components';
2
- export interface BreadcrumbProps extends Omit<AriaBreadcrumbProps, 'children'> {
3
- /** The link of the breadcrumb */
4
- href: string;
5
- /** The text of the breadcrumb */
6
- label: string;
3
+ import { RawBreadcrumbLinkProps } from './RawBreadcrumbLink.js';
4
+ export interface BreadcrumbProps extends Omit<AriaBreadcrumbProps, 'children' | 'className' | 'style'> {
5
+ /**
6
+ * A single BreadcrumbLink child element
7
+ */
8
+ children: ReactElement<ComponentPropsWithoutRef<'a'> & RawBreadcrumbLinkProps>;
7
9
  }
10
+ /**
11
+ * A semantic wrapper component for breadcrumb items that displays navigation hierarchy.
12
+ * Accepts exactly one BreadcrumbLink as a child to maintain design system consistency.
13
+ * @param props - Breadcrumb props including the BreadcrumbLink child
14
+ * @example
15
+ * ```tsx
16
+ * import { Breadcrumb, BreadcrumbLink } from '@payfit/unity-components'
17
+ *
18
+ * function Example() {
19
+ * return (
20
+ * <Breadcrumb>
21
+ * <BreadcrumbLink href="/dashboard">Dashboard</BreadcrumbLink>
22
+ * </Breadcrumb>
23
+ * )
24
+ * }
25
+ * ```
26
+ * @remarks
27
+ * - Only accepts a single BreadcrumbLink component as a child
28
+ * - Automatically handles current page styling (disabled state)
29
+ * - Displays caret icons as separators between breadcrumb items
30
+ * - On mobile, displays a back arrow for the previous breadcrumb
31
+ * @see {@link BreadcrumbProps} for all available props
32
+ */
8
33
  declare const Breadcrumb: import('react').ForwardRefExoticComponent<BreadcrumbProps & import('react').RefAttributes<HTMLLIElement>>;
9
34
  export { Breadcrumb };
@@ -1,33 +1,41 @@
1
- import { jsxs as i, jsx as r, Fragment as h } from "react/jsx-runtime";
2
- import { forwardRef as x } from "react";
3
- import { Breadcrumb as s } from "react-aria-components";
4
- import { Icon as m } from "../../icon/Icon.js";
5
- import { Link as u } from "../../link/Link.js";
6
- import { Tooltip as g } from "../../tooltip/Tooltip.js";
7
- import { useBreadcrumbsContext as w } from "../Breadcrumbs.context.js";
8
- import { breadcrumbsVariant as B } from "../Breadcrumbs.variant.js";
9
- const C = 25, l = ({ children: t, href: e }) => t.length > C ? /* @__PURE__ */ r(g, { title: t, children: /* @__PURE__ */ r(u, { isExact: !0, href: e, color: "secondary", maxCharactersTruncation: 25, children: t }) }) : /* @__PURE__ */ r(u, { isExact: !0, href: e, color: "secondary", maxCharactersTruncation: 25, children: t }), R = x(
10
- (t, e) => {
11
- const { wrap: d, isMobile: f, isStaticApi: p } = w(), { breadcrumb: o } = B({ wrap: d });
12
- if (!t)
13
- return null;
14
- const { href: n, label: a, ...c } = t;
15
- return f && !p ? /* @__PURE__ */ i(s, { ref: e, ...c, className: o(), children: [
16
- /* @__PURE__ */ r(m, { src: "CaretLeftOutlined", "aria-hidden": "true" }),
17
- /* @__PURE__ */ r(l, { href: n, children: a })
18
- ] }) : /* @__PURE__ */ r(s, { ref: e, ...c, className: o(), children: ({ isCurrent: b }) => b ? /* @__PURE__ */ r("span", { className: "uy:text-nowrap uy:text-content-neutral-lowest", children: a }) : /* @__PURE__ */ i(h, { children: [
19
- /* @__PURE__ */ r(l, { href: n, children: a }),
20
- /* @__PURE__ */ r(
21
- m,
1
+ import { jsxs as i, jsx as e, Fragment as p } from "react/jsx-runtime";
2
+ import { forwardRef as b } from "react";
3
+ import { Breadcrumb as n } from "react-aria-components";
4
+ import { Icon as s } from "../../icon/Icon.js";
5
+ import { useBreadcrumbsContext as f } from "../Breadcrumbs.context.js";
6
+ import { breadcrumbsVariant as h } from "../Breadcrumbs.variant.js";
7
+ const x = b(
8
+ ({ children: r, ...t }, a) => {
9
+ const { wrap: c, isMobile: m, isStaticApi: u } = f(), { breadcrumb: o } = h({ wrap: c });
10
+ return m && !u ? /* @__PURE__ */ i(n, { ref: a, ...t, className: o(), children: [
11
+ /* @__PURE__ */ e(s, { src: "CaretLeftOutlined", "aria-hidden": "true" }),
12
+ r
13
+ ] }) : /* @__PURE__ */ e(n, { ref: a, ...t, className: o(), children: ({ isCurrent: d }) => {
14
+ const l = typeof r.props.children == "string" ? r.props.children : "";
15
+ return d ? /* @__PURE__ */ e(
16
+ "span",
22
17
  {
23
- src: "CaretRightOutlined",
24
- "aria-hidden": "true",
25
- color: "content.neutral.lowest"
18
+ className: "uy:text-nowrap uy:text-content-neutral-lowest",
19
+ role: "link",
20
+ "aria-disabled": "true",
21
+ "aria-current": "page",
22
+ children: l
26
23
  }
27
- )
28
- ] }) });
24
+ ) : /* @__PURE__ */ i(p, { children: [
25
+ r,
26
+ /* @__PURE__ */ e(
27
+ s,
28
+ {
29
+ src: "CaretRightOutlined",
30
+ "aria-hidden": "true",
31
+ color: "content.neutral.lowest"
32
+ }
33
+ )
34
+ ] });
35
+ } });
29
36
  }
30
37
  );
38
+ x.displayName = "Breadcrumb";
31
39
  export {
32
- R as Breadcrumb
40
+ x as Breadcrumb
33
41
  };
@@ -0,0 +1,37 @@
1
+ import { RawLinkProps } from '../../link/RawLink.js';
2
+ export declare const BREADCRUMB_CONTENT_MAX_LENGTH = 25;
3
+ export type RawBreadcrumbLinkProps = RawLinkProps;
4
+ /**
5
+ * A styled link component for breadcrumbs that enforces Unity design system styling.
6
+ * This component automatically truncates long text and displays a tooltip when the content exceeds 25 characters.
7
+ * @param props - Link props from RawLink {@see {@link RawLinkProps}}
8
+ * @example
9
+ * ```tsx
10
+ * import { RawBreadcrumbLink } from '@payfit/unity-components'
11
+ *
12
+ * function Example() {
13
+ * return (
14
+ * <RawBreadcrumbLink href="/dashboard">
15
+ * Dashboard
16
+ * </RawBreadcrumbLink>
17
+ * )
18
+ * }
19
+ * ```
20
+ * @remarks
21
+ * - The component enforces breadcrumb-specific styling that cannot be overridden
22
+ * - Text longer than 25 characters is automatically truncated with a tooltip
23
+ * - Uses the 'secondary' color variant for breadcrumb links
24
+ * @see {@link RawBreadcrumbLinkProps} for all available props
25
+ */
26
+ declare const RawBreadcrumbLink: import('react').ForwardRefExoticComponent<Omit<import('react-aria-components').LinkProps, "className" | "style"> & {
27
+ href: HTMLAnchorElement["href"];
28
+ id?: import('react').HTMLAttributes<HTMLAnchorElement>["id"];
29
+ size?: "default" | "small" | "inherit" | "large" | undefined;
30
+ variant?: "inline" | "standalone" | undefined;
31
+ color?: "inherit" | "primary" | "secondary" | undefined;
32
+ isExternal?: boolean;
33
+ isCurrent?: Pick<import('react').HTMLAttributes<HTMLAnchorElement>, "aria-current"> | undefined;
34
+ isExact?: boolean;
35
+ maxCharactersTruncation?: number;
36
+ } & import('react').RefAttributes<HTMLAnchorElement>>;
37
+ export { RawBreadcrumbLink };
@@ -0,0 +1,36 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ import { RawLink as e } from "../../link/RawLink.js";
4
+ import { Tooltip as m } from "../../tooltip/Tooltip.js";
5
+ const t = 25, u = i(
6
+ ({ children: o, href: a, ...n }, s) => {
7
+ const c = typeof o == "string" ? o : "";
8
+ return c.length > t ? /* @__PURE__ */ r(m, { title: c, children: /* @__PURE__ */ r(
9
+ e,
10
+ {
11
+ isExact: !0,
12
+ href: a,
13
+ color: "secondary",
14
+ maxCharactersTruncation: t,
15
+ ref: s,
16
+ ...n,
17
+ children: o
18
+ }
19
+ ) }) : /* @__PURE__ */ r(
20
+ e,
21
+ {
22
+ isExact: !0,
23
+ href: a,
24
+ color: "secondary",
25
+ maxCharactersTruncation: t,
26
+ ...n,
27
+ children: o
28
+ }
29
+ );
30
+ }
31
+ );
32
+ u.displayName = "BreadcrumbLink";
33
+ export {
34
+ t as BREADCRUMB_CONTENT_MAX_LENGTH,
35
+ u as RawBreadcrumbLink
36
+ };
@@ -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,103 @@
1
+ import { VariantProps } from '@payfit/unity-themes';
2
+ import { ComponentType } from 'react';
3
+ import { PaginationLinkProps } from './parts/RawPaginationLink.js';
4
+ export declare const pagination: import('tailwind-variants').TVReturnType<{
5
+ [key: string]: {
6
+ [key: string]: import('tailwind-merge').ClassNameValue | {
7
+ base?: import('tailwind-merge').ClassNameValue;
8
+ pagesList?: import('tailwind-merge').ClassNameValue;
9
+ };
10
+ };
11
+ } | {
12
+ [x: string]: {
13
+ [x: string]: import('tailwind-merge').ClassNameValue | {
14
+ base?: import('tailwind-merge').ClassNameValue;
15
+ pagesList?: import('tailwind-merge').ClassNameValue;
16
+ };
17
+ };
18
+ } | {}, {
19
+ base: string;
20
+ pagesList: string;
21
+ }, undefined, {
22
+ [key: string]: {
23
+ [key: string]: import('tailwind-merge').ClassNameValue | {
24
+ base?: import('tailwind-merge').ClassNameValue;
25
+ pagesList?: import('tailwind-merge').ClassNameValue;
26
+ };
27
+ };
28
+ } | {}, {
29
+ base: string;
30
+ pagesList: string;
31
+ }, import('tailwind-variants').TVReturnType<unknown, {
32
+ base: string;
33
+ pagesList: string;
34
+ }, undefined, unknown, unknown, undefined>>;
35
+ export interface ClientSidePaginationProps extends VariantProps<typeof pagination> {
36
+ /**
37
+ * The total number of pages to display
38
+ */
39
+ pageCount: number;
40
+ /**
41
+ * The current page for controlled mode usage
42
+ */
43
+ currentPage?: number;
44
+ /**
45
+ * The initial page to display when in uncontrolled mode
46
+ */
47
+ defaultPage?: number;
48
+ /**
49
+ * Optional callback function that is triggered when a page hover event occurs.
50
+ * Can be used to handle logic or effects related to the hover action over a specific page.
51
+ * @param {number} page - The number of the page that is being hovered over.
52
+ */
53
+ onPageHover?: (page: number) => void;
54
+ /**
55
+ * Callback fired when the page changes
56
+ * @param page - The new page number
57
+ * @param previous - The previous page number
58
+ * @param direction - The direction of navigation (1 for forward, -1 for backward)
59
+ */
60
+ onPageChange?: (page: number, previous: number, direction: -1 | 1) => void;
61
+ /**
62
+ * Optional callback for the "next" button's press
63
+ */
64
+ onNextPress?: () => void;
65
+ /**
66
+ * Optional callback for previous button press
67
+ */
68
+ onPreviousPress?: () => void;
69
+ /**
70
+ * Component used to render the pagination links
71
+ * @default 'RawPaginationLink'
72
+ */
73
+ LinkComponent?: ComponentType<PaginationLinkProps>;
74
+ }
75
+ /**
76
+ * The ClientSidePagination component helps users navigate through multiple pages of content by providing intuitive controls for moving between pages.
77
+ *
78
+ * This component is designed for client-side pagination use cases where state is managed in React state rather than URL parameters.
79
+ * For URL-driven pagination, use the composition-based Pagination components instead.
80
+ *
81
+ * Pagination offers both controlled and uncontrolled usage, support for keyboard navigation, and automatic handling of page ranges with ellipsis for large numbers of pages.
82
+ * @param {ClientSidePaginationProps} props - Regular HTML div attributes plus pagination-specific properties
83
+ * @see {@link ClientSidePaginationProps} for all available props
84
+ * @example
85
+ * ```tsx
86
+ * import { ClientSidePagination } from '@payfit/unity-components'
87
+ *
88
+ * function Example() {
89
+ * const [currentPage, setCurrentPage] = useState(1)
90
+ * return (
91
+ * <ClientSidePagination
92
+ * pageCount={10}
93
+ * currentPage={currentPage}
94
+ * onPageChange={(page) => setCurrentPage(page)}
95
+ * />
96
+ * )
97
+ * }
98
+ * ```
99
+ * @remarks
100
+ * [API](https://unity-components.payfit.io/?path=/docs/navigation-pagination--docs) • [Demo](https://unity-components.payfit.io/?path=/docs/navigation-pagination--docs)
101
+ */
102
+ declare const ClientSidePagination: import('react').ForwardRefExoticComponent<ClientSidePaginationProps & import('react').RefAttributes<HTMLDivElement>>;
103
+ export { ClientSidePagination };
@@ -0,0 +1,177 @@
1
+ import { jsxs as x, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as M, useRef as T, useMemo as q } from "react";
3
+ import { uyTv as R } from "@payfit/unity-themes";
4
+ import { useId as S } from "react-aria";
5
+ import { useIntl as E } from "react-intl";
6
+ import { useOverlayTriggerState as W } from "react-stately";
7
+ import { usePagination as $ } from "./hooks/use-pagination.js";
8
+ import { PaginationEllipsis as j } from "./parts/PaginationEllipsis.js";
9
+ import { PaginationJumpDialog as J } from "./parts/PaginationJumpDialog.js";
10
+ import { PaginationNavButton as y } from "./parts/PaginationNavButton.js";
11
+ import { RawPaginationLink as K } from "./parts/RawPaginationLink.js";
12
+ import { generatePaginationWithWindow as O } from "./utils/pagination-window.js";
13
+ const H = R({
14
+ slots: {
15
+ base: "uy:flex uy:gap-100 uy:relative",
16
+ pagesList: "uy:flex uy:gap-100 uy:list-none uy:m-0 uy:p-0"
17
+ }
18
+ }), _ = 7, z = M(
19
+ ({
20
+ pageCount: t,
21
+ defaultPage: c,
22
+ currentPage: u,
23
+ onPageHover: b,
24
+ onPageChange: f,
25
+ onNextPress: w,
26
+ onPreviousPress: P,
27
+ LinkComponent: D = K,
28
+ ...A
29
+ }, L) => {
30
+ const p = S(), l = E(), v = u !== void 0 && f !== void 0 && c === void 0, { currentPage: s, goToPage: i } = $({
31
+ pageCount: t,
32
+ initialPage: v ? u : c,
33
+ onPageChange: f,
34
+ isControlled: v
35
+ }), m = W({}), r = T(/* @__PURE__ */ new Map()), h = q(
36
+ () => O(
37
+ t,
38
+ s,
39
+ _
40
+ ),
41
+ [t, s]
42
+ ), k = new Intl.NumberFormat(l.locale, {
43
+ notation: "standard"
44
+ }), N = (e) => {
45
+ i(e), m.close(), requestAnimationFrame(() => {
46
+ const a = r.current.get(e);
47
+ a && a.focus();
48
+ });
49
+ }, d = (e, a) => {
50
+ switch (e.key) {
51
+ case "ArrowLeft":
52
+ case "ArrowUp":
53
+ e.preventDefault(), a > 1 && (i(a - 1), requestAnimationFrame(() => {
54
+ r.current.get(a - 1)?.focus();
55
+ }));
56
+ break;
57
+ case "ArrowRight":
58
+ case "ArrowDown":
59
+ e.preventDefault(), a < t && (i(a + 1), requestAnimationFrame(() => {
60
+ r.current.get(a + 1)?.focus();
61
+ }));
62
+ break;
63
+ case "Home":
64
+ e.preventDefault(), i(1), requestAnimationFrame(() => {
65
+ r.current.get(1)?.focus();
66
+ });
67
+ break;
68
+ case "End":
69
+ e.preventDefault(), i(t), requestAnimationFrame(() => {
70
+ r.current.get(t)?.focus();
71
+ });
72
+ break;
73
+ }
74
+ }, g = {
75
+ paginationLabel: l.formatMessage({
76
+ id: "unity:component:pagination:label",
77
+ defaultMessage: "Pagination"
78
+ }),
79
+ pageListLabel: l.formatMessage(
80
+ {
81
+ id: "unity:component:pagination:page-list:label",
82
+ defaultMessage: "Page {current} of {total}"
83
+ },
84
+ {
85
+ current: s,
86
+ total: t
87
+ }
88
+ )
89
+ }, { base: F, pagesList: I } = H();
90
+ return /* @__PURE__ */ x(
91
+ "nav",
92
+ {
93
+ "data-dd-privacy": "allow",
94
+ ...A,
95
+ ref: L,
96
+ className: F(),
97
+ "aria-labelledby": g.paginationLabel,
98
+ children: [
99
+ /* @__PURE__ */ n(
100
+ J,
101
+ {
102
+ pageCount: t,
103
+ onJumpToPage: N,
104
+ state: m
105
+ }
106
+ ),
107
+ /* @__PURE__ */ n(
108
+ y,
109
+ {
110
+ variant: "previous",
111
+ isDisabled: s === 1,
112
+ onClick: () => {
113
+ i("previous"), P?.();
114
+ }
115
+ }
116
+ ),
117
+ /* @__PURE__ */ n("ul", { className: I(), "aria-label": g.pageListLabel, children: h.map(
118
+ (e, a) => e.type === "page" ? /* @__PURE__ */ n(
119
+ "li",
120
+ {
121
+ "aria-setsize": t,
122
+ "aria-posinset": e.value,
123
+ children: /* @__PURE__ */ n(
124
+ D,
125
+ {
126
+ ref: (o) => {
127
+ o ? r.current.set(e.value, o) : r.current.delete(e.value);
128
+ },
129
+ onPress: () => {
130
+ i(e.value);
131
+ },
132
+ onHoverChange: (o) => {
133
+ o && b?.(e.value);
134
+ },
135
+ onKeyDown: (o) => {
136
+ d(o, e.value);
137
+ },
138
+ isActive: e.value === s,
139
+ value: e.value,
140
+ children: k.format(e.value)
141
+ }
142
+ )
143
+ },
144
+ `pagination-${p}-item-${a}`
145
+ ) : /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
146
+ j,
147
+ {
148
+ value: e.value,
149
+ onKeyDown: (o) => {
150
+ d(o, -1);
151
+ },
152
+ onPress: () => {
153
+ m.open();
154
+ }
155
+ }
156
+ ) }, `pagination-${p}-item-${a}`)
157
+ ) }),
158
+ /* @__PURE__ */ n(
159
+ y,
160
+ {
161
+ variant: "next",
162
+ isDisabled: s === t,
163
+ onClick: () => {
164
+ i("next"), w?.();
165
+ }
166
+ }
167
+ )
168
+ ]
169
+ }
170
+ );
171
+ }
172
+ );
173
+ z.displayName = "ClientSidePagination";
174
+ export {
175
+ z as ClientSidePagination,
176
+ H as pagination
177
+ };
@@ -0,0 +1,11 @@
1
+ import { VariantProps } from '@payfit/unity-themes';
2
+ import { ButtonProps } from 'react-aria-components';
3
+ import { paginationLink } from './RawPaginationLink.js';
4
+ export interface PaginationEllipsisProps extends Omit<ButtonProps, 'value' | 'children' | 'className' | 'style' | 'slot'>, VariantProps<typeof paginationLink> {
5
+ value: [number, number];
6
+ id?: string;
7
+ isDisabled?: boolean;
8
+ isActive?: boolean;
9
+ }
10
+ declare const PaginationEllipsis: import('react').ForwardRefExoticComponent<PaginationEllipsisProps & import('react').RefAttributes<HTMLButtonElement>>;
11
+ export { PaginationEllipsis };