@payfit/unity-components 2.8.0 → 2.8.2
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.
|
@@ -5,38 +5,38 @@ import { SelectList as p } from "../select-list/SelectList.js";
|
|
|
5
5
|
function s(l) {
|
|
6
6
|
return "children" in l && l.children.length > 0;
|
|
7
7
|
}
|
|
8
|
-
function m(l,
|
|
9
|
-
const
|
|
10
|
-
return (r,
|
|
8
|
+
function m(l, n) {
|
|
9
|
+
const t = (r) => /* @__PURE__ */ c(u, { items: r.children, label: r.label, children: (i) => /* @__PURE__ */ c(a, { id: i.id, textValue: i.label, children: i.label }) }), e = (r) => /* @__PURE__ */ c(a, { id: r.id, textValue: r.label, children: r.label });
|
|
10
|
+
return (r, i) => /* @__PURE__ */ c(
|
|
11
11
|
p,
|
|
12
12
|
{
|
|
13
|
-
...
|
|
13
|
+
...n,
|
|
14
14
|
items: l,
|
|
15
15
|
value: r,
|
|
16
16
|
selectionMode: "multiple",
|
|
17
|
-
onChange: (
|
|
18
|
-
o
|
|
17
|
+
onChange: (o) => {
|
|
18
|
+
i(o);
|
|
19
19
|
},
|
|
20
20
|
escapeKeyBehavior: "none",
|
|
21
21
|
sortSelectedFirst: !0,
|
|
22
|
-
className: "uy:
|
|
23
|
-
children: (
|
|
22
|
+
className: "uy:scroll-pb-500",
|
|
23
|
+
children: (o) => s(o) ? t(o) : e(o)
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
function L(l) {
|
|
28
|
-
return (
|
|
29
|
-
if (
|
|
28
|
+
return (n) => {
|
|
29
|
+
if (n === "all")
|
|
30
30
|
return l.flatMap((e) => s(e) ? e.children : e).map((e) => e.label).join(", ");
|
|
31
|
-
const
|
|
31
|
+
const t = [];
|
|
32
32
|
for (const e of l) {
|
|
33
33
|
if (s(e)) {
|
|
34
|
-
|
|
34
|
+
t.push(...e.children.filter((r) => n.has(r.id)));
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
n.has(e.id) && t.push(e);
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return t.map((e) => e.label).join(", ");
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
@@ -14,7 +14,7 @@ const x = m({
|
|
|
14
14
|
'uy:data-[entering]:data-[placement="right"]:-translate-x-100 uy:data-[entering]:data-[placement="right"]:translate-y-0 uy:data-[exiting]:data-[placement="right"]:translate-y-0'
|
|
15
15
|
],
|
|
16
16
|
dialog: ["uy:flex uy:flex-col uy:gap-0"],
|
|
17
|
-
content: ["uy:flex-1 uy:max-h-[500px]
|
|
17
|
+
content: ["uy:flex-1 uy:max-h-[500px]"],
|
|
18
18
|
footer: [
|
|
19
19
|
"uy:mx-100 uy:mb-100",
|
|
20
20
|
"uy:sticky uy:bottom-0 uy:z-2",
|
|
@@ -10,18 +10,18 @@ import { SelectListEmptyState as V } from "./parts/SelectListEmptyState.js";
|
|
|
10
10
|
import { SelectListSearchInput as z } from "./parts/SelectListSearchInput.js";
|
|
11
11
|
const G = R({
|
|
12
12
|
slots: {
|
|
13
|
-
wrapper: "uy:bg-surface-neutral uy:p-100 uy:overscroll-contain
|
|
13
|
+
wrapper: "uy:bg-surface-neutral uy:p-100 uy:overscroll-contain",
|
|
14
14
|
base: "uy:flex uy:w-full uy:gap-100 uy:h-500 uy:border uy:border-solid uy:rounded-75 uy:py-100 uy:border-border-form-enabled uy:bg-surface-form-enabled uy:px-150 uy:typography-body uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2 uy:active:border-border-form-active",
|
|
15
15
|
inputContainer: "uy:sticky uy:top-0 uy:bg-surface-neutral",
|
|
16
16
|
separator: "uy:h-[1px] uy:bg-border-neutral uy:w-full uy:mt-100",
|
|
17
|
-
list: "uy:overflow-y-auto uy:mt-100",
|
|
17
|
+
list: "uy:overflow-y-auto uy:mt-100 uy:h-[300px]",
|
|
18
18
|
selectedListBox: "uy:bg-surface-neutral uy:border-b uy:border-border-neutral uy:py-100 uy:data-[empty=true]:border-0 uy:data-[is-last=true]:border-0 uy:data-[is-last=true]:py-0"
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
function K({
|
|
22
22
|
items: r,
|
|
23
|
-
children:
|
|
24
|
-
value:
|
|
23
|
+
children: p,
|
|
24
|
+
value: f,
|
|
25
25
|
onChange: h,
|
|
26
26
|
className: b,
|
|
27
27
|
showSearch: a = !1,
|
|
@@ -29,8 +29,8 @@ function K({
|
|
|
29
29
|
selectedSectionLabel: S = "Selected",
|
|
30
30
|
...o
|
|
31
31
|
}, I) {
|
|
32
|
-
const { contains: L } = T({ sensitivity: "base" }), { wrapper:
|
|
33
|
-
|
|
32
|
+
const { contains: L } = T({ sensitivity: "base" }), { wrapper: x, inputContainer: v, list: w, separator: C, selectedListBox: A } = G(), [i, l] = k(
|
|
33
|
+
f,
|
|
34
34
|
h
|
|
35
35
|
), N = y(() => (Array.isArray(r) ? r.length : Array.from(r).length) >= j || a, [r, a]), t = D(
|
|
36
36
|
r,
|
|
@@ -52,16 +52,16 @@ function K({
|
|
|
52
52
|
H,
|
|
53
53
|
{
|
|
54
54
|
...o,
|
|
55
|
-
className:
|
|
55
|
+
className: w({ className: b }),
|
|
56
56
|
items: t.remainingItems,
|
|
57
57
|
selectedKeys: i,
|
|
58
58
|
onSelectionChange: l,
|
|
59
59
|
renderEmptyState: V,
|
|
60
|
-
children: /* @__PURE__ */ e(M, { items: t.remainingItems, children:
|
|
60
|
+
children: /* @__PURE__ */ e(M, { items: t.remainingItems, children: p })
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
return /* @__PURE__ */ e("div", { ref: I, className:
|
|
64
|
-
/* @__PURE__ */ s("div", { className:
|
|
63
|
+
return /* @__PURE__ */ e("div", { ref: I, className: x(), children: N ? /* @__PURE__ */ s(O, { filter: L, children: [
|
|
64
|
+
/* @__PURE__ */ s("div", { className: v(), "data-dd-privacy": "mask", children: [
|
|
65
65
|
/* @__PURE__ */ e(z, {}),
|
|
66
66
|
/* @__PURE__ */ e(_, { className: C() })
|
|
67
67
|
] }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@hookform/devtools": "4.4.0",
|
|
43
43
|
"@hookform/resolvers": "5.2.1",
|
|
44
44
|
"@internationalized/date": "3.11.0",
|
|
45
|
-
"@payfit/unity-illustrations": "2.8.
|
|
45
|
+
"@payfit/unity-illustrations": "2.8.2",
|
|
46
46
|
"@radix-ui/react-avatar": "1.1.11",
|
|
47
47
|
"@radix-ui/react-slot": "1.2.4",
|
|
48
48
|
"@react-aria/interactions": "3.27.0",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
"react-international-phone": "4.5.0",
|
|
65
65
|
"react-intl": "7.1.14",
|
|
66
66
|
"react-stately": "3.44.0",
|
|
67
|
-
"storybook": "10.2.
|
|
67
|
+
"storybook": "10.2.8",
|
|
68
68
|
"tailwind-variants": "2.1.0",
|
|
69
69
|
"usehooks-ts": "3.1.0",
|
|
70
70
|
"zod": "4.3.6"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@hookform/devtools": "^4",
|
|
74
|
-
"@payfit/unity-icons": "2.8.
|
|
75
|
-
"@payfit/unity-themes": "2.8.
|
|
74
|
+
"@payfit/unity-icons": "2.8.2",
|
|
75
|
+
"@payfit/unity-themes": "2.8.2",
|
|
76
76
|
"@storybook/react-vite": "^10.2.2",
|
|
77
77
|
"@tanstack/react-query": "^5",
|
|
78
78
|
"@tanstack/react-router": "^1.131",
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
92
92
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
93
93
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
94
|
-
"@payfit/unity-icons": "2.8.
|
|
95
|
-
"@payfit/unity-illustrations": "2.8.
|
|
96
|
-
"@payfit/unity-themes": "2.8.
|
|
94
|
+
"@payfit/unity-icons": "2.8.2",
|
|
95
|
+
"@payfit/unity-illustrations": "2.8.2",
|
|
96
|
+
"@payfit/unity-themes": "2.8.2",
|
|
97
97
|
"@payfit/vite-configs": "0.0.0-use.local",
|
|
98
|
-
"@storybook/addon-a11y": "10.2.
|
|
99
|
-
"@storybook/addon-docs": "10.2.
|
|
100
|
-
"@storybook/addon-links": "10.2.
|
|
101
|
-
"@storybook/addon-vitest": "10.2.
|
|
102
|
-
"@storybook/react-vite": "10.2.
|
|
98
|
+
"@storybook/addon-a11y": "10.2.8",
|
|
99
|
+
"@storybook/addon-docs": "10.2.8",
|
|
100
|
+
"@storybook/addon-links": "10.2.8",
|
|
101
|
+
"@storybook/addon-vitest": "10.2.8",
|
|
102
|
+
"@storybook/react-vite": "10.2.8",
|
|
103
103
|
"@tanstack/react-devtools": "0.9.5",
|
|
104
104
|
"@tanstack/react-form-devtools": "0.2.13",
|
|
105
105
|
"@tanstack/react-query": "5.90.20",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"prettier": "3.1.0",
|
|
121
121
|
"react-docgen-typescript": "2.2.2",
|
|
122
122
|
"react-hot-toast": "2.5.1",
|
|
123
|
-
"storybook": "10.2.
|
|
123
|
+
"storybook": "10.2.8",
|
|
124
124
|
"storybook-addon-pseudo-states": "10.2.2",
|
|
125
125
|
"storybook-addon-tag-badges": "3.0.6",
|
|
126
126
|
"storybook-mock-date-decorator": "3.0.0",
|