@payfit/unity-components 2.46.39 → 2.47.0
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/esm/components/definition-list/DefinitionList.context.js +17 -0
- package/dist/esm/components/definition-list/DefinitionList.js +23 -0
- package/dist/esm/components/definition-list/parts/DefinitionItem.js +51 -0
- package/dist/esm/components/multi-select/MultiSelect.d.ts +6 -1
- package/dist/esm/components/multi-select/MultiSelect.js +286 -238
- package/dist/esm/components/multi-select/Multiselect.context.d.ts +1 -1
- package/dist/esm/components/multi-select/MultiselectTypes.d.ts +5 -4
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.d.ts +20 -13
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.js +33 -22
- package/dist/esm/components/multi-select/parts/MultiSelectOption.d.ts +6 -3
- package/dist/esm/components/multi-select/parts/MultiSelectOption.js +51 -59
- package/dist/esm/components/multi-select/utils/selection-adapter.d.ts +5 -0
- package/dist/esm/components/multi-select/utils/selection-adapter.js +18 -0
- package/dist/esm/components/phone-number/PhoneNumberInput.js +38 -36
- package/dist/esm/components/select/Select.js +47 -44
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +444 -440
- package/package.json +7 -7
- package/dist/esm/components/multi-select/hooks/use-combobox-filter.d.ts +0 -12
- package/dist/esm/components/multi-select/hooks/use-combobox-filter.js +0 -22
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.d.ts +0 -14
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +0 -47
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +0 -18
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +0 -174
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.d.ts +0 -7
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +0 -65
- package/dist/esm/components/select/parts/SearchInput.d.ts +0 -5
- package/dist/esm/components/select/parts/SearchInput.js +0 -59
|
@@ -1,87 +1,90 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as C, useState as F, useMemo as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useState as F, useMemo as k } from "react";
|
|
3
3
|
import { uyTv as A } from "@payfit/unity-themes";
|
|
4
|
-
import { useFilter as
|
|
5
|
-
import { Select as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
4
|
+
import { useFilter as I, Autocomplete as T } from "react-aria-components/Autocomplete";
|
|
5
|
+
import { Select as U, Popover as V, ListBox as m } from "react-aria-components/Select";
|
|
6
|
+
import { Separator as $ } from "react-aria-components/Separator";
|
|
7
|
+
import { Virtualizer as y, ListLayout as f } from "react-aria-components/Virtualizer";
|
|
8
|
+
import { useIntl as q } from "react-intl";
|
|
9
|
+
import { Search as G } from "../search/Search.js";
|
|
10
|
+
import { SelectButton as H } from "./parts/SelectButton.js";
|
|
11
|
+
const J = A({
|
|
11
12
|
slots: {
|
|
12
13
|
base: "uy:flex uy:flex-col uy:gap-100 uy:w-full",
|
|
13
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",
|
|
14
15
|
listbox: "uy:overflow-y-auto uy:max-h-[296px] uy:pt-100 uy:pb-100"
|
|
15
16
|
}
|
|
16
|
-
}),
|
|
17
|
+
}), K = ({
|
|
17
18
|
children: r,
|
|
18
19
|
items: t,
|
|
19
20
|
placeholder: s,
|
|
20
21
|
isDisabled: l,
|
|
21
|
-
isInvalid:
|
|
22
|
+
isInvalid: a,
|
|
22
23
|
isReadOnly: i,
|
|
23
|
-
value:
|
|
24
|
+
value: n,
|
|
24
25
|
defaultValue: b,
|
|
25
26
|
onChange: u,
|
|
26
27
|
isSearchable: h = !1,
|
|
27
28
|
onBlur: v,
|
|
28
29
|
placement: x,
|
|
29
|
-
searchInputAriaLabel:
|
|
30
|
+
searchInputAriaLabel: S,
|
|
30
31
|
renderEmptyState: e,
|
|
31
|
-
renderValue:
|
|
32
|
-
...
|
|
33
|
-
},
|
|
34
|
-
const O =
|
|
35
|
-
value:
|
|
32
|
+
renderValue: g,
|
|
33
|
+
...N
|
|
34
|
+
}, w) => {
|
|
35
|
+
const O = q(), [L, M] = F(!1), { contains: P } = I({ sensitivity: "base" }), { base: j, popover: z, listbox: c } = J(), B = n !== void 0 || u !== void 0 ? {
|
|
36
|
+
value: n,
|
|
36
37
|
onChange: u
|
|
37
|
-
} : { defaultValue: b },
|
|
38
|
+
} : { defaultValue: b }, d = k(() => {
|
|
38
39
|
if (e !== void 0)
|
|
39
40
|
return typeof e == "function" ? e : () => e;
|
|
40
41
|
}, [e]);
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
42
|
+
return /* @__PURE__ */ p(
|
|
43
|
+
U,
|
|
43
44
|
{
|
|
44
45
|
onOpenChange: M,
|
|
45
|
-
...
|
|
46
|
-
ref:
|
|
46
|
+
...N,
|
|
47
|
+
ref: w,
|
|
47
48
|
className: j(),
|
|
48
49
|
placeholder: l ? void 0 : s,
|
|
49
50
|
isDisabled: l || i,
|
|
50
|
-
isInvalid:
|
|
51
|
+
isInvalid: a,
|
|
51
52
|
onBlur: v,
|
|
52
53
|
...B,
|
|
53
54
|
children: [
|
|
54
55
|
/* @__PURE__ */ o(
|
|
55
|
-
|
|
56
|
+
H,
|
|
56
57
|
{
|
|
57
58
|
isDisabled: l,
|
|
58
|
-
isInvalid:
|
|
59
|
+
isInvalid: a,
|
|
59
60
|
isReadOnly: i,
|
|
60
61
|
isOpen: L,
|
|
61
|
-
renderValue:
|
|
62
|
+
renderValue: g
|
|
62
63
|
}
|
|
63
64
|
),
|
|
64
65
|
/* @__PURE__ */ o(
|
|
65
|
-
|
|
66
|
+
V,
|
|
66
67
|
{
|
|
67
68
|
offset: 1,
|
|
68
69
|
containerPadding: 8,
|
|
69
70
|
className: z(),
|
|
70
71
|
placement: x,
|
|
71
|
-
children: h ? /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */ o(
|
|
73
|
-
|
|
72
|
+
children: h ? /* @__PURE__ */ p(T, { filter: P, children: [
|
|
73
|
+
/* @__PURE__ */ o("div", { className: "uy:m-100", children: /* @__PURE__ */ o(
|
|
74
|
+
G,
|
|
74
75
|
{
|
|
75
|
-
|
|
76
|
+
label: S ?? O.formatMessage({
|
|
76
77
|
id: "unity:component:select:search:label",
|
|
77
78
|
defaultMessage: "Search options"
|
|
78
|
-
})
|
|
79
|
+
}),
|
|
80
|
+
"data-dd-privacy": "mask"
|
|
79
81
|
}
|
|
80
|
-
),
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ o($, { className: "uy:mx-100 uy:border-t uy:border-border-neutral uy:border-solid" }),
|
|
81
84
|
/* @__PURE__ */ o(
|
|
82
|
-
|
|
85
|
+
y,
|
|
83
86
|
{
|
|
84
|
-
layout:
|
|
87
|
+
layout: f,
|
|
85
88
|
layoutOptions: {
|
|
86
89
|
padding: 8
|
|
87
90
|
},
|
|
@@ -90,16 +93,16 @@ const H = A({
|
|
|
90
93
|
{
|
|
91
94
|
items: t,
|
|
92
95
|
className: c(),
|
|
93
|
-
renderEmptyState:
|
|
96
|
+
renderEmptyState: d,
|
|
94
97
|
children: r
|
|
95
98
|
}
|
|
96
99
|
)
|
|
97
100
|
}
|
|
98
101
|
)
|
|
99
102
|
] }) : /* @__PURE__ */ o(
|
|
100
|
-
|
|
103
|
+
y,
|
|
101
104
|
{
|
|
102
|
-
layout:
|
|
105
|
+
layout: f,
|
|
103
106
|
layoutOptions: {
|
|
104
107
|
padding: 8
|
|
105
108
|
},
|
|
@@ -108,7 +111,7 @@ const H = A({
|
|
|
108
111
|
{
|
|
109
112
|
items: t,
|
|
110
113
|
className: c(),
|
|
111
|
-
renderEmptyState:
|
|
114
|
+
renderEmptyState: d,
|
|
112
115
|
children: r
|
|
113
116
|
}
|
|
114
117
|
)
|
|
@@ -119,10 +122,10 @@ const H = A({
|
|
|
119
122
|
]
|
|
120
123
|
}
|
|
121
124
|
);
|
|
122
|
-
},
|
|
123
|
-
return
|
|
125
|
+
}, Q = C(function(t, s) {
|
|
126
|
+
return K(t, s);
|
|
124
127
|
});
|
|
125
|
-
|
|
128
|
+
Q.displayName = "Select";
|
|
126
129
|
export {
|
|
127
|
-
|
|
130
|
+
Q as Select
|
|
128
131
|
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export * from './components/date-calendar/DateCalendar.js';
|
|
|
54
54
|
export * from './components/date-picker/DatePicker.js';
|
|
55
55
|
export * from './components/date-range-calendar/DateRangeCalendar.js';
|
|
56
56
|
export * from './components/date-range-picker/DateRangePicker.js';
|
|
57
|
+
export * from './components/definition-list/DefinitionList.js';
|
|
58
|
+
export * from './components/definition-list/parts/DefinitionItem.js';
|
|
57
59
|
export * from './components/definition-tooltip/DefinitionTooltip.js';
|
|
58
60
|
export * from './components/dialog/Dialog.js';
|
|
59
61
|
export * from './components/dialog/parts/DialogActions.js';
|