@box/metadata-editor 0.82.3 → 0.83.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.
@@ -1,59 +1,59 @@
1
- import { Text as n, EmptyState as f } from "@box/blueprint-web";
2
- import { JobAnalyzeData as p } from "@box/blueprint-web-assets/illustrations/Small";
3
- import { useCallback as l } from "react";
1
+ import { Text as n, EmptyState as m } from "@box/blueprint-web";
2
+ import { JobAnalyzeData as c } from "@box/blueprint-web-assets/illustrations/Small";
3
+ import { useCallback as f } from "react";
4
4
  import { useIntl as d } from "react-intl";
5
- import e from "./messages.js";
6
- import { jsx as a } from "react/jsx-runtime";
5
+ import a from "./messages.js";
6
+ import { jsx as e } from "react/jsx-runtime";
7
7
  function E({
8
- isAnyEmptyValueHidden: m = !1,
9
- isBoxAiSuggestionsFeatureEnabled: s = !1,
8
+ isAnyEmptyValueHidden: s = !1,
9
+ isBoxAiSuggestionsFeatureEnabled: p = !1,
10
10
  level: r,
11
- onShowEmptyValues: i
11
+ onShowEmptyValues: o
12
12
  }) {
13
- const t = d(), c = l(() => {
13
+ const t = d(), l = f(() => {
14
14
  if (r === "manager")
15
- return /* @__PURE__ */ a(n, {
15
+ return /* @__PURE__ */ e(n, {
16
16
  as: "p",
17
- children: t.formatMessage(e.managerLevelEmptyStateBody)
17
+ children: t.formatMessage(a.managerLevelEmptyStateBody)
18
18
  });
19
19
  if (r === "instance")
20
- return m ? /* @__PURE__ */ a(f.PrimaryAction, {
21
- onClick: i,
22
- children: t.formatMessage(e.instanceLevelSeeEmptyValuesCTA)
20
+ return s ? /* @__PURE__ */ e(m.PrimaryAction, {
21
+ onClick: o,
22
+ children: t.formatMessage(a.instanceLevelSeeEmptyValuesCTA)
23
23
  }) : (
24
24
  // EmptyState component requires body element so if level === "instance" && !isAnyEmptyValueHidden we pass heading as body and nothing as heading
25
- /* @__PURE__ */ a(n, {
25
+ /* @__PURE__ */ e(n, {
26
26
  as: "h1",
27
27
  variant: "titleSmall",
28
- children: t.formatMessage(e.instanceLevelEmptyStateHeadingNoAttributes)
28
+ children: t.formatMessage(a.instanceLevelEmptyStateHeadingNoAttributes)
29
29
  })
30
30
  );
31
- const o = s ? t.formatMessage(e.fileLevelEmptyStateBoxAiEnabledBody) : t.formatMessage(e.fileLevelEmptyStateDefaultBody);
32
- return /* @__PURE__ */ a(n, {
31
+ const i = t.formatMessage(a.fileLevelEmptyStateDefaultBody);
32
+ return /* @__PURE__ */ e(n, {
33
33
  as: "p",
34
- children: o
34
+ children: i
35
35
  });
36
- }, [t, m, s, r, i]), g = l(() => {
36
+ }, [t, s, r, o]), g = f(() => {
37
37
  if (r === "manager")
38
- return /* @__PURE__ */ a(n, {
38
+ return /* @__PURE__ */ e(n, {
39
39
  as: "h2",
40
- children: t.formatMessage(e.managerLevelEmptyStateHeading)
40
+ children: t.formatMessage(a.managerLevelEmptyStateHeading)
41
41
  });
42
42
  if (r === "instance")
43
- return m ? /* @__PURE__ */ a(n, {
43
+ return s ? /* @__PURE__ */ e(n, {
44
44
  as: "h2",
45
- children: t.formatMessage(e.instanceLevelEmptyStateHeading)
45
+ children: t.formatMessage(a.instanceLevelEmptyStateHeading)
46
46
  }) : null;
47
- const o = s ? t.formatMessage(e.fileLevelEmptyStateBoxAiEnabledHeading) : t.formatMessage(e.fileLevelEmptyStateDefaultHeading);
48
- return /* @__PURE__ */ a(n, {
47
+ const i = t.formatMessage(a.fileLevelEmptyStateDefaultHeading);
48
+ return /* @__PURE__ */ e(n, {
49
49
  as: "h2",
50
- children: o
50
+ children: i
51
51
  });
52
- }, [t, m, s, r]);
53
- return /* @__PURE__ */ a(f, {
54
- body: c(),
52
+ }, [t, s, r]);
53
+ return /* @__PURE__ */ e(m, {
54
+ body: l(),
55
55
  heading: g(),
56
- illustration: p,
56
+ illustration: c,
57
57
  size: "small"
58
58
  });
59
59
  }
@@ -1,42 +1,42 @@
1
1
  import "../../../../../../styles/custom-instance-new-field.css";
2
- import { Card as y, TextInput as m, Button as u } from "@box/blueprint-web";
2
+ import { Card as I, TextInput as u, Button as m } from "@box/blueprint-web";
3
3
  import { useState as l } from "react";
4
- import { useIntl as v } from "react-intl";
4
+ import { useIntl as y } from "react-intl";
5
5
  import t from "./messages.js";
6
6
  import { jsxs as p, jsx as a } from "react/jsx-runtime";
7
- const M = "_customInstanceNewFieldCard_1m7z1_1", _ = "_customInstanceNewFieldFooter_1m7z1_6", b = "_inputWrapper_1m7z1_13", n = {
7
+ const M = "_customInstanceNewFieldCard_ivrhw_1", _ = "_customInstanceNewFieldFooter_ivrhw_6", b = "_inputWrapper_ivrhw_13", n = {
8
8
  customInstanceNewFieldCard: M,
9
9
  customInstanceNewFieldFooter: _,
10
10
  inputWrapper: b
11
11
  }, E = (g) => {
12
12
  const {
13
- onAdd: f,
14
- onCancel: F,
13
+ onAdd: h,
14
+ onCancel: f,
15
15
  formKeys: c = []
16
- } = g, e = v(), [r, h] = l(""), [i, C] = l(""), [d, o] = l(""), N = c.length !== 0, I = (s) => {
17
- h(s), d && o("");
18
- }, w = () => {
19
- r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) : f(r, i) : o(e.formatMessage(t.keyFieldRequiredError));
16
+ } = g, e = y(), [r, F] = l(""), [i, C] = l(""), [d, o] = l(""), N = c.length !== 0, w = (s) => {
17
+ F(s), d && o("");
18
+ }, v = () => {
19
+ r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) : h(r, i) : o(e.formatMessage(t.keyFieldRequiredError));
20
20
  };
21
- return /* @__PURE__ */ p(y, {
21
+ return /* @__PURE__ */ p(I, {
22
22
  "aria-label": e.formatMessage(t.addAttributeGroupAriaLabel),
23
23
  className: n.customInstanceNewFieldCard,
24
24
  "data-testid": "customInstanceNewField",
25
25
  role: "group",
26
26
  children: [/* @__PURE__ */ a("div", {
27
27
  className: n.inputWrapper,
28
- children: /* @__PURE__ */ a(m, {
28
+ children: /* @__PURE__ */ a(u, {
29
29
  autoFocus: !0,
30
30
  error: d,
31
31
  label: e.formatMessage(t.customKeyLabel),
32
- onChange: (s) => I(s.target.value),
32
+ onChange: (s) => w(s.target.value),
33
33
  placeholder: e.formatMessage(t.customKeyPlaceholder),
34
34
  required: !0,
35
35
  value: r
36
36
  })
37
37
  }), /* @__PURE__ */ a("div", {
38
38
  className: n.inputWrapper,
39
- children: /* @__PURE__ */ a(m, {
39
+ children: /* @__PURE__ */ a(u, {
40
40
  label: e.formatMessage(t.valueLabel),
41
41
  onChange: (s) => C(s.target.value),
42
42
  placeholder: e.formatMessage(t.valuePlaceholder),
@@ -44,13 +44,13 @@ const M = "_customInstanceNewFieldCard_1m7z1_1", _ = "_customInstanceNewFieldFoo
44
44
  })
45
45
  }), /* @__PURE__ */ p("div", {
46
46
  className: n.customInstanceNewFieldFooter,
47
- children: [N && /* @__PURE__ */ a(u, {
48
- onClick: F,
47
+ children: [N && /* @__PURE__ */ a(m, {
48
+ onClick: f,
49
49
  variant: "secondary",
50
50
  "data-target-id": "Button-cancelCTA",
51
51
  children: e.formatMessage(t.cancelCTA)
52
- }), /* @__PURE__ */ a(u, {
53
- onClick: w,
52
+ }), /* @__PURE__ */ a(m, {
53
+ onClick: v,
54
54
  variant: "primary",
55
55
  "data-target-id": "Button-addNewFieldCTA",
56
56
  children: e.formatMessage(t.addNewFieldCTA)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.82.3",
3
+ "version": "0.83.0",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.14",
6
6
  "@box/blueprint-web": "^7.30.3",
@@ -14,9 +14,9 @@
14
14
  "devDependencies": {
15
15
  "@ariakit/react": "0.4.14",
16
16
  "@box/babel-plugin-target-attributes": "1.3.0",
17
- "@box/blueprint-web": "^9.7.1",
18
- "@box/blueprint-web-assets": "^4.31.0",
19
- "@box/storybook-utils": "^0.8.0",
17
+ "@box/blueprint-web": "^9.7.3",
18
+ "@box/blueprint-web-assets": "^4.31.1",
19
+ "@box/storybook-utils": "^0.8.1",
20
20
  "@testing-library/react": "^15.0.6",
21
21
  "react": "^18.3.0",
22
22
  "react-dom": "^18.3.0",
@@ -53,5 +53,5 @@
53
53
  "**/*.css"
54
54
  ],
55
55
  "license": "SEE LICENSE IN LICENSE",
56
- "gitHead": "11c8390fbd9edf91abd52bee5c250e40331d2c30"
56
+ "gitHead": "ce8788c77a7c7c083cb57af2d5b14abb566ce6e2"
57
57
  }
@@ -1 +1 @@
1
- ._customInstanceNewFieldCard_1m7z1_1{background-color:var(--box-blue-02);border-color:var(--box-blue-50)}._customInstanceNewFieldFooter_1m7z1_6{display:flex;justify-content:flex-end;gap:var(--space-3);margin-top:var(--space-6)}._inputWrapper_1m7z1_13{margin-bottom:var(--space-3)}
1
+ div._customInstanceNewFieldCard_ivrhw_1{background-color:var(--box-blue-02);border-color:var(--box-blue-50)}._customInstanceNewFieldFooter_ivrhw_6{display:flex;justify-content:flex-end;gap:var(--space-3);margin-top:var(--space-6)}._inputWrapper_ivrhw_13{margin-bottom:var(--space-3)}