@box/metadata-editor 0.65.1 → 0.66.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,15 +1,16 @@
1
1
  import "../../../../../../styles/metadata-instance-entry.css";
2
- import { Text as o } from "@box/blueprint-web";
3
- import { FormattedDate as m } from "react-intl";
4
- import d from "../../../interactive-text/interactive-text.js";
2
+ import { Text as m } from "@box/blueprint-web";
3
+ import { FormattedDate as d } from "react-intl";
4
+ import y from "../../../interactive-text/interactive-text.js";
5
+ import { TaxonomyValue as f } from "./taxonomy-value.js";
5
6
  import { jsxs as l, jsx as r } from "react/jsx-runtime";
6
- const f = "_metadataInstanceEntry_kd217_1", y = {
7
- metadataInstanceEntry: f
8
- }, D = ({
9
- description: a,
10
- name: e,
11
- shouldHideEmptyValues: i,
12
- type: c,
7
+ const u = "_metadataInstanceEntry_kd217_1", x = {
8
+ metadataInstanceEntry: u
9
+ }, V = ({
10
+ description: o,
11
+ name: a,
12
+ shouldHideEmptyValues: s,
13
+ type: e,
13
14
  value: t
14
15
  }) => {
15
16
  const n = (() => {
@@ -19,36 +20,41 @@ const f = "_metadataInstanceEntry_kd217_1", y = {
19
20
  return null;
20
21
  if (Array.isArray(t))
21
22
  return t.join(", ");
22
- if (c === "date" && typeof t == "string") {
23
- const s = new Date(t);
24
- return /* @__PURE__ */ r(m, {
23
+ if (e === "date" && typeof t == "string") {
24
+ const i = new Date(t);
25
+ return /* @__PURE__ */ r(d, {
25
26
  day: "numeric",
26
27
  month: "long",
27
- value: s,
28
+ value: i,
28
29
  year: "numeric"
29
30
  });
30
31
  }
31
32
  return t;
32
33
  })();
33
- return i && !n ? null : /* @__PURE__ */ l("div", {
34
- className: y.metadataInstanceEntry,
35
- children: [/* @__PURE__ */ r(o, {
34
+ if (s && !n)
35
+ return null;
36
+ const c = () => e === "taxonomy" ? /* @__PURE__ */ r(f, {
37
+ value: t
38
+ }) : n && /* @__PURE__ */ r(m, {
39
+ as: "p",
40
+ children: n
41
+ });
42
+ return /* @__PURE__ */ l("div", {
43
+ className: x.metadataInstanceEntry,
44
+ children: [/* @__PURE__ */ r(m, {
36
45
  as: "p",
37
46
  color: "textOnLightSecondary",
38
47
  variant: "bodyDefaultBold",
39
- children: a ? /* @__PURE__ */ r(d, {
48
+ children: o ? /* @__PURE__ */ r(y, {
40
49
  as: "span",
41
50
  color: "textOnLightSecondary",
42
- tooltipText: a,
51
+ tooltipText: o,
43
52
  variant: "bodyDefaultBold",
44
- children: e
45
- }) : e
46
- }), n && /* @__PURE__ */ r(o, {
47
- as: "p",
48
- children: n
49
- })]
53
+ children: a
54
+ }) : a
55
+ }), c()]
50
56
  });
51
57
  };
52
58
  export {
53
- D as MetadataInstanceEntry
59
+ V as MetadataInstanceEntry
54
60
  };
@@ -0,0 +1,25 @@
1
+ import "../../../../../../styles/taxonomy-value.css";
2
+ import { FilterChip as n } from "@box/blueprint-web";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ const l = "_taxonomyValueContainer_1m6f6_1", m = "_taxonomyValueButton_1m6f6_1", u = "_taxonomyValueLabel_1m6f6_8", e = {
5
+ taxonomyValueContainer: l,
6
+ taxonomyValueButton: m,
7
+ taxonomyValueLabel: u
8
+ }, x = ({
9
+ value: a
10
+ }) => !a || !Array.isArray(a) || !a.length ? null : /* @__PURE__ */ t(n.Group, {
11
+ className: e.taxonomyValueContainer,
12
+ name: "taxonomy-value",
13
+ type: "single",
14
+ children: a.map((o) => /* @__PURE__ */ t(n.ChipButton, {
15
+ className: e.taxonomyValueButton,
16
+ value: o.value,
17
+ children: /* @__PURE__ */ t(n.Label, {
18
+ className: e.taxonomyValueLabel,
19
+ children: o.displayValue
20
+ })
21
+ }, o.value))
22
+ });
23
+ export {
24
+ x as TaxonomyValue
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.65.1",
3
+ "version": "0.66.0",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.5",
6
6
  "@box/blueprint-web": "^7.30.3",
@@ -14,7 +14,7 @@
14
14
  "devDependencies": {
15
15
  "@ariakit/react": "0.4.5",
16
16
  "@box/babel-plugin-target-attributes": "1.3.0",
17
- "@box/blueprint-web": "^7.33.0",
17
+ "@box/blueprint-web": "^7.33.1",
18
18
  "@box/blueprint-web-assets": "^4.27.0",
19
19
  "@box/storybook-utils": "^0.6.1",
20
20
  "@testing-library/react": "^15.0.6",
@@ -53,5 +53,5 @@
53
53
  "**/*.css"
54
54
  ],
55
55
  "license": "SEE LICENSE IN LICENSE",
56
- "gitHead": "b3c8f235ca17a93a637e7f0adbd794c167d54795"
56
+ "gitHead": "fec5f60d64cecfdab83b9ec202aa14114171031f"
57
57
  }
@@ -0,0 +1 @@
1
+ ._taxonomyValueContainer_1m6f6_1 ._taxonomyValueButton_1m6f6_1{overflow-x:hidden}._taxonomyValueContainer_1m6f6_1 ._taxonomyValueButton_1m6f6_1:focus-visible{overflow-x:hidden}._taxonomyValueButton_1m6f6_1 ._taxonomyValueLabel_1m6f6_8{overflow-x:hidden;text-overflow:ellipsis}
@@ -0,0 +1,6 @@
1
+ import { type MetadataFieldValue } from '../../../../types';
2
+ type Props = {
3
+ value?: MetadataFieldValue;
4
+ };
5
+ export declare const TaxonomyValue: ({ value }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};