@payfit/unity-components 3.22.15 → 3.22.17

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.
@@ -32,6 +32,12 @@ export interface SelectListProps<TType extends object = object> extends Omit<Ari
32
32
  * Does not replace the translated accessible search label.
33
33
  */
34
34
  searchPlaceholder?: string;
35
+ /**
36
+ * Focus the search input when it mounts so users can start typing immediately.
37
+ * Applies only when search is visible and takes precedence over list `autoFocus`.
38
+ * @default false
39
+ */
40
+ searchAutoFocus?: boolean;
35
41
  /**
36
42
  * Additional CSS classes to apply to the list container. Use this to customize height or other container styles.
37
43
  */
@@ -20,48 +20,52 @@ var v = c({ slots: {
20
20
  list: "uy:overflow-y-auto uy:mt-100 uy:max-h-[300px]",
21
21
  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"
22
22
  } });
23
- function y({ items: o, children: c, value: y, onChange: b, className: x, showSearch: S = !1, searchPlaceholder: C, sortSelectedFirst: w = !1, selectedSectionLabel: T = "Selected", ...E }, D) {
24
- let { contains: O } = g({ sensitivity: "base" }), { wrapper: k, inputContainer: A, list: j, separator: M, selectedListBox: N } = v(), [P, F] = t(y, b), I = s(() => (Array.isArray(o) ? o.length : Array.from(o).length) >= 10 || S, [o, S]), L = n(o, P, w), R = s(() => L.remainingItems ? !L.remainingItems[Symbol.iterator]().next().done : !1, [L.remainingItems]), z = /* @__PURE__ */ u(r, {
25
- items: L.selectedItems,
26
- selectedKeys: P,
27
- onSelectionChange: F,
28
- selectionMode: E.selectionMode,
29
- selectionBehavior: E.selectionBehavior,
30
- label: T,
31
- className: N(),
32
- "data-is-last": !R
33
- }), B = /* @__PURE__ */ u(m, {
34
- ...E,
35
- className: j({ className: x }),
36
- items: L.remainingItems,
37
- selectedKeys: P,
38
- onSelectionChange: F,
23
+ function y({ items: o, children: c, value: y, onChange: b, className: x, showSearch: S = !1, searchPlaceholder: C, searchAutoFocus: w = !1, sortSelectedFirst: T = !1, selectedSectionLabel: E = "Selected", ...D }, O) {
24
+ let { contains: k } = g({ sensitivity: "base" }), { wrapper: A, inputContainer: j, list: M, separator: N, selectedListBox: P } = v(), [F, I] = t(y, b), L = s(() => (Array.isArray(o) ? o.length : Array.from(o).length) >= 10 || S, [o, S]), R = n(o, F, T), z = s(() => R.remainingItems ? !R.remainingItems[Symbol.iterator]().next().done : !1, [R.remainingItems]), B = /* @__PURE__ */ u(r, {
25
+ items: R.selectedItems,
26
+ selectedKeys: F,
27
+ onSelectionChange: I,
28
+ selectionMode: D.selectionMode,
29
+ selectionBehavior: D.selectionBehavior,
30
+ label: E,
31
+ className: P(),
32
+ "data-is-last": !z
33
+ }), V = /* @__PURE__ */ u(m, {
34
+ ...D,
35
+ autoFocus: L && w ? !1 : D.autoFocus,
36
+ className: M({ className: x }),
37
+ items: R.remainingItems,
38
+ selectedKeys: F,
39
+ onSelectionChange: I,
39
40
  renderEmptyState: i,
40
41
  children: /* @__PURE__ */ u(p, {
41
- items: L.remainingItems,
42
+ items: R.remainingItems,
42
43
  children: c
43
44
  })
44
45
  });
45
46
  return /* @__PURE__ */ u("div", {
46
- ref: D,
47
- className: k(),
48
- children: I ? /* @__PURE__ */ d(h, {
49
- filter: O,
47
+ ref: O,
48
+ className: A(),
49
+ children: L ? /* @__PURE__ */ d(h, {
50
+ filter: k,
50
51
  children: [
51
52
  /* @__PURE__ */ d("div", {
52
- className: A(),
53
+ className: j(),
53
54
  "data-dd-privacy": "mask",
54
- children: [/* @__PURE__ */ u(a, { placeholder: C }), /* @__PURE__ */ u(f, { className: M() })]
55
+ children: [/* @__PURE__ */ u(a, {
56
+ placeholder: C,
57
+ autoFocus: w
58
+ }), /* @__PURE__ */ u(f, { className: N() })]
55
59
  }),
56
- z,
57
- R && /* @__PURE__ */ u(_, {
60
+ B,
61
+ z && /* @__PURE__ */ u(_, {
58
62
  ...e,
59
- children: B
63
+ children: V
60
64
  })
61
65
  ]
62
- }) : /* @__PURE__ */ d(l, { children: [z, R && /* @__PURE__ */ u(_, {
66
+ }) : /* @__PURE__ */ d(l, { children: [B, z && /* @__PURE__ */ u(_, {
63
67
  ...e,
64
- children: B
68
+ children: V
65
69
  })] })
66
70
  });
67
71
  }
@@ -1,5 +1,6 @@
1
1
  type SelectListSearchInputProps = {
2
2
  placeholder?: string;
3
+ autoFocus?: boolean;
3
4
  };
4
5
  declare const SelectListSearchInput: import('react').ForwardRefExoticComponent<SelectListSearchInputProps & import('react').RefAttributes<HTMLDivElement>>;
5
6
  export { SelectListSearchInput };
@@ -10,11 +10,12 @@ import { SearchField as c } from "react-aria-components/SearchField";
10
10
  var l = r({ slots: {
11
11
  base: "uy:flex uy:gap-100 uy:items-center uy:transition-colors uy:py-125 uy:sm:py-100 uy:px-150 uy:rounded-100 uy:sm:rounded-75 uy:bg-surface-form-high-enabled uy:focus-within:outline-utility-focus-ring uy:focus-within:outline-2 uy:focus-within:outline-offset-2 uy:text-content-form-active uy:typography-body",
12
12
  input: "uy:flex-grow uy:outline-none uy:[&::-webkit-search-cancel-button]:hidden"
13
- } }), u = n(({ placeholder: n }, r) => {
14
- let u = o(), { base: d, input: f } = l();
13
+ } }), u = n(({ placeholder: n, autoFocus: r }, u) => {
14
+ let d = o(), { base: f, input: p } = l();
15
15
  return /* @__PURE__ */ a(c, {
16
- className: d(),
17
- ref: r,
16
+ className: f(),
17
+ ref: u,
18
+ autoFocus: r,
18
19
  "data-dd-privacy": "mask",
19
20
  children: [
20
21
  /* @__PURE__ */ i(e, {
@@ -24,14 +25,14 @@ var l = r({ slots: {
24
25
  }),
25
26
  /* @__PURE__ */ i(s, {
26
27
  placeholder: n,
27
- "aria-label": u.formatMessage({
28
+ "aria-label": d.formatMessage({
28
29
  id: "unity:component:common:search:label",
29
30
  defaultMessage: "Search"
30
31
  }),
31
- className: f()
32
+ className: p()
32
33
  }),
33
34
  /* @__PURE__ */ i(t, {
34
- title: u.formatMessage({
35
+ title: d.formatMessage({
35
36
  id: "unity:component:common:clear:title",
36
37
  defaultMessage: "Clear"
37
38
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-components",
3
- "version": "3.22.15",
3
+ "version": "3.22.17",
4
4
  "module": "./dist/esm/index.js",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -103,7 +103,7 @@
103
103
  "@formatjs/intl": "4.1.12",
104
104
  "@internationalized/date": "3.12.4",
105
105
  "minimatch": "10.2.5",
106
- "@payfit/unity-illustrations": "3.22.15",
106
+ "@payfit/unity-illustrations": "3.22.17",
107
107
  "@radix-ui/react-avatar": "1.2.7",
108
108
  "@radix-ui/react-slot": "1.4.0",
109
109
  "@react-aria/interactions": "3.28.1",
@@ -132,8 +132,8 @@
132
132
  "zod": "4.6.7"
133
133
  },
134
134
  "peerDependencies": {
135
- "@payfit/unity-icons": "3.22.15",
136
- "@payfit/unity-themes": "3.22.15",
135
+ "@payfit/unity-icons": "3.22.17",
136
+ "@payfit/unity-themes": "3.22.17",
137
137
  "@storybook/react-vite": "^10",
138
138
  "@tanstack/react-query": "^5",
139
139
  "@tanstack/form-core": "1.33.5",
@@ -156,8 +156,8 @@
156
156
  "@payfit/storybook-addon-console-errors": "0.0.0-use.local",
157
157
  "@payfit/storybook-addon-datadog-rum": "0.0.0-use.local",
158
158
  "@payfit/storybook-config": "0.0.0-use.local",
159
- "@payfit/unity-icons": "3.22.15",
160
- "@payfit/unity-themes": "3.22.15",
159
+ "@payfit/unity-icons": "3.22.17",
160
+ "@payfit/unity-themes": "3.22.17",
161
161
  "@payfit/vite-configs": "0.0.0-use.local",
162
162
  "@storybook/addon-a11y": "10.6.1",
163
163
  "@storybook/addon-designs": "11.1.4",