@box/tree 1.38.33 → 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.
Files changed (62) hide show
  1. package/dist/chunks/error.js +28 -0
  2. package/dist/chunks/expander-with-loading.js +29 -41
  3. package/dist/chunks/expander.js +24 -0
  4. package/dist/chunks/inline-error.js +27 -0
  5. package/dist/chunks/loading-node.js +20 -0
  6. package/dist/chunks/node-icon.module.js +2 -6
  7. package/dist/chunks/node-label.js +23 -0
  8. package/dist/chunks/nodes.module.js +317 -319
  9. package/dist/chunks/reload-node.js +40 -0
  10. package/dist/chunks/skeleton.js +14 -0
  11. package/dist/chunks/tree.js +78 -0
  12. package/dist/esm/index.js +6 -10
  13. package/dist/esm/lib/components/content-node/content-node.js +109 -136
  14. package/dist/esm/lib/components/content-node/expander-with-loading.js +2 -9
  15. package/dist/esm/lib/components/content-node/index.js +2 -4
  16. package/dist/esm/lib/components/content-node/messages.js +5 -9
  17. package/dist/esm/lib/components/content-node/variant-icon.js +15 -23
  18. package/dist/esm/lib/components/error/error.js +2 -34
  19. package/dist/esm/lib/components/error/index.js +2 -4
  20. package/dist/esm/lib/components/error/messages.js +14 -16
  21. package/dist/esm/lib/components/expander/expander.js +2 -33
  22. package/dist/esm/lib/components/expander/index.js +2 -4
  23. package/dist/esm/lib/components/expander/messages.js +10 -12
  24. package/dist/esm/lib/components/index.js +8 -17
  25. package/dist/esm/lib/components/inline-error/index.js +2 -4
  26. package/dist/esm/lib/components/inline-error/inline-error.js +2 -33
  27. package/dist/esm/lib/components/inline-error/messages.js +18 -20
  28. package/dist/esm/lib/components/load-more-node/index.js +2 -4
  29. package/dist/esm/lib/components/load-more-node/load-more-node.js +21 -31
  30. package/dist/esm/lib/components/load-more-node/messages.js +10 -12
  31. package/dist/esm/lib/components/loading-node/index.js +2 -4
  32. package/dist/esm/lib/components/loading-node/loading-node.js +2 -30
  33. package/dist/esm/lib/components/loading-node/messages.js +5 -9
  34. package/dist/esm/lib/components/node-icon/index.js +3 -6
  35. package/dist/esm/lib/components/node-icon/messages.js +5 -9
  36. package/dist/esm/lib/components/node-icon/node-avatar.js +27 -34
  37. package/dist/esm/lib/components/node-icon/node-item-icon.js +30 -41
  38. package/dist/esm/lib/components/node-label/index.js +2 -4
  39. package/dist/esm/lib/components/node-label/node-label.js +2 -34
  40. package/dist/esm/lib/components/reload-node/index.js +2 -4
  41. package/dist/esm/lib/components/reload-node/messages.js +18 -20
  42. package/dist/esm/lib/components/reload-node/reload-node.js +2 -52
  43. package/dist/esm/lib/components/service-node-wrapper/index.js +2 -4
  44. package/dist/esm/lib/components/service-node-wrapper/service-node-wrapper.js +10 -19
  45. package/dist/esm/lib/components/skeleton/index.js +2 -4
  46. package/dist/esm/lib/components/skeleton/skeleton.js +2 -22
  47. package/dist/esm/lib/components/truncated-tooltip-text/index.js +1 -3
  48. package/dist/esm/lib/components/truncated-tooltip-text/truncated-tooltip-text.js +25 -26
  49. package/dist/esm/lib/constants.js +2 -9
  50. package/dist/esm/lib/hooks/index.js +3 -6
  51. package/dist/esm/lib/hooks/useIntersectionObserver.js +13 -17
  52. package/dist/esm/lib/hooks/useSelectionInheritance.js +16 -20
  53. package/dist/esm/lib/tree.js +3 -128
  54. package/dist/esm/lib/utils.js +38 -46
  55. package/dist/styles/expander-with-loading.css +1 -1
  56. package/dist/styles/inline-error.css +1 -1
  57. package/dist/styles/loading-node.css +1 -1
  58. package/dist/styles/node-label.css +1 -1
  59. package/dist/styles/nodes.css +1 -1
  60. package/dist/styles/reload-node.css +1 -1
  61. package/dist/styles/skeleton.css +1 -1
  62. 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 { useIntl as n } from "react-intl";
2
- import { LoadingIndicator as _ } from "@box/blueprint-web";
3
- import d from "../esm/lib/components/content-node/messages.js";
4
- import { jsx as l } from "react/jsx-runtime";
5
- import { Expander as c } from "../esm/lib/components/expander/expander.js";
6
- import '../styles/expander-with-loading.css';const m = "_loader_1stia_2", p = "_content_1stia_10", g = "_title_1stia_16", b = "_subtitle_1stia_68", f = "_tooltip_1stia_84", u = {
7
- loader: m,
8
- content: p,
9
- "title-wrapper": "_title-wrapper_1stia_16",
10
- title: g,
11
- "title--small": "_title--small_1stia_30",
12
- "title--selected": "_title--selected_1stia_39",
13
- "title--large": "_title--large_1stia_49",
14
- subtitle: b,
15
- tooltip: f
16
- }, w = ({
17
- metadata: t,
18
- handleExpand: o,
19
- isDisabled: i,
20
- isExpanded: e,
21
- isLoading: s,
22
- size: a
23
- }) => {
24
- const r = n();
25
- return s ? /* @__PURE__ */ l(_, {
26
- "aria-label": r.formatMessage(d.branchContentLoaderLabel),
27
- className: u.loader,
28
- size: a === "small" ? "small" : "medium"
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 };
@@ -1,6 +1,2 @@
1
- import '../styles/node-icon.css';const o = "_icon_1ih26_1", s = {
2
- icon: o
3
- };
4
- export {
5
- s
6
- };
1
+ import '../styles/node-icon.css';var e = { icon: "_icon_1ih26_1" };
2
+ export { e 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 };