@box/metadata-editor 0.82.2 → 0.82.4
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,42 +1,42 @@
|
|
1
1
|
import "../../../../../../styles/custom-instance-new-field.css";
|
2
|
-
import { Card as
|
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
|
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 = "
|
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:
|
14
|
-
onCancel:
|
13
|
+
onAdd: h,
|
14
|
+
onCancel: f,
|
15
15
|
formKeys: c = []
|
16
|
-
} = g, e =
|
17
|
-
|
18
|
-
},
|
19
|
-
r ? r.startsWith("$") ? o(e.formatMessage(t.customErrorInternalKey)) : c.includes(r) ? o(e.formatMessage(t.customErrorDuplicateKey)) :
|
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(
|
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(
|
28
|
+
children: /* @__PURE__ */ a(u, {
|
29
29
|
autoFocus: !0,
|
30
30
|
error: d,
|
31
31
|
label: e.formatMessage(t.customKeyLabel),
|
32
|
-
onChange: (s) =>
|
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(
|
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(
|
48
|
-
onClick:
|
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(
|
53
|
-
onClick:
|
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
|
+
"version": "0.82.4",
|
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.
|
18
|
-
"@box/blueprint-web-assets": "^4.31.
|
19
|
-
"@box/storybook-utils": "^0.8.
|
17
|
+
"@box/blueprint-web": "^9.7.2",
|
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": "
|
56
|
+
"gitHead": "dde602878a340420bb58265221994bdf9c2453eb"
|
57
57
|
}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
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)}
|