@box/metadata-editor 0.51.1 → 0.52.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 (47) hide show
  1. package/chunks/metadata-editor-field-wrapper.js +18 -16
  2. package/esm/index.js +16 -16
  3. package/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +191 -0
  4. package/esm/lib/components/combobox-with-api-pagination/index.js +4 -0
  5. package/esm/lib/components/combobox-with-api-pagination/utils/use-controllable-state.js +40 -0
  6. package/esm/lib/components/interactive-text/interactive-text.js +16 -10
  7. package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +57 -50
  8. package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +39 -30
  9. package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +43 -34
  10. package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +39 -30
  11. package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +37 -28
  12. package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/single-level-taxonomy-field.js +8 -0
  13. package/esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js +8 -8
  14. package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-entry/metadata-instance-entry.js +19 -21
  15. package/package.json +3 -3
  16. package/styles/interactive-text.css +1 -0
  17. package/styles/metadata-instance-entry.css +1 -1
  18. package/types/index.d.ts +1 -1
  19. package/types/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.d.ts +2 -0
  20. package/types/lib/components/combobox-with-api-pagination/index.d.ts +2 -0
  21. package/types/lib/components/combobox-with-api-pagination/types.d.ts +35 -0
  22. package/types/lib/components/combobox-with-api-pagination/utils/use-controllable-state.d.ts +8 -0
  23. package/types/lib/components/interactive-text/interactive-text.d.ts +2 -1
  24. package/types/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.d.ts +1 -1
  25. package/types/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.d.ts +1 -1
  26. package/types/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.d.ts +1 -1
  27. package/types/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.d.ts +1 -1
  28. package/types/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.d.ts +1 -1
  29. package/types/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/types.d.ts +21 -0
  30. package/types/lib/components/metadata-editor-fields/types.d.ts +1 -0
  31. package/types/lib/test-utils/sample-data.d.ts +1 -1
  32. package/esm/lib/components/metadata-taxonomy-field/combobox-with-api-pagination.js +0 -188
  33. package/esm/lib/components/metadata-taxonomy-field/single-level-taxonomy-field.js +0 -19
  34. package/types/lib/components/metadata-taxonomy-field/combobox-with-api-pagination.d.ts +0 -15
  35. package/types/lib/components/metadata-taxonomy-field/types.d.ts +0 -41
  36. /package/esm/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/messages.js +0 -0
  37. /package/esm/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/request.js +0 -0
  38. /package/esm/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/use-async-list.js +0 -0
  39. /package/esm/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/utils/use-intersection-observer.js +0 -0
  40. /package/esm/lib/components/{metadata-taxonomy-field → metadata-editor-fields/components/metadata-taxonomy-field}/index.js +0 -0
  41. /package/i18n/json/src/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/messages.json +0 -0
  42. /package/types/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/messages.d.ts +0 -0
  43. /package/types/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/request.d.ts +0 -0
  44. /package/types/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/use-async-list.d.ts +0 -0
  45. /package/types/lib/components/{metadata-taxonomy-field → combobox-with-api-pagination}/utils/use-intersection-observer.d.ts +0 -0
  46. /package/types/lib/components/{metadata-taxonomy-field → metadata-editor-fields/components/metadata-taxonomy-field}/index.d.ts +0 -0
  47. /package/types/lib/components/{metadata-taxonomy-field → metadata-editor-fields/components/metadata-taxonomy-field}/single-level-taxonomy-field.d.ts +0 -0
@@ -1,49 +1,58 @@
1
- import { TextInput as v } from "@box/blueprint-web";
2
- import { useFormikContext as g, getIn as x, Field as C } from "formik";
3
- import { useRef as T } from "react";
4
- import { fieldDefaultProps as V } from "../constants.js";
5
- import { useFloatValidation as $ } from "./use-float-validation.js";
6
- import { jsx as r } from "react/jsx-runtime";
7
- const D = ({
8
- label: o,
9
- fieldNamePrefix: l,
10
- disableForm: n,
11
- className: i
1
+ import { TextInput as x } from "@box/blueprint-web";
2
+ import { useFormikContext as T, getIn as g, Field as C } from "formik";
3
+ import { useRef as I } from "react";
4
+ import V from "../../../interactive-text/interactive-text.js";
5
+ import { fieldDefaultProps as $ } from "../constants.js";
6
+ import { useFloatValidation as B } from "./use-float-validation.js";
7
+ import { jsx as a } from "react/jsx-runtime";
8
+ const N = ({
9
+ className: i,
10
+ description: l,
11
+ label: r,
12
+ fieldNamePrefix: d,
13
+ disableForm: s
12
14
  }) => {
13
15
  const {
14
- values: d,
15
- setFieldValue: s,
16
- setFieldTouched: u
17
- } = g(), t = `${l}.value`, c = x(d, t), a = T(c), {
18
- validateFloats: m
19
- } = $(), f = (e) => {
20
- a.current = e, s(t, e);
21
- }, p = (e) => {
22
- u(e, !0);
16
+ values: u,
17
+ setFieldValue: m,
18
+ setFieldTouched: c
19
+ } = T(), t = `${d}.value`, f = g(u, t), n = I(f), {
20
+ validateFloats: p
21
+ } = B(), h = (e) => {
22
+ n.current = e, m(t, e);
23
+ }, F = (e) => {
24
+ c(e, !0);
23
25
  };
24
- return /* @__PURE__ */ r("div", {
25
- "data-testid": `${o}-field`,
26
- children: /* @__PURE__ */ r(C, {
26
+ return /* @__PURE__ */ a("div", {
27
+ "data-testid": `${r}-field`,
28
+ children: /* @__PURE__ */ a(C, {
27
29
  name: `${t}`,
28
- validate: () => m(a.current),
30
+ validate: () => p(n.current),
29
31
  children: ({
30
32
  field: e,
31
- meta: h
32
- }) => /* @__PURE__ */ r(v, {
33
- ...V,
33
+ meta: v
34
+ }) => /* @__PURE__ */ a(x, {
35
+ ...$,
34
36
  ...e,
35
37
  className: i,
36
- disabled: n,
37
- error: h.error,
38
- label: o,
39
- onBlur: () => p(t),
40
- onChange: (F) => f(F.currentTarget.value),
38
+ disabled: s,
39
+ error: v.error,
40
+ label: l ? ({
41
+ ...o
42
+ }) => V({
43
+ as: "label",
44
+ tooltipText: l,
45
+ children: r,
46
+ ...o
47
+ }) : r,
48
+ onBlur: () => F(t),
49
+ onChange: (o) => h(o.currentTarget.value),
41
50
  placeholder: "0"
42
51
  })
43
52
  })
44
53
  });
45
54
  };
46
55
  export {
47
- D as MetadataFloatField,
48
- D as default
56
+ N as MetadataFloatField,
57
+ N as default
49
58
  };
@@ -1,45 +1,54 @@
1
- import { TooltipProvider as v, Combobox as F } from "@box/blueprint-web";
2
- import { useFormikContext as g, getIn as C, Field as x } from "formik";
3
- import { useIntl as M } from "react-intl";
4
- import $ from "../../../../messages.js";
5
- import { fieldDefaultProps as b } from "../constants.js";
1
+ import { TooltipProvider as F, Combobox as g } from "@box/blueprint-web";
2
+ import { useFormikContext as x, getIn as C, Field as b } from "formik";
3
+ import { useIntl as I } from "react-intl";
4
+ import M from "../../../../messages.js";
5
+ import T from "../../../interactive-text/interactive-text.js";
6
+ import { fieldDefaultProps as $ } from "../constants.js";
6
7
  import { jsx as o } from "react/jsx-runtime";
7
- const k = ({
8
+ const O = ({
8
9
  className: s,
9
- disableForm: a,
10
- fieldNamePrefix: l,
11
- label: r,
12
- portalElement: n,
13
- options: m
10
+ description: a,
11
+ disableForm: m,
12
+ fieldNamePrefix: i,
13
+ label: l,
14
+ portalElement: u,
15
+ options: d
14
16
  }) => {
15
17
  const {
16
- setFieldValue: u,
17
- values: d
18
- } = g(), c = M(), i = `${l}.value`, p = m || C(d, `${l}.options`, []).map(({
18
+ setFieldValue: c,
19
+ values: p
20
+ } = x(), f = I(), n = `${i}.value`, h = d || C(p, `${i}.options`, []).map(({
19
21
  key: e
20
- }) => e), f = (e, t) => t.toLowerCase().includes(e.toLowerCase());
22
+ }) => e), v = (e, t) => t.toLowerCase().includes(e.toLowerCase());
21
23
  return /* @__PURE__ */ o("div", {
22
- "data-testid": `${r}-field`,
23
- children: /* @__PURE__ */ o(x, {
24
- name: i,
24
+ "data-testid": `${l}-field`,
25
+ children: /* @__PURE__ */ o(b, {
26
+ name: n,
25
27
  children: ({
26
28
  field: e
27
29
  }) => {
28
30
  var t;
29
- return /* @__PURE__ */ o(v, {
30
- children: /* @__PURE__ */ o(F, {
31
- ...b,
31
+ return /* @__PURE__ */ o(F, {
32
+ children: /* @__PURE__ */ o(g, {
33
+ ...$,
32
34
  as: "input",
33
35
  className: s,
34
- disabled: a,
35
- filterFn: f,
36
- label: r,
36
+ disabled: m,
37
+ filterFn: v,
38
+ label: a ? ({
39
+ ...r
40
+ }) => T({
41
+ as: "label",
42
+ tooltipText: a,
43
+ children: l,
44
+ ...r
45
+ }) : l,
37
46
  multiselect: !0,
38
47
  name: e.name,
39
- onValueChange: (h) => u(i, h),
40
- options: p,
41
- placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? c.formatMessage($.multiselectPlaceholder) : "",
42
- portalElement: n,
48
+ onValueChange: (r) => c(n, r),
49
+ options: h,
50
+ placeholder: ((t = e.value) == null ? void 0 : t.length) === 0 ? f.formatMessage(M.multiselectPlaceholder) : "",
51
+ portalElement: u,
43
52
  value: e.value
44
53
  })
45
54
  });
@@ -48,6 +57,6 @@ const k = ({
48
57
  });
49
58
  };
50
59
  export {
51
- k as MetadataMultiSelectField,
52
- k as default
60
+ O as MetadataMultiSelectField,
61
+ O as default
53
62
  };
@@ -1,37 +1,46 @@
1
- import { TextInput as s } from "@box/blueprint-web";
2
- import { Field as f } from "formik";
3
- import { useIntl as n } from "react-intl";
4
- import p from "../../../../messages.js";
5
- import { fieldDefaultProps as c } from "../constants.js";
6
- import { jsx as e } from "react/jsx-runtime";
7
- const u = ({
8
- label: r,
9
- fieldNamePrefix: t,
10
- disableForm: a,
11
- className: o
1
+ import { TextInput as n } from "@box/blueprint-web";
2
+ import { Field as p } from "formik";
3
+ import { useIntl as c } from "react-intl";
4
+ import u from "../../../../messages.js";
5
+ import h from "../../../interactive-text/interactive-text.js";
6
+ import { fieldDefaultProps as x } from "../constants.js";
7
+ import { jsx as t } from "react/jsx-runtime";
8
+ const g = ({
9
+ description: r,
10
+ label: e,
11
+ fieldNamePrefix: a,
12
+ disableForm: o,
13
+ className: i
12
14
  }) => {
13
- const i = n(), d = `${t}.value`;
14
- return /* @__PURE__ */ e("div", {
15
- "data-testid": `${r}-field`,
16
- children: /* @__PURE__ */ e(f, {
15
+ const l = c(), d = `${a}.value`;
16
+ return /* @__PURE__ */ t("div", {
17
+ "data-testid": `${e}-field`,
18
+ children: /* @__PURE__ */ t(p, {
17
19
  name: d,
18
20
  children: ({
19
- field: l,
20
- meta: m
21
- }) => /* @__PURE__ */ e(s, {
22
- ...c,
23
- ...l,
24
- className: o,
25
- disabled: a,
26
- error: m.error,
27
- label: r,
28
- placeholder: i.formatMessage(p.setValuePlaceholder)
21
+ field: m,
22
+ meta: s
23
+ }) => /* @__PURE__ */ t(n, {
24
+ ...x,
25
+ ...m,
26
+ className: i,
27
+ disabled: o,
28
+ error: s.error,
29
+ label: r ? ({
30
+ ...f
31
+ }) => h({
32
+ as: "label",
33
+ tooltipText: r,
34
+ children: e,
35
+ ...f
36
+ }) : e,
37
+ placeholder: l.formatMessage(u.setValuePlaceholder)
29
38
  })
30
39
  })
31
40
  });
32
41
  };
33
- u.displayName = "MetadataStringField";
42
+ g.displayName = "MetadataStringField";
34
43
  export {
35
- u as MetadataStringField,
36
- u as default
44
+ g as MetadataStringField,
45
+ g as default
37
46
  };
@@ -0,0 +1,8 @@
1
+ import { ComboboxWithApiPagination as i } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ const m = (o) => /* @__PURE__ */ r(i, {
4
+ ...o
5
+ });
6
+ export {
7
+ m as SingleLevelTaxonomyField
8
+ };
@@ -18,13 +18,13 @@ const $ = "_wrapperContianer_1n09p_1", B = "_fieldContainer_1n09p_6", U = "_fiel
18
18
  hidden: V
19
19
  }, j = (e) => e === i.ReplaceEntered, y = (e) => e === "string" || e === "multiSelect", O = ({
20
20
  children: e,
21
- fieldNamePrefix: r,
21
+ fieldNamePrefix: d,
22
22
  fieldType: f
23
23
  }) => {
24
24
  const {
25
25
  setFieldValue: g,
26
26
  values: m
27
- } = E(), [p, M] = N(!0), t = S(), u = `${r}.updateMode.mode`, h = C(m, u), d = e && _.Children.only(e), v = C(m, `${r}.options`, []).map(({
27
+ } = E(), [p, M] = N(!0), t = S(), u = `${d}.updateMode.mode`, h = C(m, u), r = e && _.Children.only(e), v = C(m, `${d}.options`, []).map(({
28
28
  key: c
29
29
  }) => c);
30
30
  return /* @__PURE__ */ s("div", {
@@ -37,7 +37,7 @@ const $ = "_wrapperContianer_1n09p_1", B = "_fieldContainer_1n09p_6", U = "_fiel
37
37
  }), /* @__PURE__ */ o(b, {
38
38
  "aria-label": t.formatMessage(n.toggleUpdateModeSelectiorAriaLabel),
39
39
  className: a.collapseButton,
40
- "data-testid": `${d.props.label}-update-mode-toggle`,
40
+ "data-testid": `${r.props.label}-update-mode-toggle`,
41
41
  icon: p ? I : R,
42
42
  onClick: () => {
43
43
  M(!p);
@@ -49,11 +49,11 @@ const $ = "_wrapperContianer_1n09p_1", B = "_fieldContainer_1n09p_6", U = "_fiel
49
49
  [a.hidden]: p
50
50
  }),
51
51
  children: [/* @__PURE__ */ o(A, {
52
- name: `${r}.updateMode.mode`,
52
+ name: `${d}.updateMode.mode`,
53
53
  children: ({
54
54
  field: c
55
55
  }) => /* @__PURE__ */ s(l.Group, {
56
- "data-testid": `${d.props.label}-radio-group`,
56
+ "data-testid": `${r.props.label}-radio-group`,
57
57
  loop: !0,
58
58
  onValueChange: (F) => g(u, F),
59
59
  orientation: "vertical",
@@ -72,11 +72,11 @@ const $ = "_wrapperContianer_1n09p_1", B = "_fieldContainer_1n09p_6", U = "_fiel
72
72
  value: i.ReplaceEntered
73
73
  })]
74
74
  })
75
- }), j(h) && d && /* @__PURE__ */ o("div", {
75
+ }), j(h) && r && /* @__PURE__ */ o("div", {
76
76
  className: a.additionalFieldContainer,
77
- children: /* @__PURE__ */ _.cloneElement(d, {
77
+ children: /* @__PURE__ */ _.cloneElement(r, {
78
78
  // This field edits ${fieldNamePrefix}.updateMode.value, the '.value' is added by the field component
79
- fieldNamePrefix: `${r}.updateMode`,
79
+ fieldNamePrefix: `${d}.updateMode`,
80
80
  options: v,
81
81
  label: t.formatMessage(n.with)
82
82
  })
@@ -1,17 +1,16 @@
1
1
  import "../../../../../../styles/metadata-instance-entry.css";
2
2
  import { Text as o } from "@box/blueprint-web";
3
- import { FormattedDate as d } from "react-intl";
4
- import { convertISOStringToUTCDate as l } from "./convertDate.js";
5
- import y from "../../../interactive-text/interactive-text.js";
6
- import { jsxs as f, jsx as a } from "react/jsx-runtime";
7
- const I = "_metadataInstanceEntry_1qhk8_1", p = "_metadataInstanceEntryInteractiveLabel_1qhk8_7", c = {
8
- metadataInstanceEntry: I,
9
- metadataInstanceEntryInteractiveLabel: p
10
- }, _ = ({
11
- description: r,
3
+ import { FormattedDate as s } from "react-intl";
4
+ import { convertISOStringToUTCDate as d } from "./convertDate.js";
5
+ import f from "../../../interactive-text/interactive-text.js";
6
+ import { jsxs as y, jsx as r } from "react/jsx-runtime";
7
+ const l = "_metadataInstanceEntry_gwoh6_1", p = {
8
+ metadataInstanceEntry: l
9
+ }, S = ({
10
+ description: a,
12
11
  name: e,
13
12
  shouldHideEmptyValues: i,
14
- type: s,
13
+ type: c,
15
14
  value: t
16
15
  }) => {
17
16
  const n = (() => {
@@ -21,9 +20,9 @@ const I = "_metadataInstanceEntry_1qhk8_1", p = "_metadataInstanceEntryInteracti
21
20
  return null;
22
21
  if (Array.isArray(t))
23
22
  return t.join(", ");
24
- if (s === "date" && typeof t == "string") {
25
- const m = l(t);
26
- return /* @__PURE__ */ a(d, {
23
+ if (c === "date" && typeof t == "string") {
24
+ const m = d(t);
25
+ return /* @__PURE__ */ r(s, {
27
26
  day: "numeric",
28
27
  month: "long",
29
28
  value: m,
@@ -32,26 +31,25 @@ const I = "_metadataInstanceEntry_1qhk8_1", p = "_metadataInstanceEntryInteracti
32
31
  }
33
32
  return t;
34
33
  })();
35
- return i && !n ? null : /* @__PURE__ */ f("div", {
36
- className: c.metadataInstanceEntry,
37
- children: [/* @__PURE__ */ a(o, {
34
+ return i && !n ? null : /* @__PURE__ */ y("div", {
35
+ className: p.metadataInstanceEntry,
36
+ children: [/* @__PURE__ */ r(o, {
38
37
  as: "p",
39
38
  color: "textOnLightSecondary",
40
39
  variant: "bodyDefaultBold",
41
- children: r ? /* @__PURE__ */ a(y, {
40
+ children: a ? /* @__PURE__ */ r(f, {
42
41
  as: "span",
43
- className: c.metadataInstanceEntryInteractiveLabel,
44
42
  color: "textOnLightSecondary",
45
- tooltipText: r,
43
+ tooltipText: a,
46
44
  variant: "bodyDefaultBold",
47
45
  children: e
48
46
  }) : e
49
- }), n && /* @__PURE__ */ a(o, {
47
+ }), n && /* @__PURE__ */ r(o, {
50
48
  as: "p",
51
49
  children: n
52
50
  })]
53
51
  });
54
52
  };
55
53
  export {
56
- _ as MetadataInstanceEntry
54
+ S as MetadataInstanceEntry
57
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.51.1",
3
+ "version": "0.52.0",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.5",
6
6
  "@box/blueprint-web": "^7.20.0",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@ariakit/react": "0.4.5",
16
- "@box/blueprint-web": "^7.25.4",
16
+ "@box/blueprint-web": "^7.26.0",
17
17
  "@box/blueprint-web-assets": "^4.23.0",
18
18
  "@box/storybook-utils": "^0.6.1",
19
19
  "@testing-library/react": "^15.0.6",
@@ -52,5 +52,5 @@
52
52
  "**/*.css"
53
53
  ],
54
54
  "license": "SEE LICENSE IN LICENSE",
55
- "gitHead": "114a9fc84dfc0b21d45b6b647064e736ea022384"
55
+ "gitHead": "e065ce29641de99f4dd47486a9f6928da2cfaa74"
56
56
  }
@@ -0,0 +1 @@
1
+ ._interactiveText_2jv0p_1{text-decoration:dashed underline var(--gray-50) .5px!important;text-underline-offset:2px;width:fit-content}._interactiveText_2jv0p_1:hover{color:var(--gray-100);text-decoration-color:var(--gray-100)!important}
@@ -1 +1 @@
1
- ._metadataInstanceEntry_1qhk8_1{display:flex;flex-direction:column;gap:var(--space-2)}._metadataInstanceEntryInteractiveLabel_1qhk8_7{text-decoration:dashed underline var(--gray-50) .5px!important;text-underline-offset:2px}._metadataInstanceEntryInteractiveLabel_1qhk8_7:hover{color:var(--gray-100);text-decoration-color:var(--gray-100)!important}
1
+ ._metadataInstanceEntry_gwoh6_1{display:flex;flex-direction:column;gap:var(--space-2)}
package/types/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export * from './lib/components/add-metadata-template-dropdown';
2
2
  export * from './lib/components/filter-dropdown-menu';
3
+ export * from './lib/components/metadata-editor-fields/components/metadata-taxonomy-field';
3
4
  export * from './lib/components/metadata-empty-state/metadata-empty-state';
4
5
  export * from './lib/components/metadata-instance-editor';
5
6
  export * from './lib/components/metadata-instance-list';
6
- export * from './lib/components/metadata-taxonomy-field';
7
7
  export * from './lib/components/unsaved-changes-modal';
8
8
  export * from './lib/defaults';
9
9
  export * from './lib/metadata-editor';
@@ -0,0 +1,2 @@
1
+ import { type BaseOptionType, type ComboboxWithApiPaginationProps } from './types';
2
+ export declare const ComboboxWithApiPagination: <TComboboxOption extends BaseOptionType>(props: ComboboxWithApiPaginationProps<TComboboxOption>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ComboboxWithApiPagination } from './combobox-with-api-pagination';
2
+ export type { ComboboxWithApiPaginationProps } from './types';
@@ -0,0 +1,35 @@
1
+ import { type ReactElement } from 'react';
2
+ export interface PaginationQueryInput {
3
+ marker?: string;
4
+ searchInput?: string;
5
+ /**
6
+ * Abort signal that will be used to cancel the request in your fetching function
7
+ */
8
+ signal?: AbortSignal;
9
+ }
10
+ export interface FetcherResponse<T> {
11
+ marker?: string;
12
+ options: T[];
13
+ }
14
+ export interface BaseOptionType {
15
+ id?: string;
16
+ value: string;
17
+ }
18
+ interface BaseComboboxProps<T extends BaseOptionType, M extends boolean> {
19
+ defaultFetcher(input: PaginationQueryInput): Promise<FetcherResponse<T>>;
20
+ includeTextInputOption?: boolean;
21
+ noResultMessage?: ReactElement | string;
22
+ onInputValueChange?: (inputValue: string) => void;
23
+ multiselect: M;
24
+ onValueChange?: (selectedOptions: M extends true ? T[] : T) => void;
25
+ value?: M extends true ? T[] : T;
26
+ defaultValue?: M extends true ? T[] : T;
27
+ label: string;
28
+ loadingAriaLabel?: string;
29
+ portalElement?: HTMLElement | (() => HTMLElement);
30
+ experimentalVirtualization?: boolean;
31
+ }
32
+ export type SingleSelectComboboxWithApiPaginationProps<T extends BaseOptionType> = BaseComboboxProps<T, false>;
33
+ export type MultiselectComboboxWithApiPaginationProps<T extends BaseOptionType> = BaseComboboxProps<T, true>;
34
+ export type ComboboxWithApiPaginationProps<T extends BaseOptionType> = SingleSelectComboboxWithApiPaginationProps<T> | MultiselectComboboxWithApiPaginationProps<T>;
35
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ interface UseControllableStateParams<T> {
3
+ prop?: T | undefined;
4
+ defaultProp?: T | undefined;
5
+ onChange?: (state: T) => void;
6
+ }
7
+ declare function useControllableState<T>({ prop, defaultProp, onChange }: UseControllableStateParams<T>): readonly [T, React.Dispatch<React.SetStateAction<T>>];
8
+ export { useControllableState };
@@ -1,9 +1,10 @@
1
1
  import { type TextProps } from '@box/blueprint-web';
2
2
  export type InteractiveTextProps = TextProps & {
3
+ className?: string;
3
4
  tooltipText: string;
4
5
  };
5
6
  /**
6
7
  * Wrapper component for displaying tooltip content on focusing text nodes
7
8
  */
8
- declare const InteractiveText: ({ tooltipText, children, ...props }: InteractiveTextProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const InteractiveText: ({ tooltipText, className, children, ...props }: InteractiveTextProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export default InteractiveText;
@@ -1,3 +1,3 @@
1
1
  import { type MetadataFieldProps } from '../../types';
2
- export declare const MetadataDateField: ({ disableForm, fieldNamePrefix, label, portalElement, className, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataDateField: ({ description, disableForm, fieldNamePrefix, label, portalElement, className, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataDateField;
@@ -1,3 +1,3 @@
1
1
  import { type MetadataFieldProps } from '../../types';
2
- export declare const MetadataEnumField: ({ className, disableForm, fieldNamePrefix, label, options, portalElement, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataEnumField: ({ className, description, disableForm, fieldNamePrefix, label, options, portalElement, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataEnumField;
@@ -1,3 +1,3 @@
1
1
  import { type MetadataFieldProps } from '../../types';
2
- export declare const MetadataFloatField: ({ label, fieldNamePrefix, disableForm, className }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataFloatField: ({ className, description, label, fieldNamePrefix, disableForm, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataFloatField;
@@ -1,3 +1,3 @@
1
1
  import { type MetadataFieldProps } from '../../types';
2
- export declare const MetadataMultiSelectField: ({ className, disableForm, fieldNamePrefix, label, portalElement, options, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataMultiSelectField: ({ className, description, disableForm, fieldNamePrefix, label, portalElement, options, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataMultiSelectField;
@@ -1,6 +1,6 @@
1
1
  import { type MetadataFieldProps } from '../../types';
2
2
  export declare const MetadataStringField: {
3
- ({ label, fieldNamePrefix, disableForm, className }: MetadataFieldProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ description, label, fieldNamePrefix, disableForm, className, }: MetadataFieldProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default MetadataStringField;
@@ -0,0 +1,21 @@
1
+ import { type ComboboxWithApiPaginationProps } from '../../../combobox-with-api-pagination';
2
+ export interface PaginationQueryInput {
3
+ marker?: string;
4
+ searchInput?: string;
5
+ /**
6
+ * Abort signal that will be used to cancel the request in your fetching function
7
+ */
8
+ signal?: AbortSignal;
9
+ }
10
+ export interface TaxonomyFetcherResponse {
11
+ marker?: string;
12
+ options: TaxonomyComboboxOption[];
13
+ }
14
+ export interface TaxonomyComboboxOption {
15
+ id?: string;
16
+ value: string;
17
+ level?: number;
18
+ parentId?: string;
19
+ disabled?: boolean;
20
+ }
21
+ export type SingleLevelTaxonomyFieldProps = ComboboxWithApiPaginationProps<TaxonomyComboboxOption>;
@@ -4,6 +4,7 @@ export type TemplateInstanceProps = {
4
4
  portalElement?: HTMLElement;
5
5
  };
6
6
  export type MetadataFieldProps = {
7
+ description?: string | null;
7
8
  label: string;
8
9
  fieldNamePrefix: string;
9
10
  disableForm: boolean;
@@ -1,4 +1,4 @@
1
- import { type MetadataTemplate, type MetadataTemplateField, type MetadataTemplateInstance, type MetadataTemplateOption, type AutofillSuggestions } from '../types';
1
+ import { type AutofillSuggestions, type MetadataTemplate, type MetadataTemplateField, type MetadataTemplateInstance, type MetadataTemplateOption } from '../types';
2
2
  declare const stringField: MetadataTemplateField;
3
3
  declare const dateField: MetadataTemplateField;
4
4
  declare const enumField: MetadataTemplateField;