@box/tree 1.38.32 → 1.38.34
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.
- package/dist/chunks/error.js +28 -0
- package/dist/chunks/expander-with-loading.js +29 -41
- package/dist/chunks/expander.js +24 -0
- package/dist/chunks/inline-error.js +27 -0
- package/dist/chunks/loading-node.js +20 -0
- package/dist/chunks/node-icon.module.js +2 -6
- package/dist/chunks/node-label.js +23 -0
- package/dist/chunks/nodes.module.js +317 -319
- package/dist/chunks/reload-node.js +40 -0
- package/dist/chunks/skeleton.js +14 -0
- package/dist/chunks/tree.js +78 -0
- package/dist/esm/index.js +6 -10
- package/dist/esm/lib/components/content-node/content-node.js +109 -136
- package/dist/esm/lib/components/content-node/expander-with-loading.js +2 -9
- package/dist/esm/lib/components/content-node/index.js +2 -4
- package/dist/esm/lib/components/content-node/messages.js +5 -9
- package/dist/esm/lib/components/content-node/variant-icon.js +15 -23
- package/dist/esm/lib/components/error/error.js +2 -34
- package/dist/esm/lib/components/error/index.js +2 -4
- package/dist/esm/lib/components/error/messages.js +14 -16
- package/dist/esm/lib/components/expander/expander.js +2 -33
- package/dist/esm/lib/components/expander/index.js +2 -4
- package/dist/esm/lib/components/expander/messages.js +10 -12
- package/dist/esm/lib/components/index.js +8 -17
- package/dist/esm/lib/components/inline-error/index.js +2 -4
- package/dist/esm/lib/components/inline-error/inline-error.js +2 -33
- package/dist/esm/lib/components/inline-error/messages.js +18 -20
- package/dist/esm/lib/components/load-more-node/index.js +2 -4
- package/dist/esm/lib/components/load-more-node/load-more-node.js +21 -31
- package/dist/esm/lib/components/load-more-node/messages.js +10 -12
- package/dist/esm/lib/components/loading-node/index.js +2 -4
- package/dist/esm/lib/components/loading-node/loading-node.js +2 -30
- package/dist/esm/lib/components/loading-node/messages.js +5 -9
- package/dist/esm/lib/components/node-icon/index.js +3 -6
- package/dist/esm/lib/components/node-icon/messages.js +5 -9
- package/dist/esm/lib/components/node-icon/node-avatar.js +27 -34
- package/dist/esm/lib/components/node-icon/node-item-icon.js +30 -41
- package/dist/esm/lib/components/node-label/index.js +2 -4
- package/dist/esm/lib/components/node-label/node-label.js +2 -34
- package/dist/esm/lib/components/reload-node/index.js +2 -4
- package/dist/esm/lib/components/reload-node/messages.js +18 -20
- package/dist/esm/lib/components/reload-node/reload-node.js +2 -52
- package/dist/esm/lib/components/service-node-wrapper/index.js +2 -4
- package/dist/esm/lib/components/service-node-wrapper/service-node-wrapper.js +10 -19
- package/dist/esm/lib/components/skeleton/index.js +2 -4
- package/dist/esm/lib/components/skeleton/skeleton.js +2 -22
- package/dist/esm/lib/components/truncated-tooltip-text/index.js +1 -3
- package/dist/esm/lib/components/truncated-tooltip-text/truncated-tooltip-text.js +25 -26
- package/dist/esm/lib/constants.js +2 -9
- package/dist/esm/lib/hooks/index.js +3 -6
- package/dist/esm/lib/hooks/useIntersectionObserver.js +13 -17
- package/dist/esm/lib/hooks/useSelectionInheritance.js +16 -20
- package/dist/esm/lib/tree.js +3 -128
- package/dist/esm/lib/utils.js +38 -46
- package/dist/styles/expander-with-loading.css +1 -1
- package/dist/styles/inline-error.css +1 -1
- package/dist/styles/loading-node.css +1 -1
- package/dist/styles/node-label.css +1 -1
- package/dist/styles/nodes.css +1 -1
- package/dist/styles/reload-node.css +1 -1
- package/dist/styles/skeleton.css +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import e from "../esm/lib/components/error/messages.js";
|
|
2
|
+
import { EmptyState as t, Text as n } from "@box/blueprint-web";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { useIntl as i } from "react-intl";
|
|
5
|
+
import { Loader as a } from "@box/blueprint-web-assets/icons/Fill";
|
|
6
|
+
import { Unplugged as o } from "@box/blueprint-web-assets/illustrations/Medium";
|
|
7
|
+
import '../styles/error.css';var s = { error: "_error_pq9k8_1" };
|
|
8
|
+
function c({ onReload: c }) {
|
|
9
|
+
let l = i();
|
|
10
|
+
return /* @__PURE__ */ r(t, {
|
|
11
|
+
body: /* @__PURE__ */ r(n, {
|
|
12
|
+
as: "p",
|
|
13
|
+
children: l.formatMessage(e.errorBody)
|
|
14
|
+
}),
|
|
15
|
+
className: s.error,
|
|
16
|
+
heading: /* @__PURE__ */ r(n, {
|
|
17
|
+
as: "h2",
|
|
18
|
+
children: l.formatMessage(e.errorTitle)
|
|
19
|
+
}),
|
|
20
|
+
illustration: o,
|
|
21
|
+
children: /* @__PURE__ */ r(t.PrimaryAction, {
|
|
22
|
+
endIcon: a,
|
|
23
|
+
onClick: c,
|
|
24
|
+
children: l.formatMessage(e.reloadButton)
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export { c as t };
|
|
@@ -1,42 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
import {
|
|
6
|
-
import '../styles/expander-with-loading.css';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}) : /* @__PURE__ */ l(c, {
|
|
30
|
-
...t?.dataTargetId && {
|
|
31
|
-
dataTargetId: `${t.dataTargetId}:${e ? "collapse" : "expand"}`
|
|
32
|
-
},
|
|
33
|
-
disabled: i,
|
|
34
|
-
expanded: e,
|
|
35
|
-
onClick: o,
|
|
36
|
-
size: a
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
w as E,
|
|
41
|
-
u as c
|
|
1
|
+
import e from "../esm/lib/components/content-node/messages.js";
|
|
2
|
+
import { t } from "./expander.js";
|
|
3
|
+
import { LoadingIndicator as n } from "@box/blueprint-web";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { useIntl as i } from "react-intl";
|
|
6
|
+
import '../styles/expander-with-loading.css';var a = {
|
|
7
|
+
loader: "_loader_1stia_2",
|
|
8
|
+
content: "_content_1stia_10",
|
|
9
|
+
"title-wrapper": "_title-wrapper_1stia_16",
|
|
10
|
+
title: "_title_1stia_16",
|
|
11
|
+
"title--small": "_title--small_1stia_30",
|
|
12
|
+
"title--selected": "_title--selected_1stia_39",
|
|
13
|
+
"title--large": "_title--large_1stia_49",
|
|
14
|
+
subtitle: "_subtitle_1stia_68",
|
|
15
|
+
tooltip: "_tooltip_1stia_84"
|
|
16
|
+
}, o = ({ metadata: o, handleExpand: s, isDisabled: c, isExpanded: l, isLoading: u, size: d }) => {
|
|
17
|
+
let f = i();
|
|
18
|
+
return u ? /* @__PURE__ */ r(n, {
|
|
19
|
+
"aria-label": f.formatMessage(e.branchContentLoaderLabel),
|
|
20
|
+
className: a.loader,
|
|
21
|
+
size: d === "small" ? "small" : "medium"
|
|
22
|
+
}) : /* @__PURE__ */ r(t, {
|
|
23
|
+
...o?.dataTargetId && { dataTargetId: `${o.dataTargetId}:${l ? "collapse" : "expand"}` },
|
|
24
|
+
disabled: c,
|
|
25
|
+
expanded: l,
|
|
26
|
+
onClick: s,
|
|
27
|
+
size: d
|
|
28
|
+
});
|
|
42
29
|
};
|
|
30
|
+
export { a as n, o as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "../esm/lib/components/expander/messages.js";
|
|
2
|
+
import { IconButton as t } from "@box/blueprint-web";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { useIntl as r } from "react-intl";
|
|
5
|
+
import { PointerChevron as i, PointerChevronRight as a } from "@box/blueprint-web-assets/icons/Fill";
|
|
6
|
+
import '../styles/expander.css';var o = {
|
|
7
|
+
"expander-small": "_expander-small_17erq_1",
|
|
8
|
+
"expander-large": "_expander-large_17erq_5"
|
|
9
|
+
};
|
|
10
|
+
function s({ onClick: s, size: c, disabled: l, expanded: u, dataTargetId: d }) {
|
|
11
|
+
return /* @__PURE__ */ n(t, {
|
|
12
|
+
"aria-label": r().formatMessage(u ? e.collapse : e.expand),
|
|
13
|
+
className: o[`expander-${c}`],
|
|
14
|
+
"data-target-id": d,
|
|
15
|
+
disabled: l,
|
|
16
|
+
icon: u ? i : a,
|
|
17
|
+
onClick: (e) => {
|
|
18
|
+
e.stopPropagation(), s(e);
|
|
19
|
+
},
|
|
20
|
+
size: c === "small" ? "x-small" : "small",
|
|
21
|
+
tabIndex: -1
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { s as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import e from "../esm/lib/components/inline-error/messages.js";
|
|
2
|
+
import { InlineNotice as t, TextButton as n } from "@box/blueprint-web";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { useIntl as a } from "react-intl";
|
|
5
|
+
import { Loader as o } from "@box/blueprint-web-assets/icons/Fill";
|
|
6
|
+
import '../styles/inline-error.css';var s = {
|
|
7
|
+
inlineNotice: "_inlineNotice_16lna_1",
|
|
8
|
+
reloadTextButton: "_reloadTextButton_16lna_6"
|
|
9
|
+
};
|
|
10
|
+
function c({ onReload: c }) {
|
|
11
|
+
let l = a();
|
|
12
|
+
return /* @__PURE__ */ i("div", {
|
|
13
|
+
className: s.inlineNotice,
|
|
14
|
+
children: [/* @__PURE__ */ r(t, {
|
|
15
|
+
variant: "error",
|
|
16
|
+
variantIconAriaLabel: l.formatMessage(e.inlineNoticeIconAriaLabel),
|
|
17
|
+
children: /* @__PURE__ */ r("span", { children: l.formatMessage(e.inlineNoticeText) })
|
|
18
|
+
}), /* @__PURE__ */ r(n, {
|
|
19
|
+
"aria-label": l.formatMessage(e.reloadButtonAriaLabel),
|
|
20
|
+
className: s.reloadTextButton,
|
|
21
|
+
icon: o,
|
|
22
|
+
onClick: c,
|
|
23
|
+
children: l.formatMessage(e.reloadButtonText)
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { c as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as e } from "./nodes.module.js";
|
|
2
|
+
import t from "../esm/lib/components/loading-node/messages.js";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { LoadingIndicator as r } from "@box/blueprint-web";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { useIntl as a } from "react-intl";
|
|
7
|
+
import '../styles/loading-node.css';var o = { loader: "_loader_1d12s_1" };
|
|
8
|
+
function s({ level: s, size: c, getNodeProps: l }) {
|
|
9
|
+
let u = a(), d = l();
|
|
10
|
+
return /* @__PURE__ */ i("div", {
|
|
11
|
+
...d,
|
|
12
|
+
className: n("node", e.node, e[`node-${c}-level${s - 1}`], e[`node--${c}`], { [e["node--focused"]]: d.className.includes("tree-node--focused") }),
|
|
13
|
+
children: /* @__PURE__ */ i(r, {
|
|
14
|
+
"aria-label": u.formatMessage(t.loadingIndicatorAriaLabel),
|
|
15
|
+
className: o.loader,
|
|
16
|
+
size: c === "small" ? "small" : "medium"
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export { s as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { Text as n } from "@box/blueprint-web";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import '../styles/node-label.css';var a = { label: "_label_24n7b_2" }, o = /* @__PURE__ */ t((t, o) => {
|
|
6
|
+
let { color: s = "textOnLightSecondary", isInTooltip: c = !1, labelName: l, labelValue: u } = t;
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
8
|
+
ref: o,
|
|
9
|
+
className: e({ [a.label]: !c }),
|
|
10
|
+
children: [/* @__PURE__ */ r(n, {
|
|
11
|
+
as: "span",
|
|
12
|
+
color: s,
|
|
13
|
+
variant: "labelBold",
|
|
14
|
+
children: l.toUpperCase()
|
|
15
|
+
}), /* @__PURE__ */ r(n, {
|
|
16
|
+
as: "span",
|
|
17
|
+
color: s,
|
|
18
|
+
variant: "label",
|
|
19
|
+
children: ` / ${u.toUpperCase()}`
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export { o as t };
|