@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.
Files changed (28) hide show
  1. package/dist/esm/components/definition-list/DefinitionList.context.js +17 -0
  2. package/dist/esm/components/definition-list/DefinitionList.js +23 -0
  3. package/dist/esm/components/definition-list/parts/DefinitionItem.js +51 -0
  4. package/dist/esm/components/multi-select/MultiSelect.d.ts +6 -1
  5. package/dist/esm/components/multi-select/MultiSelect.js +286 -238
  6. package/dist/esm/components/multi-select/Multiselect.context.d.ts +1 -1
  7. package/dist/esm/components/multi-select/MultiselectTypes.d.ts +5 -4
  8. package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.d.ts +20 -13
  9. package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.js +33 -22
  10. package/dist/esm/components/multi-select/parts/MultiSelectOption.d.ts +6 -3
  11. package/dist/esm/components/multi-select/parts/MultiSelectOption.js +51 -59
  12. package/dist/esm/components/multi-select/utils/selection-adapter.d.ts +5 -0
  13. package/dist/esm/components/multi-select/utils/selection-adapter.js +18 -0
  14. package/dist/esm/components/phone-number/PhoneNumberInput.js +38 -36
  15. package/dist/esm/components/select/Select.js +47 -44
  16. package/dist/esm/index.d.ts +2 -0
  17. package/dist/esm/index.js +444 -440
  18. package/package.json +7 -7
  19. package/dist/esm/components/multi-select/hooks/use-combobox-filter.d.ts +0 -12
  20. package/dist/esm/components/multi-select/hooks/use-combobox-filter.js +0 -22
  21. package/dist/esm/components/multi-select/hooks/use-multiselection-state.d.ts +0 -14
  22. package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +0 -47
  23. package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +0 -18
  24. package/dist/esm/components/multi-select/parts/MultiSelectButton.js +0 -174
  25. package/dist/esm/components/multi-select/parts/MultiSelectPopover.d.ts +0 -7
  26. package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +0 -65
  27. package/dist/esm/components/select/parts/SearchInput.d.ts +0 -5
  28. package/dist/esm/components/select/parts/SearchInput.js +0 -59
@@ -1,87 +1,90 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as C, useState as F, useMemo as I } from "react";
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 T, Autocomplete as U } from "react-aria-components/Autocomplete";
5
- import { Select as V, Popover as $, ListBox as m } from "react-aria-components/Select";
6
- import { Virtualizer as f, ListLayout as y } from "react-aria-components/Virtualizer";
7
- import { useIntl as k } from "react-intl";
8
- import { SearchInput as q } from "./parts/SearchInput.js";
9
- import { SelectButton as G } from "./parts/SelectButton.js";
10
- const H = A({
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
- }), J = ({
17
+ }), K = ({
17
18
  children: r,
18
19
  items: t,
19
20
  placeholder: s,
20
21
  isDisabled: l,
21
- isInvalid: n,
22
+ isInvalid: a,
22
23
  isReadOnly: i,
23
- value: a,
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: g,
30
+ searchInputAriaLabel: S,
30
31
  renderEmptyState: e,
31
- renderValue: S,
32
- ...w
33
- }, N) => {
34
- const O = k(), [L, M] = F(!1), { contains: P } = T({ sensitivity: "base" }), { base: j, popover: z, listbox: c } = H(), B = a !== void 0 || u !== void 0 ? {
35
- value: a,
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 }, p = I(() => {
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__ */ d(
42
- V,
42
+ return /* @__PURE__ */ p(
43
+ U,
43
44
  {
44
45
  onOpenChange: M,
45
- ...w,
46
- ref: N,
46
+ ...N,
47
+ ref: w,
47
48
  className: j(),
48
49
  placeholder: l ? void 0 : s,
49
50
  isDisabled: l || i,
50
- isInvalid: n,
51
+ isInvalid: a,
51
52
  onBlur: v,
52
53
  ...B,
53
54
  children: [
54
55
  /* @__PURE__ */ o(
55
- G,
56
+ H,
56
57
  {
57
58
  isDisabled: l,
58
- isInvalid: n,
59
+ isInvalid: a,
59
60
  isReadOnly: i,
60
61
  isOpen: L,
61
- renderValue: S
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__ */ d(U, { filter: P, children: [
72
- /* @__PURE__ */ o(
73
- q,
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
- "aria-label": g ?? O.formatMessage({
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
- f,
85
+ y,
83
86
  {
84
- layout: y,
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: p,
96
+ renderEmptyState: d,
94
97
  children: r
95
98
  }
96
99
  )
97
100
  }
98
101
  )
99
102
  ] }) : /* @__PURE__ */ o(
100
- f,
103
+ y,
101
104
  {
102
- layout: y,
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: p,
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
- }, K = C(function(t, s) {
123
- return J(t, s);
125
+ }, Q = C(function(t, s) {
126
+ return K(t, s);
124
127
  });
125
- K.displayName = "Select";
128
+ Q.displayName = "Select";
126
129
  export {
127
- K as Select
130
+ Q as Select
128
131
  };
@@ -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';