@payfit/unity-components 3.22.18 → 3.22.20
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.
|
@@ -16,6 +16,12 @@ export interface SelectProps<T extends object> extends Omit<AriaSelectProps<T>,
|
|
|
16
16
|
onChange?: AriaSelectProps<T>['onChange'];
|
|
17
17
|
/** Whether the search input should be displayed or not */
|
|
18
18
|
isSearchable?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Focus the search input each time the dropdown opens.
|
|
21
|
+
* Only applies when `isSearchable` is true.
|
|
22
|
+
* When omitted, preserves the existing search focus behavior.
|
|
23
|
+
*/
|
|
24
|
+
searchAutoFocus?: boolean;
|
|
19
25
|
/** The placement of the popover */
|
|
20
26
|
placement?: Extract<AriaPopoverProps['placement'], 'top' | 'bottom'>;
|
|
21
27
|
/** The aria-label for the search input when isSearchable is true */
|
|
@@ -13,41 +13,42 @@ var _ = a({ slots: {
|
|
|
13
13
|
base: "uy:flex uy:flex-col uy:gap-100 uy:w-full",
|
|
14
14
|
popover: "uy:rounded-100 uy:sm:rounded-75 uy:border uy:border-solid uy:border-border-neutral uy:w-[var(--trigger-width)] uy:bg-surface-neutral uy:shadow-300",
|
|
15
15
|
listbox: "uy:overflow-y-auto uy:max-h-[296px] uy:pt-100 uy:pb-100"
|
|
16
|
-
} }), v = ({ children: n, items: a, placeholder: v, isDisabled: y, isInvalid: b, isReadOnly: x, value: S, defaultValue: C, onChange: w, isSearchable: T = !1,
|
|
17
|
-
let
|
|
16
|
+
} }), v = ({ children: n, items: a, placeholder: v, isDisabled: y, isInvalid: b, isReadOnly: x, value: S, defaultValue: C, onChange: w, isSearchable: T = !1, searchAutoFocus: E, onBlur: D, placement: O, searchInputAriaLabel: k, renderEmptyState: A, renderValue: j, ...M }, N) => {
|
|
17
|
+
let P = c(), [F, I] = i(!1), { contains: L } = d({ sensitivity: "base" }), { base: R, popover: z, listbox: B } = _(), V = S !== void 0 || w !== void 0 ? {
|
|
18
18
|
value: S,
|
|
19
19
|
onChange: w
|
|
20
|
-
} : { defaultValue: C },
|
|
21
|
-
if (
|
|
22
|
-
}, [
|
|
20
|
+
} : { defaultValue: C }, H = r(() => {
|
|
21
|
+
if (A !== void 0) return typeof A == "function" ? A : () => A;
|
|
22
|
+
}, [A]);
|
|
23
23
|
return /* @__PURE__ */ s(g, {
|
|
24
|
-
onOpenChange:
|
|
25
|
-
...
|
|
26
|
-
ref:
|
|
27
|
-
className:
|
|
24
|
+
onOpenChange: I,
|
|
25
|
+
...M,
|
|
26
|
+
ref: N,
|
|
27
|
+
className: R(),
|
|
28
28
|
placeholder: y ? void 0 : v,
|
|
29
29
|
isDisabled: y || x,
|
|
30
30
|
isInvalid: b,
|
|
31
|
-
onBlur:
|
|
32
|
-
...
|
|
31
|
+
onBlur: D,
|
|
32
|
+
...V,
|
|
33
33
|
children: [/* @__PURE__ */ o(t, {
|
|
34
34
|
isDisabled: y,
|
|
35
35
|
isInvalid: b,
|
|
36
36
|
isReadOnly: x,
|
|
37
|
-
isOpen:
|
|
38
|
-
renderValue:
|
|
37
|
+
isOpen: F,
|
|
38
|
+
renderValue: j
|
|
39
39
|
}), /* @__PURE__ */ o(h, {
|
|
40
40
|
offset: 1,
|
|
41
41
|
containerPadding: 8,
|
|
42
|
-
className:
|
|
43
|
-
placement:
|
|
42
|
+
className: z(),
|
|
43
|
+
placement: O,
|
|
44
44
|
children: T ? /* @__PURE__ */ s(u, {
|
|
45
|
-
filter:
|
|
45
|
+
filter: L,
|
|
46
46
|
children: [
|
|
47
47
|
/* @__PURE__ */ o("div", {
|
|
48
48
|
className: "uy:m-100",
|
|
49
49
|
children: /* @__PURE__ */ o(e, {
|
|
50
|
-
|
|
50
|
+
autoFocus: E,
|
|
51
|
+
label: k ?? P.formatMessage({
|
|
51
52
|
id: "unity:component:select:search:label",
|
|
52
53
|
defaultMessage: "Search options"
|
|
53
54
|
}),
|
|
@@ -60,8 +61,8 @@ var _ = a({ slots: {
|
|
|
60
61
|
layoutOptions: { padding: 8 },
|
|
61
62
|
children: /* @__PURE__ */ o(m, {
|
|
62
63
|
items: a,
|
|
63
|
-
className:
|
|
64
|
-
renderEmptyState:
|
|
64
|
+
className: B(),
|
|
65
|
+
renderEmptyState: H,
|
|
65
66
|
children: n
|
|
66
67
|
})
|
|
67
68
|
})
|
|
@@ -71,8 +72,8 @@ var _ = a({ slots: {
|
|
|
71
72
|
layoutOptions: { padding: 8 },
|
|
72
73
|
children: /* @__PURE__ */ o(m, {
|
|
73
74
|
items: a,
|
|
74
|
-
className:
|
|
75
|
-
renderEmptyState:
|
|
75
|
+
className: B(),
|
|
76
|
+
renderEmptyState: H,
|
|
76
77
|
children: n
|
|
77
78
|
})
|
|
78
79
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "3.22.
|
|
3
|
+
"version": "3.22.20",
|
|
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.
|
|
106
|
+
"@payfit/unity-illustrations": "3.22.20",
|
|
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.
|
|
136
|
-
"@payfit/unity-themes": "3.22.
|
|
135
|
+
"@payfit/unity-icons": "3.22.20",
|
|
136
|
+
"@payfit/unity-themes": "3.22.20",
|
|
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.
|
|
160
|
-
"@payfit/unity-themes": "3.22.
|
|
159
|
+
"@payfit/unity-icons": "3.22.20",
|
|
160
|
+
"@payfit/unity-themes": "3.22.20",
|
|
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",
|