@box/unified-share-modal 2.16.8 → 2.16.9

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.
@@ -12,93 +12,94 @@ import { t as ie } from "./text-area-container.js";
12
12
  import { useCallback as o, useEffect as s, useRef as ae, useState as oe } from "react";
13
13
  import c from "clsx";
14
14
  import { useIntl as l } from "react-intl";
15
- import { Focusable as u, Modal as d, Text as f, Tooltip as p, useBlueprintModernization as se, useLabelable as ce, useNotification as le, useUniqueId as ue } from "@box/blueprint-web";
16
- import { Fragment as de, jsx as m, jsxs as h } from "react/jsx-runtime";
17
- import { createPortal as fe } from "react-dom";
18
- import { Globe as pe } from "@box/blueprint-web-assets/icons/Medium";
19
- import { bpSize040 as g } from "@box/blueprint-web-assets/tokens/tokens";
20
- import { UserSelectorContainer as me } from "@box/user-selector";
21
- import '../styles/collaboration-section.css';var _ = {
22
- container: "_container_1e2gg_2",
23
- label: "_label_1e2gg_8",
24
- modernized: "_modernized_1e2gg_15",
25
- security: "_security_1e2gg_33",
26
- icon: "_icon_1e2gg_37",
27
- access: "_access_1e2gg_43"
15
+ import { Focusable as u, Modal as d, Text as f, Tooltip as p, useBlueprintModernization as m, useLabelable as h, useNotification as se, useUniqueId as ce } from "@box/blueprint-web";
16
+ import { Fragment as le, jsx as g, jsxs as _ } from "react/jsx-runtime";
17
+ import { createPortal as ue } from "react-dom";
18
+ import { Globe as de } from "@box/blueprint-web-assets/icons/Medium";
19
+ import { bpSize040 as v } from "@box/blueprint-web-assets/tokens/tokens";
20
+ import { UserSelectorContainer as fe } from "@box/user-selector";
21
+ import '../styles/collaboration-section.css';var y = {
22
+ container: "_container_1qux4_2",
23
+ label: "_label_1qux4_8",
24
+ modernized: "_modernized_1qux4_15",
25
+ security: "_security_1qux4_33",
26
+ disclosures: "_disclosures_1qux4_37",
27
+ icon: "_icon_1qux4_43",
28
+ access: "_access_1qux4_49"
28
29
  };
29
- function v() {
30
- let { formatMessage: v } = l(), [y, b] = oe(), { enableModernizedComponents: x } = se(), { addNotification: S } = le(), { validateShieldRestriction: C } = ee(), { contactValue: w, containerRef: T, form: E, setForm: D, setUserContacts: O, shieldRestriction: k, userContacts: A } = r(), { collaborationAccess: j, collaborationNotices: M, config: N, contactService: P, isFetching: F, isSubmitting: I, item: L, onOpenChange: R, sharingService: z, variant: he } = e(), { permissions: B = {}, type: ge } = L, { getContacts: V, getContactsAvatarUrls: H } = P, { sendInvitations: _e, sendSharedLink: ve } = z, ye = he === "desktop", U = E === "default" || E === "invite", W = E === "invite" || E === "email", be = E === "invite" && N.collaborationMessage, xe = E === "email" && N.sharedLinkEmailMessage, Se = A.some((e) => e.isExternalUser), G, K;
31
- E === "invite" && (G = _e, K = "invite-collaborators"), E === "email" && (G = ve, K = "email-shared-link");
32
- let { errors: Ce, handleFormReset: q, handleFormSubmit: we, handleSelectedUsersChange: J, handleUserSelectorBlur: Te, updateContactValue: Ee } = te(G, K), Y = ae(E === "email" ? "email" : "invite");
30
+ function b() {
31
+ let { formatMessage: b } = l(), [x, S] = oe(), { enableModernizedComponents: pe } = m(), { addNotification: me } = se(), { validateShieldRestriction: C } = ee(), { contactValue: w, containerRef: T, form: E, setForm: D, setUserContacts: O, shieldRestriction: k, userContacts: A } = r(), { collaborationAccess: j, collaborationNotices: M, config: N, contactService: P, invitationFormNotices: F, isFetching: I, isSubmitting: L, item: R, onOpenChange: z, sharingService: he, variant: ge } = e(), { permissions: B = {}, type: _e } = R, { getContacts: V, getContactsAvatarUrls: H } = P, { sendInvitations: ve, sendSharedLink: ye } = he, be = ge === "desktop", U = E === "default" || E === "invite", W = E === "invite" || E === "email", xe = E === "invite" && N.collaborationMessage, Se = E === "email" && N.sharedLinkEmailMessage, G = A.some((e) => e.isExternalUser), K, q;
32
+ E === "invite" && (K = ve, q = "invite-collaborators"), E === "email" && (K = ye, q = "email-shared-link");
33
+ let { errors: Ce, handleFormReset: J, handleFormSubmit: we, handleSelectedUsersChange: Y, handleUserSelectorBlur: Te, updateContactValue: Ee } = te(K, q), X = ae(E === "email" ? "email" : "invite");
33
34
  s(() => {
34
- Y.current = E === "email" ? "email" : "invite";
35
+ X.current = E === "email" ? "email" : "invite";
35
36
  }, [E]), s(() => {
36
- (!A.length || !A.some((e) => e.chipVariant === "error")) && b(null);
37
+ (!A.length || !A.some((e) => e.chipVariant === "error")) && S(null);
37
38
  }, [A]);
38
- let De = o((e) => (e.stopPropagation(), !0), []), Oe = o((e) => V ? V(e, Y.current) : Promise.resolve([]), [V]), ke = o((e) => H ? H(e) : Promise.resolve({}), [H]), Ae = (e) => {
39
+ let De = o((e) => (e.stopPropagation(), !0), []), Oe = o((e) => V ? V(e, X.current) : Promise.resolve([]), [V]), ke = o((e) => H ? H(e) : Promise.resolve({}), [H]), Ae = (e) => {
39
40
  W || D("invite"), Ee(e);
40
- }, X = o((e) => {
41
+ }, je = o((e) => {
41
42
  let n = e.clipboardData.getData("text");
42
- t(n).length !== 0 && (e.preventDefault(), W || D("invite"), J([...A, { value: n }]));
43
+ t(n).length !== 0 && (e.preventDefault(), W || D("invite"), Y([...A, { value: n }]));
43
44
  }, [
44
- J,
45
+ Y,
45
46
  W,
46
47
  D,
47
48
  A
48
- ]), je = () => {
49
- q(), D("default");
50
- }, Me = async () => {
49
+ ]), Me = () => {
50
+ J(), D("default");
51
+ }, Ne = async () => {
51
52
  try {
52
- if (y) {
53
+ if (x) {
53
54
  let e = C(A, k);
54
55
  if (e) {
55
- S({
56
- ...n(v, "error"),
56
+ me({
57
+ ...n(b, "error"),
57
58
  styledText: e
58
59
  });
59
60
  return;
60
61
  }
61
62
  }
62
63
  if (await we()) return;
63
- q(), R(!1), D("default");
64
+ J(), z(!1), D("default");
64
65
  } catch (e) {
65
66
  if (!e.shieldRestriction) return;
66
67
  let { shieldRestriction: t } = e, n = [...t.restrictedEmails ?? [], ...t.restrictedGroups ?? []], r = A.map((e) => n.includes(e.email) || n.includes(`${e.id}`) ? {
67
68
  ...e,
68
69
  chipVariant: "error"
69
70
  } : e);
70
- b(t), O(r);
71
+ S(t), O(r);
71
72
  }
72
73
  }, Z, Q = !1;
73
- U && !B.canInviteCollaborator && (Z = v(i.inviteDisabledTooltip), Q = !0), U && ge === "web_link" && (Z = v(i.inviteWebLinkDisabledTooltip), Q = !0);
74
- let $ = ue("usm-UserContacts-"), Ne = ce(v(U ? i.invitePeopleLabel : i.emailSharedLinkLabel), $);
75
- return /* @__PURE__ */ h("form", {
76
- className: _.container,
74
+ U && !B.canInviteCollaborator && (Z = b(i.inviteDisabledTooltip), Q = !0), U && _e === "web_link" && (Z = b(i.inviteWebLinkDisabledTooltip), Q = !0);
75
+ let $ = ce("usm-UserContacts-"), Pe = h(b(U ? i.invitePeopleLabel : i.emailSharedLinkLabel), $);
76
+ return /* @__PURE__ */ _("form", {
77
+ className: y.container,
77
78
  onSubmit: (e) => e.preventDefault(),
78
79
  children: [
79
- y && /* @__PURE__ */ m(re, {
80
- error: y,
81
- isLoading: I,
82
- onSelectedUsersChange: J
80
+ x && /* @__PURE__ */ g(re, {
81
+ error: x,
82
+ isLoading: L,
83
+ onSelectedUsersChange: Y
83
84
  }),
84
85
  M,
85
- /* @__PURE__ */ h("div", { children: [
86
- U && N.collaborators && /* @__PURE__ */ m(ne, {}),
87
- /* @__PURE__ */ m(Ne, { className: c(_.label, x && _.modernized) }),
88
- /* @__PURE__ */ m(p, {
86
+ /* @__PURE__ */ _("div", { children: [
87
+ U && N.collaborators && /* @__PURE__ */ g(ne, {}),
88
+ /* @__PURE__ */ g(Pe, { className: c(y.label, pe && y.modernized) }),
89
+ /* @__PURE__ */ g(p, {
89
90
  content: Z,
90
91
  "data-testid": "usm-UserContacts-tooltip",
91
92
  open: Z ? void 0 : !1,
92
93
  side: "bottom",
93
- children: /* @__PURE__ */ m(u, {
94
+ children: /* @__PURE__ */ g(u, {
94
95
  focusable: Q,
95
- children: /* @__PURE__ */ m(me, {
96
+ children: /* @__PURE__ */ g(fe, {
96
97
  autoFocus: B.canInviteCollaborator,
97
98
  className: "usm-UserContacts-input",
98
- clearButtonAriaLabel: v(i.clearButton),
99
+ clearButtonAriaLabel: b(i.clearButton),
99
100
  clearOnBlur: !1,
100
101
  "data-target-id": "PillSelectorDropdown-AddNamesOrEmailAddresses",
101
- disabled: Q || I,
102
+ disabled: Q || L,
102
103
  displayChipVariant: (e) => e.chipVariant,
103
104
  error: Ce.userContacts,
104
105
  fetchAvatarUrls: ke,
@@ -109,9 +110,9 @@ function v() {
109
110
  label: null,
110
111
  onBlur: Te,
111
112
  onInputValueChange: Ae,
112
- onPaste: X,
113
- onSelectedUsersChange: J,
114
- placeholder: A.length ? "" : v(i.invitePeoplePlaceholder),
113
+ onPaste: je,
114
+ onSelectedUsersChange: Y,
115
+ placeholder: A.length ? "" : b(i.invitePeoplePlaceholder),
115
116
  portalElement: T,
116
117
  selectedUsers: A,
117
118
  selectOnEnterOrTab: !0,
@@ -119,39 +120,42 @@ function v() {
119
120
  })
120
121
  })
121
122
  }),
122
- U && /* @__PURE__ */ h("div", {
123
- className: _.access,
124
- children: [N.collaborationRole && /* @__PURE__ */ m(a, {}), j]
123
+ U && /* @__PURE__ */ _("div", {
124
+ className: y.access,
125
+ children: [N.collaborationRole && /* @__PURE__ */ g(a, {}), j]
125
126
  })
126
127
  ] }),
127
- (be || xe) && /* @__PURE__ */ m(ie, { maxCount: N.collaborationMessageLimit }),
128
- W && Se && /* @__PURE__ */ h("div", {
129
- className: _.security,
130
- children: [/* @__PURE__ */ m(pe, {
131
- className: _.icon,
132
- height: g,
133
- width: g
134
- }), /* @__PURE__ */ m(f, {
135
- as: "span",
136
- color: "textOnLightSecondary",
137
- children: v(i.contentSharedWithExternalCollaborators)
138
- })]
128
+ (xe || Se) && /* @__PURE__ */ g(ie, { maxCount: N.collaborationMessageLimit }),
129
+ W && (G || F) && /* @__PURE__ */ _("div", {
130
+ className: y.disclosures,
131
+ children: [G && /* @__PURE__ */ _("div", {
132
+ className: y.security,
133
+ children: [/* @__PURE__ */ g(de, {
134
+ className: y.icon,
135
+ height: v,
136
+ width: v
137
+ }), /* @__PURE__ */ g(f, {
138
+ as: "span",
139
+ color: "textOnLightSecondary",
140
+ children: b(i.contentSharedWithExternalCollaborators)
141
+ })]
142
+ }), F]
139
143
  }),
140
- W && T && /* @__PURE__ */ fe(/* @__PURE__ */ h(de, { children: [!F && /* @__PURE__ */ h(d.Footer, { children: [/* @__PURE__ */ m(d.Footer.SecondaryButton, {
141
- disabled: I,
142
- onClick: je,
143
- children: v(i.cancelButton)
144
- }), /* @__PURE__ */ m(d.Footer.PrimaryButton, {
145
- "data-target-id": "Modal.Footer.PrimaryButton-USMSendInvite",
146
- loading: I,
147
- loadingAriaLabel: v(i.loadingLabel),
144
+ W && T && /* @__PURE__ */ ue(/* @__PURE__ */ _(le, { children: [!I && /* @__PURE__ */ _(d.Footer, { children: [/* @__PURE__ */ g(d.Footer.SecondaryButton, {
145
+ disabled: L,
148
146
  onClick: Me,
149
- children: v(i.sendButton)
150
- })] }), !ye && /* @__PURE__ */ m(d.Close, {
151
- "aria-label": v(i.closeButton),
152
- disabled: I
147
+ children: b(i.cancelButton)
148
+ }), /* @__PURE__ */ g(d.Footer.PrimaryButton, {
149
+ "data-target-id": "Modal.Footer.PrimaryButton-USMSendInvite",
150
+ loading: L,
151
+ loadingAriaLabel: b(i.loadingLabel),
152
+ onClick: Ne,
153
+ children: b(i.sendButton)
154
+ })] }), !be && /* @__PURE__ */ g(d.Close, {
155
+ "aria-label": b(i.closeButton),
156
+ disabled: L
153
157
  })] }), T)
154
158
  ]
155
159
  });
156
160
  }
157
- export { v as t };
161
+ export { b as t };
@@ -9,40 +9,41 @@ import { t as s } from "./shared-link-access.js";
9
9
  import { t as ee } from "./shared-link-permission.js";
10
10
  import { useCallback as c, useEffect as l, useRef as u } from "react";
11
11
  import { useIntl as d } from "react-intl";
12
- import { Button as f, Focusable as te, Link as p, Status as ne, Switch as re, Text as m, Tooltip as h, useNotification as g } from "@box/blueprint-web";
13
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
- import { ClockBadge as ie } from "@box/blueprint-web-assets/icons/Line";
12
+ import { Button as te, Focusable as ne, Link as f, Status as re, Switch as ie, Text as p, Tooltip as m, useNotification as h } from "@box/blueprint-web";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { ClockBadge as v } from "@box/blueprint-web-assets/icons/Line";
15
15
  import { CopyInput as y } from "@box/copy-input";
16
16
  import { Globe as b, Mail as x } from "@box/blueprint-web-assets/icons/Medium";
17
17
  import { SurfaceStatusSurfaceRed as S, bpSize040 as C } from "@box/blueprint-web-assets/tokens/tokens";
18
18
  import '../styles/shared-link-section.css';var w = {
19
- container: "_container_j966c_1",
20
- toggle: "_toggle_j966c_7",
21
- settings: "_settings_j966c_13",
22
- copy: "_copy_j966c_22",
23
- access: "_access_j966c_30",
24
- icon: "_icon_j966c_36"
19
+ container: "_container_so6jb_1",
20
+ toggle: "_toggle_so6jb_7",
21
+ settings: "_settings_so6jb_13",
22
+ copy: "_copy_so6jb_22",
23
+ access: "_access_so6jb_30",
24
+ disclosures: "_disclosures_so6jb_36",
25
+ icon: "_icon_so6jb_42"
25
26
  };
26
27
  function T() {
27
- let { formatMessage: T } = d(), { addNotification: E } = g(), D = u(null), { isInteracted: O, isSharedLinkAutoCopied: k, isSharedLinkAutoCreated: A, setForm: j } = a(), { config: M, eventService: N, isFetching: P, isSubmitting: F, item: I, setView: L, sharedLink: R, sharingService: z } = e(), { permissions: B = {} } = I, { onSharedLinkCopy: V, onSharedLinkSettingsClick: H } = N, { createSharedLink: U } = z, { notifications: W, sharedLinkAutoCopy: G, sharedLinkAutoCreate: K } = M, q = !!R.url, J = G && !k.current && !O, Y = K && !A.current && !O, { onAction: X } = o(c(async () => {
28
+ let { formatMessage: T } = d(), { addNotification: E } = h(), D = u(null), { isInteracted: O, isSharedLinkAutoCopied: k, isSharedLinkAutoCreated: A, setForm: ae } = a(), { config: j, eventService: M, isFetching: N, isSubmitting: P, item: F, setView: I, sharedLink: L, sharedLinkNotices: R, sharingService: z } = e(), { permissions: B = {} } = F, { onSharedLinkCopy: V, onSharedLinkSettingsClick: H } = M, { createSharedLink: U } = z, { notifications: W, sharedLinkAutoCopy: G, sharedLinkAutoCreate: K } = j, q = !!L.url, J = G && !k.current && !O, Y = K && !A.current && !O, { onAction: X } = o(c(async () => {
28
29
  let e = await U();
29
30
  return J ? { messages: [] } : e;
30
31
  }, [J, U]), "create-shared-link");
31
32
  l(() => {
32
33
  (async () => {
33
- P || F || ((J || Y) && !q && !A.current && (A.current = !0, await X()), J && q && D.current && D.current.click());
34
+ N || P || ((J || Y) && !q && !A.current && (A.current = !0, await X()), J && q && D.current && D.current.click());
34
35
  })();
35
36
  }, [
36
37
  q,
37
38
  J,
38
39
  Y,
39
- P,
40
+ N,
40
41
  k,
41
42
  A,
42
- F,
43
+ P,
43
44
  X
44
45
  ]);
45
- let ae = c((e) => {
46
+ let oe = c((e) => {
46
47
  if (V && V(e), !J) return;
47
48
  k.current = !0;
48
49
  let t;
@@ -58,119 +59,125 @@ function T() {
58
59
  A,
59
60
  W,
60
61
  V
61
- ]), oe = async (e) => {
62
+ ]), se = async (e) => {
62
63
  if (e) {
63
64
  await X();
64
65
  return;
65
66
  }
66
- L("remove-shared-link");
67
+ I("remove-shared-link");
67
68
  }, Z = () => {
68
69
  if (H) {
69
70
  H();
70
71
  return;
71
72
  }
72
- L("shared-link-settings");
73
+ I("shared-link-settings");
73
74
  }, Q, $ = !1;
74
- return !q && !F && (Q = T(i.sharedLinkToggleTooltip)), !q && !B.canShare && (Q = T(i.createLinkDisabledTooltip), $ = !0), q && !B.canSetShareAccess && (Q = T(i.removeLinkDisabledTooltip), $ = !0), /* @__PURE__ */ v("div", {
75
+ return !q && !P && (Q = T(i.sharedLinkToggleTooltip)), !q && !B.canShare && (Q = T(i.createLinkDisabledTooltip), $ = !0), q && !B.canSetShareAccess && (Q = T(i.removeLinkDisabledTooltip), $ = !0), /* @__PURE__ */ _("div", {
75
76
  className: w.container,
76
77
  children: [
77
- /* @__PURE__ */ _(m, {
78
+ /* @__PURE__ */ g(p, {
78
79
  as: "label",
79
80
  variant: "bodyDefaultBold",
80
81
  children: T(i.shareLinkLabel)
81
82
  }),
82
- /* @__PURE__ */ v("div", {
83
+ /* @__PURE__ */ _("div", {
83
84
  className: w.toggle,
84
85
  children: [
85
- /* @__PURE__ */ _(h, {
86
+ /* @__PURE__ */ g(m, {
86
87
  align: "start",
87
88
  content: Q,
88
89
  "data-testid": "usm-SharedLinkToggle-tooltip",
89
90
  open: Q ? void 0 : !1,
90
- children: /* @__PURE__ */ _(te, {
91
+ children: /* @__PURE__ */ g(ne, {
91
92
  focusable: $,
92
- children: /* @__PURE__ */ _(re.Item, {
93
+ children: /* @__PURE__ */ g(ie.Item, {
93
94
  autoFocus: !B.canInviteCollaborator,
94
95
  checked: q,
95
96
  "data-target-id": "Toggle-CreateSharedLink",
96
- disabled: $ || F,
97
+ disabled: $ || P,
97
98
  label: T(i.sharedLinkToggleLabel),
98
- onCheckedChange: oe,
99
+ onCheckedChange: se,
99
100
  value: "shared-link"
100
101
  })
101
102
  })
102
103
  }),
103
- q && !!R.expiresAt && /* @__PURE__ */ _(h, {
104
- content: T(i.expirationIconTooltip, { expirationDate: t(R.expiresAt) }),
104
+ q && !!L.expiresAt && /* @__PURE__ */ g(m, {
105
+ content: T(i.expirationIconTooltip, { expirationDate: t(L.expiresAt) }),
105
106
  "data-testid": "usm-SharedLinkExpiration-tooltip",
106
- children: /* @__PURE__ */ _(ne, {
107
+ children: /* @__PURE__ */ g(re, {
107
108
  color: S,
108
109
  hideText: !0,
109
- icon: ie,
110
+ icon: v,
110
111
  text: T(i.expirationIconLabel)
111
112
  })
112
113
  }),
113
- q && M.sharedLinkSettings && /* @__PURE__ */ _(p, {
114
- "aria-disabled": F,
114
+ q && j.sharedLinkSettings && /* @__PURE__ */ g(f, {
115
+ "aria-disabled": P,
115
116
  "aria-haspopup": "dialog",
116
117
  className: w.settings,
117
118
  "data-target-id": "PlainButton-SharedLinkSettings",
118
119
  onClick: Z,
119
120
  onKeyDown: n(Z, { canPreventDefault: !0 }),
120
121
  role: "button",
121
- tabIndex: F ? -1 : 0,
122
+ tabIndex: P ? -1 : 0,
122
123
  variant: "standalone",
123
124
  children: T(i.sharedLinkSettingsLabel)
124
125
  })
125
126
  ]
126
127
  }),
127
- q && /* @__PURE__ */ v("div", {
128
+ q && /* @__PURE__ */ _("div", {
128
129
  className: w.copy,
129
- children: [/* @__PURE__ */ _(y, {
130
+ children: [/* @__PURE__ */ g(y, {
130
131
  ref: D,
131
132
  autoFocus: K && A.current && !O,
132
133
  "data-target-id": "Button-CopySharedLink",
133
- disabled: F,
134
+ disabled: P,
134
135
  hideLabel: !0,
135
136
  label: T(i.sharedLinkUrlLabel),
136
- onCopy: ae,
137
- value: R.url
138
- }), M.sharedLinkEmail && /* @__PURE__ */ _(h, {
137
+ onCopy: oe,
138
+ value: L.url
139
+ }), j.sharedLinkEmail && /* @__PURE__ */ g(m, {
139
140
  align: "end",
140
141
  content: T(i.sharedLinkEmailLabel),
141
- children: /* @__PURE__ */ _(f, {
142
+ children: /* @__PURE__ */ g(te, {
142
143
  "aria-label": T(i.sharedLinkEmailLabel),
143
144
  "data-target-id": "Button-SendSharedLink",
144
- disabled: F,
145
+ disabled: P,
145
146
  endIcon: x,
146
- onClick: () => j("email"),
147
+ onClick: () => ae("email"),
147
148
  size: "large",
148
149
  variant: "secondary"
149
150
  })
150
151
  })]
151
152
  }),
152
- q && (M.sharedLinkAccess || M.sharedLinkPermission) && /* @__PURE__ */ v("div", {
153
+ q && (j.sharedLinkAccess || j.sharedLinkPermission) && /* @__PURE__ */ _("div", {
153
154
  className: w.access,
154
- children: [M.sharedLinkAccess && /* @__PURE__ */ _(s, {}), M.sharedLinkPermission && /* @__PURE__ */ _(ee, {})]
155
+ children: [j.sharedLinkAccess && /* @__PURE__ */ g(s, {}), j.sharedLinkPermission && /* @__PURE__ */ g(ee, {})]
155
156
  }),
156
- q && R.access === "open" && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _(b, {
157
- className: w.icon,
158
- height: C,
159
- width: C
160
- }), /* @__PURE__ */ _(m, {
161
- as: "span",
162
- color: "textOnLightSecondary",
163
- children: R.permission === "can_edit" ? T(i.sharedLinkEditablePubliclyAvailable) : T(i.sharedLinkPubliclyAvailable)
164
- })] }),
165
- q && R.access === "company" && R.permission === "can_edit" && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _(b, {
166
- className: w.icon,
167
- height: C,
168
- width: C
169
- }), /* @__PURE__ */ _(m, {
170
- as: "span",
171
- color: "textOnLightSecondary",
172
- children: T(i.sharedLinkElevatedEditableCompanyAvailable)
173
- })] })
157
+ q && (L.access === "open" || L.access === "company" && L.permission === "can_edit" || R) && /* @__PURE__ */ _("div", {
158
+ className: w.disclosures,
159
+ children: [
160
+ L.access === "open" && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(b, {
161
+ className: w.icon,
162
+ height: C,
163
+ width: C
164
+ }), /* @__PURE__ */ g(p, {
165
+ as: "span",
166
+ color: "textOnLightSecondary",
167
+ children: L.permission === "can_edit" ? T(i.sharedLinkEditablePubliclyAvailable) : T(i.sharedLinkPubliclyAvailable)
168
+ })] }),
169
+ L.access === "company" && L.permission === "can_edit" && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(b, {
170
+ className: w.icon,
171
+ height: C,
172
+ width: C
173
+ }), /* @__PURE__ */ g(p, {
174
+ as: "span",
175
+ color: "textOnLightSecondary",
176
+ children: T(i.sharedLinkElevatedEditableCompanyAvailable)
177
+ })] }),
178
+ R
179
+ ]
180
+ })
174
181
  ]
175
182
  });
176
183
  }
@@ -10,14 +10,14 @@ import { useIntl as c } from "react-intl";
10
10
  import { LoadingIndicator as l, Modal as u } from "@box/blueprint-web";
11
11
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
12
  import '../styles/unified-share-form-modal.css';var p = {
13
- content: "_content_1i180_1",
14
- isFullscreen: "_isFullscreen_1i180_4",
15
- body: "_body_1i180_13",
16
- title: "_title_1i180_17",
17
- hasFooter: "_hasFooter_1i180_39",
18
- loading: "_loading_1i180_43",
19
- form: "_form_1i180_51",
20
- isLoading: "_isLoading_1i180_56"
13
+ content: "_content_1p1s8_1",
14
+ isFullscreen: "_isFullscreen_1p1s8_4",
15
+ body: "_body_1p1s8_13",
16
+ title: "_title_1p1s8_17",
17
+ hasFooter: "_hasFooter_1p1s8_39",
18
+ loading: "_loading_1p1s8_43",
19
+ form: "_form_1p1s8_51",
20
+ isLoading: "_isLoading_1p1s8_56"
21
21
  };
22
22
  function m({ children: m, isOpen: h, onOpenChange: g }) {
23
23
  let { formatMessage: _ } = c(), { form: v, isCollaboratorsOpen: y, setContainerRef: b, setForm: x } = t(), { eventService: S, isFetching: C, isSubmitting: w, item: T, variant: E } = e(), { onCloseAutoFocus: D } = S, { name: O } = T, k = E === "desktop", A = v === "default" && !y;
@@ -5,16 +5,16 @@ var s = /* @__PURE__ */ t(null), c = () => {
5
5
  let e = n(s);
6
6
  if (!e) throw Error("useUnifiedShareModalContext must be used with UnifiedShareModalContext.Provider");
7
7
  return e;
8
- }, l = ({ children: t, collaborationAccess: n, collaborationNotices: c, collaborationRoles: l, collaborators: u, config: d, contactService: f, currentUser: p, eventService: m, initialContacts: h, isFetching: g, isOpen: _, isSubmitting: v, item: y, onOpenChange: b, sharedLink: x, sharingService: S, variant: C }) => {
9
- let [w, T] = a(null), [E, D] = a(!1), [O, k] = a("unified-share-form");
8
+ }, l = ({ children: t, collaborationAccess: n, collaborationNotices: c, collaborationRoles: l, collaborators: u, config: d, contactService: f, currentUser: p, eventService: m, initialContacts: h, invitationFormNotices: g, isFetching: _, isOpen: v, isSubmitting: y, item: b, onOpenChange: x, sharedLink: S, sharedLinkNotices: C, sharingService: w, variant: T }) => {
9
+ let [E, D] = a(null), [O, k] = a(!1), [A, j] = a("unified-share-form");
10
10
  r(() => {
11
- _ || (D(!1), k("unified-share-form"));
12
- }, [_]);
13
- let A = i(() => ({
11
+ v || (k(!1), j("unified-share-form"));
12
+ }, [v]);
13
+ let M = i(() => ({
14
14
  collaborationAccess: n,
15
15
  collaborationNotices: c,
16
16
  collaborationRoles: l ?? [],
17
- collaborator: w,
17
+ collaborator: E,
18
18
  collaborators: u ?? [],
19
19
  config: {
20
20
  ...e,
@@ -24,23 +24,25 @@ var s = /* @__PURE__ */ t(null), c = () => {
24
24
  currentUser: p ?? {},
25
25
  eventService: m ?? {},
26
26
  initialContacts: h ?? [],
27
- isFetching: g,
28
- isOpen: _,
29
- isSubmitting: v ?? E,
30
- item: y,
31
- onOpenChange: b,
32
- setCollaborator: T,
33
- setIsLoading: D,
34
- setView: k,
35
- sharedLink: x ?? {},
36
- sharingService: S ?? {},
37
- variant: C,
38
- view: O
27
+ invitationFormNotices: g,
28
+ isFetching: _,
29
+ isOpen: v,
30
+ isSubmitting: y ?? O,
31
+ item: b,
32
+ onOpenChange: x,
33
+ setCollaborator: D,
34
+ setIsLoading: k,
35
+ setView: j,
36
+ sharedLink: S ?? {},
37
+ sharedLinkNotices: C,
38
+ sharingService: w ?? {},
39
+ variant: T,
40
+ view: A
39
41
  }), [
40
42
  n,
41
43
  c,
42
44
  l,
43
- w,
45
+ E,
44
46
  u,
45
47
  d,
46
48
  f,
@@ -48,18 +50,20 @@ var s = /* @__PURE__ */ t(null), c = () => {
48
50
  m,
49
51
  h,
50
52
  g,
51
- E,
52
53
  _,
54
+ O,
53
55
  v,
54
56
  y,
55
57
  b,
56
58
  x,
57
59
  S,
58
60
  C,
59
- O
61
+ w,
62
+ T,
63
+ A
60
64
  ]);
61
65
  return /* @__PURE__ */ o(s.Provider, {
62
- value: A,
66
+ value: M,
63
67
  children: t
64
68
  });
65
69
  };
@@ -2,21 +2,21 @@ import { UnifiedShareModalProvider as e } from "./contexts/unified-share-modal-c
2
2
  import { UnifiedShareBase as t } from "./unified-share-base.js";
3
3
  import { useCallback as n, useEffect as r, useState as i } from "react";
4
4
  import { jsx as a } from "react/jsx-runtime";
5
- function o({ children: o, collaborationAccess: s, collaborationNotices: c, collaborationRoles: l, collaborators: u, config: d, contactService: f, currentUser: p, eventService: m, initialContacts: h, isFetching: g, isOpen: _, isSubmitting: v, item: y, onLoad: b, onOpenChange: x, sharedLink: S, sharingService: C, variant: w = "modal" }) {
6
- let [T, E] = i(_ ?? (!o || w === "desktop")), [D, O] = i(!!b);
5
+ function o({ children: o, collaborationAccess: s, collaborationNotices: c, collaborationRoles: l, collaborators: u, config: d, contactService: f, currentUser: p, eventService: m, initialContacts: h, invitationFormNotices: g, isFetching: _, isOpen: v, isSubmitting: y, item: b, onLoad: x, onOpenChange: S, sharedLink: C, sharedLinkNotices: w, sharingService: T, variant: E = "modal" }) {
6
+ let [D, O] = i(v ?? (!o || E === "desktop")), [k, A] = i(!!x);
7
7
  r(() => {
8
- _ !== void 0 && E(_);
9
- }, [_]), r(() => {
8
+ v !== void 0 && O(v);
9
+ }, [v]), r(() => {
10
10
  (async () => {
11
- b && (T && await b(), O(!T));
11
+ x && (D && await x(), A(!D));
12
12
  })();
13
- }, [T, b]);
14
- let k = n((e) => {
15
- _ === void 0 && w !== "desktop" && E(e), x && x(e);
13
+ }, [D, x]);
14
+ let j = n((e) => {
15
+ v === void 0 && E !== "desktop" && O(e), S && S(e);
16
16
  }, [
17
- _,
18
- x,
19
- w
17
+ v,
18
+ S,
19
+ E
20
20
  ]);
21
21
  return /* @__PURE__ */ a(e, {
22
22
  collaborationAccess: s,
@@ -28,14 +28,16 @@ function o({ children: o, collaborationAccess: s, collaborationNotices: c, colla
28
28
  currentUser: p,
29
29
  eventService: m,
30
30
  initialContacts: h,
31
- isFetching: g ?? D,
32
- isOpen: T,
33
- isSubmitting: v,
34
- item: y,
35
- onOpenChange: k,
36
- sharedLink: S,
37
- sharingService: C,
38
- variant: w,
31
+ invitationFormNotices: g,
32
+ isFetching: _ ?? k,
33
+ isOpen: D,
34
+ isSubmitting: y,
35
+ item: b,
36
+ onOpenChange: j,
37
+ sharedLink: C,
38
+ sharedLinkNotices: w,
39
+ sharingService: T,
40
+ variant: E,
39
41
  children: /* @__PURE__ */ a(t, { children: o })
40
42
  });
41
43
  }
@@ -1 +1 @@
1
- ._container_1e2gg_2{gap:var(--bp-space-040);flex-direction:column;display:flex}._label_1e2gg_8{padding:var(--bp-space-010) 0;color:var(--text-text-on-light);overflow-wrap:break-word;margin-block-end:var(--space-2);display:block}._label_1e2gg_8._modernized_1e2gg_15{font-weight:var(--bp-font-weight-bold);font-size:var(--bp-font-size-05);font-family:var(--bp-font-font-family), -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;font-style:normal;line-height:var(--bp-font-line-height-04);letter-spacing:var(--bp-font-letter-spacing-01)}._label_1e2gg_8:not(._modernized_1e2gg_15){font-weight:var(--body-default-bold-font-weight);font-size:var(--body-default-bold-font-size);font-family:var(--body-default-bold-font-family);line-height:var(--body-default-bold-line-height);letter-spacing:var(--body-default-bold-letter-spacing);text-transform:var(--body-default-bold-text-case);-webkit-text-decoration:var(--body-default-bold-text-decoration);text-decoration:var(--body-default-bold-text-decoration)}._security_1e2gg_33{margin-top:calc(var(--bp-space-010) * -1)}._icon_1e2gg_37{height:var(--bp-size-050);margin-right:var(--bp-space-010);vertical-align:text-bottom}._access_1e2gg_43{gap:var(--bp-space-010);margin-top:var(--bp-space-030);flex-wrap:wrap;display:flex}
1
+ ._container_1qux4_2{gap:var(--bp-space-040);flex-direction:column;display:flex}._label_1qux4_8{padding:var(--bp-space-010) 0;color:var(--text-text-on-light);overflow-wrap:break-word;margin-block-end:var(--space-2);display:block}._label_1qux4_8._modernized_1qux4_15{font-weight:var(--bp-font-weight-bold);font-size:var(--bp-font-size-05);font-family:var(--bp-font-font-family), -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;font-style:normal;line-height:var(--bp-font-line-height-04);letter-spacing:var(--bp-font-letter-spacing-01)}._label_1qux4_8:not(._modernized_1qux4_15){font-weight:var(--body-default-bold-font-weight);font-size:var(--body-default-bold-font-size);font-family:var(--body-default-bold-font-family);line-height:var(--body-default-bold-line-height);letter-spacing:var(--body-default-bold-letter-spacing);text-transform:var(--body-default-bold-text-case);-webkit-text-decoration:var(--body-default-bold-text-decoration);text-decoration:var(--body-default-bold-text-decoration)}._security_1qux4_33{margin-top:calc(var(--bp-space-010) * -1)}._disclosures_1qux4_37{gap:var(--bp-space-010);flex-direction:column;display:flex}._icon_1qux4_43{height:var(--bp-size-050);margin-right:var(--bp-space-010);vertical-align:text-bottom}._access_1qux4_49{gap:var(--bp-space-010);margin-top:var(--bp-space-030);flex-wrap:wrap;display:flex}
@@ -1 +1 @@
1
- ._container_j966c_1{gap:var(--bp-space-030);flex-direction:column;display:flex}._toggle_j966c_7{gap:var(--bp-space-020);align-items:center;display:flex}._settings_j966c_13{cursor:pointer;margin-left:auto}._settings_j966c_13[aria-disabled=true]{opacity:.3;pointer-events:none}._copy_j966c_22{gap:var(--bp-space-020);display:flex}._copy_j966c_22>div:first-child{flex-grow:1}._access_j966c_30{gap:var(--bp-space-010);flex-wrap:wrap;display:flex}._icon_j966c_36{height:var(--bp-size-050);margin-right:var(--bp-space-010);vertical-align:text-bottom}
1
+ ._container_so6jb_1{gap:var(--bp-space-030);flex-direction:column;display:flex}._toggle_so6jb_7{gap:var(--bp-space-020);align-items:center;display:flex}._settings_so6jb_13{cursor:pointer;margin-left:auto}._settings_so6jb_13[aria-disabled=true]{opacity:.3;pointer-events:none}._copy_so6jb_22{gap:var(--bp-space-020);display:flex}._copy_so6jb_22>div:first-child{flex-grow:1}._access_so6jb_30{gap:var(--bp-space-010);flex-wrap:wrap;display:flex}._disclosures_so6jb_36{gap:var(--bp-space-010);flex-direction:column;display:flex}._icon_so6jb_42{height:var(--bp-size-050);margin-right:var(--bp-space-010);vertical-align:text-bottom}
@@ -1 +1 @@
1
- ._content_1i180_1._content_1i180_1{max-width:480px}._content_1i180_1._content_1i180_1._isFullscreen_1i180_4{border-radius:0;width:100vw;max-width:none;height:100vh;max-height:none;margin:0;animation:none!important}._content_1i180_1._content_1i180_1._isFullscreen_1i180_4 ._body_1i180_13{overflow:hidden auto}._title_1i180_17{display:inline}._title_1i180_17:after{width:var(--bp-space-020);content:"";display:inline-block}._body_1i180_13._body_1i180_13{padding-top:0;padding-bottom:var(--bp-space-080);flex-direction:column;flex-grow:1;display:flex;position:relative}._body_1i180_13._body_1i180_13:before{content:"";width:100vw;display:block}._body_1i180_13._body_1i180_13._hasFooter_1i180_39{padding-bottom:0}._loading_1i180_43{padding-bottom:var(--bp-space-080);align-items:center;display:flex;position:absolute;inset:0}._form_1i180_51{flex-direction:column;flex-grow:1;display:flex}._form_1i180_51._isLoading_1i180_56{visibility:hidden}@media (width>374px){._content_1i180_1._content_1i180_1{overflow:auto}}@media (width>459px){:has(>._content_1i180_1._content_1i180_1:not(._isFullscreen_1i180_4)){padding:var(--bp-space-080);display:flex;overflow:auto}._content_1i180_1._content_1i180_1{max-height:none;margin:auto;overflow:visible}}
1
+ ._content_1p1s8_1._content_1p1s8_1{max-width:480px}._content_1p1s8_1._content_1p1s8_1._isFullscreen_1p1s8_4{border-radius:0;width:100vw;max-width:none;height:100vh;max-height:none;margin:0;animation:none!important}._content_1p1s8_1._content_1p1s8_1._isFullscreen_1p1s8_4 ._body_1p1s8_13{overflow:hidden auto}._title_1p1s8_17{display:inline}._title_1p1s8_17:not(:last-child):after{content:" ";font-size:2rem;line-height:0}._body_1p1s8_13._body_1p1s8_13{padding-top:0;padding-bottom:var(--bp-space-080);flex-direction:column;flex-grow:1;display:flex;position:relative}._body_1p1s8_13._body_1p1s8_13:before{content:"";width:100vw;display:block}._body_1p1s8_13._body_1p1s8_13._hasFooter_1p1s8_39{padding-bottom:0}._loading_1p1s8_43{padding-bottom:var(--bp-space-080);align-items:center;display:flex;position:absolute;inset:0}._form_1p1s8_51{flex-direction:column;flex-grow:1;display:flex}._form_1p1s8_51._isLoading_1p1s8_56{visibility:hidden}@media (width>374px){._content_1p1s8_1._content_1p1s8_1{overflow:auto}}@media (width>459px){:has(>._content_1p1s8_1._content_1p1s8_1:not(._isFullscreen_1p1s8_4)){padding:var(--bp-space-080);display:flex;overflow:auto}._content_1p1s8_1._content_1p1s8_1{max-height:none;margin:auto;overflow:visible}}
@@ -12,6 +12,7 @@ export interface UnifiedShareModalContextValue {
12
12
  currentUser: Partial<User>;
13
13
  eventService: EventService;
14
14
  initialContacts: UserContactType[];
15
+ invitationFormNotices?: ReactElement | ReactElement[];
15
16
  isFetching: boolean;
16
17
  isOpen: boolean;
17
18
  isSubmitting: boolean;
@@ -21,6 +22,7 @@ export interface UnifiedShareModalContextValue {
21
22
  setIsLoading: Dispatch<SetStateAction<boolean>>;
22
23
  setView: Dispatch<SetStateAction<ViewType>>;
23
24
  sharedLink: Partial<SharedLink>;
25
+ sharedLinkNotices?: ReactElement | ReactElement[];
24
26
  sharingService: SharingService;
25
27
  variant: VariantType;
26
28
  view: ViewType;
@@ -38,13 +40,15 @@ export interface UnifiedShareModalProviderProps {
38
40
  currentUser?: User;
39
41
  eventService?: EventService;
40
42
  initialContacts?: UserContactType[];
43
+ invitationFormNotices?: ReactElement | ReactElement[];
41
44
  isFetching: boolean;
42
45
  isOpen: boolean;
43
46
  isSubmitting?: boolean;
44
47
  item: Item;
45
48
  onOpenChange: (open: boolean) => void;
46
49
  sharedLink?: SharedLink;
50
+ sharedLinkNotices?: ReactElement | ReactElement[];
47
51
  sharingService?: SharingService;
48
52
  variant: VariantType;
49
53
  }
50
- export declare const UnifiedShareModalProvider: ({ children, collaborationAccess, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, isFetching, isOpen, isSubmitting, item, onOpenChange, sharedLink, sharingService, variant, }: UnifiedShareModalProviderProps) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const UnifiedShareModalProvider: ({ children, collaborationAccess, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, invitationFormNotices, isFetching, isOpen, isSubmitting, item, onOpenChange, sharedLink, sharedLinkNotices, sharingService, variant, }: UnifiedShareModalProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { UserContactType } from '@box/user-selector';
2
3
  import { UnifiedShareModalContextValue } from '../contexts';
3
4
  import { UnifiedShareModalProps } from '../unified-share-modal';
@@ -43,4 +44,7 @@ export declare const useMockSharedLink: (sharedLinkArg: any) => {
43
44
  };
44
45
  export declare const defaultArgs: UnifiedShareModalProps;
45
46
  export declare const defaultContext: UnifiedShareModalContextValue;
47
+ export declare const HubAccessDisclosure: ({ children }: {
48
+ children: ReactNode;
49
+ }) => import("react/jsx-runtime").JSX.Element;
46
50
  export declare const UnifiedShareModalTemplate: (props: UnifiedShareModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -44,6 +44,10 @@ export interface UnifiedShareModalProps {
44
44
  * The initially selected users when the Unified Share Modal is opened.
45
45
  */
46
46
  initialContacts?: UserContactType[];
47
+ /**
48
+ * The inline notice component(s) to render in the collaboration section when the invitation form is expanded.
49
+ */
50
+ invitationFormNotices?: ReactElement | ReactElement[];
47
51
  /**
48
52
  * The controlled fetching state of the Unified Share Modal.
49
53
  *
@@ -78,6 +82,10 @@ export interface UnifiedShareModalProps {
78
82
  * The shared link for sharing the item with users.
79
83
  */
80
84
  sharedLink?: SharedLink;
85
+ /**
86
+ * The inline notice component(s) to render in the shared link section.
87
+ */
88
+ sharedLinkNotices?: ReactElement | ReactElement[];
81
89
  /**
82
90
  * The service for managing the collaborations and shared link of the item.
83
91
  */
@@ -91,4 +99,4 @@ export interface UnifiedShareModalProps {
91
99
  */
92
100
  variant?: VariantType;
93
101
  }
94
- export declare function UnifiedShareModal({ children, collaborationAccess, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, isFetching, isOpen: isControlledOpen, isSubmitting, item, onLoad, onOpenChange, sharedLink, sharingService, variant, }: UnifiedShareModalProps): import("react/jsx-runtime").JSX.Element;
102
+ export declare function UnifiedShareModal({ children, collaborationAccess, collaborationNotices, collaborationRoles, collaborators, config, contactService, currentUser, eventService, initialContacts, invitationFormNotices, isFetching, isOpen: isControlledOpen, isSubmitting, item, onLoad, onOpenChange, sharedLink, sharedLinkNotices, sharingService, variant, }: UnifiedShareModalProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "2.16.8",
3
+ "version": "2.16.9",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^15.4.0",
7
- "@box/blueprint-web-assets": "^4.121.7",
8
- "@box/copy-input": "^1.43.8",
9
- "@box/user-selector": "^1.77.8",
6
+ "@box/blueprint-web": "^15.5.0",
7
+ "@box/blueprint-web-assets": "^4.121.8",
8
+ "@box/copy-input": "^1.43.9",
9
+ "@box/user-selector": "^1.77.9",
10
10
  "lodash": "^4.17.15",
11
11
  "react": "^18.0.0",
12
12
  "react-dom": "^18.0.0",
13
13
  "react-intl": "^6.4.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@box/blueprint-web": "^15.4.0",
17
- "@box/blueprint-web-assets": "^4.121.7",
18
- "@box/copy-input": "^1.43.8",
16
+ "@box/blueprint-web": "^15.5.0",
17
+ "@box/blueprint-web-assets": "^4.121.8",
18
+ "@box/copy-input": "^1.43.9",
19
19
  "@box/eslint-plugin-blueprint": "1.2.4",
20
- "@box/storybook-utils": "0.20.7",
20
+ "@box/storybook-utils": "0.20.8",
21
21
  "react-intl": "^6.4.2"
22
22
  },
23
23
  "publishConfig": {