@payfit/unity-components 2.8.1 → 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, t) {
9
- const n = (r) => /* @__PURE__ */ c(u, { items: r.children, label: r.label, children: (o) => /* @__PURE__ */ c(a, { id: o.id, textValue: o.label, children: o.label }) }), e = (r) => /* @__PURE__ */ c(a, { id: r.id, textValue: r.label, children: r.label });
10
- return (r, o) => /* @__PURE__ */ c(
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
- ...t,
13
+ ...n,
14
14
  items: l,
15
15
  value: r,
16
16
  selectionMode: "multiple",
17
- onChange: (i) => {
18
- o(i);
17
+ onChange: (o) => {
18
+ i(o);
19
19
  },
20
20
  escapeKeyBehavior: "none",
21
21
  sortSelectedFirst: !0,
22
- className: "uy:overflow-y-auto uy:scroll-pb-500",
23
- children: (i) => s(i) ? n(i) : e(i)
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 (t) => {
29
- if (t === "all")
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 n = [];
31
+ const t = [];
32
32
  for (const e of l) {
33
33
  if (s(e)) {
34
- n.push(...e.children.filter((r) => t.has(r.id)));
34
+ t.push(...e.children.filter((r) => n.has(r.id)));
35
35
  continue;
36
36
  }
37
- t.has(e.id) && n.push(e);
37
+ n.has(e.id) && t.push(e);
38
38
  }
39
- return n.map((e) => e.label).join(", ");
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] uy:overflow-y-auto"],
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 uy:overflow-hidden",
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: f,
24
- value: p,
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: v, inputContainer: w, list: x, separator: C, selectedListBox: A } = G(), [i, l] = k(
33
- p,
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: x({ className: b }),
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: f })
60
+ children: /* @__PURE__ */ e(M, { items: t.remainingItems, children: p })
61
61
  }
62
62
  );
63
- return /* @__PURE__ */ e("div", { ref: I, className: v(), children: N ? /* @__PURE__ */ s(O, { filter: L, children: [
64
- /* @__PURE__ */ s("div", { className: w(), "data-dd-privacy": "mask", children: [
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.1",
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.1",
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",
@@ -71,8 +71,8 @@
71
71
  },
72
72
  "peerDependencies": {
73
73
  "@hookform/devtools": "^4",
74
- "@payfit/unity-icons": "2.8.1",
75
- "@payfit/unity-themes": "2.8.1",
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,9 +91,9 @@
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.1",
95
- "@payfit/unity-illustrations": "2.8.1",
96
- "@payfit/unity-themes": "2.8.1",
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
98
  "@storybook/addon-a11y": "10.2.8",
99
99
  "@storybook/addon-docs": "10.2.8",