@payfit/unity-components 0.0.0-alpha.13 → 0.0.0-alpha.16
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/cjs/components/app-menu/parts/AppMenuFooter.cjs +1 -1
- package/dist/cjs/components/avatar/parts/AvatarFallback.cjs +1 -1
- package/dist/cjs/components/badge/Badge.cjs +1 -1
- package/dist/cjs/components/bottom-sheet/BottomSheet.cjs +1 -1
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.d.cts +1 -1
- package/dist/cjs/components/breadcrumbs/parts/Breadcrumb.cjs +1 -1
- package/dist/cjs/components/button/Button.variants.cjs +1 -1
- package/dist/cjs/components/checkbox/Checkbox.variants.cjs +1 -1
- package/dist/cjs/components/checkbox/parts/CheckboxIndicator.cjs +1 -1
- package/dist/cjs/components/date-calendar/DateCalendar.cjs +1 -1
- package/dist/cjs/components/date-calendar/parts/DateSegmentSelect.cjs +1 -1
- package/dist/cjs/components/date-picker/DatePicker.cjs +1 -1
- package/dist/cjs/components/dialog/Dialog.cjs +1 -1
- package/dist/cjs/components/icon-button/CircularIconButton.cjs +1 -1
- package/dist/cjs/components/icon-button/CircularIconButton.d.cts +7 -0
- package/dist/cjs/components/icon-button/IconButton.cjs +1 -1
- package/dist/cjs/components/icon-button/IconButton.d.cts +1 -4
- package/dist/cjs/components/icon-button/IconButton.variants.cjs +1 -1
- package/dist/cjs/components/input/Input.cjs +1 -1
- package/dist/cjs/components/link/Link.variants.cjs +1 -1
- package/dist/cjs/components/link/Link.variants.d.cts +2 -2
- package/dist/cjs/components/menu/parts/MenuItem.cjs +1 -1
- package/dist/cjs/components/multi-select/parts/MultiSelectButton.cjs +1 -1
- package/dist/cjs/components/nav/parts/NavItem.cjs +1 -1
- package/dist/cjs/components/nav/parts/NavItem.d.cts +18 -14
- package/dist/cjs/components/number-input/NumberInput.cjs +1 -1
- package/dist/cjs/components/pagination/parts/PaginationLink.cjs +1 -1
- package/dist/cjs/components/pagination/parts/PaginationNavButton.cjs +1 -1
- package/dist/cjs/components/payfit-brand/PayFitPreprod.cjs +1 -1
- package/dist/cjs/components/radio-button-group-field/RadioButtonGroupField.cjs +1 -1
- package/dist/cjs/components/search/Search.cjs +1 -1
- package/dist/cjs/components/segmented-button-group/SegmentedButtonGroup.cjs +1 -1
- package/dist/cjs/components/segmented-button-group/parts/ToggleButton.cjs +1 -1
- package/dist/cjs/components/select/Select.cjs +1 -1
- package/dist/cjs/components/select/Select.d.cts +3 -1
- package/dist/cjs/components/select/parts/SearchInput.cjs +1 -1
- package/dist/cjs/components/select/parts/SelectButton.cjs +1 -1
- package/dist/cjs/components/selectable-button-group/parts/SelectableButton.cjs +1 -1
- package/dist/cjs/components/side-panel/SidePanel.cjs +1 -1
- package/dist/cjs/components/table/Table.cjs +1 -1
- package/dist/cjs/components/table/parts/TableBody.cjs +1 -1
- package/dist/cjs/components/table/parts/TableBody.d.cts +36 -1
- package/dist/cjs/components/table/parts/TableHeader.cjs +1 -1
- package/dist/cjs/components/table/parts/TablePagination.cjs +1 -1
- package/dist/cjs/components/tabs/Tabs.variant.cjs +1 -1
- package/dist/cjs/components/tabs/Tabs.variant.d.cts +17 -0
- package/dist/cjs/components/tabs/parts/NavigationButton.cjs +1 -1
- package/dist/cjs/components/tabs/parts/TabList.cjs +1 -1
- package/dist/cjs/components/task-menu/TaskMenu.cjs +1 -0
- package/dist/cjs/components/task-menu/TaskMenu.context.cjs +1 -0
- package/dist/cjs/components/task-menu/TaskMenu.context.d.cts +24 -0
- package/dist/cjs/components/task-menu/TaskMenu.d.cts +92 -0
- package/dist/cjs/components/task-menu/parts/Content.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/Content.d.cts +9 -0
- package/dist/cjs/components/task-menu/parts/Header.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/Header.d.cts +5 -0
- package/dist/cjs/components/task-menu/parts/SubTask.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/SubTask.d.cts +281 -0
- package/dist/cjs/components/task-menu/parts/Task.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/Task.d.cts +279 -0
- package/dist/cjs/components/task-menu/parts/TaskGroup.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/TaskGroup.d.cts +30 -0
- package/dist/cjs/components/task-menu/parts/dot.svg.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/task.variants.cjs +1 -0
- package/dist/cjs/components/task-menu/parts/task.variants.d.cts +152 -0
- package/dist/cjs/components/toast/UnityToast.cjs +1 -1
- package/dist/cjs/components/toast/UnityToast.d.cts +2 -2
- package/dist/cjs/components/toggle-switch/ToggleSwitch.cjs +1 -1
- package/dist/cjs/hooks/use-media-query.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.cts +10 -6
- package/dist/cjs/utils/platform.cjs +1 -1
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +25 -25
- package/dist/esm/components/avatar/parts/AvatarFallback.js +1 -1
- package/dist/esm/components/badge/Badge.js +22 -22
- package/dist/esm/components/bottom-sheet/BottomSheet.js +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +19 -10
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +21 -14
- package/dist/esm/components/button/Button.variants.js +43 -41
- package/dist/esm/components/checkbox/Checkbox.variants.js +1 -1
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +1 -1
- package/dist/esm/components/date-calendar/DateCalendar.js +7 -7
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +6 -6
- package/dist/esm/components/date-picker/DatePicker.js +7 -7
- package/dist/esm/components/dialog/Dialog.js +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +7 -0
- package/dist/esm/components/icon-button/CircularIconButton.js +31 -30
- package/dist/esm/components/icon-button/IconButton.d.ts +1 -4
- package/dist/esm/components/icon-button/IconButton.js +52 -49
- package/dist/esm/components/icon-button/IconButton.variants.js +47 -47
- package/dist/esm/components/input/Input.js +7 -7
- package/dist/esm/components/link/Link.variants.d.ts +2 -2
- package/dist/esm/components/link/Link.variants.js +2 -2
- package/dist/esm/components/menu/parts/MenuItem.js +18 -18
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +5 -5
- package/dist/esm/components/nav/parts/NavItem.d.ts +18 -14
- package/dist/esm/components/nav/parts/NavItem.js +36 -28
- package/dist/esm/components/number-input/NumberInput.js +1 -1
- package/dist/esm/components/pagination/parts/PaginationLink.js +1 -1
- package/dist/esm/components/pagination/parts/PaginationNavButton.js +5 -4
- package/dist/esm/components/payfit-brand/PayFitPreprod.js +16 -16
- package/dist/esm/components/radio-button-group-field/RadioButtonGroupField.js +9 -9
- package/dist/esm/components/search/Search.js +13 -13
- package/dist/esm/components/segmented-button-group/SegmentedButtonGroup.js +1 -1
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +22 -22
- package/dist/esm/components/select/Select.d.ts +3 -1
- package/dist/esm/components/select/Select.js +36 -26
- package/dist/esm/components/select/parts/SearchInput.js +2 -1
- package/dist/esm/components/select/parts/SelectButton.js +7 -7
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +29 -19
- package/dist/esm/components/side-panel/SidePanel.js +1 -1
- package/dist/esm/components/table/Table.js +1 -1
- package/dist/esm/components/table/parts/TableBody.d.ts +36 -1
- package/dist/esm/components/table/parts/TableBody.js +24 -20
- package/dist/esm/components/table/parts/TableHeader.js +1 -1
- package/dist/esm/components/table/parts/TablePagination.js +1 -1
- package/dist/esm/components/tabs/Tabs.variant.d.ts +17 -0
- package/dist/esm/components/tabs/Tabs.variant.js +8 -5
- package/dist/esm/components/tabs/parts/NavigationButton.js +15 -15
- package/dist/esm/components/tabs/parts/TabList.js +34 -34
- package/dist/esm/components/task-menu/TaskMenu.context.d.ts +24 -0
- package/dist/esm/components/task-menu/TaskMenu.context.js +60 -0
- package/dist/esm/components/task-menu/TaskMenu.d.ts +92 -0
- package/dist/esm/components/task-menu/TaskMenu.js +28 -0
- package/dist/esm/components/task-menu/parts/Content.d.ts +9 -0
- package/dist/esm/components/task-menu/parts/Content.js +48 -0
- package/dist/esm/components/task-menu/parts/Header.d.ts +5 -0
- package/dist/esm/components/task-menu/parts/Header.js +55 -0
- package/dist/esm/components/task-menu/parts/SubTask.d.ts +281 -0
- package/dist/esm/components/task-menu/parts/SubTask.js +193 -0
- package/dist/esm/components/task-menu/parts/Task.d.ts +279 -0
- package/dist/esm/components/task-menu/parts/Task.js +171 -0
- package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +30 -0
- package/dist/esm/components/task-menu/parts/TaskGroup.js +174 -0
- package/dist/esm/components/task-menu/parts/dot.svg.js +5 -0
- package/dist/esm/components/task-menu/parts/task.variants.d.ts +152 -0
- package/dist/esm/components/task-menu/parts/task.variants.js +54 -0
- package/dist/esm/components/toast/UnityToast.d.ts +2 -2
- package/dist/esm/components/toast/UnityToast.js +16 -16
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +1 -1
- package/dist/esm/hooks/use-media-query.js +12 -12
- package/dist/esm/index.d.ts +10 -6
- package/dist/esm/index.js +284 -273
- package/dist/esm/utils/platform.js +3 -7
- package/i18n/en-GB.json +4 -0
- package/i18n/es-ES.json +4 -0
- package/i18n/fr-FR.json +4 -0
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as n, jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h, useRef as I, useContext as w } from "react";
|
|
3
3
|
import { useToggleButtonGroupItem as B, mergeProps as S } from "react-aria";
|
|
4
4
|
import { tv as N } from "tailwind-variants";
|
|
5
5
|
import { Icon as G } from "../../icon/Icon.js";
|
|
@@ -11,7 +11,7 @@ const j = N({
|
|
|
11
11
|
base: [
|
|
12
12
|
"uy-group uy-border uy-border-solid uy-rounded-75 uy-py-100 uy-flex uy-gap-50 uy-items-center",
|
|
13
13
|
// default background and border
|
|
14
|
-
"uy-border-border-form-enabled uy-bg-surface-form-enabled",
|
|
14
|
+
"uy-border-border-form-enabled uy-bg-surface-form-enabled uy-text-content-form-enabled",
|
|
15
15
|
// pseudo-states
|
|
16
16
|
"hover:uy-bg-surface-form-hover hover:uy-border-border-form-hover",
|
|
17
17
|
"active:uy-bg-surface-form-pressed active:uy-border-border-form-pressed",
|
|
@@ -20,13 +20,23 @@ const j = N({
|
|
|
20
20
|
// Pressed
|
|
21
21
|
"data-[pressed=true]:uy-bg-surface-form-pressed data-[pressed=true]:uy-border-border-form-pressed data-[pressed=true]:uy-text-content-form-pressed",
|
|
22
22
|
// selected
|
|
23
|
-
"data-[selected=true]:uy-bg-surface-form-selected data-[selected=true]:uy-border-border-form-selected data-[selected=true]:uy-text-content-
|
|
23
|
+
"data-[selected=true]:uy-bg-surface-form-selected data-[selected=true]:uy-border-border-form-selected data-[selected=true]:uy-text-content-primary-active",
|
|
24
24
|
// Disabled
|
|
25
25
|
"disabled:uy-bg-surface-form-disabled disabled:uy-border-border-form-disabled disabled:uy-text-content-form-disabled disabled:uy-cursor-not-allowed",
|
|
26
26
|
// Loading
|
|
27
27
|
"data-[loading=true]:uy-bg-surface-form-disabled data-[loading=true]:uy-border-border-form-disabled data-[loading=true]:uy-text-content-form-disabled data-[loading=true]:uy-cursor-wait"
|
|
28
28
|
],
|
|
29
|
-
icon: [
|
|
29
|
+
icon: [
|
|
30
|
+
"uy-p-25 uy-text-content-neutral-low",
|
|
31
|
+
// Pseudo-states
|
|
32
|
+
"group-data-[pressed=true]:uy-text-content-form-pressed",
|
|
33
|
+
// selected
|
|
34
|
+
"group-data-[selected=true]:uy-text-content-primary-active",
|
|
35
|
+
// disabled
|
|
36
|
+
"group-disabled:uy-text-content-form-disabled",
|
|
37
|
+
// Loading
|
|
38
|
+
"data-[loading=true]:uy-hidden"
|
|
39
|
+
],
|
|
30
40
|
label: ["uy-typography-action"]
|
|
31
41
|
},
|
|
32
42
|
variants: {
|
|
@@ -48,23 +58,23 @@ const j = N({
|
|
|
48
58
|
hasIcon: !1,
|
|
49
59
|
isInvalid: !1
|
|
50
60
|
}
|
|
51
|
-
}), z =
|
|
52
|
-
(
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
61
|
+
}), z = h(
|
|
62
|
+
(o, c) => {
|
|
63
|
+
const a = I(null), s = w(R);
|
|
64
|
+
if (!s)
|
|
55
65
|
throw new Error(
|
|
56
66
|
"SelectableButton must be used within a ToggleButtonGroup component"
|
|
57
67
|
);
|
|
58
|
-
const { state: b, isInvalid: d } =
|
|
59
|
-
{ id:
|
|
68
|
+
const { state: b, isInvalid: d } = s, { buttonProps: u, isPressed: f, isSelected: l } = B(
|
|
69
|
+
{ id: o.value, ...o },
|
|
60
70
|
b,
|
|
61
|
-
|
|
62
|
-
), { ref: y } = S({ ref:
|
|
71
|
+
a
|
|
72
|
+
), { ref: y } = S({ ref: a }, { ref: c }), {
|
|
63
73
|
isDisabled: m = !1,
|
|
64
74
|
isLoading: e = !1,
|
|
65
75
|
prefixIcon: r,
|
|
66
76
|
children: i
|
|
67
|
-
} =
|
|
77
|
+
} = o, { base: p, icon: g, label: v } = j({
|
|
68
78
|
hasIcon: !!r && !e,
|
|
69
79
|
isInvalid: !!d
|
|
70
80
|
});
|
|
@@ -82,7 +92,7 @@ const j = N({
|
|
|
82
92
|
"data-invalid": d,
|
|
83
93
|
"aria-busy": e,
|
|
84
94
|
children: [
|
|
85
|
-
r && !e && /* @__PURE__ */
|
|
95
|
+
r && !e && /* @__PURE__ */ t(
|
|
86
96
|
G,
|
|
87
97
|
{
|
|
88
98
|
src: l ? `${r}Filled` : `${r}Outlined`,
|
|
@@ -91,10 +101,10 @@ const j = N({
|
|
|
91
101
|
size: 20
|
|
92
102
|
}
|
|
93
103
|
),
|
|
94
|
-
e ? /* @__PURE__ */ n(
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
] }) : /* @__PURE__ */
|
|
104
|
+
e ? /* @__PURE__ */ n(x, { children: [
|
|
105
|
+
/* @__PURE__ */ t(P, { label: "Loading", size: "small", color: "inherit" }),
|
|
106
|
+
/* @__PURE__ */ t("span", { className: "uy-sr-only", children: i })
|
|
107
|
+
] }) : /* @__PURE__ */ t("span", { className: v(), children: i })
|
|
98
108
|
]
|
|
99
109
|
}
|
|
100
110
|
);
|
|
@@ -7,7 +7,7 @@ const N = w({
|
|
|
7
7
|
slots: {
|
|
8
8
|
overlay: [
|
|
9
9
|
"md:uy-bg-gradient-to-r md:uy-from-grayscale-L12/0 md:uy-to-grayscale-L12/10 md:uy-from-70% md:uy-via-100%",
|
|
10
|
-
"uy-fixed uy-inset-0 uy-isolate uy-z-
|
|
10
|
+
"uy-fixed uy-inset-0 uy-isolate uy-z-30",
|
|
11
11
|
"data-[entering]:uy-animate-fade-in data-[exiting]:uy-animate-fade-out"
|
|
12
12
|
],
|
|
13
13
|
wrapper: [
|
|
@@ -5,7 +5,7 @@ import { useResizeObserver as $ } from "usehooks-ts";
|
|
|
5
5
|
import { TableContextProvider as D, useTableContext as M } from "./Table.context.js";
|
|
6
6
|
const P = E({
|
|
7
7
|
slots: {
|
|
8
|
-
root: "uy-w-full uy-border uy-border-solid uy-border-border-neutral
|
|
8
|
+
root: "uy-w-full uy-border uy-border-solid uy-border-border-neutral uy-rounded-100 uy-overflow-hidden",
|
|
9
9
|
scroller: [
|
|
10
10
|
"uy-relative uy-flex uy-flex-col",
|
|
11
11
|
"uy-min-h-[var(--uy-table-min-rows)] uy-max-h-[var(--uy-table-max-rows)]",
|
|
@@ -9,7 +9,42 @@ export interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionEle
|
|
|
9
9
|
*/
|
|
10
10
|
renderDataState?: () => ReactNode | undefined;
|
|
11
11
|
}
|
|
12
|
-
export declare const tableBody: import('tailwind-variants').TVReturnType<{
|
|
12
|
+
export declare const tableBody: import('tailwind-variants').TVReturnType<{
|
|
13
|
+
isEmpty: {
|
|
14
|
+
true: string[];
|
|
15
|
+
false: string[];
|
|
16
|
+
};
|
|
17
|
+
}, undefined, string[], import('tailwind-variants/dist/config.js').TVConfig<{
|
|
18
|
+
isEmpty: {
|
|
19
|
+
true: string[];
|
|
20
|
+
false: string[];
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
isEmpty: {
|
|
24
|
+
true: string[];
|
|
25
|
+
false: string[];
|
|
26
|
+
};
|
|
27
|
+
}>, {
|
|
28
|
+
isEmpty: {
|
|
29
|
+
true: string[];
|
|
30
|
+
false: string[];
|
|
31
|
+
};
|
|
32
|
+
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
33
|
+
isEmpty: {
|
|
34
|
+
true: string[];
|
|
35
|
+
false: string[];
|
|
36
|
+
};
|
|
37
|
+
}, undefined, string[], import('tailwind-variants/dist/config.js').TVConfig<{
|
|
38
|
+
isEmpty: {
|
|
39
|
+
true: string[];
|
|
40
|
+
false: string[];
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
isEmpty: {
|
|
44
|
+
true: string[];
|
|
45
|
+
false: string[];
|
|
46
|
+
};
|
|
47
|
+
}>, unknown, unknown, undefined>>;
|
|
13
48
|
/**
|
|
14
49
|
* The `TableBody` component renders the body section of a table, containing rows of data.
|
|
15
50
|
* It automatically processes its children to add row indices and handles empty states.
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import p, { forwardRef as b, Children as f, cloneElement as h } from "react";
|
|
3
3
|
import { tv as v } from "tailwind-variants";
|
|
4
4
|
const C = v({
|
|
5
|
-
base: [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
base: ["uy-transition-all uy-duration-200 uy-ease-in-out"],
|
|
6
|
+
variants: {
|
|
7
|
+
isEmpty: {
|
|
8
|
+
true: ["uy-h-[var(--uy-table-min-rows)]"],
|
|
9
|
+
false: [
|
|
10
|
+
"[&_tr:last-child]:uy-border-b",
|
|
11
|
+
"[&_tr:last-child]:uy-border-b-[length:calc(1px*(1-var(--uy-table-is-scrollable,0)))]"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
11
15
|
}), x = b(
|
|
12
|
-
({ children: c, renderEmptyState:
|
|
13
|
-
const
|
|
14
|
-
|
|
16
|
+
({ children: c, renderEmptyState: l, renderDataState: s, ...u }, y) => {
|
|
17
|
+
const i = s ? s() : void 0, t = i !== void 0, n = t ? [] : f.map(c, (o, m) => p.isValidElement(o) ? h(
|
|
18
|
+
o,
|
|
15
19
|
{
|
|
16
|
-
rowIndex:
|
|
17
|
-
...
|
|
20
|
+
rowIndex: m,
|
|
21
|
+
...o.props
|
|
18
22
|
}
|
|
19
|
-
) :
|
|
20
|
-
let
|
|
21
|
-
return t ?
|
|
23
|
+
) : o), e = (!n || n.length === 0) && !t, d = e && l ? l() : null;
|
|
24
|
+
let a = null;
|
|
25
|
+
return t ? a = i : e && d && (a = d), /* @__PURE__ */ r(
|
|
22
26
|
"tbody",
|
|
23
27
|
{
|
|
24
|
-
ref:
|
|
25
|
-
className: C(),
|
|
28
|
+
ref: y,
|
|
29
|
+
className: C({ isEmpty: e }),
|
|
26
30
|
"data-dd-privacy": "mask",
|
|
27
|
-
"data-empty":
|
|
28
|
-
...
|
|
29
|
-
children:
|
|
31
|
+
"data-empty": e || t || void 0,
|
|
32
|
+
...u,
|
|
33
|
+
children: a ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: 1e3, className: "uy-p-0", children: a }) }) : n
|
|
30
34
|
}
|
|
31
35
|
);
|
|
32
36
|
}
|
|
@@ -3,7 +3,7 @@ import r, { forwardRef as u } from "react";
|
|
|
3
3
|
import { tv as s } from "tailwind-variants";
|
|
4
4
|
const y = s({
|
|
5
5
|
base: [
|
|
6
|
-
"uy-h-500 uy-bg-surface-neutral-
|
|
6
|
+
"uy-h-500 uy-bg-surface-neutral-lowest uy-rounded-tl-100 uy-rounded-tr-100 uy-overflow-hidden",
|
|
7
7
|
"uy-sticky uy-top-0 uy-z-[1]",
|
|
8
8
|
"[&_tr]:uy-border-b [&_tr]:uy-border-solid [&_tr]:uy-border-b-border-neutral-enabled"
|
|
9
9
|
]
|
|
@@ -8,7 +8,7 @@ import { SelectOption as T } from "../../select/parts/SelectOption.js";
|
|
|
8
8
|
import { Select as C } from "../../select/Select.js";
|
|
9
9
|
const E = O({
|
|
10
10
|
base: [
|
|
11
|
-
"uy-bg-surface-neutral-
|
|
11
|
+
"uy-bg-surface-neutral-lowest",
|
|
12
12
|
"uy-sticky uy-bottom-0",
|
|
13
13
|
"uy-grid uy-grid-cols-3 uy-items-center",
|
|
14
14
|
"uy-ps-200 uy-py-100 uy-pe-100"
|
|
@@ -10,15 +10,18 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
10
10
|
scrollable: {
|
|
11
11
|
true: {
|
|
12
12
|
tabList: string;
|
|
13
|
+
scroller: string;
|
|
13
14
|
};
|
|
14
15
|
false: {
|
|
15
16
|
base: string;
|
|
17
|
+
scroller: string;
|
|
16
18
|
tabList: string;
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
21
|
}, {
|
|
20
22
|
base: string;
|
|
21
23
|
tabList: string;
|
|
24
|
+
scroller: string;
|
|
22
25
|
tab: string[];
|
|
23
26
|
}, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
|
|
24
27
|
variant: {
|
|
@@ -32,9 +35,11 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
32
35
|
scrollable: {
|
|
33
36
|
true: {
|
|
34
37
|
tabList: string;
|
|
38
|
+
scroller: string;
|
|
35
39
|
};
|
|
36
40
|
false: {
|
|
37
41
|
base: string;
|
|
42
|
+
scroller: string;
|
|
38
43
|
tabList: string;
|
|
39
44
|
};
|
|
40
45
|
};
|
|
@@ -50,9 +55,11 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
50
55
|
scrollable: {
|
|
51
56
|
true: {
|
|
52
57
|
tabList: string;
|
|
58
|
+
scroller: string;
|
|
53
59
|
};
|
|
54
60
|
false: {
|
|
55
61
|
base: string;
|
|
62
|
+
scroller: string;
|
|
56
63
|
tabList: string;
|
|
57
64
|
};
|
|
58
65
|
};
|
|
@@ -68,15 +75,18 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
68
75
|
scrollable: {
|
|
69
76
|
true: {
|
|
70
77
|
tabList: string;
|
|
78
|
+
scroller: string;
|
|
71
79
|
};
|
|
72
80
|
false: {
|
|
73
81
|
base: string;
|
|
82
|
+
scroller: string;
|
|
74
83
|
tabList: string;
|
|
75
84
|
};
|
|
76
85
|
};
|
|
77
86
|
}, {
|
|
78
87
|
base: string;
|
|
79
88
|
tabList: string;
|
|
89
|
+
scroller: string;
|
|
80
90
|
tab: string[];
|
|
81
91
|
}, import('tailwind-variants').TVReturnType<{
|
|
82
92
|
variant: {
|
|
@@ -90,15 +100,18 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
90
100
|
scrollable: {
|
|
91
101
|
true: {
|
|
92
102
|
tabList: string;
|
|
103
|
+
scroller: string;
|
|
93
104
|
};
|
|
94
105
|
false: {
|
|
95
106
|
base: string;
|
|
107
|
+
scroller: string;
|
|
96
108
|
tabList: string;
|
|
97
109
|
};
|
|
98
110
|
};
|
|
99
111
|
}, {
|
|
100
112
|
base: string;
|
|
101
113
|
tabList: string;
|
|
114
|
+
scroller: string;
|
|
102
115
|
tab: string[];
|
|
103
116
|
}, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
|
|
104
117
|
variant: {
|
|
@@ -112,9 +125,11 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
112
125
|
scrollable: {
|
|
113
126
|
true: {
|
|
114
127
|
tabList: string;
|
|
128
|
+
scroller: string;
|
|
115
129
|
};
|
|
116
130
|
false: {
|
|
117
131
|
base: string;
|
|
132
|
+
scroller: string;
|
|
118
133
|
tabList: string;
|
|
119
134
|
};
|
|
120
135
|
};
|
|
@@ -130,9 +145,11 @@ export declare const tabsVariant: import('tailwind-variants').TVReturnType<{
|
|
|
130
145
|
scrollable: {
|
|
131
146
|
true: {
|
|
132
147
|
tabList: string;
|
|
148
|
+
scroller: string;
|
|
133
149
|
};
|
|
134
150
|
false: {
|
|
135
151
|
base: string;
|
|
152
|
+
scroller: string;
|
|
136
153
|
tabList: string;
|
|
137
154
|
};
|
|
138
155
|
};
|
|
@@ -3,16 +3,17 @@ const a = e({
|
|
|
3
3
|
slots: {
|
|
4
4
|
base: "uy-w-full",
|
|
5
5
|
tabList: "uy-flex",
|
|
6
|
+
scroller: "uy-overflow-x-auto uy-overflow-y-hidden [scrollbar-width:thin]",
|
|
6
7
|
tab: [
|
|
7
|
-
"uy-flex uy-relative uy-shrink-0 uy-gap-100 uy-whitespace-nowrap uy-min-w-[3ch] uy-text-center uy-text-
|
|
8
|
-
'data-[selected]:after:uy-content:" " data-[selected]:after:uy-w-full data-[selected]:after:uy-h-[4px] data-[selected]:after:uy-absolute data-[selected]:after:uy-bottom-[-1px] data-[selected]:after:uy-left-0 data-[selected]:after:uy-right-0',
|
|
8
|
+
"uy-flex uy-relative uy-shrink-0 uy-gap-100 uy-whitespace-nowrap uy-min-w-[3ch] uy-text-center uy-text-action uy-text-content-neutral-lowest-enabled uy-pt-150 uy-pb-150 uy-pl-200 uy-pr-200 uy-rounded-25 uy-cursor-pointer",
|
|
9
|
+
'data-[selected]:uy-text-content-form-enabled data-[selected]:after:uy-content:" " data-[selected]:after:uy-w-full data-[selected]:after:uy-h-[4px] data-[selected]:after:uy-absolute data-[selected]:after:uy-bottom-[-1px] data-[selected]:after:uy-left-0 data-[selected]:after:uy-right-0 data-[selected]:uy-text-content-form-active',
|
|
9
10
|
"hover:uy-cursor-pointer focus-visible:uy-outline-2 focus-visible:uy-outline-utility-focus-ring focus-visible:uy-outline-offset-[4px]"
|
|
10
11
|
]
|
|
11
12
|
},
|
|
12
13
|
variants: {
|
|
13
14
|
variant: {
|
|
14
15
|
primary: {
|
|
15
|
-
tab: "data-[selected]:after:uy-bg-border-
|
|
16
|
+
tab: "data-[selected]:after:uy-bg-border-neutral-active"
|
|
16
17
|
},
|
|
17
18
|
neutral: {
|
|
18
19
|
tab: "data-[selected]:after:uy-bg-content-neutral"
|
|
@@ -20,11 +21,13 @@ const a = e({
|
|
|
20
21
|
},
|
|
21
22
|
scrollable: {
|
|
22
23
|
true: {
|
|
23
|
-
tabList: ""
|
|
24
|
+
tabList: "",
|
|
25
|
+
scroller: "uy-border-b-[1.25px] uy-border-solid uy-border-border-neutral-enabled"
|
|
24
26
|
},
|
|
25
27
|
false: {
|
|
26
28
|
base: "",
|
|
27
|
-
|
|
29
|
+
scroller: "",
|
|
30
|
+
tabList: "uy-border-b-[1.25px] uy-border-solid uy-border-border-neutral-enabled"
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { tv as
|
|
4
|
-
import { Icon as
|
|
5
|
-
const
|
|
2
|
+
import { Button as a } from "react-aria-components";
|
|
3
|
+
import { tv as s } from "tailwind-variants";
|
|
4
|
+
import { Icon as i } from "../../icon/Icon.js";
|
|
5
|
+
const n = s({
|
|
6
6
|
slots: {
|
|
7
7
|
base: "uy-absolute uy-pt-150 uy-pb-150",
|
|
8
8
|
button: "uy-rounded-circle hover:uy-text-content-neutral-hover focus-visible:uy-outline-2 focus-visible:uy-outline-offset-2 focus-visible:uy-outline-utility-focus-ring",
|
|
@@ -11,26 +11,26 @@ const s = n({
|
|
|
11
11
|
variants: {
|
|
12
12
|
direction: {
|
|
13
13
|
left: {
|
|
14
|
-
base: "uy-top-0 uy-left-0 uy-z-10 uy-bg-gradient-to-r uy-from-
|
|
14
|
+
base: "uy-top-0 uy-left-0 uy-z-10 uy-bg-gradient-to-r uy-from-grayscale-L0/100 uy-to-grayscale-L0/0 uy-pl-50 uy-pr-200"
|
|
15
15
|
},
|
|
16
16
|
right: {
|
|
17
|
-
base: "uy-right-0 uy-top-0 uy-z-10 uy-bg-gradient-to-l uy-from-
|
|
17
|
+
base: "uy-right-0 uy-top-0 uy-z-10 uy-bg-gradient-to-l uy-from-grayscale-L0/100 uy-to-grayscale-L0/0 uy-pl-200 uy-pr-50"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
}),
|
|
22
|
-
const { base:
|
|
23
|
-
return /* @__PURE__ */ e("div", { className:
|
|
24
|
-
|
|
21
|
+
}), g = ({ direction: t, onPress: o }) => {
|
|
22
|
+
const { base: u, button: l, icon: r } = n({ direction: t });
|
|
23
|
+
return /* @__PURE__ */ e("div", { className: u(), children: /* @__PURE__ */ e(
|
|
24
|
+
a,
|
|
25
25
|
{
|
|
26
26
|
id: `scroll-${t}`,
|
|
27
|
-
className:
|
|
27
|
+
className: l(),
|
|
28
28
|
"aria-label": `Scroll ${t}`,
|
|
29
|
-
onPress:
|
|
29
|
+
onPress: o,
|
|
30
30
|
children: /* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
i,
|
|
32
32
|
{
|
|
33
|
-
className:
|
|
33
|
+
className: r(),
|
|
34
34
|
"aria-labelledby": `scroll-${t}`,
|
|
35
35
|
src: t === "left" ? "CaretLeftOutlined" : "CaretRightOutlined"
|
|
36
36
|
}
|
|
@@ -39,5 +39,5 @@ const s = n({
|
|
|
39
39
|
) });
|
|
40
40
|
};
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
g as NavigationButton
|
|
43
43
|
};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { TabList as
|
|
4
|
-
import { useResizeObserver as
|
|
5
|
-
import { useTabsContext as
|
|
6
|
-
import { tabsVariant as
|
|
1
|
+
import { jsxs as C, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as B, useRef as j, useState as L, useCallback as q } from "react";
|
|
3
|
+
import { TabList as g } from "react-aria-components";
|
|
4
|
+
import { useResizeObserver as w } from "usehooks-ts";
|
|
5
|
+
import { useTabsContext as z } from "../Tabs.context.js";
|
|
6
|
+
import { tabsVariant as P } from "../Tabs.variant.js";
|
|
7
7
|
import { NavigationButton as p } from "./NavigationButton.js";
|
|
8
|
-
const
|
|
8
|
+
const k = B(
|
|
9
9
|
({ children: f }, u) => {
|
|
10
|
-
const r =
|
|
10
|
+
const r = j(null), [S, R] = L(!1), [v, y] = L(!1), { variant: W, scrollable: b } = z(), { tabList: m, scroller: N } = P({ variant: W, scrollable: b }), h = q(() => {
|
|
11
11
|
if (!r.current) return;
|
|
12
12
|
const { scrollLeft: t, scrollWidth: s, clientWidth: e } = r.current;
|
|
13
|
-
|
|
13
|
+
R(t > 0), y(t + e < s);
|
|
14
14
|
}, []);
|
|
15
|
-
|
|
15
|
+
w({
|
|
16
16
|
ref: r,
|
|
17
|
-
onResize:
|
|
17
|
+
onResize: h
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
},
|
|
19
|
+
const T = (t) => {
|
|
20
|
+
h();
|
|
21
|
+
}, x = () => {
|
|
22
22
|
var l;
|
|
23
23
|
const t = (l = r.current) == null ? void 0 : l.querySelectorAll("[role=tab]");
|
|
24
24
|
if (!r.current || !t) return 0;
|
|
25
25
|
const { scrollLeft: s } = r.current, e = Array.from(t);
|
|
26
26
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
return -
|
|
27
|
+
const c = e[o];
|
|
28
|
+
if (c.offsetLeft < s)
|
|
29
|
+
return -c.offsetWidth;
|
|
30
30
|
}
|
|
31
31
|
return 0;
|
|
32
|
-
},
|
|
33
|
-
var
|
|
34
|
-
const t = (
|
|
32
|
+
}, A = () => {
|
|
33
|
+
var c;
|
|
34
|
+
const t = (c = r.current) == null ? void 0 : c.querySelectorAll("[role=tab]");
|
|
35
35
|
if (!r.current || !t) return 0;
|
|
36
36
|
const { scrollLeft: s, clientWidth: e } = r.current, l = Array.from(t), o = s + e;
|
|
37
37
|
for (let a = 0; a < l.length - 1; a++) {
|
|
38
|
-
const i = l[a],
|
|
39
|
-
if (
|
|
38
|
+
const i = l[a], d = i.offsetLeft + i.offsetWidth;
|
|
39
|
+
if (d > o || d < o)
|
|
40
40
|
return i.offsetWidth;
|
|
41
41
|
}
|
|
42
42
|
return 0;
|
|
43
43
|
};
|
|
44
|
-
return b ? /* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
return b ? /* @__PURE__ */ C("div", { className: "uy-relative", children: [
|
|
45
|
+
S && /* @__PURE__ */ n(
|
|
46
46
|
p,
|
|
47
47
|
{
|
|
48
48
|
direction: "left",
|
|
@@ -50,22 +50,22 @@ const P = A(
|
|
|
50
50
|
var t;
|
|
51
51
|
(t = r.current) == null || t.scrollBy({
|
|
52
52
|
behavior: "smooth",
|
|
53
|
-
left:
|
|
53
|
+
left: x()
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ n(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
ref: r,
|
|
62
62
|
"data-testid": "scrollable-tab-list",
|
|
63
|
-
className:
|
|
64
|
-
onScroll:
|
|
65
|
-
children: /* @__PURE__ */
|
|
63
|
+
className: N(),
|
|
64
|
+
onScroll: T,
|
|
65
|
+
children: /* @__PURE__ */ n(g, { ref: u, className: m(), children: f })
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
v && /* @__PURE__ */
|
|
68
|
+
v && /* @__PURE__ */ n(
|
|
69
69
|
p,
|
|
70
70
|
{
|
|
71
71
|
direction: "right",
|
|
@@ -73,15 +73,15 @@ const P = A(
|
|
|
73
73
|
var t;
|
|
74
74
|
(t = r.current) == null || t.scrollBy({
|
|
75
75
|
behavior: "smooth",
|
|
76
|
-
left:
|
|
76
|
+
left: A()
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
)
|
|
81
|
-
] }) : /* @__PURE__ */
|
|
81
|
+
] }) : /* @__PURE__ */ n(g, { ref: u, className: m(), children: f });
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
|
|
84
|
+
k.displayName = "TabList";
|
|
85
85
|
export {
|
|
86
|
-
|
|
86
|
+
k as TabList
|
|
87
87
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PropsWithChildren, RefObject } from 'react';
|
|
2
|
+
import { OverlayTriggerAria } from 'react-aria';
|
|
3
|
+
import { OverlayTriggerState } from 'react-stately';
|
|
4
|
+
export interface CurrentTask {
|
|
5
|
+
uniqueId: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
type TaskMenuContextValue = {
|
|
9
|
+
currentTask: CurrentTask | null | undefined;
|
|
10
|
+
setCurrentTask: ((currentTask: CurrentTask) => void) | undefined;
|
|
11
|
+
toggleTaskGroup: ((open: string) => void) | undefined;
|
|
12
|
+
expandedTaskGroup: string | null | undefined;
|
|
13
|
+
taskMenuId: string;
|
|
14
|
+
taskMenuContentId: string;
|
|
15
|
+
state: OverlayTriggerState | null;
|
|
16
|
+
triggerRef: RefObject<Element | null>;
|
|
17
|
+
overlayRef: RefObject<Element | null>;
|
|
18
|
+
triggerProps: OverlayTriggerAria['triggerProps'];
|
|
19
|
+
overlayProps: OverlayTriggerAria['overlayProps'];
|
|
20
|
+
};
|
|
21
|
+
export declare const TaskMenuContext: import('react').Context<TaskMenuContextValue>;
|
|
22
|
+
export declare function TaskMenuProvider({ children }: PropsWithChildren<object>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function useTaskMenuContext(): TaskMenuContextValue;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r, useRef as i, createContext as C, useContext as M } from "react";
|
|
3
|
+
import { useId as G, useOverlayTrigger as P } from "react-aria";
|
|
4
|
+
import { useOverlayTriggerState as I } from "react-stately";
|
|
5
|
+
const c = C({
|
|
6
|
+
currentTask: void 0,
|
|
7
|
+
setCurrentTask: void 0,
|
|
8
|
+
toggleTaskGroup: void 0,
|
|
9
|
+
expandedTaskGroup: void 0,
|
|
10
|
+
taskMenuId: "",
|
|
11
|
+
taskMenuContentId: "",
|
|
12
|
+
state: null,
|
|
13
|
+
triggerRef: { current: null },
|
|
14
|
+
overlayRef: { current: null },
|
|
15
|
+
triggerProps: {},
|
|
16
|
+
overlayProps: {}
|
|
17
|
+
});
|
|
18
|
+
function E({ children: e }) {
|
|
19
|
+
const n = G(), [k, d] = r(null), [o, s] = r(
|
|
20
|
+
null
|
|
21
|
+
), [T, u] = r(null), a = I({}), l = i(null), p = i(null), { triggerProps: v, overlayProps: g } = P(
|
|
22
|
+
{ type: "dialog" },
|
|
23
|
+
a,
|
|
24
|
+
l
|
|
25
|
+
), f = `task-menu-${n}`, x = (t) => {
|
|
26
|
+
t === T ? (u(null), s(null)) : (u(t), s(o === t ? null : t));
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ m(
|
|
29
|
+
c.Provider,
|
|
30
|
+
{
|
|
31
|
+
value: {
|
|
32
|
+
currentTask: k,
|
|
33
|
+
setCurrentTask: d,
|
|
34
|
+
toggleTaskGroup: x,
|
|
35
|
+
expandedTaskGroup: o,
|
|
36
|
+
taskMenuId: n,
|
|
37
|
+
taskMenuContentId: f,
|
|
38
|
+
state: a,
|
|
39
|
+
triggerRef: l,
|
|
40
|
+
overlayRef: p,
|
|
41
|
+
triggerProps: v,
|
|
42
|
+
overlayProps: g
|
|
43
|
+
},
|
|
44
|
+
children: e
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
function O() {
|
|
49
|
+
const e = M(c);
|
|
50
|
+
if (!e)
|
|
51
|
+
throw new Error(
|
|
52
|
+
"useTaskMenuContext must be used within an TaskMenuProvider"
|
|
53
|
+
);
|
|
54
|
+
return e;
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
c as TaskMenuContext,
|
|
58
|
+
E as TaskMenuProvider,
|
|
59
|
+
O as useTaskMenuContext
|
|
60
|
+
};
|