@box/metadata-editor 0.66.3 → 0.67.1

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 (23) hide show
  1. package/chunks/metadata-editor-field-wrapper.js +65 -60
  2. package/esm/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.js +70 -69
  3. package/esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js +26 -26
  4. package/esm/lib/components/metadata-editor-fields/components/metadata-date-field/metadata-date-field.js +42 -41
  5. package/esm/lib/components/metadata-editor-fields/components/metadata-enum-field/metadata-enum-field.js +24 -23
  6. package/esm/lib/components/metadata-editor-fields/components/metadata-float-field/metadata-float-field.js +31 -30
  7. package/esm/lib/components/metadata-editor-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +27 -24
  8. package/esm/lib/components/metadata-editor-fields/components/metadata-string-field/metadata-string-field.js +26 -24
  9. package/esm/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.js +25 -23
  10. package/esm/lib/components/metadata-instance-editor/subcomponents/metadata-instance-form-header/metadata-instance-form-header.js +74 -44
  11. package/esm/lib/components/metadata-instance-list/subcomponents/metadata-instance-header/metadata-instance-header.js +61 -42
  12. package/esm/lib/utils/autofill-context.js +39 -51
  13. package/package.json +3 -3
  14. package/styles/ai-suggestion-field.css +1 -1
  15. package/styles/metadata-editor-field-wrapper.css +1 -1
  16. package/styles/metadata-instance-form-header.css +1 -1
  17. package/styles/metadata-instance-header.css +1 -1
  18. package/types/lib/components/combobox-with-api-pagination/combobox-with-api-pagination.d.ts +1 -0
  19. package/types/lib/components/combobox-with-api-pagination/types.d.ts +2 -1
  20. package/types/lib/components/metadata-editor-fields/types.d.ts +1 -0
  21. package/esm/lib/components/truncated-header-text/truncated-header-text.js +0 -38
  22. package/styles/truncated-header-text.css +0 -1
  23. package/types/lib/components/truncated-header-text/truncated-header-text.d.ts +0 -7
@@ -1,80 +1,85 @@
1
1
  import "../styles/metadata-editor-field-wrapper.css";
2
- import A from "clsx";
3
- import { useFormikContext as M } from "formik";
4
- import W from "lodash/isUndefined";
5
- import { forwardRef as T, useState as q } from "react";
6
- import { AiSuggestionField as N } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js";
7
- import { UpdateModeFieldWrapper as b } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js";
8
- import { editorFieldTypes as v } from "../esm/lib/components/metadata-editor-fields/editor-field-types.js";
9
- import { jsx as s, jsxs as k } from "react/jsx-runtime";
10
- const w = "_noAttributesText_1xlmq_1", P = "_fieldWrapper_1xlmq_5", U = "_hasSuggestion_1xlmq_5", $ = "_error_1xlmq_13", j = "_dateField_1xlmq_25", n = {
11
- noAttributesText: w,
12
- fieldWrapper: P,
2
+ import N from "clsx";
3
+ import { useFormikContext as T } from "formik";
4
+ import C from "lodash/isUndefined";
5
+ import { forwardRef as v, useState as h } from "react";
6
+ import { AiSuggestionField as I } from "../esm/lib/components/metadata-editor-fields/components/ai-suggestion-field/ai-suggestion-field.js";
7
+ import { UpdateModeFieldWrapper as V } from "../esm/lib/components/metadata-editor-fields/components/update-mode-field-wrapper/update-mode-field-wrapper.js";
8
+ import { editorFieldTypes as w } from "../esm/lib/components/metadata-editor-fields/editor-field-types.js";
9
+ import { jsx as s, jsxs as E } from "react/jsx-runtime";
10
+ const P = "_noAttributesText_1kfhf_738", R = "_fieldWrapper_1kfhf_742", U = "_hasSuggestion_1kfhf_747", $ = "_error_1kfhf_755", j = "_dateField_1kfhf_767", q = "_suggestionApplied_1kfhf_771", z = "_comboboxContainer_1kfhf_771", i = {
11
+ noAttributesText: P,
12
+ fieldWrapper: R,
13
13
  hasSuggestion: U,
14
14
  error: $,
15
- dateField: j
16
- }, H = /* @__PURE__ */ T(({
17
- disableForm: a,
18
- portalElement: p,
15
+ dateField: j,
16
+ suggestionApplied: q,
17
+ comboboxContainer: z
18
+ }, Y = /* @__PURE__ */ v(({
19
+ disableForm: p,
20
+ portalElement: d,
19
21
  field: e,
20
- index: g,
22
+ index: A,
21
23
  taxonomyOptionsFetcher: l
22
- }, d) => {
23
- var c;
24
+ }, u) => {
25
+ var S;
24
26
  const {
25
- setFieldValue: u
26
- } = M(), [S, i] = q(!0), r = v[e.type], x = r && !e.hidden, _ = !W(e.updateMode), t = `metadata.fields[${g}]`, y = e.type === "taxonomy" && ((c = e.optionsRules) == null ? void 0 : c.multiSelect);
27
- if (!x)
28
- return null;
29
- if (_)
30
- return /* @__PURE__ */ s(b, {
31
- fieldNamePrefix: t,
32
- fieldType: e.type,
33
- isTaxonomyMultiSelect: y,
34
- children: /* @__PURE__ */ s(r, {
35
- ref: d,
36
- description: e.description,
37
- disableForm: a,
38
- fieldNamePrefix: t,
39
- label: e.displayName,
40
- portalElement: p,
41
- taxonomyOptionsFetcher: l
42
- })
43
- }, e.key);
44
- const {
45
- aiSuggestion: o,
27
+ setFieldValue: g
28
+ } = T(), [x, n] = h(!0), [c, r] = h(!1), a = w[e.type], {
29
+ aiSuggestion: t,
46
30
  type: f,
47
- value: F
48
- } = e, m = o && S;
49
- return /* @__PURE__ */ k("div", {
50
- className: n.fieldWrapper,
51
- children: [/* @__PURE__ */ s(r, {
52
- ref: d,
53
- className: A({
54
- [n.hasSuggestions]: m,
55
- [n.dateField]: e.type === "date"
56
- }),
31
+ value: y
32
+ } = e, b = a && !e.hidden, k = !C(e.updateMode), o = `metadata.fields[${A}]`, F = e.type === "taxonomy" && ((S = e.optionsRules) == null ? void 0 : S.multiSelect), m = t && x, W = N({
33
+ [i.suggestionApplied]: c,
34
+ [i.hasSuggestion]: m,
35
+ [i.dateField]: f === "date"
36
+ });
37
+ if (!b)
38
+ return null;
39
+ const _ = () => {
40
+ c && r(!1);
41
+ };
42
+ return k ? /* @__PURE__ */ s(V, {
43
+ fieldNamePrefix: o,
44
+ fieldType: e.type,
45
+ isTaxonomyMultiSelect: F,
46
+ children: /* @__PURE__ */ s(a, {
47
+ ref: u,
48
+ description: e.description,
49
+ disableForm: p,
50
+ fieldNamePrefix: o,
51
+ label: e.displayName,
52
+ onValueEdited: _,
53
+ portalElement: d,
54
+ taxonomyOptionsFetcher: l
55
+ })
56
+ }, e.key) : /* @__PURE__ */ E("div", {
57
+ className: i.fieldWrapper,
58
+ children: [/* @__PURE__ */ s(a, {
59
+ ref: u,
60
+ className: W,
57
61
  description: e.description,
58
- disableForm: a,
59
- fieldNamePrefix: t,
62
+ disableForm: p,
63
+ fieldNamePrefix: o,
60
64
  label: e.displayName,
61
- portalElement: p,
65
+ onValueEdited: _,
66
+ portalElement: d,
62
67
  taxonomyOptionsFetcher: l
63
- }), m && /* @__PURE__ */ s(N, {
64
- aiSuggestion: o,
68
+ }), m && /* @__PURE__ */ s(I, {
69
+ aiSuggestion: t,
65
70
  onAiSuggestionAppend: () => {
66
- const h = e.type === "multiSelect" ? [F, o].flat() : o;
67
- u(`${t}.value`, h), i(!1);
71
+ const M = e.type === "multiSelect" ? [y, t].flat() : t;
72
+ g(`${o}.value`, M), n(!1), r(!0);
68
73
  },
69
- onAiSuggestionIgnore: () => i(!1),
74
+ onAiSuggestionIgnore: () => n(!1),
70
75
  onAiSuggestionReplace: () => {
71
- u(`${t}.value`, o), i(!1);
76
+ g(`${o}.value`, t), n(!1), r(!0);
72
77
  },
73
78
  type: f
74
79
  })]
75
80
  }, e.key);
76
81
  });
77
82
  export {
78
- H as M,
79
- n as s
83
+ Y as M,
84
+ i as s
80
85
  };
@@ -1,49 +1,49 @@
1
1
  import "../../../../styles/combobox-with-api-pagination.css";
2
- import { ComboboxItemValue as $ } from "@ariakit/react";
3
- import { Combobox as m, LoadingIndicator as oo, InlineNotice as eo, Text as to } from "@box/blueprint-web";
4
- import { useForkRef as ro } from "@box/blueprint-web/lib-esm/utils/useForkRef";
5
- import { Search as no, Loader as io } from "@box/blueprint-web-assets/icons/Fill";
6
- import { IconIconOnLightSecondary as ao, Size6 as M, Size1 as so } from "@box/blueprint-web-assets/tokens/tokens";
7
- import lo from "clsx";
8
- import { forwardRef as S, useRef as C, useCallback as co, useMemo as L, useEffect as uo } from "react";
2
+ import { ComboboxItemValue as oo } from "@ariakit/react";
3
+ import { Combobox as m, LoadingIndicator as eo, InlineNotice as to, Text as ro } from "@box/blueprint-web";
4
+ import { Search as no, Loader as ao } from "@box/blueprint-web-assets/icons/Fill";
5
+ import { IconIconOnLightSecondary as io, Size6 as M, Size1 as so } from "@box/blueprint-web-assets/tokens/tokens";
6
+ import { useForkRef as lo } from "@box/blueprint-web/lib-esm/utils/useForkRef";
7
+ import co from "clsx";
8
+ import { forwardRef as S, useRef as C, useCallback as uo, useMemo as L, useEffect as mo } from "react";
9
9
  import { useIntl as F, FormattedMessage as T } from "react-intl";
10
- import i from "./messages.js";
11
- import { useAsyncList as mo } from "./use-async-list.js";
12
- import { useControllableState as po } from "./utils/use-controllable-state.js";
13
- import { useTrackVisibility as ho } from "./utils/use-intersection-observer.js";
14
- import { jsx as r, jsxs as V, Fragment as fo } from "react/jsx-runtime";
15
- const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptionText_181ao_11", Oo = "_option_181ao_24", _o = "_errorComboboxOption_181ao_28", Ro = "_errorComboboxOptionText_181ao_33", c = {
16
- container: bo,
17
- disabled: go,
18
- highlightOptionText: xo,
19
- option: Oo,
20
- errorComboboxOption: _o,
21
- errorComboboxOptionText: Ro
10
+ import a from "./messages.js";
11
+ import { useAsyncList as po } from "./use-async-list.js";
12
+ import { useControllableState as ho } from "./utils/use-controllable-state.js";
13
+ import { useTrackVisibility as fo } from "./utils/use-intersection-observer.js";
14
+ import { jsx as r, jsxs as V, Fragment as bo } from "react/jsx-runtime";
15
+ const go = "_container_181ao_1", xo = "_disabled_181ao_7", Oo = "_highlightOptionText_181ao_11", _o = "_option_181ao_24", Ro = "_errorComboboxOption_181ao_28", Co = "_errorComboboxOptionText_181ao_33", c = {
16
+ container: go,
17
+ disabled: xo,
18
+ highlightOptionText: Oo,
19
+ option: _o,
20
+ errorComboboxOption: Ro,
21
+ errorComboboxOptionText: Co
22
22
  }, N = /* @__PURE__ */ S(({
23
23
  onTryAgain: y
24
24
  }, p) => {
25
25
  const {
26
26
  formatMessage: h
27
27
  } = F();
28
- return /* @__PURE__ */ V(fo, {
29
- children: [/* @__PURE__ */ r(eo, {
28
+ return /* @__PURE__ */ V(bo, {
29
+ children: [/* @__PURE__ */ r(to, {
30
30
  variant: "error",
31
- variantIconAriaLabel: h(i.loadingResultsErrorIconLabel),
31
+ variantIconAriaLabel: h(a.loadingResultsErrorIconLabel),
32
32
  children: /* @__PURE__ */ r(T, {
33
- ...i.loadingResultsErrorMessage
33
+ ...a.loadingResultsErrorMessage
34
34
  })
35
35
  }), /* @__PURE__ */ r(m.Option, {
36
36
  ref: p,
37
37
  className: c.errorComboboxOption,
38
38
  onClick: y,
39
- children: /* @__PURE__ */ V(to, {
39
+ children: /* @__PURE__ */ V(ro, {
40
40
  as: "span",
41
41
  className: c.errorComboboxOptionText,
42
42
  color: "textOnLightLink",
43
43
  variant: "bodyDefaultBold",
44
44
  children: [/* @__PURE__ */ r(T, {
45
- ...i.loadingResultsErrorAction
46
- }), /* @__PURE__ */ r(io, {
45
+ ...a.loadingResultsErrorAction
46
+ }), /* @__PURE__ */ r(ao, {
47
47
  color: "currentColor",
48
48
  height: "12px",
49
49
  width: "12px"
@@ -51,8 +51,8 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
51
51
  })
52
52
  })]
53
53
  });
54
- }), A = "__LOADING__", E = "__LOADING_ERROR__", Co = "0px 0px 20px 0px", Lo = /* @__PURE__ */ r(no, {
55
- color: ao,
54
+ }), A = "__LOADING__", E = "__LOADING_ERROR__", Lo = "0px 0px 20px 0px", Ao = /* @__PURE__ */ r(no, {
55
+ color: io,
56
56
  height: M,
57
57
  role: "presentation",
58
58
  style: {
@@ -60,7 +60,7 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
60
60
  boxSizing: "border-box"
61
61
  },
62
62
  width: M
63
- }), wo = /* @__PURE__ */ S(function(p, h) {
63
+ }), Bo = /* @__PURE__ */ S(function(p, h) {
64
64
  const {
65
65
  defaultFetcher: P,
66
66
  onInputValueChange: f,
@@ -71,10 +71,11 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
71
71
  loadingAriaLabel: W,
72
72
  multiselect: s = !1,
73
73
  disabled: z,
74
- ...G
74
+ className: G,
75
+ ...j
75
76
  } = p, {
76
77
  formatMessage: u
77
- } = F(), b = C(null), g = C(!0), o = mo({
78
+ } = F(), b = C(null), g = C(!0), o = po({
78
79
  async load({
79
80
  marker: e,
80
81
  searchInput: t,
@@ -90,15 +91,15 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
90
91
  marker: l.marker
91
92
  };
92
93
  }
93
- }), v = C(!1), j = co(() => {
94
+ }), v = C(!1), U = uo(() => {
94
95
  v.current || (o.reload(), v.current = !0);
95
- }, []), [n, x] = po({
96
+ }, []), [n, x] = ho({
96
97
  prop: k,
97
98
  defaultProp: B,
98
99
  onChange: D
99
- }), O = !s && n.length === 1, U = (e) => {
100
+ }), O = !s && n.length === 1, q = (e) => {
100
101
  e === void 0 ? (x([]), g.current || (o.search(""), g.current = !0)) : Array.isArray(e) ? x(e) : x([e]);
101
- }, q = L(() => n.length === 0 ? s ? [] : void 0 : s ? n : n[0], [s, n]), _ = L(() => n.filter((e) => !o.items.some((t) => t.value === e.value)), [n, o.items]), H = (e) => {
102
+ }, H = L(() => n.length === 0 ? s ? [] : void 0 : s ? n : n[0], [s, n]), _ = L(() => n.filter((e) => !o.items.some((t) => t.value === e.value)), [n, o.items]), J = (e) => {
102
103
  const {
103
104
  value: t,
104
105
  displayValue: R,
@@ -107,11 +108,11 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
107
108
  if (t === A)
108
109
  return o.hasNextPage ? /* @__PURE__ */ r(m.Option, {
109
110
  ...l,
110
- ref: Q,
111
+ ref: X,
111
112
  disabled: !0,
112
113
  value: t,
113
- children: /* @__PURE__ */ r(oo, {
114
- "aria-label": u(i.loadingMoreAriaLabel),
114
+ children: /* @__PURE__ */ r(eo, {
115
+ "aria-label": u(a.loadingMoreAriaLabel),
115
116
  style: {
116
117
  position: "unset"
117
118
  }
@@ -120,44 +121,44 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
120
121
  if (t === E && o.hasError && !o.isEmpty)
121
122
  return /* @__PURE__ */ r(N, {
122
123
  onTryAgain: () => {
123
- var a;
124
- o.loadMore(), (a = b.current) == null || a.focus();
124
+ var i;
125
+ o.loadMore(), (i = b.current) == null || i.focus();
125
126
  }
126
127
  });
127
- if (_.some((a) => a.value === t))
128
+ if (_.some((i) => i.value === t))
128
129
  return null;
129
- const Z = () => n.some((a) => a.value === t);
130
+ const $ = () => n.some((i) => i.value === t);
130
131
  return /* @__PURE__ */ r(m.Option, {
131
132
  ...l,
132
133
  className: c.option,
133
- disabled: Z(),
134
+ disabled: $(),
134
135
  value: t,
135
- children: /* @__PURE__ */ r($, {
136
+ children: /* @__PURE__ */ r(oo, {
136
137
  className: c.highlightOptionText,
137
138
  value: R || t
138
139
  })
139
140
  });
140
- }, J = (e) => {
141
+ }, K = (e) => {
141
142
  if (f == null || f(e), O && e === "") {
142
143
  g.current = !1;
143
144
  return;
144
145
  }
145
146
  o.search(e);
146
- }, K = () => {
147
+ }, Q = () => {
147
148
  var e;
148
149
  o.reload(), (e = b.current) == null || e.focus();
149
150
  };
150
151
  let d;
151
152
  o.hasError && !o.isLoading ? d = /* @__PURE__ */ r(N, {
152
- onTryAgain: K
153
- }) : o.isEmpty && !o.isLoading ? d = w || u(i.noResults) : d = void 0;
154
- const [Q, {
155
- rootRef: X,
153
+ onTryAgain: Q
154
+ }) : o.isEmpty && !o.isLoading ? d = w || u(a.noResults) : d = void 0;
155
+ const [X, {
156
+ rootRef: Y,
156
157
  isVisible: I
157
- }] = ho({
158
- rootMargin: Co
158
+ }] = fo({
159
+ rootMargin: Lo
159
160
  });
160
- uo(() => {
161
+ mo(() => {
161
162
  if (!(I && o.hasNextPage))
162
163
  return;
163
164
  const t = setTimeout(() => {
@@ -167,7 +168,7 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
167
168
  clearTimeout(t);
168
169
  };
169
170
  }, [I]);
170
- const Y = L(() => {
171
+ const Z = L(() => {
171
172
  const e = o.hasNextPage ? {
172
173
  displayValue: A,
173
174
  value: A
@@ -179,29 +180,29 @@ const bo = "_container_181ao_1", go = "_disabled_181ao_7", xo = "_highlightOptio
179
180
  }, [o.hasNextPage, o.hasError, o.isEmpty, o.items, _]);
180
181
  return /* @__PURE__ */ r(m, {
181
182
  as: "input",
182
- ...G,
183
- ref: ro(b, h),
184
- className: lo({
183
+ ...j,
184
+ ref: lo(b, h),
185
+ className: co({
185
186
  [c.disabled]: O
186
- }),
187
- clearButtonAriaLabel: u(i.clearButtonAriaLabel),
187
+ }, G),
188
+ clearButtonAriaLabel: u(a.clearButtonAriaLabel),
188
189
  disabled: z || O,
189
190
  displayValue: (e) => e.displayValue || e.value,
190
- endComboboxIcon: Lo,
191
+ endComboboxIcon: Ao,
191
192
  focusLoop: !1,
192
- getPopoverRef: X,
193
+ getPopoverRef: Y,
193
194
  loading: o.isReloading,
194
- loadingAriaLabel: W || u(i.loadingAriaLabel),
195
+ loadingAriaLabel: W || u(a.loadingAriaLabel),
195
196
  multiselect: s,
196
197
  noResultMessage: d,
197
- onFocus: j,
198
- onInputValueChange: J,
199
- onValueChange: U,
200
- options: Y,
201
- renderOption: H,
202
- value: q
198
+ onFocus: U,
199
+ onInputValueChange: K,
200
+ onValueChange: q,
201
+ options: Z,
202
+ renderOption: J,
203
+ value: H
203
204
  });
204
205
  });
205
206
  export {
206
- wo as ComboboxWithApiPagination
207
+ Bo as ComboboxWithApiPagination
207
208
  };
@@ -1,76 +1,76 @@
1
1
  import "../../../../../../styles/ai-suggestion-field.css";
2
- import { Text as g, IconButton as l, DropdownMenu as t } from "@box/blueprint-web";
2
+ import { Text as p, IconButton as g, DropdownMenu as t } from "@box/blueprint-web";
3
3
  import { Checkmark as u, Ellipsis as S } from "@box/blueprint-web-assets/icons/Fill";
4
- import { useIntl as h, FormattedMessage as a } from "react-intl";
4
+ import { useIntl as h, FormattedMessage as n } from "react-intl";
5
5
  import r from "./messages.js";
6
6
  import { formatSuggestionValue as w } from "./utils.js";
7
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
8
- const I = "_wrapperGradient_1izxt_1", _ = "_wrapper_1izxt_1", f = "_buttons_1izxt_18", x = "_selectTrigger_1izxt_22", n = {
7
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
8
+ const I = "_wrapperGradient_1e3py_1", _ = "_wrapper_1e3py_1", f = "_buttons_1e3py_18", M = "_selectTrigger_1e3py_22", i = {
9
9
  wrapperGradient: I,
10
10
  wrapper: _,
11
11
  buttons: f,
12
- selectTrigger: x
12
+ selectTrigger: M
13
13
  };
14
14
  function D({
15
- aiSuggestion: c,
15
+ aiSuggestion: l,
16
16
  onAiSuggestionAppend: s,
17
- onAiSuggestionReplace: p,
17
+ onAiSuggestionReplace: c,
18
18
  onAiSuggestionIgnore: d,
19
19
  type: m
20
20
  }) {
21
21
  const o = h();
22
22
  return /* @__PURE__ */ e("div", {
23
- className: n.wrapperGradient,
24
- children: /* @__PURE__ */ i("div", {
25
- className: n.wrapper,
26
- children: [/* @__PURE__ */ i("div", {
27
- children: [/* @__PURE__ */ e(g, {
23
+ className: i.wrapperGradient,
24
+ children: /* @__PURE__ */ a("div", {
25
+ className: i.wrapper,
26
+ children: [/* @__PURE__ */ a("div", {
27
+ children: [/* @__PURE__ */ e(p, {
28
28
  as: "p",
29
29
  color: "textOnLightSecondary",
30
30
  variant: "caption",
31
- children: /* @__PURE__ */ e(a, {
31
+ children: /* @__PURE__ */ e(n, {
32
32
  ...r.aiSuggestionCaption
33
33
  })
34
- }), /* @__PURE__ */ e(g, {
34
+ }), /* @__PURE__ */ e(p, {
35
35
  as: "p",
36
- children: w(c, {
36
+ children: w(l, {
37
37
  type: m,
38
38
  locale: o.locale
39
39
  })
40
40
  })]
41
- }), /* @__PURE__ */ i("div", {
42
- className: n.buttons,
43
- children: [/* @__PURE__ */ e(l, {
41
+ }), /* @__PURE__ */ a("div", {
42
+ className: i.buttons,
43
+ children: [/* @__PURE__ */ e(g, {
44
44
  "aria-label": o.formatMessage(r.aiSuggestionAppend),
45
45
  icon: u,
46
46
  onClick: s,
47
47
  size: "x-small",
48
48
  "data-target-id": "IconButton-aiSuggestionAppend"
49
- }), /* @__PURE__ */ i(t.Root, {
49
+ }), /* @__PURE__ */ a(t.Root, {
50
50
  children: [/* @__PURE__ */ e(t.Trigger, {
51
- className: n.selectTrigger,
52
- children: /* @__PURE__ */ e(l, {
51
+ className: i.selectTrigger,
52
+ children: /* @__PURE__ */ e(g, {
53
53
  "aria-label": o.formatMessage(r.aiSuggestionOptions),
54
54
  icon: S,
55
55
  "data-target-id": "IconButton-aiSuggestionOptions"
56
56
  })
57
- }), /* @__PURE__ */ i(t.Content, {
57
+ }), /* @__PURE__ */ a(t.Content, {
58
58
  children: [/* @__PURE__ */ e(t.Item, {
59
59
  onSelect: s,
60
60
  "data-target-id": "DropdownMenu.Item-aiSuggestionAppend",
61
- children: /* @__PURE__ */ e(a, {
61
+ children: /* @__PURE__ */ e(n, {
62
62
  ...r.aiSuggestionAppend
63
63
  })
64
64
  }), /* @__PURE__ */ e(t.Item, {
65
- onSelect: p,
65
+ onSelect: c,
66
66
  "data-target-id": "DropdownMenu.Item-aiSuggestionClearAndReplace",
67
- children: /* @__PURE__ */ e(a, {
67
+ children: /* @__PURE__ */ e(n, {
68
68
  ...r.aiSuggestionClearAndReplace
69
69
  })
70
70
  }), /* @__PURE__ */ e(t.Separator, {}), /* @__PURE__ */ e(t.Item, {
71
71
  onSelect: d,
72
72
  "data-target-id": "DropdownMenu.Item-aiSuggestionIgnore",
73
- children: /* @__PURE__ */ e(a, {
73
+ children: /* @__PURE__ */ e(n, {
74
74
  ...r.aiSuggestionIgnore
75
75
  })
76
76
  })]
@@ -1,66 +1,67 @@
1
- import { DateI18nProvider as x, DatePicker as L } from "@box/blueprint-web";
2
- import { useFormikContext as T, getIn as V, Field as A } from "formik";
3
- import { forwardRef as C, useMemo as w } from "react";
4
- import { useIntl as I } from "react-intl";
5
- import { convertToDatePickerValue as N, convertToFormikValue as z } from "./date-conversion-utils.js";
6
- import { useDateInternationalization as B } from "./use-date-internationalization.js";
1
+ import { DateI18nProvider as L, DatePicker as T } from "@box/blueprint-web";
2
+ import { useFormikContext as V, getIn as A, Field as C } from "formik";
3
+ import { forwardRef as w, useMemo as I } from "react";
4
+ import { useIntl as N } from "react-intl";
5
+ import { convertToDatePickerValue as z, convertToFormikValue as B } from "./date-conversion-utils.js";
6
+ import { useDateInternationalization as O } from "./use-date-internationalization.js";
7
7
  import a from "../../../../messages.js";
8
- import { getFieldLabel as O } from "../../utils.js";
8
+ import { getFieldLabel as $ } from "../../utils.js";
9
9
  import { jsx as r } from "react/jsx-runtime";
10
- const J = /* @__PURE__ */ C(({
11
- description: s,
12
- disableForm: c,
13
- fieldNamePrefix: m,
10
+ const K = /* @__PURE__ */ w(({
11
+ className: s,
12
+ description: c,
13
+ disableForm: m,
14
+ fieldNamePrefix: d,
14
15
  label: i,
15
- portalElement: d,
16
- updateModePrefix: f,
17
- className: u
18
- }, h) => {
19
- const o = `${f ?? m}.value`, e = I(), {
20
- values: p,
21
- setFieldTouched: D,
22
- setFieldValue: M
23
- } = T(), {
24
- localTimezone: g
25
- } = B(e.locale), n = V(p, o), k = w(() => N(n), [n]), v = {
16
+ onValueEdited: f,
17
+ portalElement: u,
18
+ updateModePrefix: h
19
+ }, p) => {
20
+ const o = `${h ?? d}.value`, e = N(), {
21
+ values: D,
22
+ setFieldTouched: M,
23
+ setFieldValue: g
24
+ } = V(), {
25
+ localTimezone: k
26
+ } = O(e.locale), n = A(D, o), v = I(() => z(n), [n]), b = {
26
27
  clearDatePickerAriaLabel: e.formatMessage(a.clearSelectedDate),
27
28
  nextMonthAriaLabel: e.formatMessage(a.switchToNextMonth),
28
29
  openCalendarDropdownAriaLabel: e.formatMessage(a.openCalendar),
29
30
  previousMonthAriaLabel: e.formatMessage(a.switchToNextMonth)
30
- }, b = (t) => {
31
- const l = z(t, g);
32
- M(o, l);
33
- }, F = () => {
34
- D(o, !0);
31
+ }, F = (t) => {
32
+ const l = B(t, k);
33
+ g(o, l), f();
34
+ }, P = () => {
35
+ M(o, !0);
35
36
  };
36
37
  return /* @__PURE__ */ r("div", {
37
38
  "data-testid": `${i}-field`,
38
- children: /* @__PURE__ */ r(x, {
39
+ children: /* @__PURE__ */ r(L, {
39
40
  locale: e.locale,
40
- children: /* @__PURE__ */ r(A, {
41
+ children: /* @__PURE__ */ r(C, {
41
42
  name: o,
42
43
  children: ({
43
44
  field: t,
44
45
  meta: l
45
- }) => /* @__PURE__ */ r(L, {
46
+ }) => /* @__PURE__ */ r(T, {
46
47
  ...t,
47
- ...v,
48
- ref: h,
48
+ ...b,
49
+ ref: p,
49
50
  calendarAriaLabel: e.formatMessage(a.selectDate),
50
- className: u,
51
+ className: s,
51
52
  error: l.error,
52
- isDisabled: c,
53
- label: O(i, s),
54
- onBlur: () => F(),
55
- onChange: (P) => b(P),
56
- portalElement: d,
57
- value: k
53
+ isDisabled: m,
54
+ label: $(i, c),
55
+ onBlur: () => P(),
56
+ onChange: (x) => F(x),
57
+ portalElement: u,
58
+ value: v
58
59
  })
59
60
  })
60
61
  })
61
62
  });
62
63
  });
63
64
  export {
64
- J as MetadataDateField,
65
- J as default
65
+ K as MetadataDateField,
66
+ K as default
66
67
  };