@box/combobox-with-api 0.36.0 → 0.36.3

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.
@@ -2,7 +2,7 @@ import { useComboboxStore as G, ComboboxProvider as X, PopoverAnchor as q, Combo
2
2
  import { useLabelable as Q, ChipsGroup as U, InputChip as Y, IconButton as Z } from "@box/blueprint-web";
3
3
  import { XMark as _, Search as $ } from "@box/blueprint-web-assets/icons/Fill";
4
4
  import { IconIconOnLightSecondary as ee, Size6 as g, Size1 as oe } from "@box/blueprint-web-assets/tokens/tokens";
5
- import m from "clsx";
5
+ import p from "clsx";
6
6
  import { forwardRef as le, useId as te, useState as V, useRef as ae, useCallback as se } from "react";
7
7
  import { useIntl as re } from "react-intl";
8
8
  import I from "../combobox-with-api-pagination/messages.js";
@@ -26,44 +26,44 @@ const ce = () => /* @__PURE__ */ o($, {
26
26
  noResultMessage: y,
27
27
  defaultValue: A = [],
28
28
  loadingAriaLabel: R,
29
- multiselect: p = !1,
29
+ multiselect: b = !1,
30
30
  className: B,
31
31
  levels: z,
32
32
  selectableLevels: M,
33
33
  label: O,
34
- hideLabel: b,
34
+ hideLabel: d,
35
35
  treeAriaLabel: P,
36
36
  portalElement: W,
37
37
  placeholder: k,
38
38
  disabled: D
39
39
  } = S, {
40
- formatMessage: d
41
- } = re(), n = te(), [h, T] = V(!1), [t, i] = ne({
40
+ formatMessage: h
41
+ } = re(), n = te(), [f, T] = V(!1), [t, i] = ne({
42
42
  prop: L,
43
43
  defaultProp: A,
44
44
  onChange: N
45
- }), [f, x] = V(""), j = ae(null), E = se((e) => {
46
- x(e);
47
- }, [x]), c = G({
45
+ }), [x, c] = V(""), j = ae(null), E = se((e) => {
46
+ c(e);
47
+ }, [c]), u = G({
48
48
  includesBaseElement: !0,
49
49
  virtualFocus: !1,
50
- value: f,
50
+ value: x,
51
51
  setValue: E,
52
- open: h,
52
+ open: f,
53
53
  setOpen: T
54
54
  }), C = t.length > 0, v = t.length > 0, F = Q(O, n);
55
55
  return /* @__PURE__ */ r(X, {
56
- store: c,
56
+ store: u,
57
57
  children: [/* @__PURE__ */ o(q, {
58
58
  children: /* @__PURE__ */ r("div", {
59
- className: m(l.container, B),
59
+ className: p(l.container, B),
60
60
  children: [/* @__PURE__ */ o(F, {
61
- className: m(l.label, {
62
- [l.hiddenLabel]: b
61
+ className: p(l.label, {
62
+ [l.hiddenLabel]: d
63
63
  }),
64
- hideLabel: b
64
+ hideLabel: d
65
65
  }), /* @__PURE__ */ r("div", {
66
- className: m(l.comboboxContainer, {
66
+ className: p(l.comboboxContainer, {
67
67
  [l.withChips]: v,
68
68
  [l.withComboboxButtons]: C
69
69
  }),
@@ -84,7 +84,7 @@ const ce = () => /* @__PURE__ */ o($, {
84
84
  disabled: D,
85
85
  id: n,
86
86
  placeholder: k,
87
- store: c
87
+ store: u
88
88
  }), /* @__PURE__ */ o("div", {
89
89
  className: l.comboboxButtons,
90
90
  children: C ? /* @__PURE__ */ o(J, {
@@ -97,7 +97,7 @@ const ce = () => /* @__PURE__ */ o($, {
97
97
  icon: _,
98
98
  size: "x-small"
99
99
  }),
100
- store: c
100
+ store: u
101
101
  }) : /* @__PURE__ */ o(ce, {})
102
102
  })]
103
103
  })]
@@ -116,24 +116,24 @@ const ce = () => /* @__PURE__ */ o($, {
116
116
  ariaLabel: P,
117
117
  defaultFetcher: w,
118
118
  levels: z,
119
- loadingAriaLabel: R || d(I.loadingAriaLabel),
120
- multiselect: p,
121
- noResultMessage: y || d(I.noResults),
119
+ loadingAriaLabel: R || h(I.loadingAriaLabel),
120
+ multiselect: b,
121
+ noResultMessage: y || h(I.noResults),
122
122
  onSelect: (e) => {
123
123
  const {
124
124
  metadata: a
125
125
  } = e.element;
126
126
  let s = [];
127
- e.isSelected ? (p && (s = t.filter((u) => u.value !== e.element.id)), s.push({
127
+ e.isSelected ? (b && (s = t.filter((m) => m.value !== e.element.id)), s.push({
128
128
  value: e.element.id,
129
129
  displayValue: a.displayValue,
130
130
  level: a.level,
131
131
  selectable: a.selectable,
132
132
  ancestors: a.ancestors
133
- })) : s = t.filter((u) => u.value !== e.element.id), i(s);
133
+ })) : s = t.filter((m) => m.value !== e.element.id), i(s), c("");
134
134
  },
135
- open: h,
136
- searchInput: f.trimStart(),
135
+ open: f,
136
+ searchInput: x.trimStart(),
137
137
  selectableLevels: M,
138
138
  selectedNodes: t.map((e) => e.value)
139
139
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/combobox-with-api",
3
- "version": "0.36.0",
3
+ "version": "0.36.3",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.15",
6
6
  "@box/blueprint-web": "^10.3.1",
@@ -11,13 +11,13 @@
11
11
  "react-intl": "^6.4.2"
12
12
  },
13
13
  "dependencies": {
14
- "@box/tree": "^0.47.1",
14
+ "@box/tree": "^0.47.2",
15
15
  "react-accessible-treeview": "2.9.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@box/blueprint-web": "^11.10.2",
19
- "@box/blueprint-web-assets": "^4.42.0",
20
- "@box/storybook-utils": "^0.12.1",
18
+ "@box/blueprint-web": "^11.10.3",
19
+ "@box/blueprint-web-assets": "^4.43.0",
20
+ "@box/storybook-utils": "^0.12.2",
21
21
  "react": "^18.3.0",
22
22
  "react-dom": "^18.3.0"
23
23
  },