@box/unified-share-modal 2.12.14 → 2.12.16

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 (95) hide show
  1. package/dist/chunks/classification-status.js +62 -0
  2. package/dist/chunks/collaboration-role.js +89 -0
  3. package/dist/chunks/collaboration-section.js +156 -0
  4. package/dist/chunks/collaborator-list-item.js +61 -0
  5. package/dist/chunks/collaborator-list.js +74 -0
  6. package/dist/chunks/remove-collaborator-modal.js +61 -0
  7. package/dist/chunks/remove-shared-link-modal.js +56 -0
  8. package/dist/chunks/shared-link-access.js +65 -0
  9. package/dist/chunks/shared-link-permission.js +67 -0
  10. package/dist/chunks/shared-link-section.js +176 -0
  11. package/dist/chunks/shared-link-settings-modal.js +86 -0
  12. package/dist/chunks/shared-with-avatars.js +48 -0
  13. package/dist/chunks/shield-restriction-notice.js +97 -0
  14. package/dist/chunks/text-area-container.js +36 -0
  15. package/dist/chunks/unified-share-form-modal.js +66 -0
  16. package/dist/chunks/unified-share-form.js +23 -0
  17. package/dist/esm/index.js +2 -4
  18. package/dist/esm/lib/components/classification-status/classification-status.js +2 -80
  19. package/dist/esm/lib/components/classification-status/index.js +2 -4
  20. package/dist/esm/lib/components/classification-status/messages.js +10 -12
  21. package/dist/esm/lib/components/index.js +5 -10
  22. package/dist/esm/lib/components/remove-collaborator-modal/index.js +2 -4
  23. package/dist/esm/lib/components/remove-collaborator-modal/messages.js +26 -28
  24. package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +2 -84
  25. package/dist/esm/lib/components/remove-shared-link-modal/index.js +2 -4
  26. package/dist/esm/lib/components/remove-shared-link-modal/messages.js +26 -28
  27. package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +2 -72
  28. package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +35 -61
  29. package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +33 -50
  30. package/dist/esm/lib/components/shared-link-settings-modal/index.js +2 -4
  31. package/dist/esm/lib/components/shared-link-settings-modal/messages.js +138 -144
  32. package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +32 -52
  33. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +2 -98
  34. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +97 -126
  35. package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +33 -47
  36. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +2 -128
  37. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +2 -202
  38. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +2 -4
  39. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +134 -136
  40. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +2 -67
  41. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +2 -134
  42. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +2 -53
  43. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +48 -60
  44. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +2 -86
  45. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +2 -101
  46. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +2 -4
  47. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +38 -40
  48. package/dist/esm/lib/components/unified-share-form-modal/index.js +2 -4
  49. package/dist/esm/lib/components/unified-share-form-modal/messages.js +46 -48
  50. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +2 -4
  51. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +142 -144
  52. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +2 -102
  53. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +2 -105
  54. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +2 -191
  55. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +2 -85
  56. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +2 -29
  57. package/dist/esm/lib/constants.js +44 -28
  58. package/dist/esm/lib/contexts/index.js +4 -14
  59. package/dist/esm/lib/contexts/shared-link-settings-context.js +50 -59
  60. package/dist/esm/lib/contexts/unified-share-form-context.js +60 -57
  61. package/dist/esm/lib/contexts/unified-share-modal-context.js +65 -68
  62. package/dist/esm/lib/hooks/index.js +7 -14
  63. package/dist/esm/lib/hooks/use-access-levels.js +69 -93
  64. package/dist/esm/lib/hooks/use-collaboration-form.js +75 -95
  65. package/dist/esm/lib/hooks/use-form-validation.js +32 -43
  66. package/dist/esm/lib/hooks/use-link-settings-form.js +49 -64
  67. package/dist/esm/lib/hooks/use-permission-levels.js +33 -50
  68. package/dist/esm/lib/hooks/use-sharing-action.js +44 -59
  69. package/dist/esm/lib/messages.js +106 -108
  70. package/dist/esm/lib/unified-share-base.js +30 -40
  71. package/dist/esm/lib/unified-share-modal.js +41 -59
  72. package/dist/esm/lib/utils/collaborator.js +12 -27
  73. package/dist/esm/lib/utils/date.js +10 -14
  74. package/dist/esm/lib/utils/email.js +5 -7
  75. package/dist/esm/lib/utils/event.js +6 -13
  76. package/dist/esm/lib/utils/form.js +4 -14
  77. package/dist/esm/lib/utils/index.js +9 -34
  78. package/dist/esm/lib/utils/notification.js +19 -28
  79. package/dist/esm/lib/utils/permission.js +15 -22
  80. package/dist/esm/lib/utils/validation.js +2 -11
  81. package/dist/styles/classification-status.css +1 -1
  82. package/dist/styles/collaboration-role.css +1 -1
  83. package/dist/styles/collaboration-section.css +1 -1
  84. package/dist/styles/collaborator-list-item.css +1 -1
  85. package/dist/styles/collaborator-list.css +1 -1
  86. package/dist/styles/remove-collaborator-modal.css +1 -1
  87. package/dist/styles/shared-link-access.css +1 -1
  88. package/dist/styles/shared-link-section.css +1 -1
  89. package/dist/styles/shared-link-settings-modal.css +1 -1
  90. package/dist/styles/shared-with-avatars.css +1 -1
  91. package/dist/styles/shield-restriction-notice.css +1 -1
  92. package/dist/styles/text-area-container.css +1 -1
  93. package/dist/styles/unified-share-form-modal.css +1 -1
  94. package/dist/styles/unified-share-form.css +1 -1
  95. package/package.json +10 -10
@@ -1,80 +1,2 @@
1
- import { useIntl as u } from "react-intl";
2
- import { CardTooltip as _, Status as l, Text as e } from "@box/blueprint-web";
3
- import { Shield as d } from "@box/blueprint-web-assets/icons/Line";
4
- import h from "./messages.js";
5
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
6
- import { useUnifiedShareModalContext as v } from "../../contexts/unified-share-modal-context.js";
7
- import '../../../../styles/classification-status.css';const x = "_container_1dpzl_1", b = "_tooltip_1dpzl_5", y = "_header_1dpzl_11", z = "_content_1dpzl_17", n = {
8
- container: x,
9
- tooltip: b,
10
- header: y,
11
- content: z
12
- };
13
- function T() {
14
- const {
15
- formatMessage: i
16
- } = u(), {
17
- item: m
18
- } = v(), {
19
- classification: r
20
- } = m;
21
- if (!r)
22
- return null;
23
- const {
24
- colorId: p,
25
- definition: f,
26
- name: s,
27
- restrictions: a
28
- } = r, c = p + 1;
29
- return /* @__PURE__ */ t("div", {
30
- className: n.container,
31
- children: /* @__PURE__ */ t(_, {
32
- content: /* @__PURE__ */ o("div", {
33
- className: n.tooltip,
34
- children: [/* @__PURE__ */ o("div", {
35
- className: n.header,
36
- children: [/* @__PURE__ */ t(l, {
37
- colorIndex: c,
38
- hideText: !0,
39
- icon: d,
40
- text: ""
41
- }), /* @__PURE__ */ t(e, {
42
- as: "h3",
43
- variant: "bodyDefaultBold",
44
- children: s
45
- })]
46
- }), /* @__PURE__ */ o("div", {
47
- className: n.content,
48
- children: [/* @__PURE__ */ o("div", {
49
- children: [/* @__PURE__ */ t(e, {
50
- as: "h4",
51
- variant: "bodyDefaultBold",
52
- children: i(h.definitionLabel)
53
- }), /* @__PURE__ */ t(e, {
54
- as: "p",
55
- children: f
56
- })]
57
- }), a && /* @__PURE__ */ o("div", {
58
- children: [/* @__PURE__ */ t(e, {
59
- as: "h4",
60
- variant: "bodyDefaultBold",
61
- children: i(h.restrictionsLabel)
62
- }), /* @__PURE__ */ t(e, {
63
- as: "p",
64
- children: a
65
- })]
66
- })]
67
- })]
68
- }),
69
- children: /* @__PURE__ */ t(l, {
70
- colorIndex: c,
71
- icon: d,
72
- iconPosition: "left",
73
- text: s.toUpperCase()
74
- })
75
- })
76
- });
77
- }
78
- export {
79
- T as ClassificationStatus
80
- };
1
+ import { t as e } from "../../../../chunks/classification-status.js";
2
+ export { e as ClassificationStatus };
@@ -1,4 +1,2 @@
1
- import { ClassificationStatus as i } from "./classification-status.js";
2
- export {
3
- i as ClassificationStatus
4
- };
1
+ import { t as e } from "../../../../chunks/classification-status.js";
2
+ export { e as ClassificationStatus };
@@ -1,14 +1,12 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const i = e({
3
- definitionLabel: {
4
- id: "groupSharedFeatures.usm.classificationStatus.definitionLabel",
5
- defaultMessage: "Definition"
6
- },
7
- restrictionsLabel: {
8
- id: "groupSharedFeatures.usm.classificationStatus.restrictionsLabel",
9
- defaultMessage: "Restrictions"
10
- }
2
+ var t = e({
3
+ definitionLabel: {
4
+ id: "groupSharedFeatures.usm.classificationStatus.definitionLabel",
5
+ defaultMessage: "Definition"
6
+ },
7
+ restrictionsLabel: {
8
+ id: "groupSharedFeatures.usm.classificationStatus.restrictionsLabel",
9
+ defaultMessage: "Restrictions"
10
+ }
11
11
  });
12
- export {
13
- i as default
14
- };
12
+ export { t as default };
@@ -1,10 +1,5 @@
1
- import { RemoveCollaboratorModal as e } from "./remove-collaborator-modal/remove-collaborator-modal.js";
2
- import { RemoveSharedLinkModal as d } from "./remove-shared-link-modal/remove-shared-link-modal.js";
3
- import { SharedLinkSettingsModal as t } from "./shared-link-settings-modal/shared-link-settings-modal.js";
4
- import { UnifiedShareFormModal as f } from "./unified-share-form-modal/unified-share-form-modal.js";
5
- export {
6
- e as RemoveCollaboratorModal,
7
- d as RemoveSharedLinkModal,
8
- t as SharedLinkSettingsModal,
9
- f as UnifiedShareFormModal
10
- };
1
+ import { t as e } from "../../../chunks/remove-collaborator-modal.js";
2
+ import { t } from "../../../chunks/remove-shared-link-modal.js";
3
+ import { t as n } from "../../../chunks/shared-link-settings-modal.js";
4
+ import { t as r } from "../../../chunks/unified-share-form-modal.js";
5
+ export { e as RemoveCollaboratorModal, t as RemoveSharedLinkModal, n as SharedLinkSettingsModal, r as UnifiedShareFormModal };
@@ -1,4 +1,2 @@
1
- import { RemoveCollaboratorModal as a } from "./remove-collaborator-modal.js";
2
- export {
3
- a as RemoveCollaboratorModal
4
- };
1
+ import { t as e } from "../../../../chunks/remove-collaborator-modal.js";
2
+ export { e as RemoveCollaboratorModal };
@@ -1,30 +1,28 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const a = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.removeCollaboratorModal.title",
5
- defaultMessage: "Remove Collaborator"
6
- },
7
- bodyText: {
8
- id: "groupSharedFeatures.usm.removeCollaboratorModal.bodyText",
9
- defaultMessage: "Are you sure you want to remove {name} as a collaborator?"
10
- },
11
- cancelButton: {
12
- id: "groupSharedFeatures.usm.removeCollaboratorModal.cancelButton",
13
- defaultMessage: "Cancel"
14
- },
15
- closeButton: {
16
- id: "groupSharedFeatures.usm.removeCollaboratorModal.closeButton",
17
- defaultMessage: "Close"
18
- },
19
- loadingLabel: {
20
- id: "groupSharedFeatures.usm.removeCollaboratorModal.loadingLabel",
21
- defaultMessage: "Loading"
22
- },
23
- okayButton: {
24
- id: "groupSharedFeatures.usm.removeCollaboratorModal.okayButton",
25
- defaultMessage: "Okay"
26
- }
2
+ var t = e({
3
+ title: {
4
+ id: "groupSharedFeatures.usm.removeCollaboratorModal.title",
5
+ defaultMessage: "Remove Collaborator"
6
+ },
7
+ bodyText: {
8
+ id: "groupSharedFeatures.usm.removeCollaboratorModal.bodyText",
9
+ defaultMessage: "Are you sure you want to remove {name} as a collaborator?"
10
+ },
11
+ cancelButton: {
12
+ id: "groupSharedFeatures.usm.removeCollaboratorModal.cancelButton",
13
+ defaultMessage: "Cancel"
14
+ },
15
+ closeButton: {
16
+ id: "groupSharedFeatures.usm.removeCollaboratorModal.closeButton",
17
+ defaultMessage: "Close"
18
+ },
19
+ loadingLabel: {
20
+ id: "groupSharedFeatures.usm.removeCollaboratorModal.loadingLabel",
21
+ defaultMessage: "Loading"
22
+ },
23
+ okayButton: {
24
+ id: "groupSharedFeatures.usm.removeCollaboratorModal.okayButton",
25
+ defaultMessage: "Okay"
26
+ }
27
27
  });
28
- export {
29
- a as default
30
- };
28
+ export { t as default };
@@ -1,84 +1,2 @@
1
- import C from "clsx";
2
- import F from "lodash/noop";
3
- import { useEffect as x } from "react";
4
- import { useIntl as B } from "react-intl";
5
- import { Modal as o, Divider as S, Text as M } from "@box/blueprint-web";
6
- import r from "./messages.js";
7
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
8
- import { useUnifiedShareModalContext as k } from "../../contexts/unified-share-modal-context.js";
9
- import { useSharingAction as D } from "../../hooks/use-sharing-action.js";
10
- import '../../../../styles/remove-collaborator-modal.css';const P = "_content_166yb_1", w = "_isFullscreen_166yb_1", A = "_body_166yb_10", N = "_divider_166yb_17", i = {
11
- content: P,
12
- isFullscreen: w,
13
- body: A,
14
- divider: N
15
- };
16
- function q({
17
- isOpen: l,
18
- onOpenChange: a
19
- }) {
20
- const {
21
- formatMessage: t
22
- } = B(), {
23
- collaborator: d,
24
- isSubmitting: n,
25
- sharingService: b,
26
- setCollaborator: m,
27
- variant: u
28
- } = k(), {
29
- email: f,
30
- name: y
31
- } = d ?? {}, {
32
- removeCollaborator: p
33
- } = b, s = u === "desktop";
34
- x(() => {
35
- l || m(null);
36
- }, [l, m]);
37
- const {
38
- onAction: v
39
- } = D(p, "remove-collaborator"), h = async () => {
40
- await v(d), a(!1);
41
- }, _ = (g) => {
42
- g.preventDefault();
43
- };
44
- return /* @__PURE__ */ e(o, {
45
- onOpenChange: n ? F : a,
46
- open: l,
47
- children: /* @__PURE__ */ c(o.Content, {
48
- className: C(i.content, s && i.isFullscreen),
49
- onPointerDownOutside: _,
50
- size: "small",
51
- children: [/* @__PURE__ */ e(o.Header, {
52
- children: t(r.title)
53
- }), /* @__PURE__ */ c(o.Body, {
54
- className: i.body,
55
- children: [s && /* @__PURE__ */ e(S, {
56
- className: i.divider
57
- }), /* @__PURE__ */ e(M, {
58
- as: "p",
59
- children: t(r.bodyText, {
60
- name: f || y
61
- })
62
- })]
63
- }), /* @__PURE__ */ c(o.Footer, {
64
- children: [/* @__PURE__ */ e(o.Footer.SecondaryButton, {
65
- disabled: n,
66
- onClick: () => a(!1),
67
- children: t(r.cancelButton)
68
- }), /* @__PURE__ */ e(o.Footer.PrimaryButton, {
69
- "data-target-id": "Modal.Footer.PrimaryButton-USMRemoveCollaborator",
70
- loading: n,
71
- loadingAriaLabel: t(r.loadingLabel),
72
- onClick: h,
73
- children: t(r.okayButton)
74
- })]
75
- }), !s && /* @__PURE__ */ e(o.Close, {
76
- "aria-label": t(r.closeButton),
77
- disabled: n
78
- })]
79
- })
80
- });
81
- }
82
- export {
83
- q as RemoveCollaboratorModal
84
- };
1
+ import { t as e } from "../../../../chunks/remove-collaborator-modal.js";
2
+ export { e as RemoveCollaboratorModal };
@@ -1,4 +1,2 @@
1
- import { RemoveSharedLinkModal as r } from "./remove-shared-link-modal.js";
2
- export {
3
- r as RemoveSharedLinkModal
4
- };
1
+ import { t as e } from "../../../../chunks/remove-shared-link-modal.js";
2
+ export { e as RemoveSharedLinkModal };
@@ -1,30 +1,28 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const o = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.removeSharedLinkModal.title",
5
- defaultMessage: "Remove Shared Link"
6
- },
7
- bodyText: {
8
- id: "groupSharedFeatures.usm.removeSharedLinkModal.bodyText",
9
- defaultMessage: "This will permanently remove the shared link. If this item is embedded on other sites it will also become inaccessible. Any custom properties, settings and expirations will be removed as well. Do you want to continue?"
10
- },
11
- cancelButton: {
12
- id: "groupSharedFeatures.usm.removeSharedLinkModal.cancelButton",
13
- defaultMessage: "Cancel"
14
- },
15
- closeButton: {
16
- id: "groupSharedFeatures.usm.removeSharedLinkModal.closeButton",
17
- defaultMessage: "Close"
18
- },
19
- loadingLabel: {
20
- id: "groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel",
21
- defaultMessage: "Loading"
22
- },
23
- okayButton: {
24
- id: "groupSharedFeatures.usm.removeSharedLinkModal.okayButton",
25
- defaultMessage: "Okay"
26
- }
2
+ var t = e({
3
+ title: {
4
+ id: "groupSharedFeatures.usm.removeSharedLinkModal.title",
5
+ defaultMessage: "Remove Shared Link"
6
+ },
7
+ bodyText: {
8
+ id: "groupSharedFeatures.usm.removeSharedLinkModal.bodyText",
9
+ defaultMessage: "This will permanently remove the shared link. If this item is embedded on other sites it will also become inaccessible. Any custom properties, settings and expirations will be removed as well. Do you want to continue?"
10
+ },
11
+ cancelButton: {
12
+ id: "groupSharedFeatures.usm.removeSharedLinkModal.cancelButton",
13
+ defaultMessage: "Cancel"
14
+ },
15
+ closeButton: {
16
+ id: "groupSharedFeatures.usm.removeSharedLinkModal.closeButton",
17
+ defaultMessage: "Close"
18
+ },
19
+ loadingLabel: {
20
+ id: "groupSharedFeatures.usm.removeSharedLinkModal.loadingLabel",
21
+ defaultMessage: "Loading"
22
+ },
23
+ okayButton: {
24
+ id: "groupSharedFeatures.usm.removeSharedLinkModal.okayButton",
25
+ defaultMessage: "Okay"
26
+ }
27
27
  });
28
- export {
29
- o as default
30
- };
28
+ export { t as default };
@@ -1,72 +1,2 @@
1
- import p from "clsx";
2
- import _ from "lodash/noop";
3
- import { useIntl as v } from "react-intl";
4
- import { Modal as e, Divider as S, Text as k } from "@box/blueprint-web";
5
- import n from "./messages.js";
6
- import { jsx as o, jsxs as a } from "react/jsx-runtime";
7
- import { useUnifiedShareModalContext as g } from "../../contexts/unified-share-modal-context.js";
8
- import { useSharingAction as F } from "../../hooks/use-sharing-action.js";
9
- import '../../../../styles/remove-collaborator-modal.css';const x = "_content_166yb_1", B = "_isFullscreen_166yb_1", D = "_body_166yb_10", M = "_divider_166yb_17", r = {
10
- content: x,
11
- isFullscreen: B,
12
- body: D,
13
- divider: M
14
- };
15
- function T({
16
- isOpen: d,
17
- onOpenChange: s
18
- }) {
19
- const {
20
- formatMessage: t
21
- } = v(), {
22
- isSubmitting: i,
23
- sharingService: c,
24
- variant: m
25
- } = g(), {
26
- deleteSharedLink: u
27
- } = c, l = m === "desktop", {
28
- onAction: b
29
- } = F(u, "delete-shared-link"), h = async () => {
30
- await b(), s(!1);
31
- }, y = (f) => {
32
- f.preventDefault();
33
- };
34
- return /* @__PURE__ */ o(e, {
35
- onOpenChange: i ? _ : s,
36
- open: d,
37
- children: /* @__PURE__ */ a(e.Content, {
38
- className: p(r.content, l && r.isFullscreen),
39
- onPointerDownOutside: y,
40
- size: "small",
41
- children: [/* @__PURE__ */ o(e.Header, {
42
- children: t(n.title)
43
- }), /* @__PURE__ */ a(e.Body, {
44
- className: r.body,
45
- children: [l && /* @__PURE__ */ o(S, {
46
- className: r.divider
47
- }), /* @__PURE__ */ o(k, {
48
- as: "p",
49
- children: t(n.bodyText)
50
- })]
51
- }), /* @__PURE__ */ a(e.Footer, {
52
- children: [/* @__PURE__ */ o(e.Footer.SecondaryButton, {
53
- disabled: i,
54
- onClick: () => s(!1),
55
- children: t(n.cancelButton)
56
- }), /* @__PURE__ */ o(e.Footer.PrimaryButton, {
57
- "data-target-id": "Modal.Footer.PrimaryButton-USMRemoveSharedLink",
58
- loading: i,
59
- loadingAriaLabel: t(n.loadingLabel),
60
- onClick: h,
61
- children: t(n.okayButton)
62
- })]
63
- }), !l && /* @__PURE__ */ o(e.Close, {
64
- "aria-label": t(n.closeButton),
65
- disabled: i
66
- })]
67
- })
68
- });
69
- }
70
- export {
71
- T as RemoveSharedLinkModal
72
- };
1
+ import { t as e } from "../../../../chunks/remove-shared-link-modal.js";
2
+ export { e as RemoveSharedLinkModal };
@@ -1,62 +1,36 @@
1
- import { useIntl as b } from "react-intl";
2
- import { Tooltip as w, Focusable as y, Switch as m } from "@box/blueprint-web";
3
- import { CopyInput as B } from "@box/copy-input";
4
- import e from "./messages.js";
5
- import { jsx as o, jsxs as C, Fragment as x } from "react/jsx-runtime";
6
- import { useUnifiedShareModalContext as S } from "../../contexts/unified-share-modal-context.js";
7
- function j({
8
- canChange: k,
9
- isAvailable: f,
10
- isChecked: n,
11
- isDisabled: s,
12
- onToggle: c
13
- }) {
14
- const {
15
- formatMessage: t
16
- } = b(), {
17
- item: u,
18
- sharedLink: g
19
- } = S(), {
20
- classification: p
21
- } = u, {
22
- downloadUrl: l,
23
- directLinkBlockedReason: a,
24
- settings: h = {}
25
- } = g, {
26
- isDirectLinkAvailable: d
27
- } = h, r = /* @__PURE__ */ o(B, {
28
- disabled: s,
29
- label: t(e.directLinkLabel),
30
- value: l
31
- });
32
- if (!f)
33
- return l && d ? r : null;
34
- let i;
35
- a === "malicious_content" ? i = t(e.directLinkBlockedByMaliciousContent) : a === "access_policy" && (i = t(p ? e.directLinkBlockedByAccessPolicyWithClassification : e.directLinkBlockedByAccessPolicyWithoutClassification));
36
- const L = n && !!l && d && !i;
37
- return /* @__PURE__ */ C(x, {
38
- children: [i ? /* @__PURE__ */ o(w, {
39
- content: i,
40
- "data-testid": "usm-DownloadSettings-tooltip",
41
- side: "left",
42
- children: /* @__PURE__ */ o(y, {
43
- children: /* @__PURE__ */ o(m.Item, {
44
- checked: n,
45
- disabled: !0,
46
- label: t(e.downloadSettingsToggleText),
47
- onCheckedChange: c,
48
- value: "download-link-settings"
49
- })
50
- })
51
- }) : /* @__PURE__ */ o(m.Item, {
52
- checked: n,
53
- disabled: s || !k,
54
- label: t(e.downloadSettingsToggleText),
55
- onCheckedChange: c,
56
- value: "download-link-settings"
57
- }), L && r]
58
- });
1
+ import { useUnifiedShareModalContext as e } from "../../contexts/unified-share-modal-context.js";
2
+ import t from "./messages.js";
3
+ import { useIntl as n } from "react-intl";
4
+ import { Focusable as r, Switch as i, Tooltip as a } from "@box/blueprint-web";
5
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import { CopyInput as l } from "@box/copy-input";
7
+ function u({ canChange: u, isAvailable: d, isChecked: f, isDisabled: p, onToggle: m }) {
8
+ let { formatMessage: h } = n(), { item: g, sharedLink: _ } = e(), { classification: v } = g, { downloadUrl: y, directLinkBlockedReason: b, settings: x = {} } = _, { isDirectLinkAvailable: S } = x, C = /* @__PURE__ */ s(l, {
9
+ disabled: p,
10
+ label: h(t.directLinkLabel),
11
+ value: y
12
+ });
13
+ if (!d) return y && S ? C : null;
14
+ let w;
15
+ b === "malicious_content" ? w = h(t.directLinkBlockedByMaliciousContent) : b === "access_policy" && (w = h(v ? t.directLinkBlockedByAccessPolicyWithClassification : t.directLinkBlockedByAccessPolicyWithoutClassification));
16
+ let T = f && !!y && S && !w;
17
+ return /* @__PURE__ */ c(o, { children: [w ? /* @__PURE__ */ s(a, {
18
+ content: w,
19
+ "data-testid": "usm-DownloadSettings-tooltip",
20
+ side: "left",
21
+ children: /* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(i.Item, {
22
+ checked: f,
23
+ disabled: !0,
24
+ label: h(t.downloadSettingsToggleText),
25
+ onCheckedChange: m,
26
+ value: "download-link-settings"
27
+ }) })
28
+ }) : /* @__PURE__ */ s(i.Item, {
29
+ checked: f,
30
+ disabled: p || !u,
31
+ label: h(t.downloadSettingsToggleText),
32
+ onCheckedChange: m,
33
+ value: "download-link-settings"
34
+ }), T && C] });
59
35
  }
60
- export {
61
- j as DownloadSection
62
- };
36
+ export { u as DownloadSection };
@@ -1,51 +1,34 @@
1
- import { useIntl as c } from "react-intl";
2
- import { Switch as x, DateI18nProvider as b, DatePicker as d } from "@box/blueprint-web";
3
- import a from "./messages.js";
4
- import { jsxs as k, Fragment as L, jsx as r } from "react/jsx-runtime";
5
- import { useSharedLinkSettingsContext as u } from "../../contexts/shared-link-settings-context.js";
6
- import { formatTomorrowDateToCalendarDate as f } from "../../utils/date.js";
7
- function C({
8
- canChange: i,
9
- error: o,
10
- expiration: l,
11
- isChecked: n,
12
- isDisabled: t,
13
- onChange: p,
14
- onToggle: m
15
- }) {
16
- const {
17
- formatMessage: e
18
- } = c(), {
19
- containerRef: s
20
- } = u();
21
- return /* @__PURE__ */ k(L, {
22
- children: [/* @__PURE__ */ r(x.Item, {
23
- checked: n,
24
- disabled: t || !i,
25
- label: e(a.linkExpirationToggleText),
26
- onCheckedChange: m,
27
- value: "link-expiration-settings"
28
- }), n && // Get the locale from the user's operating system settings
29
- /* @__PURE__ */ r(b, {
30
- locale: navigator.language || "en-US",
31
- children: /* @__PURE__ */ r(d, {
32
- calendarAriaLabel: e(a.linkExpirationCalendarAriaLabel),
33
- clearDatePickerAriaLabel: e(a.linkExpirationClearDatePickerAriaLabel),
34
- error: o,
35
- hideLabel: !0,
36
- isDisabled: t || !i,
37
- label: e(a.linkExpirationDatePickerLabel),
38
- minValue: f(),
39
- nextMonthAriaLabel: e(a.linkExpirationNextMonthAriaLabel),
40
- onChange: p,
41
- openCalendarDropdownAriaLabel: e(a.linkExpirationOpenCalendarDropdownAriaLabel),
42
- portalElement: s,
43
- previousMonthAriaLabel: e(a.linkExpirationPreviousMonthAriaLabel),
44
- value: l
45
- })
46
- })]
47
- });
1
+ import { formatTomorrowDateToCalendarDate as e } from "../../utils/date.js";
2
+ import { useSharedLinkSettingsContext as t } from "../../contexts/shared-link-settings-context.js";
3
+ import n from "./messages.js";
4
+ import { useIntl as r } from "react-intl";
5
+ import { DateI18nProvider as i, DatePicker as a, Switch as o } from "@box/blueprint-web";
6
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ function u({ canChange: u, error: d, expiration: f, isChecked: p, isDisabled: m, onChange: h, onToggle: g }) {
8
+ let { formatMessage: _ } = r(), { containerRef: v } = t();
9
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(o.Item, {
10
+ checked: p,
11
+ disabled: m || !u,
12
+ label: _(n.linkExpirationToggleText),
13
+ onCheckedChange: g,
14
+ value: "link-expiration-settings"
15
+ }), p && /* @__PURE__ */ c(i, {
16
+ locale: navigator.language || "en-US",
17
+ children: /* @__PURE__ */ c(a, {
18
+ calendarAriaLabel: _(n.linkExpirationCalendarAriaLabel),
19
+ clearDatePickerAriaLabel: _(n.linkExpirationClearDatePickerAriaLabel),
20
+ error: d,
21
+ hideLabel: !0,
22
+ isDisabled: m || !u,
23
+ label: _(n.linkExpirationDatePickerLabel),
24
+ minValue: e(),
25
+ nextMonthAriaLabel: _(n.linkExpirationNextMonthAriaLabel),
26
+ onChange: h,
27
+ openCalendarDropdownAriaLabel: _(n.linkExpirationOpenCalendarDropdownAriaLabel),
28
+ portalElement: v,
29
+ previousMonthAriaLabel: _(n.linkExpirationPreviousMonthAriaLabel),
30
+ value: f
31
+ })
32
+ })] });
48
33
  }
49
- export {
50
- C as ExpirationSection
51
- };
34
+ export { u as ExpirationSection };
@@ -1,4 +1,2 @@
1
- import { SharedLinkSettingsModal as r } from "./shared-link-settings-modal.js";
2
- export {
3
- r as SharedLinkSettingsModal
4
- };
1
+ import { t as e } from "../../../../chunks/shared-link-settings-modal.js";
2
+ export { e as SharedLinkSettingsModal };