@payfit/unity-components 1.2.0 → 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 (136) hide show
  1. package/dist/esm/components/action-bar/ActionBar.js +14 -14
  2. package/dist/esm/components/actionable/Actionable.js +31 -28
  3. package/dist/esm/components/app-layout/AppLayout.js +17 -17
  4. package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +86 -4
  5. package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
  6. package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
  7. package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
  8. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
  9. package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
  10. package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
  11. package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
  12. package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
  13. package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
  14. package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
  15. package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
  16. package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
  17. package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
  18. package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
  19. package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +2 -2
  20. package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
  21. package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
  22. package/dist/esm/components/error-state/ErrorState.d.ts +13 -1
  23. package/dist/esm/components/error-state/ErrorState.js +133 -92
  24. package/dist/esm/components/error-state/initConfig.js +1 -1
  25. package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
  26. package/dist/esm/components/fieldset/Fieldset.js +32 -26
  27. package/dist/esm/components/flex/Flex.js +52 -37
  28. package/dist/esm/components/form-field/FormField.js +12 -12
  29. package/dist/esm/components/form-field/parts/{FormContextualLink.d.ts → RawFormContextualLink.d.ts} +2 -2
  30. package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
  31. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
  32. package/dist/esm/components/icon/Icon.js +23 -19
  33. package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
  34. package/dist/esm/components/link/{Link.variants.js → RawLink.js} +70 -4
  35. package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
  36. package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
  37. package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
  38. package/dist/esm/components/nav/parts/NavGroup.js +62 -51
  39. package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
  40. package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
  41. package/dist/esm/components/page/Page.js +1 -1
  42. package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
  43. package/dist/esm/components/page/parts/PageHeader.js +22 -20
  44. package/dist/esm/components/pagination/Pagination.d.ts +23 -44
  45. package/dist/esm/components/pagination/Pagination.js +89 -163
  46. package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
  47. package/dist/esm/components/pagination/PaginationContext.js +15 -0
  48. package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
  49. package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
  50. package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
  51. package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
  52. package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
  53. package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
  54. package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
  55. package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
  56. package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
  57. package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
  58. package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
  59. package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
  60. package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
  61. package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
  62. package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
  63. package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
  64. package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
  65. package/dist/esm/components/select/Select.js +63 -45
  66. package/dist/esm/components/select/parts/SelectOption.js +9 -9
  67. package/dist/esm/components/skip-links/SkipLinks.js +1 -1
  68. package/dist/esm/components/table/Table.d.ts +1 -0
  69. package/dist/esm/components/table/Table.js +82 -73
  70. package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
  71. package/dist/esm/components/table/parts/TableCell.js +29 -26
  72. package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
  73. package/dist/esm/components/table/parts/TablePagination.js +10 -10
  74. package/dist/esm/components/table/parts/TableRow.js +21 -18
  75. package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
  76. package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
  77. package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
  78. package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
  79. package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +19 -19
  80. package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
  81. package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +17 -17
  82. package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
  83. package/dist/esm/components/text/Text.js +30 -27
  84. package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
  85. package/dist/esm/hooks/use-container-query-level.js +33 -0
  86. package/dist/esm/index.d.ts +21 -11
  87. package/dist/esm/index.js +424 -399
  88. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
  89. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
  90. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
  91. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
  92. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
  93. package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +40 -0
  94. package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
  95. package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
  96. package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
  97. package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
  98. package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
  99. package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
  100. package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
  101. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
  102. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
  103. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
  104. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
  105. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
  106. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
  107. package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
  108. package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
  109. package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
  110. package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
  111. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
  112. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
  113. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
  114. package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
  115. package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
  116. package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
  117. package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
  118. package/dist/esm/integrations/tanstack-router/index.d.ts +16 -0
  119. package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
  120. package/dist/esm/integrations/tanstack-router.js +34 -0
  121. package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
  122. package/dist/esm/providers/router/RouterProvider.js +14 -10
  123. package/dist/esm/types/DataAttributes.d.ts +1 -1
  124. package/i18n/en-GB.json +1 -0
  125. package/i18n/es-ES.json +1 -0
  126. package/i18n/fr-FR.json +1 -0
  127. package/package.json +47 -25
  128. package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
  129. package/dist/esm/components/link/Link.d.ts +0 -93
  130. package/dist/esm/components/link/Link.js +0 -68
  131. package/dist/esm/components/nav/parts/NavItem.js +0 -95
  132. /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
  133. /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
  134. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
  135. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
  136. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-components",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "module": "./dist/esm/index.js",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -22,6 +22,13 @@
22
22
  "default": "./dist/esm/integrations/react-router/v5.js"
23
23
  }
24
24
  },
25
+ "./integrations/tanstack-router": {
26
+ "import": {
27
+ "hrAppsLocalDev": "./src/integrations/tanstack-router/index.ts",
28
+ "types": "./dist/esm/integrations/tanstack-router/index.d.ts",
29
+ "default": "./dist/esm/integrations/tanstack-router.js"
30
+ }
31
+ },
25
32
  "./testing-utils/storybook": {
26
33
  "import": {
27
34
  "hrAppsLocalDev": "./src/index.storybook-testing.ts",
@@ -37,39 +44,42 @@
37
44
  "i18n"
38
45
  ],
39
46
  "dependencies": {
40
- "@ariakit/react": "0.4.18",
47
+ "@ariakit/react": "0.4.19",
41
48
  "@formatjs/intl": "3.1.3",
42
49
  "@hookform/devtools": "4.4.0",
43
50
  "@hookform/resolvers": "5.2.1",
44
- "@internationalized/date": "3.9.0",
45
- "@payfit/unity-illustrations": "1.2.0",
51
+ "@internationalized/date": "3.10.0",
52
+ "@payfit/unity-illustrations": "2.0.0",
46
53
  "@radix-ui/react-avatar": "1.1.10",
47
54
  "@radix-ui/react-slot": "1.2.3",
48
- "@react-aria/interactions": "3.25.5",
49
- "@react-aria/utils": "3.30.1",
55
+ "@react-aria/interactions": "3.25.6",
56
+ "@react-aria/utils": "3.31.0",
50
57
  "@react-types/shared": "3.26.0",
51
58
  "@standard-schema/spec": "1.0.0",
52
59
  "@use-gesture/react": "10.3.1",
53
60
  "prettier": "3.1.0",
54
61
  "react": "18.3.1",
55
- "react-aria": "3.43.2",
56
- "react-aria-components": "1.12.2",
62
+ "react-aria": "3.44.0",
63
+ "react-aria-components": "1.13.0",
57
64
  "react-dom": "18.3.1",
58
65
  "react-hook-form": "7.62.0",
59
66
  "react-hot-toast": "2.5.1",
60
67
  "react-hotkeys-hook": "5.1.0",
61
68
  "react-intl": "7.1.3",
62
- "react-stately": "3.41.0",
63
- "storybook": "9.1.7",
69
+ "react-stately": "3.42.0",
70
+ "storybook": "9.1.13",
64
71
  "tailwind-variants": "2.1.0",
65
72
  "usehooks-ts": "3.1.0",
66
73
  "zod": "4.1.9"
67
74
  },
68
75
  "peerDependencies": {
69
76
  "@hookform/devtools": "4.4.0",
70
- "@payfit/unity-icons": "1.2.0",
71
- "@payfit/unity-themes": "1.2.0",
72
- "@storybook/react-vite": "^9.1.2",
77
+ "@payfit/unity-icons": "2.0.0",
78
+ "@payfit/unity-themes": "2.0.0",
79
+ "@storybook/react-vite": "^9.1.13",
80
+ "@tanstack/react-query": "5.90.2",
81
+ "@tanstack/react-router": "^1.131",
82
+ "@tanstack/react-router-devtools": "^1.131",
73
83
  "@tanstack/react-table": "8.21.3",
74
84
  "history": "4.10.1",
75
85
  "react-hook-form": "^7",
@@ -78,20 +88,23 @@
78
88
  },
79
89
  "devDependencies": {
80
90
  "@hookform/devtools": "4.4.0",
81
- "@internationalized/date": "3.9.0",
91
+ "@internationalized/date": "3.10.0",
82
92
  "@payfit/code-pushup-tools": "0.0.0-use.local",
83
93
  "@payfit/hr-app-eslint": "0.0.0-use.local",
84
94
  "@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
85
95
  "@payfit/storybook-addon-console-errors": "0.0.0-use.local",
86
- "@payfit/unity-icons": "1.2.0",
87
- "@payfit/unity-illustrations": "1.2.0",
88
- "@payfit/unity-themes": "1.2.0",
96
+ "@payfit/unity-icons": "2.0.0",
97
+ "@payfit/unity-illustrations": "2.0.0",
98
+ "@payfit/unity-themes": "2.0.0",
89
99
  "@payfit/vite-configs": "0.0.0-use.local",
90
- "@storybook/addon-a11y": "9.1.7",
91
- "@storybook/addon-docs": "9.1.7",
92
- "@storybook/addon-links": "9.1.7",
93
- "@storybook/addon-vitest": "9.1.7",
94
- "@storybook/react-vite": "9.1.7",
100
+ "@storybook/addon-a11y": "9.1.13",
101
+ "@storybook/addon-docs": "9.1.13",
102
+ "@storybook/addon-links": "9.1.13",
103
+ "@storybook/addon-vitest": "9.1.13",
104
+ "@storybook/react-vite": "9.1.13",
105
+ "@tanstack/react-query": "5.90.2",
106
+ "@tanstack/react-router": "1.133.13",
107
+ "@tanstack/react-router-devtools": "1.133.13",
95
108
  "@testing-library/dom": "10.4.0",
96
109
  "@testing-library/react": "16.2.0",
97
110
  "@types/react": "18.3.18",
@@ -99,7 +112,7 @@
99
112
  "@types/react-router-dom": "5.3.3",
100
113
  "@vitejs/plugin-react": "5.0.3",
101
114
  "@vitest/browser": "3.2.4",
102
- "eslint-plugin-storybook": "9.1.2",
115
+ "eslint-plugin-storybook": "9.1.13",
103
116
  "glob": "11.0.1",
104
117
  "msw": "2.8.4",
105
118
  "msw-storybook-addon": "^2.0.5",
@@ -107,8 +120,8 @@
107
120
  "prettier": "3.1.0",
108
121
  "react-docgen-typescript": "2.2.2",
109
122
  "react-hot-toast": "2.5.1",
110
- "storybook": "9.1.7",
111
- "storybook-addon-pseudo-states": "9.1.2",
123
+ "storybook": "9.1.13",
124
+ "storybook-addon-pseudo-states": "9.1.13",
112
125
  "storybook-addon-tag-badges": "^2.0.1",
113
126
  "storybook-mock-date-decorator": "3.0.0",
114
127
  "tailwindcss": "4.1.11",
@@ -121,6 +134,15 @@
121
134
  "@hookform/devtools": {
122
135
  "optional": true
123
136
  },
137
+ "@tanstack/react-query": {
138
+ "optional": true
139
+ },
140
+ "@tanstack/react-router": {
141
+ "optional": true
142
+ },
143
+ "@tanstack/react-router-devtools": {
144
+ "optional": true
145
+ },
124
146
  "@tanstack/react-table": {
125
147
  "optional": true
126
148
  },
@@ -1,37 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as n } from "react";
3
- import { Button as m } from "react-aria-components";
4
- import { Link as d } from "../../link/Link.js";
5
- import { useFormField as s } from "../FormField.context.js";
6
- const e = n(({ children: o, href: t, onPress: l }, a) => {
7
- const { formContextualLinkId: r } = s();
8
- return t ? /* @__PURE__ */ i(
9
- d,
10
- {
11
- id: r,
12
- size: "small",
13
- color: "secondary",
14
- variant: "standalone",
15
- "data-unity-slot": "contextual-link",
16
- href: t,
17
- ref: a,
18
- "data-dd-privacy": "allow",
19
- children: o
20
- }
21
- ) : /* @__PURE__ */ i(
22
- m,
23
- {
24
- id: r,
25
- onPress: l,
26
- "data-unity-slot": "contextual-link",
27
- className: "uy:typography-body-small uy:w-fit",
28
- ref: a,
29
- "data-dd-privacy": "allow",
30
- children: o
31
- }
32
- );
33
- });
34
- e.displayName = "FormContextualLink";
35
- export {
36
- e as FormContextualLink
37
- };
@@ -1,93 +0,0 @@
1
- import { VariantProps } from '@payfit/unity-themes';
2
- import { HTMLAttributes } from 'react';
3
- import { LinkProps as AriaLinkProps } from 'react-aria-components';
4
- import { NavLinkProps as NavRouterLinkProps } from 'react-router-dom';
5
- import { link } from './Link.variants.js';
6
- export type LinkProps = Omit<AriaLinkProps, 'style' | 'className'> & {
7
- /**
8
- * The URL the link navigates to.
9
- */
10
- href: HTMLAnchorElement['href'] | NavRouterLinkProps['to'];
11
- /**
12
- * The link id
13
- */
14
- id?: HTMLAttributes<HTMLLinkElement>['id'];
15
- /**
16
- * The link's size.
17
- * @default 'inherit'
18
- */
19
- size?: VariantProps<typeof link>['size'];
20
- /**
21
- * The link's display variant. Links can be inline with text or standalone (block).
22
- * @default 'inline'
23
- */
24
- variant?: VariantProps<typeof link>['variant'];
25
- /**
26
- * The link's color.
27
- * @default 'primary'
28
- */
29
- color?: VariantProps<typeof link>['color'];
30
- /**
31
- * Whether the link navigates to an external page. If true, the link will open in a new tab and display an indicator icon.
32
- * @default false
33
- */
34
- isExternal?: boolean;
35
- /**
36
- * Whether the link marks the current section or page.
37
- * @default false
38
- */
39
- isCurrent?: Pick<HTMLAttributes<HTMLAnchorElement>, 'aria-current'> | undefined;
40
- /**
41
- * When true, the active state will only be applied if the location is matched exactly.
42
- * @default false
43
- */
44
- isExact?: boolean;
45
- maxCharactersTruncation?: number;
46
- };
47
- /**
48
- * Links allow users to navigate to different pages or sections.
49
- */
50
- declare const Link: import('react').ForwardRefExoticComponent<Omit<AriaLinkProps, "className" | "style"> & {
51
- /**
52
- * The URL the link navigates to.
53
- */
54
- href: HTMLAnchorElement["href"] | NavRouterLinkProps["to"];
55
- /**
56
- * The link id
57
- */
58
- id?: HTMLAttributes<HTMLLinkElement>["id"];
59
- /**
60
- * The link's size.
61
- * @default 'inherit'
62
- */
63
- size?: VariantProps<typeof link>["size"];
64
- /**
65
- * The link's display variant. Links can be inline with text or standalone (block).
66
- * @default 'inline'
67
- */
68
- variant?: VariantProps<typeof link>["variant"];
69
- /**
70
- * The link's color.
71
- * @default 'primary'
72
- */
73
- color?: VariantProps<typeof link>["color"];
74
- /**
75
- * Whether the link navigates to an external page. If true, the link will open in a new tab and display an indicator icon.
76
- * @default false
77
- */
78
- isExternal?: boolean;
79
- /**
80
- * Whether the link marks the current section or page.
81
- * @default false
82
- */
83
- isCurrent?: Pick<HTMLAttributes<HTMLAnchorElement>, "aria-current"> | undefined;
84
- /**
85
- * When true, the active state will only be applied if the location is matched exactly.
86
- * @default false
87
- */
88
- isExact?: boolean;
89
- maxCharactersTruncation?: number;
90
- } & {
91
- children?: import('react').ReactNode | undefined;
92
- } & import('react').RefAttributes<HTMLAnchorElement>>;
93
- export { Link };
@@ -1,68 +0,0 @@
1
- import { jsxs as g, jsx as w } from "react/jsx-runtime";
2
- import { forwardRef as x } from "react";
3
- import { IconSprite as y } from "@payfit/unity-icons";
4
- import { Link as L } from "react-aria-components";
5
- import { useRouter as A } from "../../providers/router/RouterProvider.js";
6
- import { link as E } from "./Link.variants.js";
7
- import { isExternalUrl as N } from "./utils.js";
8
- const S = x(
9
- ({
10
- href: o,
11
- children: l,
12
- variant: s = "inline",
13
- color: c = "primary",
14
- isDisabled: n = !1,
15
- isExact: m = !1,
16
- isCurrent: p = void 0,
17
- isExternal: d,
18
- maxCharactersTruncation: i,
19
- size: u = "inherit",
20
- ...r
21
- }, f) => {
22
- const a = A(), e = d ?? N(o), t = !e && a ? a.isActive(o.toString(), m) : p, { base: k, icon: v } = E({
23
- variant: s,
24
- color: c,
25
- isDisabled: n,
26
- size: u,
27
- isTruncated: !!i
28
- });
29
- return /* @__PURE__ */ g(
30
- L,
31
- {
32
- "data-dd-privacy": "allow",
33
- ...r,
34
- href: o,
35
- ref: f,
36
- style: !!i ? {
37
- "--uy-link-max-w": `${i}ch`
38
- } : {},
39
- className: k(),
40
- isDisabled: n,
41
- target: e ? "_blank" : r.target,
42
- rel: e && !r.rel ? "noopener noreferrer" : r.rel,
43
- ...t !== void 0 && {
44
- "data-current": t,
45
- "aria-current": t ? "page" : void 0
46
- },
47
- children: [
48
- l,
49
- e && /* @__PURE__ */ w(
50
- y,
51
- {
52
- src: "ArrowSquareOutOutlined",
53
- color: "currentColor",
54
- width: "1.45em",
55
- height: "1.45em",
56
- role: "presentation",
57
- className: v()
58
- }
59
- )
60
- ]
61
- }
62
- );
63
- }
64
- );
65
- S.displayName = "Link";
66
- export {
67
- S as Link
68
- };
@@ -1,95 +0,0 @@
1
- import { jsx as u, jsxs as h } from "react/jsx-runtime";
2
- import { uyTv as y, uyMerge as N } from "@payfit/unity-themes";
3
- import { Link as w, Button as I } from "react-aria-components";
4
- import { useRouter as j } from "../../../providers/router/RouterProvider.js";
5
- const A = y({
6
- slots: {
7
- base: [
8
- "uy:group uy:grid uy:w-full uy:grid-cols-[auto_1fr_auto] uy:items-center uy:py-100 uy:px-150 uy:gap-100 uy:rounded-75 uy:outline-0 uy:transition-all",
9
- "uy:hover:bg-surface-neutral-hover uy:active:bg-surface-neutral-active uy:data-[pressed]:bg-surface-neutral-pressed",
10
- "uy:focus:outline-0 uy:data-[focus-visible]:outline-none uy:data-[focus-visible]:ring-2 uy:data-[focus-visible]:ring-utility-focus-ring uy:data-[focus-visible]:ring-offset-2"
11
- ],
12
- prefix: "uy:p-25 uy:empty:hidden uy:text-content-neutral-low",
13
- suffix: "uy:flex uy:gap-100 uy:items-center uy:text-content-neutral-low uy:justify-self-end uy:text-right uy:empty:hidden",
14
- label: [
15
- "uy:flex-1 uy:basis-full uy:text-left uy:truncate uy:overflow-hidden uy:whitespace-break-spaces uy:typography-body uy:text-content-neutral"
16
- ]
17
- },
18
- variants: {
19
- level: {
20
- 0: "uy:pl-150",
21
- 1: "uy:pl-600"
22
- },
23
- isDisabled: {
24
- true: {
25
- base: "uy:pointer-events-none",
26
- label: "uy:text-content-neutral-disabled"
27
- },
28
- false: ""
29
- }
30
- }
31
- }), S = y({
32
- extend: A,
33
- variants: {
34
- isActive: {
35
- true: {
36
- base: "uy:bg-surface-neutral-active",
37
- prefix: "uy:text-content-neutral",
38
- label: "uy:typography-body-strong"
39
- },
40
- false: {
41
- base: "",
42
- prefix: "uy:text-content-neutral-low",
43
- label: "uy:typography-body"
44
- }
45
- }
46
- }
47
- });
48
- function k({
49
- children: o,
50
- level: s = 0,
51
- prefix: n,
52
- suffix: r,
53
- onPress: c,
54
- href: e,
55
- isCurrent: p,
56
- isDisabled: a = !1,
57
- isExact: f = !1,
58
- ...d
59
- }) {
60
- const i = j(), b = e ? w : I, t = i && e ? i.isActive(e.toString(), f) : p, {
61
- base: v,
62
- label: l,
63
- prefix: g,
64
- suffix: m
65
- } = S({ level: s, isActive: t, isDisabled: a }), x = Object.assign(
66
- {},
67
- t !== void 0 && {
68
- "data-current": t,
69
- "aria-current": t ? "page" : void 0
70
- },
71
- !e && { tabIndex: a ? -1 : void 0 }
72
- );
73
- return /* @__PURE__ */ u("li", { children: /* @__PURE__ */ h(
74
- b,
75
- {
76
- className: N(v(), l()),
77
- href: e,
78
- onPress: c,
79
- isDisabled: a,
80
- "data-level": s,
81
- ...x,
82
- ...d,
83
- children: [
84
- n && /* @__PURE__ */ u("span", { className: g(), children: n({ isCurrent: t ?? !1 }) }),
85
- /* @__PURE__ */ u("span", { className: l(), children: o }),
86
- r && /* @__PURE__ */ u("span", { className: m(), children: r })
87
- ]
88
- }
89
- ) });
90
- }
91
- k.displayName = "NavItem";
92
- export {
93
- k as NavItem,
94
- A as navItemBase
95
- };