@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.
- package/dist/esm/components/action-bar/ActionBar.js +14 -14
- package/dist/esm/components/actionable/Actionable.js +31 -28
- package/dist/esm/components/app-layout/AppLayout.js +17 -17
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +86 -4
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
- package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
- package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +2 -2
- package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
- package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
- package/dist/esm/components/error-state/ErrorState.d.ts +13 -1
- package/dist/esm/components/error-state/ErrorState.js +133 -92
- package/dist/esm/components/error-state/initConfig.js +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
- package/dist/esm/components/fieldset/Fieldset.js +32 -26
- package/dist/esm/components/flex/Flex.js +52 -37
- package/dist/esm/components/form-field/FormField.js +12 -12
- package/dist/esm/components/form-field/parts/{FormContextualLink.d.ts → RawFormContextualLink.d.ts} +2 -2
- package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/icon/Icon.js +23 -19
- package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
- package/dist/esm/components/link/{Link.variants.js → RawLink.js} +70 -4
- package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
- package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
- package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
- package/dist/esm/components/nav/parts/NavGroup.js +62 -51
- package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
- package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
- package/dist/esm/components/page/Page.js +1 -1
- package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
- package/dist/esm/components/page/parts/PageHeader.js +22 -20
- package/dist/esm/components/pagination/Pagination.d.ts +23 -44
- package/dist/esm/components/pagination/Pagination.js +89 -163
- package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
- package/dist/esm/components/pagination/PaginationContext.js +15 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
- package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
- package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
- package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
- package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
- package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
- package/dist/esm/components/select/Select.js +63 -45
- package/dist/esm/components/select/parts/SelectOption.js +9 -9
- package/dist/esm/components/skip-links/SkipLinks.js +1 -1
- package/dist/esm/components/table/Table.d.ts +1 -0
- package/dist/esm/components/table/Table.js +82 -73
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
- package/dist/esm/components/table/parts/TableCell.js +29 -26
- package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
- package/dist/esm/components/table/parts/TablePagination.js +10 -10
- package/dist/esm/components/table/parts/TableRow.js +21 -18
- package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
- package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
- package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
- package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +19 -19
- package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +17 -17
- package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
- package/dist/esm/components/text/Text.js +30 -27
- package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
- package/dist/esm/hooks/use-container-query-level.js +33 -0
- package/dist/esm/index.d.ts +21 -11
- package/dist/esm/index.js +424 -399
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +40 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +16 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router.js +34 -0
- package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
- package/dist/esm/providers/router/RouterProvider.js +14 -10
- package/dist/esm/types/DataAttributes.d.ts +1 -1
- package/i18n/en-GB.json +1 -0
- package/i18n/es-ES.json +1 -0
- package/i18n/fr-FR.json +1 -0
- package/package.json +47 -25
- package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
- package/dist/esm/components/link/Link.d.ts +0 -93
- package/dist/esm/components/link/Link.js +0 -68
- package/dist/esm/components/nav/parts/NavItem.js +0 -95
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as v, forwardRef as g } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useTableContext as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { memo as v, forwardRef as g, useMemo as T } from "react";
|
|
3
|
+
import { uyTv as w } from "@payfit/unity-themes";
|
|
4
|
+
import { useTableContext as k } from "../Table.context.js";
|
|
5
|
+
const D = w({
|
|
6
6
|
base: [
|
|
7
7
|
"uy:px-200 uy:py-150 uy:text-content-neutral uy:typography-body",
|
|
8
8
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-offset-[-2px] uy:focus-visible:outline-utility-focus-ring"
|
|
@@ -14,46 +14,49 @@ const w = C({
|
|
|
14
14
|
right: "uy:text-right"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
}),
|
|
17
|
+
}), K = v(
|
|
18
18
|
g(
|
|
19
19
|
({
|
|
20
|
-
children:
|
|
20
|
+
children: s,
|
|
21
21
|
colIndex: t = 0,
|
|
22
|
-
rowIndex:
|
|
23
|
-
align:
|
|
24
|
-
onKeyDown:
|
|
22
|
+
rowIndex: u = 0,
|
|
23
|
+
align: o,
|
|
24
|
+
onKeyDown: i,
|
|
25
25
|
onFocus: r,
|
|
26
|
-
className:
|
|
27
|
-
isRowHeader:
|
|
28
|
-
isFocusable:
|
|
26
|
+
className: l,
|
|
27
|
+
isRowHeader: a = !1,
|
|
28
|
+
isFocusable: n = !0,
|
|
29
29
|
...y
|
|
30
30
|
}, c) => {
|
|
31
|
-
const { keyboardNavigation: f } =
|
|
32
|
-
|
|
31
|
+
const { keyboardNavigation: f } = k(), { isCellFocused: b, handleCellKeyDown: d, handleCellFocus: m } = f, p = T(
|
|
32
|
+
() => D({ align: o, className: l }),
|
|
33
|
+
[o, l]
|
|
34
|
+
), x = n && b(u, t), h = (e) => {
|
|
35
|
+
e.key !== "Tab" && (d(e), i?.(e));
|
|
33
36
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
37
|
+
return /* @__PURE__ */ C(
|
|
38
|
+
a ? "th" : "td",
|
|
36
39
|
{
|
|
37
40
|
ref: c,
|
|
38
|
-
role:
|
|
41
|
+
role: a ? "rowheader" : "gridcell",
|
|
39
42
|
"aria-colindex": t + 1,
|
|
40
|
-
tabIndex:
|
|
41
|
-
"data-focusable":
|
|
42
|
-
className:
|
|
43
|
-
onKeyDown:
|
|
43
|
+
tabIndex: x ? 0 : -1,
|
|
44
|
+
"data-focusable": n,
|
|
45
|
+
className: p,
|
|
46
|
+
onKeyDown: h,
|
|
44
47
|
onFocus: (e) => {
|
|
45
48
|
m(e), r?.(e);
|
|
46
49
|
},
|
|
47
50
|
"data-dd-privacy": "mask",
|
|
48
51
|
...y,
|
|
49
|
-
children:
|
|
52
|
+
children: s
|
|
50
53
|
}
|
|
51
54
|
);
|
|
52
55
|
}
|
|
53
56
|
)
|
|
54
57
|
);
|
|
55
|
-
|
|
58
|
+
K.displayName = "TableCell";
|
|
56
59
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
K as TableCell,
|
|
61
|
+
D as tableCell
|
|
59
62
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from '@payfit/unity-themes';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ClientSidePaginationProps } from '../../client-side-pagination/ClientSidePagination.js';
|
|
4
4
|
export declare const tablePagination: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
5
5
|
type PageSizeOption = {
|
|
6
6
|
value: string;
|
|
@@ -44,22 +44,22 @@ export interface TablePaginationProps extends PropsWithChildren<VariantProps<typ
|
|
|
44
44
|
* This function is intended for handling hover events on individual pagination controls or elements.
|
|
45
45
|
* It is derived from the `onPageHover` property in the `Pagination` component.
|
|
46
46
|
*/
|
|
47
|
-
onPageHover?:
|
|
47
|
+
onPageHover?: ClientSidePaginationProps['onPageHover'];
|
|
48
48
|
/**
|
|
49
49
|
* Callback fired when the page changes
|
|
50
50
|
* @param page - The new page number
|
|
51
51
|
* @param previous - The previous page number
|
|
52
52
|
* @param direction - The direction of navigation (1 for forward, -1 for backward)
|
|
53
53
|
*/
|
|
54
|
-
onPageChange?:
|
|
54
|
+
onPageChange?: ClientSidePaginationProps['onPageChange'];
|
|
55
55
|
/**
|
|
56
56
|
* Optional callback for next button press
|
|
57
57
|
*/
|
|
58
|
-
onNextPress?:
|
|
58
|
+
onNextPress?: ClientSidePaginationProps['onNextPress'];
|
|
59
59
|
/**
|
|
60
60
|
* Optional callback for previous button press
|
|
61
61
|
*/
|
|
62
|
-
onPreviousPress?:
|
|
62
|
+
onPreviousPress?: ClientSidePaginationProps['onPreviousPress'];
|
|
63
63
|
/**
|
|
64
64
|
* The options for the number of rows per page selection dropdown.
|
|
65
65
|
* If not provided, the default options will be used.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
2
|
+
import { forwardRef as C, useState as I } from "react";
|
|
3
|
+
import { uyTv as j } from "@payfit/unity-themes";
|
|
4
4
|
import { useId as L } from "react-aria";
|
|
5
5
|
import { useIntl as T } from "react-intl";
|
|
6
|
-
import {
|
|
6
|
+
import { ClientSidePagination as O } from "../../client-side-pagination/ClientSidePagination.js";
|
|
7
7
|
import { SelectOption as R } from "../../select/parts/SelectOption.js";
|
|
8
8
|
import { Select as E } from "../../select/Select.js";
|
|
9
|
-
const _ =
|
|
9
|
+
const _ = j({
|
|
10
10
|
base: [
|
|
11
11
|
"uy:bg-surface-neutral-lowest",
|
|
12
12
|
"uy:sticky uy:bottom-0",
|
|
@@ -18,7 +18,7 @@ const _ = C({
|
|
|
18
18
|
{ value: "50", label: "50" },
|
|
19
19
|
{ value: "100", label: "100" },
|
|
20
20
|
{ value: "200", label: "200" }
|
|
21
|
-
], A =
|
|
21
|
+
], A = C(
|
|
22
22
|
(b, y) => {
|
|
23
23
|
const {
|
|
24
24
|
pageCount: i,
|
|
@@ -31,18 +31,18 @@ const _ = C({
|
|
|
31
31
|
onPageChange: P,
|
|
32
32
|
onNextPress: v,
|
|
33
33
|
onPreviousPress: N,
|
|
34
|
-
onPageSizeChange:
|
|
35
|
-
onPageHover:
|
|
34
|
+
onPageSizeChange: S,
|
|
35
|
+
onPageHover: z,
|
|
36
36
|
itemLabel: g = "unity:component:table:pagination:item",
|
|
37
37
|
...w
|
|
38
|
-
} = b, a = L(), t = T(), [M, $] =
|
|
38
|
+
} = b, a = L(), t = T(), [M, $] = I(h), x = {
|
|
39
39
|
pageCount: i,
|
|
40
40
|
defaultPage: u,
|
|
41
41
|
currentPage: r,
|
|
42
42
|
onPageChange: P,
|
|
43
43
|
onNextPress: v,
|
|
44
44
|
onPreviousPress: N,
|
|
45
|
-
onPageHover:
|
|
45
|
+
onPageHover: z
|
|
46
46
|
}, o = Math.max(((r ?? u ?? 1) - 1) * s + 1, 1), p = Math.min(o + s - 1, n), c = {
|
|
47
47
|
singular: t.formatMessage(
|
|
48
48
|
{
|
|
@@ -122,7 +122,7 @@ const _ = C({
|
|
|
122
122
|
value: `${M}`,
|
|
123
123
|
onChange: (l) => {
|
|
124
124
|
const m = parseInt(l, 10);
|
|
125
|
-
|
|
125
|
+
S?.(m), $(m);
|
|
126
126
|
},
|
|
127
127
|
"aria-labelledby": `table-pagination-${a}-pagesize-label`,
|
|
128
128
|
children: (l) => /* @__PURE__ */ e(R, { id: l.value, children: l.label })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { uyTv as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import c, { memo as f, forwardRef as m, useMemo as a, Children as p, cloneElement as v } from "react";
|
|
3
|
+
import { uyTv as w } from "@payfit/unity-themes";
|
|
4
|
+
const R = w({
|
|
5
5
|
base: [
|
|
6
6
|
"uy:group uy:h-500",
|
|
7
7
|
"uy:bg-surface-neutral uy:border-b uy:border-solid uy:border-b-border-neutral-enabled",
|
|
@@ -10,32 +10,35 @@ const w = v({
|
|
|
10
10
|
"uy:aria-[selected=true]:bg-surface-neutral-selected uy:aria-[selected=true]:border-b-border-neutral-selected",
|
|
11
11
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-offset-[-2px] uy:focus-visible:outline-utility-focus-ring"
|
|
12
12
|
]
|
|
13
|
-
}), g =
|
|
14
|
-
|
|
15
|
-
({ children: o, className:
|
|
16
|
-
const
|
|
13
|
+
}), g = f(
|
|
14
|
+
m(
|
|
15
|
+
({ children: o, className: u, rowIndex: r = 0, onKeyDown: s, isSelected: t, ...l }, i) => {
|
|
16
|
+
const n = a(
|
|
17
|
+
() => R({ className: u }),
|
|
18
|
+
[u]
|
|
19
|
+
), b = a(() => p.map(o, (e, d) => c.isValidElement(e) ? v(
|
|
17
20
|
e,
|
|
18
21
|
{
|
|
19
22
|
rowIndex: r,
|
|
20
|
-
colIndex:
|
|
23
|
+
colIndex: d,
|
|
21
24
|
...e.props
|
|
22
25
|
}
|
|
23
26
|
) : e), [o, r]);
|
|
24
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ y(
|
|
25
28
|
"tr",
|
|
26
29
|
{
|
|
27
|
-
ref:
|
|
30
|
+
ref: i,
|
|
28
31
|
role: "row",
|
|
29
|
-
className:
|
|
32
|
+
className: n,
|
|
30
33
|
"aria-rowindex": r + 1,
|
|
31
|
-
"aria-selected":
|
|
34
|
+
"aria-selected": t,
|
|
32
35
|
onKeyDown: (e) => {
|
|
33
|
-
|
|
36
|
+
s?.(e);
|
|
34
37
|
},
|
|
35
38
|
"data-dd-privacy": "mask",
|
|
36
|
-
"data-selectable":
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
39
|
+
"data-selectable": t !== void 0,
|
|
40
|
+
...l,
|
|
41
|
+
children: b
|
|
39
42
|
}
|
|
40
43
|
);
|
|
41
44
|
}
|
|
@@ -44,5 +47,5 @@ const w = v({
|
|
|
44
47
|
g.displayName = "TableRow";
|
|
45
48
|
export {
|
|
46
49
|
g as TableRow,
|
|
47
|
-
|
|
50
|
+
R as tableRow
|
|
48
51
|
};
|
|
@@ -4,7 +4,7 @@ export interface TabProps extends Omit<AriaTabProps, 'isDisabled' | 'className'
|
|
|
4
4
|
id: Key | undefined;
|
|
5
5
|
suffix?: ReactNode;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
7
|
+
declare const RawTab: import('react').ForwardRefExoticComponent<TabProps & {
|
|
8
8
|
children?: ReactNode | undefined;
|
|
9
9
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export {
|
|
10
|
+
export { RawTab };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Tab as
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { Tab as b } from "react-aria-components";
|
|
4
4
|
import { useTabsContext as c } from "../Tabs.context.js";
|
|
5
5
|
import { tabsVariant as f } from "../Tabs.variant.js";
|
|
6
|
-
const
|
|
6
|
+
const d = p(
|
|
7
7
|
({ children: a, suffix: r, id: o, ...t }, s) => {
|
|
8
8
|
const { variant: m, scrollable: n } = c(), { tab: e } = f({ variant: m, scrollable: n });
|
|
9
|
-
return /* @__PURE__ */ i(
|
|
9
|
+
return /* @__PURE__ */ i(b, { ...t, ref: s, id: o, className: e(), children: [
|
|
10
10
|
a,
|
|
11
11
|
r ? /* @__PURE__ */ l("span", { children: r }) : null
|
|
12
12
|
] });
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
|
-
|
|
15
|
+
d.displayName = "RawTab";
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
d as RawTab
|
|
18
18
|
};
|
|
@@ -38,14 +38,14 @@ export interface TaskMenuProps extends PropsWithChildren<VariantProps<typeof tas
|
|
|
38
38
|
* import { TaskMenu, Task, TaskGroup, SubTask } from '@payfit/unity-components'
|
|
39
39
|
*
|
|
40
40
|
* <TaskMenu>
|
|
41
|
-
* <
|
|
41
|
+
* <RawTask
|
|
42
42
|
* uniqueId="task1"
|
|
43
43
|
* label="Complete Profile"
|
|
44
44
|
* taskNumber={1}
|
|
45
45
|
* taskStatus="completed"
|
|
46
46
|
* href="/profile"
|
|
47
47
|
* />
|
|
48
|
-
* <
|
|
48
|
+
* <RawTask
|
|
49
49
|
* uniqueId="task2"
|
|
50
50
|
* label="Upload Documents"
|
|
51
51
|
* taskNumber={2}
|
|
@@ -58,13 +58,13 @@ export interface TaskMenuProps extends PropsWithChildren<VariantProps<typeof tas
|
|
|
58
58
|
* taskNumber={3}
|
|
59
59
|
* taskStatus="uncompleted"
|
|
60
60
|
* >
|
|
61
|
-
* <
|
|
61
|
+
* <RawSubTask
|
|
62
62
|
* uniqueId="step1"
|
|
63
63
|
* label="Welcome Video"
|
|
64
64
|
* href="/onboarding/welcome"
|
|
65
65
|
* taskStatus="completed"
|
|
66
66
|
* />
|
|
67
|
-
* <
|
|
67
|
+
* <RawSubTask
|
|
68
68
|
* uniqueId="step2"
|
|
69
69
|
* label="Company Policies"
|
|
70
70
|
* href="/onboarding/policies"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskProps } from './
|
|
2
|
-
export declare const
|
|
1
|
+
import { TaskProps } from './RawTask.js';
|
|
2
|
+
export declare const rawSubTask: import('tailwind-variants').TVReturnType<{
|
|
3
3
|
taskStatus: {
|
|
4
4
|
uncompleted: {
|
|
5
5
|
dot: string[];
|
|
@@ -138,7 +138,7 @@ export interface SubTaskProps extends Omit<TaskProps, 'taskNumber'> {
|
|
|
138
138
|
*
|
|
139
139
|
* ```tsx
|
|
140
140
|
* // Link-based subtask for navigation within a task group
|
|
141
|
-
* <
|
|
141
|
+
* <RawSubTask
|
|
142
142
|
* uniqueId="profile-setup"
|
|
143
143
|
* label="Complete Profile Information"
|
|
144
144
|
* taskStatus="uncompleted"
|
|
@@ -146,7 +146,7 @@ export interface SubTaskProps extends Omit<TaskProps, 'taskNumber'> {
|
|
|
146
146
|
* />
|
|
147
147
|
*
|
|
148
148
|
* // Button-based subtask for custom interactions
|
|
149
|
-
* <
|
|
149
|
+
* <RawSubTask
|
|
150
150
|
* uniqueId="validate-email"
|
|
151
151
|
* label="Validate Email Address"
|
|
152
152
|
* taskStatus="completed"
|
|
@@ -154,7 +154,7 @@ export interface SubTaskProps extends Omit<TaskProps, 'taskNumber'> {
|
|
|
154
154
|
* />
|
|
155
155
|
*
|
|
156
156
|
* // Locked subtask that cannot be interacted with
|
|
157
|
-
* <
|
|
157
|
+
* <RawSubTask
|
|
158
158
|
* uniqueId="final-approval"
|
|
159
159
|
* label="Manager Approval"
|
|
160
160
|
* taskStatus="locked"
|
|
@@ -162,5 +162,5 @@ export interface SubTaskProps extends Omit<TaskProps, 'taskNumber'> {
|
|
|
162
162
|
* ```
|
|
163
163
|
* @see {@link SubTaskProps} for all available props
|
|
164
164
|
*/
|
|
165
|
-
declare const
|
|
166
|
-
export {
|
|
165
|
+
declare const RawSubTask: import('react').ForwardRefExoticComponent<SubTaskProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
166
|
+
export { RawSubTask };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as L, useEffect as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useRouter as
|
|
2
|
+
import { forwardRef as L, useEffect as R } from "react";
|
|
3
|
+
import { uyTv as j } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as O, Button as z } from "react-aria-components";
|
|
5
|
+
import { useIntl as E, FormattedMessage as i } from "react-intl";
|
|
6
|
+
import { useRouter as F } from "../../../providers/router/RouterProvider.js";
|
|
7
7
|
import { Icon as p } from "../../icon/Icon.js";
|
|
8
|
-
import { Text as
|
|
8
|
+
import { Text as P } from "../../text/Text.js";
|
|
9
9
|
import { useTaskMenuContext as A } from "../TaskMenu.context.js";
|
|
10
10
|
import D from "./dot.svg.js";
|
|
11
11
|
import { commonTask as I } from "./task.variants.js";
|
|
12
|
-
const V =
|
|
12
|
+
const V = j({
|
|
13
13
|
extend: I,
|
|
14
14
|
slots: {
|
|
15
15
|
base: ["uy:gap-300 uy:py-100", "uy:md:py-50"],
|
|
@@ -134,20 +134,20 @@ const V = O({
|
|
|
134
134
|
uniqueId: r,
|
|
135
135
|
...c
|
|
136
136
|
}, g) => {
|
|
137
|
-
const k =
|
|
138
|
-
|
|
137
|
+
const k = E(), u = F(), { currentTask: b, setCurrentTask: m, state: h } = A();
|
|
138
|
+
R(() => {
|
|
139
139
|
t && u?.isActive(t.toString(), l) && m?.({ uniqueId: r, label: o });
|
|
140
140
|
}, [t, l, u, r, o]);
|
|
141
|
-
const s = b?.uniqueId === r, { base: v, element: S, text: x, dot: N, lock:
|
|
141
|
+
const s = b?.uniqueId === r, { base: v, element: S, text: x, dot: N, lock: w } = V({
|
|
142
142
|
isSelected: s,
|
|
143
143
|
taskStatus: n
|
|
144
|
-
}),
|
|
144
|
+
}), M = Object.assign(
|
|
145
145
|
{},
|
|
146
146
|
s !== void 0 && {
|
|
147
147
|
"data-current": s,
|
|
148
148
|
"aria-current": s ? "page" : void 0
|
|
149
149
|
}
|
|
150
|
-
),
|
|
150
|
+
), T = t ? O : z;
|
|
151
151
|
return /* @__PURE__ */ a(
|
|
152
152
|
"li",
|
|
153
153
|
{
|
|
@@ -158,7 +158,7 @@ const V = O({
|
|
|
158
158
|
children: [
|
|
159
159
|
/* @__PURE__ */ e(D, { width: 8, height: 8, className: N(), role: "presentation" }),
|
|
160
160
|
/* @__PURE__ */ a(
|
|
161
|
-
|
|
161
|
+
T,
|
|
162
162
|
{
|
|
163
163
|
className: S(),
|
|
164
164
|
href: t,
|
|
@@ -166,11 +166,11 @@ const V = O({
|
|
|
166
166
|
m?.({ uniqueId: r, label: o }), h?.toggle(), f?.(C);
|
|
167
167
|
},
|
|
168
168
|
isDisabled: y,
|
|
169
|
-
...
|
|
169
|
+
...M,
|
|
170
170
|
...c,
|
|
171
171
|
children: [
|
|
172
172
|
/* @__PURE__ */ e(
|
|
173
|
-
|
|
173
|
+
P,
|
|
174
174
|
{
|
|
175
175
|
asElement: "span",
|
|
176
176
|
className: x(),
|
|
@@ -179,7 +179,7 @@ const V = O({
|
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
181
|
B(n, k, {
|
|
182
|
-
locked:
|
|
182
|
+
locked: w(),
|
|
183
183
|
completed: "uy:self-center"
|
|
184
184
|
})
|
|
185
185
|
]
|
|
@@ -190,8 +190,8 @@ const V = O({
|
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
|
-
G.displayName = "
|
|
193
|
+
G.displayName = "RawSubTask";
|
|
194
194
|
export {
|
|
195
|
-
G as
|
|
196
|
-
V as
|
|
195
|
+
G as RawSubTask,
|
|
196
|
+
V as rawSubTask
|
|
197
197
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from '@payfit/unity-themes';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { AriaButtonProps } from 'react-aria';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const rawTask: import('tailwind-variants').TVReturnType<{
|
|
5
5
|
isSelected: {
|
|
6
6
|
false: string;
|
|
7
7
|
true: string;
|
|
@@ -117,7 +117,7 @@ export declare const task: import('tailwind-variants').TVReturnType<{
|
|
|
117
117
|
* Props for the Task component, defining the configuration options for individual task items.
|
|
118
118
|
* Supports both link-based navigation and button-based interactions with various visual states.
|
|
119
119
|
*/
|
|
120
|
-
export interface TaskProps extends PropsWithChildren<Omit<VariantProps<typeof
|
|
120
|
+
export interface TaskProps extends PropsWithChildren<Omit<VariantProps<typeof rawTask>, 'isSelected'>> {
|
|
121
121
|
/**
|
|
122
122
|
* Unique identifier for the task, used for state management and accessibility.
|
|
123
123
|
* This ID is used to track the current selected task and manage focus states.
|
|
@@ -148,7 +148,7 @@ export interface TaskProps extends PropsWithChildren<Omit<VariantProps<typeof ta
|
|
|
148
148
|
*
|
|
149
149
|
* ```tsx
|
|
150
150
|
* // Link-based task for navigation
|
|
151
|
-
* <
|
|
151
|
+
* <RawTask
|
|
152
152
|
* uniqueId="setup-profile"
|
|
153
153
|
* label="Complete Profile Setup"
|
|
154
154
|
* taskNumber={1}
|
|
@@ -157,7 +157,7 @@ export interface TaskProps extends PropsWithChildren<Omit<VariantProps<typeof ta
|
|
|
157
157
|
* />
|
|
158
158
|
*
|
|
159
159
|
* // Button-based task for custom interactions
|
|
160
|
-
* <
|
|
160
|
+
* <RawTask
|
|
161
161
|
* uniqueId="validate-data"
|
|
162
162
|
* label="Validate Information"
|
|
163
163
|
* taskNumber={2}
|
|
@@ -166,7 +166,7 @@ export interface TaskProps extends PropsWithChildren<Omit<VariantProps<typeof ta
|
|
|
166
166
|
* />
|
|
167
167
|
*
|
|
168
168
|
* // Locked task that cannot be interacted with
|
|
169
|
-
* <
|
|
169
|
+
* <RawTask
|
|
170
170
|
* uniqueId="final-review"
|
|
171
171
|
* label="Final Review"
|
|
172
172
|
* taskNumber={3}
|
|
@@ -175,5 +175,5 @@ export interface TaskProps extends PropsWithChildren<Omit<VariantProps<typeof ta
|
|
|
175
175
|
* ```
|
|
176
176
|
* @see {@link TaskProps} for all available props
|
|
177
177
|
*/
|
|
178
|
-
declare const
|
|
179
|
-
export {
|
|
178
|
+
declare const RawTask: import('react').ForwardRefExoticComponent<TaskProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
179
|
+
export { RawTask };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Link as
|
|
2
|
+
import { forwardRef as O, useEffect as F } from "react";
|
|
3
|
+
import { uyTv as G } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as P, Button as z } from "react-aria-components";
|
|
5
5
|
import { useIntl as A, FormattedMessage as g } from "react-intl";
|
|
6
6
|
import { useRouter as B } from "../../../providers/router/RouterProvider.js";
|
|
7
7
|
import { Icon as y } from "../../icon/Icon.js";
|
|
8
8
|
import { Text as k } from "../../text/Text.js";
|
|
9
9
|
import { useTaskMenuContext as V } from "../TaskMenu.context.js";
|
|
10
10
|
import { commonTask as D } from "./task.variants.js";
|
|
11
|
-
const H =
|
|
11
|
+
const H = G({
|
|
12
12
|
extend: D,
|
|
13
13
|
slots: {
|
|
14
14
|
base: [],
|
|
@@ -55,7 +55,7 @@ const H = R({
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
|
-
}), I =
|
|
58
|
+
}), I = O(
|
|
59
59
|
({
|
|
60
60
|
href: s,
|
|
61
61
|
isExact: l = !1,
|
|
@@ -73,8 +73,8 @@ const H = R({
|
|
|
73
73
|
state: N,
|
|
74
74
|
expandedTaskGroup: i,
|
|
75
75
|
toggleTaskGroup: T
|
|
76
|
-
} = V(), S = s ?
|
|
77
|
-
|
|
76
|
+
} = V(), S = s ? P : z;
|
|
77
|
+
F(() => {
|
|
78
78
|
s && c?.isActive(s.toString(), l) && d?.({ uniqueId: n, label: a });
|
|
79
79
|
}, [s, l, c, a, n]);
|
|
80
80
|
const t = x?.uniqueId === n, M = Object.assign(
|
|
@@ -83,7 +83,7 @@ const H = R({
|
|
|
83
83
|
"data-current": t,
|
|
84
84
|
"aria-current": t ? "page" : void 0
|
|
85
85
|
}
|
|
86
|
-
), { base: C, number:
|
|
86
|
+
), { base: C, number: w, element: L, text: R, lock: j } = H({
|
|
87
87
|
isSelected: t,
|
|
88
88
|
taskStatus: o
|
|
89
89
|
});
|
|
@@ -91,15 +91,15 @@ const H = R({
|
|
|
91
91
|
/* @__PURE__ */ r(
|
|
92
92
|
S,
|
|
93
93
|
{
|
|
94
|
-
className:
|
|
94
|
+
className: L(),
|
|
95
95
|
href: s,
|
|
96
|
-
onPress: (
|
|
97
|
-
d?.({ uniqueId: n, label: a }), N?.toggle(), i && T?.(i), f?.(
|
|
96
|
+
onPress: (E) => {
|
|
97
|
+
d?.({ uniqueId: n, label: a }), N?.toggle(), i && T?.(i), f?.(E);
|
|
98
98
|
},
|
|
99
99
|
...M,
|
|
100
100
|
...u,
|
|
101
101
|
children: [
|
|
102
|
-
/* @__PURE__ */ e("div", { className:
|
|
102
|
+
/* @__PURE__ */ e("div", { className: w(), children: o === "completed" ? /* @__PURE__ */ r(p, { children: [
|
|
103
103
|
/* @__PURE__ */ e(
|
|
104
104
|
y,
|
|
105
105
|
{
|
|
@@ -132,7 +132,7 @@ const H = R({
|
|
|
132
132
|
k,
|
|
133
133
|
{
|
|
134
134
|
asElement: "span",
|
|
135
|
-
className:
|
|
135
|
+
className: R(),
|
|
136
136
|
variant: t ? "bodyStrong" : "body",
|
|
137
137
|
children: a
|
|
138
138
|
}
|
|
@@ -142,7 +142,7 @@ const H = R({
|
|
|
142
142
|
y,
|
|
143
143
|
{
|
|
144
144
|
"aria-hidden": "true",
|
|
145
|
-
className:
|
|
145
|
+
className: j(),
|
|
146
146
|
src: "LockOutlined",
|
|
147
147
|
alt: m.formatMessage({
|
|
148
148
|
id: "unity:component:task-menu:task:lock:label",
|
|
@@ -165,8 +165,8 @@ const H = R({
|
|
|
165
165
|
] });
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
|
-
I.displayName = "
|
|
168
|
+
I.displayName = "RawTask";
|
|
169
169
|
export {
|
|
170
|
-
I as
|
|
171
|
-
H as
|
|
170
|
+
I as RawTask,
|
|
171
|
+
H as rawTask
|
|
172
172
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { DataAttributes } from '../../../types/DataAttributes.js';
|
|
3
|
-
import { SubTaskProps } from './
|
|
4
|
-
import { TaskProps } from './
|
|
3
|
+
import { SubTaskProps } from './RawSubTask.js';
|
|
4
|
+
import { TaskProps } from './RawTask.js';
|
|
5
5
|
export interface TaskGroupProps extends Omit<TaskProps, 'href' | 'isExact' | 'isCurrent' | 'onPress' | 'isSelected'>, DataAttributes {
|
|
6
6
|
/**
|
|
7
7
|
* The subtasks that belong to this task group. Can be a single SubTask or an array of SubTask components.
|
|
@@ -19,9 +19,9 @@ export interface TaskGroupProps extends Omit<TaskProps, 'href' | 'isExact' | 'is
|
|
|
19
19
|
* taskNumber={1}
|
|
20
20
|
* taskStatus="uncompleted"
|
|
21
21
|
* >
|
|
22
|
-
* <
|
|
23
|
-
* <
|
|
24
|
-
* <
|
|
22
|
+
* <RawSubTask uniqueId="profile" label="Complete Profile" href="/profile" />
|
|
23
|
+
* <RawSubTask uniqueId="documents" label="Upload Documents" href="/documents" />
|
|
24
|
+
* <RawSubTask uniqueId="training" label="Complete Training" href="/training" />
|
|
25
25
|
* </TaskGroup>
|
|
26
26
|
* ```
|
|
27
27
|
* @see {@link TaskGroupProps} for all available props
|