@box/metadata-template-browser 1.16.3
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/LICENSE +379 -0
- package/README.md +57 -0
- package/dist/chunks/types.js +6 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/lib/components/breadcrumb-navigation/breadcrumb-navigation.js +51 -0
- package/dist/esm/lib/components/breadcrumb-navigation/index.js +4 -0
- package/dist/esm/lib/components/breadcrumb-navigation/messages.js +18 -0
- package/dist/esm/lib/components/browse-list/browse-list.js +83 -0
- package/dist/esm/lib/components/browse-list/index.js +4 -0
- package/dist/esm/lib/components/browse-list/messages.js +18 -0
- package/dist/esm/lib/components/browser-row/browser-row.js +63 -0
- package/dist/esm/lib/components/browser-row/index.js +4 -0
- package/dist/esm/lib/components/error-state/error-state.js +32 -0
- package/dist/esm/lib/components/error-state/index.js +4 -0
- package/dist/esm/lib/components/error-state/messages.js +10 -0
- package/dist/esm/lib/components/index.js +24 -0
- package/dist/esm/lib/components/load-more-feedback/index.js +6 -0
- package/dist/esm/lib/components/load-more-feedback/load-more-error-row.js +44 -0
- package/dist/esm/lib/components/load-more-feedback/load-more-loading-row.js +34 -0
- package/dist/esm/lib/components/load-more-feedback/messages.js +22 -0
- package/dist/esm/lib/components/loader-skeleton/index.js +4 -0
- package/dist/esm/lib/components/loader-skeleton/loader-skeleton.js +26 -0
- package/dist/esm/lib/components/messages.js +30 -0
- package/dist/esm/lib/components/metadata-template-browser-container.js +35 -0
- package/dist/esm/lib/components/metadata-template-browser-controller.js +58 -0
- package/dist/esm/lib/components/metadata-template-browser-list-box/index.js +4 -0
- package/dist/esm/lib/components/metadata-template-browser-list-box/metadata-template-browser-list-box.js +65 -0
- package/dist/esm/lib/components/namespace-row/index.js +4 -0
- package/dist/esm/lib/components/namespace-row/messages.js +10 -0
- package/dist/esm/lib/components/namespace-row/namespace-row.js +32 -0
- package/dist/esm/lib/components/search-list/index.js +4 -0
- package/dist/esm/lib/components/search-list/messages.js +22 -0
- package/dist/esm/lib/components/search-list/search-list.js +76 -0
- package/dist/esm/lib/components/template-row/index.js +4 -0
- package/dist/esm/lib/components/template-row/messages.js +10 -0
- package/dist/esm/lib/components/template-row/template-row.js +70 -0
- package/dist/esm/lib/components/virtualized-grid-list/grid-list-load-more-sentinel.js +49 -0
- package/dist/esm/lib/components/virtualized-grid-list/index.js +4 -0
- package/dist/esm/lib/components/virtualized-grid-list/messages.js +10 -0
- package/dist/esm/lib/components/virtualized-grid-list/virtualized-grid-list.js +66 -0
- package/dist/esm/lib/constants.js +14 -0
- package/dist/esm/lib/contexts/contexts.js +129 -0
- package/dist/esm/lib/contexts/hooks.js +46 -0
- package/dist/esm/lib/contexts/index.js +17 -0
- package/dist/esm/lib/contexts/provider.js +59 -0
- package/dist/esm/lib/contexts/reducer.js +180 -0
- package/dist/esm/lib/contexts/use-template-browser-actions.js +263 -0
- package/dist/esm/lib/hooks/use-is-initial-browse-loading.js +16 -0
- package/dist/esm/lib/metadata-template-browser.js +27 -0
- package/dist/i18n/bn-IN.js +26 -0
- package/dist/i18n/bn-IN.properties +48 -0
- package/dist/i18n/da-DK.js +26 -0
- package/dist/i18n/da-DK.properties +48 -0
- package/dist/i18n/de-DE.js +26 -0
- package/dist/i18n/de-DE.properties +48 -0
- package/dist/i18n/en-AU.js +26 -0
- package/dist/i18n/en-AU.properties +48 -0
- package/dist/i18n/en-CA.js +26 -0
- package/dist/i18n/en-CA.properties +48 -0
- package/dist/i18n/en-GB.js +26 -0
- package/dist/i18n/en-GB.properties +48 -0
- package/dist/i18n/en-US.js +26 -0
- package/dist/i18n/en-US.properties +48 -0
- package/dist/i18n/en-x-pseudo.js +26 -0
- package/dist/i18n/en-x-pseudo.properties +48 -0
- package/dist/i18n/es-419.js +26 -0
- package/dist/i18n/es-419.properties +48 -0
- package/dist/i18n/es-ES.js +26 -0
- package/dist/i18n/es-ES.properties +48 -0
- package/dist/i18n/fi-FI.js +26 -0
- package/dist/i18n/fi-FI.properties +48 -0
- package/dist/i18n/fr-CA.js +26 -0
- package/dist/i18n/fr-CA.properties +48 -0
- package/dist/i18n/fr-FR.js +26 -0
- package/dist/i18n/fr-FR.properties +48 -0
- package/dist/i18n/hi-IN.js +26 -0
- package/dist/i18n/hi-IN.properties +48 -0
- package/dist/i18n/it-IT.js +26 -0
- package/dist/i18n/it-IT.properties +48 -0
- package/dist/i18n/ja-JP.js +26 -0
- package/dist/i18n/ja-JP.properties +48 -0
- package/dist/i18n/json/src/lib/components/breadcrumb-navigation/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/browse-list/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/error-state/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/load-more-feedback/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/namespace-row/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/search-list/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/template-row/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/virtualized-grid-list/messages.json +1 -0
- package/dist/i18n/ko-KR.js +26 -0
- package/dist/i18n/ko-KR.properties +48 -0
- package/dist/i18n/nb-NO.js +26 -0
- package/dist/i18n/nb-NO.properties +48 -0
- package/dist/i18n/nl-NL.js +26 -0
- package/dist/i18n/nl-NL.properties +48 -0
- package/dist/i18n/pl-PL.js +26 -0
- package/dist/i18n/pl-PL.properties +48 -0
- package/dist/i18n/pt-BR.js +26 -0
- package/dist/i18n/pt-BR.properties +48 -0
- package/dist/i18n/ru-RU.js +26 -0
- package/dist/i18n/ru-RU.properties +48 -0
- package/dist/i18n/sv-SE.js +26 -0
- package/dist/i18n/sv-SE.properties +48 -0
- package/dist/i18n/tr-TR.js +26 -0
- package/dist/i18n/tr-TR.properties +48 -0
- package/dist/i18n/zh-CN.js +26 -0
- package/dist/i18n/zh-CN.properties +48 -0
- package/dist/i18n/zh-TW.js +26 -0
- package/dist/i18n/zh-TW.properties +48 -0
- package/dist/styles/breadcrumb-navigation.css +1 -0
- package/dist/styles/browser-row.css +1 -0
- package/dist/styles/grid-list-load-more-sentinel.css +1 -0
- package/dist/styles/load-more-error-row.css +1 -0
- package/dist/styles/load-more-loading-row.css +1 -0
- package/dist/styles/loader-skeleton.css +1 -0
- package/dist/styles/metadata-template-browser-container.css +1 -0
- package/dist/styles/metadata-template-browser-controller.css +1 -0
- package/dist/styles/metadata-template-browser-list-box.css +1 -0
- package/dist/styles/virtualized-grid-list.css +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/lib/components/breadcrumb-navigation/breadcrumb-navigation.d.ts +12 -0
- package/dist/types/lib/components/breadcrumb-navigation/index.d.ts +1 -0
- package/dist/types/lib/components/breadcrumb-navigation/messages.d.ts +17 -0
- package/dist/types/lib/components/browse-list/browse-list.d.ts +23 -0
- package/dist/types/lib/components/browse-list/index.d.ts +2 -0
- package/dist/types/lib/components/browse-list/messages.d.ts +17 -0
- package/dist/types/lib/components/browser-row/browser-row.d.ts +25 -0
- package/dist/types/lib/components/browser-row/index.d.ts +1 -0
- package/dist/types/lib/components/error-state/error-state.d.ts +11 -0
- package/dist/types/lib/components/error-state/index.d.ts +2 -0
- package/dist/types/lib/components/error-state/messages.d.ts +7 -0
- package/dist/types/lib/components/index.d.ts +15 -0
- package/dist/types/lib/components/load-more-feedback/index.d.ts +2 -0
- package/dist/types/lib/components/load-more-feedback/load-more-error-row.d.ts +10 -0
- package/dist/types/lib/components/load-more-feedback/load-more-loading-row.d.ts +6 -0
- package/dist/types/lib/components/load-more-feedback/messages.d.ts +22 -0
- package/dist/types/lib/components/loader-skeleton/index.d.ts +1 -0
- package/dist/types/lib/components/loader-skeleton/loader-skeleton.d.ts +5 -0
- package/dist/types/lib/components/messages.d.ts +32 -0
- package/dist/types/lib/components/metadata-template-browser-container.d.ts +8 -0
- package/dist/types/lib/components/metadata-template-browser-controller.d.ts +11 -0
- package/dist/types/lib/components/metadata-template-browser-list-box/index.d.ts +1 -0
- package/dist/types/lib/components/metadata-template-browser-list-box/metadata-template-browser-list-box.d.ts +6 -0
- package/dist/types/lib/components/namespace-row/index.d.ts +2 -0
- package/dist/types/lib/components/namespace-row/messages.d.ts +7 -0
- package/dist/types/lib/components/namespace-row/namespace-row.d.ts +10 -0
- package/dist/types/lib/components/search-list/index.d.ts +2 -0
- package/dist/types/lib/components/search-list/messages.d.ts +22 -0
- package/dist/types/lib/components/search-list/search-list.d.ts +12 -0
- package/dist/types/lib/components/template-row/index.d.ts +2 -0
- package/dist/types/lib/components/template-row/messages.d.ts +7 -0
- package/dist/types/lib/components/template-row/template-row.d.ts +19 -0
- package/dist/types/lib/components/virtualized-grid-list/grid-list-load-more-sentinel.d.ts +15 -0
- package/dist/types/lib/components/virtualized-grid-list/index.d.ts +2 -0
- package/dist/types/lib/components/virtualized-grid-list/messages.d.ts +7 -0
- package/dist/types/lib/components/virtualized-grid-list/virtualized-grid-list.d.ts +37 -0
- package/dist/types/lib/constants.d.ts +8 -0
- package/dist/types/lib/contexts/contexts.d.ts +47 -0
- package/dist/types/lib/contexts/hooks.d.ts +13 -0
- package/dist/types/lib/contexts/index.d.ts +7 -0
- package/dist/types/lib/contexts/provider.d.ts +14 -0
- package/dist/types/lib/contexts/reducer.d.ts +106 -0
- package/dist/types/lib/contexts/use-template-browser-actions.d.ts +9 -0
- package/dist/types/lib/hooks/use-is-initial-browse-loading.d.ts +7 -0
- package/dist/types/lib/metadata-template-browser.d.ts +23 -0
- package/dist/types/lib/stories/shared/constants.d.ts +16 -0
- package/dist/types/lib/stories/shared/create-mock-event-service.d.ts +2 -0
- package/dist/types/lib/stories/shared/create-mock-items-service.d.ts +53 -0
- package/dist/types/lib/stories/shared/generate-namespaces.d.ts +6 -0
- package/dist/types/lib/stories/shared/generate-templates.d.ts +8 -0
- package/dist/types/lib/stories/shared/index.d.ts +8 -0
- package/dist/types/lib/stories/shared/paginate-items.d.ts +2 -0
- package/dist/types/lib/stories/shared/story-container.d.ts +5 -0
- package/dist/types/lib/stories/shared/story-interaction-helpers.d.ts +30 -0
- package/dist/types/lib/types.d.ts +116 -0
- package/package.json +49 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EllipsizableText as _ } from "@box/blueprint-web";
|
|
2
|
+
import a from "clsx";
|
|
3
|
+
import { GridListItem as b } from "react-aria-components";
|
|
4
|
+
import { jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { useConsumerState as y } from "../../contexts/hooks.js";
|
|
6
|
+
import '../../../../styles/browser-row.css';const g = "_row_ybl3t_2", v = "_trailingSlotHoverOnly_ybl3t_15", u = "_item_ybl3t_19", p = "_disabled_ybl3t_40", S = "_leadingIcon_ybl3t_59", h = "_content_ybl3t_66", N = "_trailingSlot_ybl3t_15", f = "_subtitle_ybl3t_77", t = {
|
|
7
|
+
row: g,
|
|
8
|
+
trailingSlotHoverOnly: v,
|
|
9
|
+
item: u,
|
|
10
|
+
disabled: p,
|
|
11
|
+
leadingIcon: S,
|
|
12
|
+
content: h,
|
|
13
|
+
trailingSlot: N,
|
|
14
|
+
subtitle: f
|
|
15
|
+
};
|
|
16
|
+
function C({
|
|
17
|
+
id: c,
|
|
18
|
+
leadingIcon: l,
|
|
19
|
+
title: e,
|
|
20
|
+
subtitle: n,
|
|
21
|
+
trailingSlot: o,
|
|
22
|
+
isTrailingSlotHoverOnly: d
|
|
23
|
+
}) {
|
|
24
|
+
const {
|
|
25
|
+
isDisabled: s
|
|
26
|
+
} = y(), m = a(t.trailingSlot, {
|
|
27
|
+
[t.trailingSlotHoverOnly]: d
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ i(b, {
|
|
30
|
+
className: a(t.item, {
|
|
31
|
+
[t.disabled]: s
|
|
32
|
+
}),
|
|
33
|
+
id: c,
|
|
34
|
+
isDisabled: s,
|
|
35
|
+
textValue: e,
|
|
36
|
+
children: /* @__PURE__ */ r("div", {
|
|
37
|
+
className: t.row,
|
|
38
|
+
children: [l !== void 0 && /* @__PURE__ */ i("div", {
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
className: t.leadingIcon,
|
|
41
|
+
"data-testid": "leading-icon",
|
|
42
|
+
children: l
|
|
43
|
+
}), /* @__PURE__ */ r("div", {
|
|
44
|
+
className: t.content,
|
|
45
|
+
children: [/* @__PURE__ */ i(_, {
|
|
46
|
+
as: "span",
|
|
47
|
+
lineClamp: 1,
|
|
48
|
+
variant: "bodyDefault",
|
|
49
|
+
children: e
|
|
50
|
+
}), n && /* @__PURE__ */ i("div", {
|
|
51
|
+
className: t.subtitle,
|
|
52
|
+
children: n
|
|
53
|
+
})]
|
|
54
|
+
}), o !== void 0 && /* @__PURE__ */ i("div", {
|
|
55
|
+
className: m,
|
|
56
|
+
children: o
|
|
57
|
+
})]
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
C as BrowserRow
|
|
63
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EmptyState as t, Text as s } from "@box/blueprint-web";
|
|
2
|
+
import { CustomTemplate as a } from "@box/blueprint-web-assets/illustrations/Small";
|
|
3
|
+
import { useIntl as l } from "react-intl";
|
|
4
|
+
import { messages as n } from "./messages.js";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { useConsumerState as p } from "../../contexts/hooks.js";
|
|
7
|
+
function h({
|
|
8
|
+
body: o,
|
|
9
|
+
onRetry: e
|
|
10
|
+
}) {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage: m
|
|
13
|
+
} = l(), {
|
|
14
|
+
isDisabled: i
|
|
15
|
+
} = p();
|
|
16
|
+
return /* @__PURE__ */ r(t, {
|
|
17
|
+
body: /* @__PURE__ */ r(s, {
|
|
18
|
+
as: "p",
|
|
19
|
+
children: o
|
|
20
|
+
}),
|
|
21
|
+
illustration: a,
|
|
22
|
+
size: "small",
|
|
23
|
+
children: /* @__PURE__ */ r(t.PrimaryAction, {
|
|
24
|
+
disabled: i,
|
|
25
|
+
onClick: e,
|
|
26
|
+
children: m(n.retryLabel)
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
h as ErrorState
|
|
32
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MetadataTemplateBrowserContainer as o } from "./metadata-template-browser-container.js";
|
|
2
|
+
import { MetadataTemplateBrowserController as a } from "./metadata-template-browser-controller.js";
|
|
3
|
+
import { BreadcrumbNavigation as p } from "./breadcrumb-navigation/breadcrumb-navigation.js";
|
|
4
|
+
import { BrowseList as f } from "./browse-list/browse-list.js";
|
|
5
|
+
import { SearchList as s } from "./search-list/search-list.js";
|
|
6
|
+
import { ErrorState as d } from "./error-state/error-state.js";
|
|
7
|
+
import { LoaderSkeleton as B } from "./loader-skeleton/loader-skeleton.js";
|
|
8
|
+
import { MetadataTemplateBrowserListBox as L } from "./metadata-template-browser-list-box/metadata-template-browser-list-box.js";
|
|
9
|
+
import { NamespaceRow as c } from "./namespace-row/namespace-row.js";
|
|
10
|
+
import { TemplateRow as S } from "./template-row/template-row.js";
|
|
11
|
+
import { VirtualizedGridList as C } from "./virtualized-grid-list/virtualized-grid-list.js";
|
|
12
|
+
export {
|
|
13
|
+
p as BreadcrumbNavigation,
|
|
14
|
+
f as BrowseList,
|
|
15
|
+
d as ErrorState,
|
|
16
|
+
B as LoaderSkeleton,
|
|
17
|
+
o as MetadataTemplateBrowserContainer,
|
|
18
|
+
a as MetadataTemplateBrowserController,
|
|
19
|
+
L as MetadataTemplateBrowserListBox,
|
|
20
|
+
c as NamespaceRow,
|
|
21
|
+
s as SearchList,
|
|
22
|
+
S as TemplateRow,
|
|
23
|
+
C as VirtualizedGridList
|
|
24
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InlineNotice as m, TextButton as c } from "@box/blueprint-web";
|
|
2
|
+
import { Loader as l } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { GridListItem as d } from "react-aria-components";
|
|
4
|
+
import { useIntl as p } from "react-intl";
|
|
5
|
+
import { LOAD_MORE_ERROR_ROW_ID as f } from "../../constants.js";
|
|
6
|
+
import { messages as o } from "./messages.js";
|
|
7
|
+
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
+
import { useConsumerState as u } from "../../contexts/hooks.js";
|
|
9
|
+
import '../../../../styles/load-more-error-row.css';const b = "_container_1bidp_1", L = "_item_1bidp_9", i = {
|
|
10
|
+
container: b,
|
|
11
|
+
item: L
|
|
12
|
+
};
|
|
13
|
+
function O({
|
|
14
|
+
onRetry: n
|
|
15
|
+
}) {
|
|
16
|
+
const {
|
|
17
|
+
formatMessage: r
|
|
18
|
+
} = p(), {
|
|
19
|
+
isDisabled: e
|
|
20
|
+
} = u(), a = (s) => {
|
|
21
|
+
s.stopPropagation(), !e && n();
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ t(d, {
|
|
24
|
+
className: i.item,
|
|
25
|
+
id: f,
|
|
26
|
+
textValue: r(o.loadMoreErrorBody),
|
|
27
|
+
children: /* @__PURE__ */ _("div", {
|
|
28
|
+
className: i.container,
|
|
29
|
+
children: [/* @__PURE__ */ t(m, {
|
|
30
|
+
variant: "error",
|
|
31
|
+
variantIconAriaLabel: r(o.errorIconAriaLabel),
|
|
32
|
+
children: r(o.loadMoreErrorBody)
|
|
33
|
+
}), /* @__PURE__ */ t(c, {
|
|
34
|
+
disabled: e,
|
|
35
|
+
icon: l,
|
|
36
|
+
onClick: a,
|
|
37
|
+
children: r(o.retryLabel)
|
|
38
|
+
})]
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
O as LoadMoreErrorRow
|
|
44
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Ghost as r } from "@box/blueprint-web";
|
|
2
|
+
import { useIntl as i } from "react-intl";
|
|
3
|
+
import { GridListItem as a } from "react-aria-components";
|
|
4
|
+
import { LOAD_MORE_LOADING_ROW_ID as s } from "../../constants.js";
|
|
5
|
+
import { messages as n } from "./messages.js";
|
|
6
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
7
|
+
import '../../../../styles/load-more-loading-row.css';const l = "_container_1rh3v_1", c = {
|
|
8
|
+
container: l
|
|
9
|
+
};
|
|
10
|
+
function _() {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage: e
|
|
13
|
+
} = i(), t = e(n.loadingRowAriaLabel);
|
|
14
|
+
return /* @__PURE__ */ o(a, {
|
|
15
|
+
"aria-busy": "true",
|
|
16
|
+
"aria-label": t,
|
|
17
|
+
id: s,
|
|
18
|
+
isDisabled: !0,
|
|
19
|
+
textValue: t,
|
|
20
|
+
children: /* @__PURE__ */ m("div", {
|
|
21
|
+
className: c.container,
|
|
22
|
+
children: [/* @__PURE__ */ o(r, {
|
|
23
|
+
height: 16
|
|
24
|
+
}), /* @__PURE__ */ o(r, {
|
|
25
|
+
height: 16
|
|
26
|
+
}), /* @__PURE__ */ o(r, {
|
|
27
|
+
height: 16
|
|
28
|
+
})]
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
_ as LoadMoreLoadingRow
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const r = e({
|
|
3
|
+
loadingRowAriaLabel: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.loadingRowAriaLabel",
|
|
5
|
+
defaultMessage: "Loading more items"
|
|
6
|
+
},
|
|
7
|
+
errorIconAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.errorIconAriaLabel",
|
|
9
|
+
defaultMessage: "Error"
|
|
10
|
+
},
|
|
11
|
+
loadMoreErrorBody: {
|
|
12
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.loadMoreErrorBody",
|
|
13
|
+
defaultMessage: "Failed to load more items."
|
|
14
|
+
},
|
|
15
|
+
retryLabel: {
|
|
16
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.loadMoreFeedback.retryLabel",
|
|
17
|
+
defaultMessage: "Try again"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
r as messages
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Ghost as t } from "@box/blueprint-web";
|
|
2
|
+
import { useIntl as a } from "react-intl";
|
|
3
|
+
import { messages as s } from "../messages.js";
|
|
4
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
5
|
+
import '../../../../styles/loader-skeleton.css';const l = "_loaderSkeleton_hxe4x_1", n = {
|
|
6
|
+
loaderSkeleton: l
|
|
7
|
+
}, i = 16, m = 20;
|
|
8
|
+
function _() {
|
|
9
|
+
const {
|
|
10
|
+
formatMessage: o
|
|
11
|
+
} = a();
|
|
12
|
+
return /* @__PURE__ */ e("div", {
|
|
13
|
+
"aria-busy": "true",
|
|
14
|
+
"aria-label": o(s.loadingAriaLabel),
|
|
15
|
+
className: n.loaderSkeleton,
|
|
16
|
+
role: "status",
|
|
17
|
+
children: Array.from({
|
|
18
|
+
length: m
|
|
19
|
+
}, (c, r) => /* @__PURE__ */ e(t, {
|
|
20
|
+
height: i
|
|
21
|
+
}, r))
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
_ as LoaderSkeleton
|
|
26
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const t = e({
|
|
3
|
+
searchInputPlaceholder: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputPlaceholder",
|
|
5
|
+
defaultMessage: "Search templates"
|
|
6
|
+
},
|
|
7
|
+
searchInputAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputAriaLabel",
|
|
9
|
+
defaultMessage: "Search templates"
|
|
10
|
+
},
|
|
11
|
+
searchInputClearAriaLabel: {
|
|
12
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.container.searchInputClearAriaLabel",
|
|
13
|
+
defaultMessage: "Clear search"
|
|
14
|
+
},
|
|
15
|
+
loadingAriaLabel: {
|
|
16
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.container.loadingAriaLabel",
|
|
17
|
+
defaultMessage: "Loading templates"
|
|
18
|
+
},
|
|
19
|
+
initialEmptyStateBody: {
|
|
20
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.container.initialEmptyStateBody",
|
|
21
|
+
defaultMessage: "At the moment, there are no metadata templates ready for use. You can create the first one by reaching out to your Admin."
|
|
22
|
+
},
|
|
23
|
+
initialLoadErrorBody: {
|
|
24
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.container.initialLoadErrorBody",
|
|
25
|
+
defaultMessage: "Something went wrong while loading templates."
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
t as messages
|
|
30
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SearchInput as i } from "@box/blueprint-web";
|
|
2
|
+
import { useIntl as c } from "react-intl";
|
|
3
|
+
import { useIsInitialBrowseLoading as m } from "../hooks/use-is-initial-browse-loading.js";
|
|
4
|
+
import { messages as a } from "./messages.js";
|
|
5
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { useConsumerState as p, useBrowserActions as u } from "../contexts/hooks.js";
|
|
7
|
+
import { BreadcrumbNavigation as h } from "./breadcrumb-navigation/breadcrumb-navigation.js";
|
|
8
|
+
import { MetadataTemplateBrowserListBox as I } from "./metadata-template-browser-list-box/metadata-template-browser-list-box.js";
|
|
9
|
+
import '../../../styles/metadata-template-browser-container.css';const d = "_container_qa97y_1", f = "_searchInput_qa97y_9", s = {
|
|
10
|
+
container: d,
|
|
11
|
+
searchInput: f
|
|
12
|
+
};
|
|
13
|
+
function x() {
|
|
14
|
+
const {
|
|
15
|
+
formatMessage: e
|
|
16
|
+
} = c(), {
|
|
17
|
+
isDisabled: o
|
|
18
|
+
} = p(), {
|
|
19
|
+
setSearchValue: n
|
|
20
|
+
} = u(), t = m();
|
|
21
|
+
return /* @__PURE__ */ l("div", {
|
|
22
|
+
className: s.container,
|
|
23
|
+
children: [/* @__PURE__ */ r(i, {
|
|
24
|
+
className: s.searchInput,
|
|
25
|
+
disabled: o || t,
|
|
26
|
+
onChange: n,
|
|
27
|
+
placeholder: e(a.searchInputPlaceholder),
|
|
28
|
+
searchInputAriaLabel: e(a.searchInputAriaLabel),
|
|
29
|
+
searchInputClearAriaLabel: e(a.searchInputClearAriaLabel)
|
|
30
|
+
}), !t && /* @__PURE__ */ r(h, {}), /* @__PURE__ */ r(I, {})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
x as MetadataTemplateBrowserContainer
|
|
35
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MetadataTemplateBrowserContainer as g } from "./metadata-template-browser-container.js";
|
|
2
|
+
import { EmptyState as E, Text as B } from "@box/blueprint-web";
|
|
3
|
+
import { NoTemplates as L } from "@box/blueprint-web-assets/illustrations/Medium";
|
|
4
|
+
import { useRef as w, useEffect as S } from "react";
|
|
5
|
+
import { useIntl as x } from "react-intl";
|
|
6
|
+
import { messages as a } from "./messages.js";
|
|
7
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
8
|
+
import { useConsumerState as I, useBrowserActions as R, useNavigationState as T, useBrowseState as M } from "../contexts/hooks.js";
|
|
9
|
+
import { ErrorState as N } from "./error-state/error-state.js";
|
|
10
|
+
import "./breadcrumb-navigation/breadcrumb-navigation.js";
|
|
11
|
+
import "./browse-list/browse-list.js";
|
|
12
|
+
import "./search-list/search-list.js";
|
|
13
|
+
import "./loader-skeleton/loader-skeleton.js";
|
|
14
|
+
import "./metadata-template-browser-list-box/metadata-template-browser-list-box.js";
|
|
15
|
+
import "./namespace-row/namespace-row.js";
|
|
16
|
+
import "./template-row/template-row.js";
|
|
17
|
+
import "./virtualized-grid-list/virtualized-grid-list.js";
|
|
18
|
+
import '../../../styles/metadata-template-browser-controller.css';const _ = "_container_14phx_1", b = {
|
|
19
|
+
container: _
|
|
20
|
+
};
|
|
21
|
+
function W() {
|
|
22
|
+
const {
|
|
23
|
+
isLoading: o
|
|
24
|
+
} = I(), {
|
|
25
|
+
formatMessage: e
|
|
26
|
+
} = x(), {
|
|
27
|
+
initialLoad: s,
|
|
28
|
+
retry: m
|
|
29
|
+
} = R(), {
|
|
30
|
+
path: p
|
|
31
|
+
} = T(), {
|
|
32
|
+
isFetching: l,
|
|
33
|
+
initialLoadError: c,
|
|
34
|
+
namespaces: d,
|
|
35
|
+
templates: f
|
|
36
|
+
} = M(), i = w(!1);
|
|
37
|
+
S(() => {
|
|
38
|
+
!o && !i.current && (i.current = !0, s());
|
|
39
|
+
}, [o, s]);
|
|
40
|
+
const u = d.length > 0 || f.length > 0, r = c !== null, h = p.length === 0, n = !l && !o && !u && !r && h, y = !r && !n;
|
|
41
|
+
return /* @__PURE__ */ C("div", {
|
|
42
|
+
className: b.container,
|
|
43
|
+
children: [r && /* @__PURE__ */ t(N, {
|
|
44
|
+
body: e(a.initialLoadErrorBody),
|
|
45
|
+
onRetry: m
|
|
46
|
+
}), n && /* @__PURE__ */ t(E, {
|
|
47
|
+
body: /* @__PURE__ */ t(B, {
|
|
48
|
+
as: "p",
|
|
49
|
+
children: e(a.initialEmptyStateBody)
|
|
50
|
+
}),
|
|
51
|
+
illustration: L,
|
|
52
|
+
size: "small"
|
|
53
|
+
}), y && /* @__PURE__ */ t(g, {})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
W as MetadataTemplateBrowserController
|
|
58
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import x from "clsx";
|
|
2
|
+
import { useCallback as _, useMemo as g } from "react";
|
|
3
|
+
import { useIsInitialBrowseLoading as L } from "../../hooks/use-is-initial-browse-loading.js";
|
|
4
|
+
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
5
|
+
import { useConsumerState as A, useSearchState as I, useBrowseState as N, useSelectionState as T, useBrowserActions as W } from "../../contexts/hooks.js";
|
|
6
|
+
import { LoaderSkeleton as q } from "../loader-skeleton/loader-skeleton.js";
|
|
7
|
+
import { BrowseList as j } from "../browse-list/browse-list.js";
|
|
8
|
+
import { SearchList as k } from "../search-list/search-list.js";
|
|
9
|
+
import '../../../../styles/metadata-template-browser-list-box.css';const y = "_listBox_1qbmg_1", C = "_browseWrapper_1qbmg_9", M = "_hidden_1qbmg_16", o = {
|
|
10
|
+
listBox: y,
|
|
11
|
+
browseWrapper: C,
|
|
12
|
+
hidden: M
|
|
13
|
+
};
|
|
14
|
+
function H() {
|
|
15
|
+
const {
|
|
16
|
+
isDisabled: a
|
|
17
|
+
} = A(), w = L(), {
|
|
18
|
+
searchValue: B,
|
|
19
|
+
searchResults: c
|
|
20
|
+
} = I(), {
|
|
21
|
+
namespaces: l,
|
|
22
|
+
templates: m
|
|
23
|
+
} = N(), {
|
|
24
|
+
selectedTemplateId: i
|
|
25
|
+
} = T(), {
|
|
26
|
+
selectTemplate: r,
|
|
27
|
+
navigateTo: d
|
|
28
|
+
} = W(), t = B.length > 0, p = _((S) => {
|
|
29
|
+
if (a)
|
|
30
|
+
return;
|
|
31
|
+
const n = String(S);
|
|
32
|
+
if (t) {
|
|
33
|
+
const e = c.find((b) => b.id === n);
|
|
34
|
+
e && r(e);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const u = m.find((e) => e.id === n);
|
|
38
|
+
if (u) {
|
|
39
|
+
r(u);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const h = l.find((e) => e.id === n);
|
|
43
|
+
h && d(h);
|
|
44
|
+
}, [a, t, c, m, l, r, d]), f = g(() => i ? /* @__PURE__ */ new Set([i]) : /* @__PURE__ */ new Set(), [i]);
|
|
45
|
+
return w ? /* @__PURE__ */ s("div", {
|
|
46
|
+
className: o.listBox,
|
|
47
|
+
children: /* @__PURE__ */ s(q, {})
|
|
48
|
+
}) : /* @__PURE__ */ v("div", {
|
|
49
|
+
className: o.listBox,
|
|
50
|
+
children: [/* @__PURE__ */ s("div", {
|
|
51
|
+
"aria-hidden": t,
|
|
52
|
+
className: x(o.browseWrapper, t && o.hidden),
|
|
53
|
+
children: /* @__PURE__ */ s(j, {
|
|
54
|
+
onAction: p,
|
|
55
|
+
selectedKeys: f
|
|
56
|
+
})
|
|
57
|
+
}), t && /* @__PURE__ */ s(k, {
|
|
58
|
+
onAction: p,
|
|
59
|
+
selectedKeys: f
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
H as MetadataTemplateBrowserListBox
|
|
65
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const s = e({
|
|
3
|
+
navigateAriaLabel: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.namespaceRow.navigateAriaLabel",
|
|
5
|
+
defaultMessage: "Navigate into {displayName}"
|
|
6
|
+
}
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
s as messages
|
|
10
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IconButton as e } from "@box/blueprint-web";
|
|
2
|
+
import { ChevronRight as a, Folder as m } from "@box/blueprint-web-assets/icons/Medium";
|
|
3
|
+
import { useIntl as s } from "react-intl";
|
|
4
|
+
import { messages as l } from "./messages.js";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { useConsumerState as n } from "../../contexts/hooks.js";
|
|
7
|
+
import { BrowserRow as d } from "../browser-row/browser-row.js";
|
|
8
|
+
function w({
|
|
9
|
+
namespace: o
|
|
10
|
+
}) {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage: r
|
|
13
|
+
} = s(), {
|
|
14
|
+
isDisabled: t
|
|
15
|
+
} = n();
|
|
16
|
+
return /* @__PURE__ */ i(d, {
|
|
17
|
+
id: o.id,
|
|
18
|
+
leadingIcon: /* @__PURE__ */ i(m, {}),
|
|
19
|
+
title: o.displayName,
|
|
20
|
+
trailingSlot: /* @__PURE__ */ i(e, {
|
|
21
|
+
"aria-label": r(l.navigateAriaLabel, {
|
|
22
|
+
displayName: o.displayName
|
|
23
|
+
}),
|
|
24
|
+
disabled: t,
|
|
25
|
+
icon: a,
|
|
26
|
+
size: "x-small"
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
w as NamespaceRow
|
|
32
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const t = e({
|
|
3
|
+
listAriaLabel: {
|
|
4
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.searchList.listAriaLabel",
|
|
5
|
+
defaultMessage: "Search results"
|
|
6
|
+
},
|
|
7
|
+
emptyStateHeading: {
|
|
8
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.searchList.emptyStateHeading",
|
|
9
|
+
defaultMessage: "We couldn't find what you're looking for"
|
|
10
|
+
},
|
|
11
|
+
emptyStateBody: {
|
|
12
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.searchList.emptyStateBody",
|
|
13
|
+
defaultMessage: "Try using simpler search terms and then filtering the results."
|
|
14
|
+
},
|
|
15
|
+
searchErrorBody: {
|
|
16
|
+
id: "groupSharedFeatures.metadataTemplateBrowser.searchList.searchErrorBody",
|
|
17
|
+
defaultMessage: "Something went wrong while searching."
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
t as messages
|
|
22
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { EmptyState as T, Text as m } from "@box/blueprint-web";
|
|
2
|
+
import { CustomTemplate as E } from "@box/blueprint-web-assets/illustrations/Small";
|
|
3
|
+
import { useCallback as L } from "react";
|
|
4
|
+
import { useIntl as b } from "react-intl";
|
|
5
|
+
import { T as n } from "../../../../chunks/types.js";
|
|
6
|
+
import { messages as o } from "./messages.js";
|
|
7
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
+
import { useSearchState as R, useBrowseState as w, useBrowserActions as x } from "../../contexts/hooks.js";
|
|
9
|
+
import { TemplateRow as B } from "../template-row/template-row.js";
|
|
10
|
+
import { LoaderSkeleton as I } from "../loader-skeleton/loader-skeleton.js";
|
|
11
|
+
import { ErrorState as k } from "../error-state/error-state.js";
|
|
12
|
+
import { VirtualizedGridList as v } from "../virtualized-grid-list/virtualized-grid-list.js";
|
|
13
|
+
function K({
|
|
14
|
+
onAction: l,
|
|
15
|
+
selectedKeys: c
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
formatMessage: e
|
|
19
|
+
} = b(), {
|
|
20
|
+
searchResults: a,
|
|
21
|
+
searchNextMarker: p,
|
|
22
|
+
isFetchingSearch: d,
|
|
23
|
+
searchError: h
|
|
24
|
+
} = R(), {
|
|
25
|
+
isFetchingMore: f,
|
|
26
|
+
loadMoreError: u
|
|
27
|
+
} = w(), {
|
|
28
|
+
loadMore: i,
|
|
29
|
+
retry: S,
|
|
30
|
+
editTemplate: s
|
|
31
|
+
} = x(), y = p !== void 0, M = L((t) => /* @__PURE__ */ r(B, {
|
|
32
|
+
onEdit: s,
|
|
33
|
+
template: t.template,
|
|
34
|
+
variant: n.Search
|
|
35
|
+
}), [s]);
|
|
36
|
+
if (d)
|
|
37
|
+
return /* @__PURE__ */ r(I, {});
|
|
38
|
+
if (h !== null)
|
|
39
|
+
return /* @__PURE__ */ r(k, {
|
|
40
|
+
body: e(o.searchErrorBody),
|
|
41
|
+
onRetry: S
|
|
42
|
+
});
|
|
43
|
+
if (a.length === 0)
|
|
44
|
+
return /* @__PURE__ */ r(T, {
|
|
45
|
+
body: /* @__PURE__ */ r(m, {
|
|
46
|
+
as: "p",
|
|
47
|
+
children: e(o.emptyStateBody)
|
|
48
|
+
}),
|
|
49
|
+
heading: /* @__PURE__ */ r(m, {
|
|
50
|
+
as: "p",
|
|
51
|
+
children: e(o.emptyStateHeading)
|
|
52
|
+
}),
|
|
53
|
+
illustration: E,
|
|
54
|
+
size: "small"
|
|
55
|
+
});
|
|
56
|
+
const g = a.map((t) => ({
|
|
57
|
+
id: t.id,
|
|
58
|
+
template: t
|
|
59
|
+
}));
|
|
60
|
+
return /* @__PURE__ */ r(v, {
|
|
61
|
+
ariaLabel: e(o.listAriaLabel),
|
|
62
|
+
isFetchingMore: f,
|
|
63
|
+
items: g,
|
|
64
|
+
listType: n.Search,
|
|
65
|
+
loadMoreError: u,
|
|
66
|
+
onAction: l,
|
|
67
|
+
hasMoreItems: y,
|
|
68
|
+
onLoadMore: i,
|
|
69
|
+
onRetry: i,
|
|
70
|
+
selectedKeys: c,
|
|
71
|
+
children: M
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
K as SearchList
|
|
76
|
+
};
|