@box/unified-share-modal 1.36.0 → 1.36.1

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.
@@ -1,43 +1,43 @@
1
- import { useState as q, useMemo as G, useEffect as J } from "react";
2
- import { useIntl as K } from "react-intl";
3
- import { Modal as t, LoadingIndicator as Q, Text as W, Link as X } from "@box/blueprint-web";
4
- import { DownloadSection as Y } from "./download-section.js";
5
- import { ExpirationSection as Z } from "./expiration-section.js";
6
- import { PasswordSection as $ } from "./password-section.js";
7
- import { VanitySection as O } from "./vanity-section.js";
1
+ import { useState as R, useMemo as q, useEffect as G } from "react";
2
+ import { useIntl as J } from "react-intl";
3
+ import { Modal as t, LoadingIndicator as K, Text as Q, Link as W } from "@box/blueprint-web";
4
+ import { DownloadSection as X } from "./download-section.js";
5
+ import { ExpirationSection as Y } from "./expiration-section.js";
6
+ import { PasswordSection as Z } from "./password-section.js";
7
+ import { VanitySection as $ } from "./vanity-section.js";
8
8
  import s from "./messages.js";
9
9
  import { jsx as a, jsxs as w } from "react/jsx-runtime";
10
- import { useAccessLevels as ee } from "../../hooks/use-access-levels.js";
11
- import { formatDateFromTimestampToCalendarDate as ae } from "../../utils/date.js";
12
- import { useLinkSettingsForm as ne } from "../../hooks/use-link-settings-form.js";
13
- import { useUnifiedShareModalContext as oe } from "../../contexts/unified-share-modal-context.js";
14
- import '../../../../styles/shared-link-settings-modal.css';const ie = "_content_1r0kk_1", te = "_body_1r0kk_5", se = "_loading_1r0kk_17", f = {
15
- content: ie,
16
- body: te,
17
- loading: se
10
+ import { useAccessLevels as O } from "../../hooks/use-access-levels.js";
11
+ import { formatDateFromTimestampToCalendarDate as ee } from "../../utils/date.js";
12
+ import { useLinkSettingsForm as ae } from "../../hooks/use-link-settings-form.js";
13
+ import { useUnifiedShareModalContext as ne } from "../../contexts/unified-share-modal-context.js";
14
+ import '../../../../styles/shared-link-settings-modal.css';const oe = "_content_1r0kk_1", ie = "_body_1r0kk_5", te = "_loading_1r0kk_17", f = {
15
+ content: oe,
16
+ body: ie,
17
+ loading: te
18
18
  };
19
- function ye({
19
+ function ve({
20
20
  isOpen: c,
21
21
  onOpenChange: v
22
22
  }) {
23
23
  const {
24
24
  formatMessage: i
25
- } = K(), [g, C] = q(!1), {
26
- eventService: k,
27
- isSubmitting: E,
28
- sharedLink: x
29
- } = oe(), {
25
+ } = J(), [g, k] = R(!1), {
26
+ eventService: E,
27
+ isSubmitting: x,
28
+ sharedLink: L
29
+ } = ne(), {
30
30
  expiresAt: m = 0,
31
31
  settings: n = {},
32
- vanityDomain: L = "",
32
+ vanityDomain: D = "",
33
33
  vanityName: h = ""
34
- } = x, {
34
+ } = L, {
35
35
  onSharedLinkSettingsClose: y,
36
36
  onSharedLinkSettingsLoad: p
37
- } = k, {
38
- selectedAccess: D
39
- } = ee(), b = G(() => ({
40
- expiration: m ? ae(m) : null,
37
+ } = E, {
38
+ selectedAccess: N
39
+ } = O(), b = q(() => ({
40
+ expiration: m ? ee(m) : null,
41
41
  isDownloadEnabled: !!n.isDownloadEnabled,
42
42
  isExpirationEnabled: !!m,
43
43
  isPasswordEnabled: !!n.isPasswordEnabled,
@@ -47,41 +47,40 @@ function ye({
47
47
  }), [m, n, h]), {
48
48
  errors: u,
49
49
  formData: o,
50
- handleFormReset: N,
50
+ handleFormReset: S,
51
51
  handleFormSubmit: F,
52
52
  isUpdating: P,
53
- setErrors: T,
54
53
  setFieldError: r,
55
54
  setFieldValue: d,
56
- validatePassword: B
57
- } = ne(b);
58
- J(() => {
59
- (async () => p && (c && await p(), C(!c)))();
55
+ validatePassword: T
56
+ } = ae(b);
57
+ G(() => {
58
+ (async () => p && (c && await p(), k(!c)))();
60
59
  }, [c, p]);
61
- const S = () => {
62
- N(), y && y(), v(!1);
63
- }, A = async () => {
64
- await F() || (T({}), v(!1));
65
- }, _ = (e) => {
60
+ const C = () => {
61
+ S(), y && y(), v(!1);
62
+ }, B = async () => {
63
+ await F() || (S(), v(!1));
64
+ }, A = (e) => {
66
65
  r("expiration", void 0), d("isExpirationEnabled", e);
67
- }, V = (e) => {
66
+ }, _ = (e) => {
68
67
  r("expiration", void 0), d("expiration", e);
69
- }, M = (e) => {
68
+ }, V = (e) => {
70
69
  r("vanityName", void 0), d("isVanityNameEnabled", e);
71
- }, I = (e) => {
70
+ }, M = (e) => {
72
71
  r("vanityName", void 0), d("vanityName", e.target.value);
73
- }, j = (e) => {
72
+ }, I = (e) => {
74
73
  r("password", void 0), d("isPasswordEnabled", e);
75
- }, z = (e) => {
74
+ }, j = (e) => {
76
75
  r("password", void 0), d("password", e.target.value);
77
- }, U = (e) => {
76
+ }, z = (e) => {
78
77
  d("isDownloadEnabled", e);
79
- }, H = (e) => {
80
- const R = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(e.relatedTarget);
81
- b.isPasswordEnabled && !o.password || R || B(o.password);
82
- }, l = E || P;
78
+ }, U = (e) => {
79
+ const H = document.getElementById("usm-SharedLinkSettingsModal-primaryButton")?.contains(e.relatedTarget);
80
+ b.isPasswordEnabled && !o.password || H || T(o.password);
81
+ }, l = x || P;
83
82
  return /* @__PURE__ */ a(t, {
84
- onOpenChange: S,
83
+ onOpenChange: C,
85
84
  open: c,
86
85
  children: /* @__PURE__ */ w(t.Content, {
87
86
  className: f.content,
@@ -93,68 +92,68 @@ function ye({
93
92
  inert: g ? "" : null,
94
93
  children: [g && /* @__PURE__ */ a("div", {
95
94
  className: f.loading,
96
- children: /* @__PURE__ */ a(Q, {
95
+ children: /* @__PURE__ */ a(K, {
97
96
  "aria-label": i(s.loadingLabel),
98
97
  size: "large"
99
98
  })
100
- }), /* @__PURE__ */ a(W, {
99
+ }), /* @__PURE__ */ a(Q, {
101
100
  as: "p",
102
101
  color: "textOnLightSecondary",
103
102
  children: i(s.subtitle, {
104
- learnSharedLinkSettingsLink: /* @__PURE__ */ a(X, {
103
+ learnSharedLinkSettingsLink: /* @__PURE__ */ a(W, {
105
104
  href: "https://support.box.com/hc/en-us/articles/360043697554-Configuring-Individual-Shared-Link-Settings",
106
105
  rel: "noreferrer",
107
106
  target: "_blank",
108
107
  children: i(s.learnSharedLinkSettingsLink)
109
108
  })
110
109
  })
111
- }), /* @__PURE__ */ a(Z, {
110
+ }), /* @__PURE__ */ a(Y, {
112
111
  canChange: !!n.canChangeExpiration,
113
112
  error: u.expiration,
114
113
  expiration: o.expiration,
115
114
  isChecked: o.isExpirationEnabled,
116
115
  isDisabled: l,
117
- onChange: V,
118
- onToggle: _
119
- }), /* @__PURE__ */ a($, {
116
+ onChange: _,
117
+ onToggle: A
118
+ }), /* @__PURE__ */ a(Z, {
120
119
  canChange: !!n.canChangePassword,
121
120
  error: u.password,
122
- isAvailable: n.isPasswordAvailable && D?.id === "open",
121
+ isAvailable: n.isPasswordAvailable && N?.id === "open",
123
122
  isChecked: o.isPasswordEnabled,
124
123
  isDefaultChecked: b.isPasswordEnabled,
125
124
  isDisabled: l,
126
- onBlur: H,
127
- onChange: z,
125
+ onBlur: U,
126
+ onChange: j,
128
127
  onFocus: () => r("password", void 0),
129
- onToggle: j,
128
+ onToggle: I,
130
129
  password: o.password
131
- }), /* @__PURE__ */ a(O, {
130
+ }), /* @__PURE__ */ a($, {
132
131
  canChange: !!n.canChangeVanityName,
133
132
  error: u.vanityName,
134
133
  isAvailable: !!n.isVanityNameAvailable,
135
134
  isChecked: o.isVanityNameEnabled,
136
135
  isDisabled: l,
137
- onChange: I,
138
- onToggle: M,
139
- vanityDomain: L,
136
+ onChange: M,
137
+ onToggle: V,
138
+ vanityDomain: D,
140
139
  vanityName: o.vanityName
141
- }), /* @__PURE__ */ a(Y, {
140
+ }), /* @__PURE__ */ a(X, {
142
141
  canChange: !!n.canChangeDownload,
143
142
  isAvailable: !!n.isDownloadAvailable,
144
143
  isChecked: o.isDownloadEnabled,
145
144
  isDisabled: l,
146
- onToggle: U
145
+ onToggle: z
147
146
  })]
148
147
  }), !g && /* @__PURE__ */ w(t.Footer, {
149
148
  children: [/* @__PURE__ */ a(t.Footer.SecondaryButton, {
150
149
  disabled: l,
151
- onClick: S,
150
+ onClick: C,
152
151
  children: i(s.cancelButton)
153
152
  }), /* @__PURE__ */ a(t.Footer.PrimaryButton, {
154
153
  id: "usm-SharedLinkSettingsModal-primaryButton",
155
154
  loading: l,
156
155
  loadingAriaLabel: i(s.loadingLabel),
157
- onClick: A,
156
+ onClick: B,
158
157
  children: i(s.saveButton)
159
158
  })]
160
159
  }), /* @__PURE__ */ a(t.Close, {
@@ -164,5 +163,5 @@ function ye({
164
163
  });
165
164
  }
166
165
  export {
167
- ye as SharedLinkSettingsModal
166
+ ve as SharedLinkSettingsModal
168
167
  };
@@ -1,30 +1,30 @@
1
1
  import _ from "clsx";
2
2
  import L from "lodash/camelCase";
3
- import { useState as k, useMemo as w, useEffect as q } from "react";
4
- import { useIntl as F } from "react-intl";
5
- import { Tooltip as N, Focusable as O, TriggerButton as D, DropdownMenu as r } from "@box/blueprint-web";
6
- import $ from "../messages.js";
7
- import n from "./messages.js";
8
- import { jsx as e, jsxs as j } from "react/jsx-runtime";
9
- import { isInvitationRoleSupported as z, getDefaultCollaborationRole as A } from "../../../utils/collaborator.js";
10
- import { useUnifiedShareFormContext as P } from "../../../contexts/unified-share-form-context.js";
11
- import { useUnifiedShareModalContext as U } from "../../../contexts/unified-share-modal-context.js";
12
- import '../../../../../styles/collaboration-role.css';const B = "_container_1fonq_1", E = "_overrides_1fonq_4", W = "_focusable_1fonq_9", l = {
13
- container: B,
14
- overrides: E,
15
- focusable: W
3
+ import { useState as k, useMemo as w, useEffect as F } from "react";
4
+ import { useIntl as N } from "react-intl";
5
+ import { Tooltip as O, Focusable as $, TriggerButton as D, DropdownMenu as r } from "@box/blueprint-web";
6
+ import j from "../messages.js";
7
+ import l from "./messages.js";
8
+ import { jsx as e, jsxs as z } from "react/jsx-runtime";
9
+ import { isInvitationRoleSupported as A, getDefaultCollaborationRole as P } from "../../../utils/collaborator.js";
10
+ import { useUnifiedShareFormContext as U } from "../../../contexts/unified-share-form-context.js";
11
+ import { useUnifiedShareModalContext as B } from "../../../contexts/unified-share-modal-context.js";
12
+ import '../../../../../styles/collaboration-role.css';const E = "_container_120dl_1", W = "_overrides_120dl_9", q = "_focusable_120dl_14", n = {
13
+ container: E,
14
+ overrides: W,
15
+ focusable: q
16
16
  };
17
17
  function te() {
18
18
  const {
19
19
  formatMessage: o
20
- } = F(), [b, M] = k(!1), {
20
+ } = N(), [f, M] = k(!1), {
21
21
  collaborationRole: u,
22
22
  setCollaborationRole: d
23
- } = P(), {
23
+ } = U(), {
24
24
  collaborationRoles: g,
25
25
  isSubmitting: S,
26
26
  item: I
27
- } = U(), {
27
+ } = B(), {
28
28
  permissions: T = {},
29
29
  type: m
30
30
  } = I, s = w(() => g.map((i) => {
@@ -32,18 +32,18 @@ function te() {
32
32
  description: p,
33
33
  id: t,
34
34
  label: c
35
- } = i, f = z(t), h = L(t);
35
+ } = i, b = A(t), h = L(t);
36
36
  let x = h;
37
37
  t === "editor" && m === "folder" && (x += "Folder");
38
38
  let C = t, R = "";
39
- return f && (C = o($[`${h}Role`]), R = o(n[`${x}Description`])), {
39
+ return b && (C = o(j[`${h}Role`]), R = o(l[`${x}Description`])), {
40
40
  ...i,
41
41
  description: p ?? R,
42
42
  label: c ?? C
43
43
  };
44
44
  }), [g, o, m]);
45
- if (q(() => {
46
- d(A(s));
45
+ if (F(() => {
46
+ d(P(s));
47
47
  }, [s, d]), !s.length || !u)
48
48
  return null;
49
49
  const {
@@ -51,33 +51,33 @@ function te() {
51
51
  label: v
52
52
  } = u;
53
53
  let a;
54
- return T.canInviteCollaborator || (a = o(n.inviteDisabledTooltip)), m === "web_link" && (a = o(n.inviteWebLinkDisabledTooltip)), a ? /* @__PURE__ */ e(N, {
54
+ return T.canInviteCollaborator || (a = o(l.inviteDisabledTooltip)), m === "web_link" && (a = o(l.inviteWebLinkDisabledTooltip)), a ? /* @__PURE__ */ e(O, {
55
55
  align: "start",
56
56
  content: a,
57
57
  "data-testid": "collaboration-role-tooltip",
58
58
  side: "bottom",
59
- children: /* @__PURE__ */ e(O, {
60
- className: l.focusable,
59
+ children: /* @__PURE__ */ e($, {
60
+ className: n.focusable,
61
61
  children: /* @__PURE__ */ e(D, {
62
62
  caretDirection: "down",
63
- className: _(l.container, l.overrides),
63
+ className: _(n.container, n.overrides),
64
64
  disabled: !0,
65
- label: o(n.inviteAsRoleLabel, {
65
+ label: o(l.inviteAsRoleLabel, {
66
66
  role: v
67
67
  }),
68
68
  size: "extraSmall",
69
69
  variant: "tertiary"
70
70
  })
71
71
  })
72
- }) : /* @__PURE__ */ j(r.Root, {
72
+ }) : /* @__PURE__ */ z(r.Root, {
73
73
  onOpenChange: M,
74
- open: b,
74
+ open: f,
75
75
  children: [/* @__PURE__ */ e(r.Trigger, {
76
76
  children: /* @__PURE__ */ e(D, {
77
- caretDirection: b ? "up" : "down",
78
- className: _(l.container, l.overrides),
77
+ caretDirection: f ? "up" : "down",
78
+ className: _(n.container, n.overrides),
79
79
  disabled: S,
80
- label: o(n.inviteAsRoleLabel, {
80
+ label: o(l.inviteAsRoleLabel, {
81
81
  role: v
82
82
  }),
83
83
  size: "extraSmall",
@@ -90,7 +90,7 @@ function te() {
90
90
  description: p,
91
91
  isDisabled: t,
92
92
  id: c,
93
- label: f
93
+ label: b
94
94
  } = i;
95
95
  return /* @__PURE__ */ e(r.CheckboxItem, {
96
96
  checked: y === c,
@@ -98,7 +98,7 @@ function te() {
98
98
  onSelect: () => d(i),
99
99
  children: /* @__PURE__ */ e(r.Item.MainContent, {
100
100
  caption: p,
101
- label: f
101
+ label: b
102
102
  })
103
103
  }, c);
104
104
  })
@@ -1,6 +1,6 @@
1
1
  import { useState as ce, useRef as de, useEffect as N, useCallback as F } from "react";
2
- import { createPortal as me } from "react-dom";
3
- import { useIntl as ue } from "react-intl";
2
+ import { createPortal as ue } from "react-dom";
3
+ import { useIntl as me } from "react-intl";
4
4
  import { useNotification as he, useUniqueId as fe, useLabelable as pe, Tooltip as be, Focusable as Ce, Text as ve, Modal as h } from "@box/blueprint-web";
5
5
  import { Globe as ge } from "@box/blueprint-web-assets/icons/Medium";
6
6
  import { UserSelectorContainer as Se } from "@box/user-selector";
@@ -15,7 +15,7 @@ import { useFormValidation as _e } from "../../../hooks/use-form-validation.js";
15
15
  import { useCollaborationForm as xe } from "../../../hooks/use-collaboration-form.js";
16
16
  import { useUnifiedShareFormContext as Ee } from "../../../contexts/unified-share-form-context.js";
17
17
  import { useUnifiedShareModalContext as Be } from "../../../contexts/unified-share-modal-context.js";
18
- import '../../../../../styles/collaboration-section.css';const Ve = "_container_wmqot_2", Ne = "_label_wmqot_8", Re = "_securityIndicator_wmqot_23", Te = "_collaborationAccessContainer_wmqot_29", f = {
18
+ import '../../../../../styles/collaboration-section.css';const Ve = "_container_1d5sq_2", Ne = "_label_1d5sq_8", Re = "_securityIndicator_1d5sq_23", Te = "_collaborationAccessContainer_1d5sq_29", f = {
19
19
  container: Ve,
20
20
  label: Ne,
21
21
  securityIndicator: Re,
@@ -24,24 +24,24 @@ import '../../../../../styles/collaboration-section.css';const Ve = "_container_
24
24
  function Ye() {
25
25
  const {
26
26
  formatMessage: t
27
- } = ue(), [p, y] = ce(), {
27
+ } = me(), [p, y] = ce(), {
28
28
  addNotification: R
29
29
  } = he(), {
30
30
  validateShieldRestriction: T
31
31
  } = _e(), {
32
- contactValue: w,
32
+ contactValue: O,
33
33
  container: b,
34
34
  onModalOpenChange: I,
35
35
  onShareViewChange: C,
36
- setUserContacts: O,
36
+ setUserContacts: P,
37
37
  shareView: n,
38
38
  userContacts: a
39
39
  } = Ee(), {
40
- collaborationAccess: P,
41
- collaborationNotices: k,
40
+ collaborationAccess: k,
41
+ collaborationNotices: M,
42
42
  config: v,
43
- contactService: M,
44
- isFetching: q,
43
+ contactService: q,
44
+ isFetching: w,
45
45
  isSubmitting: D,
46
46
  item: G,
47
47
  sharingService: W
@@ -51,7 +51,7 @@ function Ye() {
51
51
  } = G, {
52
52
  getContacts: g,
53
53
  getContactsAvatarUrls: S
54
- } = M, {
54
+ } = q, {
55
55
  sendInvitations: K,
56
56
  sendSharedLink: $
57
57
  } = W;
@@ -98,15 +98,15 @@ function Ye() {
98
98
  return;
99
99
  const {
100
100
  shieldRestriction: U
101
- } = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], le = a.map((u) => V.includes(u.email) || V.includes(`${u.id}`) ? {
102
- ...u,
101
+ } = e, V = [...U.restrictedEmails ?? [], ...U.restrictedGroups ?? []], le = a.map((m) => V.includes(m.email) || V.includes(`${m.id}`) ? {
102
+ ...m,
103
103
  chipVariant: "error"
104
- } : u);
105
- y(U), O(le);
104
+ } : m);
105
+ y(U), P(le);
106
106
  }
107
107
  };
108
- let d, m = !1;
109
- s && !j.canInviteCollaborator && (d = t(o.inviteDisabledTooltip), m = !0), s && H === "web_link" && (d = t(o.inviteWebLinkDisabledTooltip), m = !0);
108
+ let d, u = !1;
109
+ s && !j.canInviteCollaborator && (d = t(o.inviteDisabledTooltip), u = !0), s && H === "web_link" && (d = t(o.inviteWebLinkDisabledTooltip), u = !0);
110
110
  const B = fe("user-contacts-"), ie = t(s ? o.invitePeopleLabel : o.emailSharedLinkLabel), se = pe(ie, B);
111
111
  return /* @__PURE__ */ i("form", {
112
112
  className: f.container,
@@ -115,7 +115,7 @@ function Ye() {
115
115
  error: p,
116
116
  isLoading: c,
117
117
  onSelectedUsersChange: x
118
- }), k, /* @__PURE__ */ i("div", {
118
+ }), M, /* @__PURE__ */ i("div", {
119
119
  children: [s && v.collaborators && /* @__PURE__ */ r(Le, {}), /* @__PURE__ */ r(se, {
120
120
  className: f.label
121
121
  }), /* @__PURE__ */ r(be, {
@@ -124,19 +124,19 @@ function Ye() {
124
124
  open: d ? void 0 : !1,
125
125
  side: "bottom",
126
126
  children: /* @__PURE__ */ r(Ce, {
127
- focusable: m,
127
+ focusable: u,
128
128
  children: /* @__PURE__ */ r(Se, {
129
129
  className: "collaboration-user-selector",
130
130
  clearButtonAriaLabel: t(o.clearButton),
131
131
  clearOnBlur: !1,
132
- disabled: m || c,
132
+ disabled: u || c,
133
133
  displayChipVariant: (e) => e.chipVariant,
134
134
  error: z["user-contact"],
135
135
  fetchAvatarUrls: oe,
136
136
  fetchUsers: te,
137
137
  hideOnEscape: ee,
138
138
  idForLabel: B,
139
- inputValue: w,
139
+ inputValue: O,
140
140
  label: null,
141
141
  onBlur: Q,
142
142
  onInputValueChange: re,
@@ -150,7 +150,7 @@ function Ye() {
150
150
  })
151
151
  }), s && /* @__PURE__ */ i("div", {
152
152
  className: f.collaborationAccessContainer,
153
- children: [v.collaborationRole && /* @__PURE__ */ r(Ae, {}), P]
153
+ children: [v.collaborationRole && /* @__PURE__ */ r(Ae, {}), k]
154
154
  })]
155
155
  }), l && v.collaborationMessage && /* @__PURE__ */ r(Fe, {
156
156
  maxCount: ye
@@ -161,8 +161,8 @@ function Ye() {
161
161
  color: "textOnLightSecondary",
162
162
  children: t(o.contentSharedWithExternalCollaborators)
163
163
  })]
164
- }), l && b && /* @__PURE__ */ me(/* @__PURE__ */ i(Ie, {
165
- children: [!q && /* @__PURE__ */ i(h.Footer, {
164
+ }), l && b && /* @__PURE__ */ ue(/* @__PURE__ */ i(Ie, {
165
+ children: [!w && /* @__PURE__ */ i(h.Footer, {
166
166
  children: [/* @__PURE__ */ r(h.Footer.SecondaryButton, {
167
167
  disabled: c,
168
168
  onClick: ne,
@@ -1,49 +1,50 @@
1
- import R from "lodash/camelCase";
1
+ import y from "lodash/camelCase";
2
2
  import { useIntl as D } from "react-intl";
3
- import { Row as S, Cell as m, Text as n, Tooltip as q, IconButton as y } from "@box/blueprint-web";
4
- import { XMark as B } from "@box/blueprint-web-assets/icons/Fill";
5
- import { CollaboratorAvatar as L } from "./collaborator-avatar.js";
6
- import M from "../messages.js";
3
+ import { Row as S, Cell as m, Text as n, Tooltip as z, IconButton as B } from "@box/blueprint-web";
4
+ import { XMark as L } from "@box/blueprint-web-assets/icons/Fill";
5
+ import { CollaboratorAvatar as M } from "./collaborator-avatar.js";
6
+ import N from "../messages.js";
7
7
  import s from "./messages.js";
8
8
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
9
- import { isCollaboratorRoleSupported as N } from "../../../utils/collaborator.js";
10
- import { useUnifiedShareModalContext as I } from "../../../contexts/unified-share-modal-context.js";
11
- import { useUnifiedShareFormContext as j } from "../../../contexts/unified-share-form-context.js";
12
- import '../../../../../styles/collaborator-list-item.css';const k = "_nameCell_empqg_1", w = "_nameDetails_empqg_7", O = "_roleCell_empqg_14", T = "_text_empqg_21", l = {
13
- nameCell: k,
14
- nameDetails: w,
15
- roleCell: O,
16
- text: T
9
+ import { isCollaboratorRoleSupported as I } from "../../../utils/collaborator.js";
10
+ import { useUnifiedShareModalContext as j } from "../../../contexts/unified-share-modal-context.js";
11
+ import { useUnifiedShareFormContext as k } from "../../../contexts/unified-share-form-context.js";
12
+ import '../../../../../styles/collaborator-list-item.css';const w = "_nameCell_y1zd0_1", O = "_nameDetails_y1zd0_7", T = "_roleCell_y1zd0_15", U = "_text_y1zd0_22", l = {
13
+ nameCell: w,
14
+ nameDetails: O,
15
+ roleCell: T,
16
+ text: U
17
17
  };
18
- function J({
19
- collaborator: a
18
+ function K({
19
+ collaborator: a,
20
+ isSmall: c
20
21
  }) {
21
22
  const {
22
23
  formatMessage: o
23
24
  } = D(), {
24
25
  email: i,
25
- hasCustomRole: c,
26
- id: d,
27
- isPending: p,
28
- isRemovable: C,
29
- name: f,
26
+ hasCustomRole: d,
27
+ id: p,
28
+ isPending: C,
29
+ isRemovable: f,
30
+ name: h,
30
31
  role: r
31
32
  } = a, {
32
- item: h,
33
- setCollaborator: g
34
- } = I(), {
35
- permissions: u = {}
36
- } = h, {
37
- onModalViewChange: v
38
- } = j(), x = N(r) ? o(M[`${R(r)}Role`]) : "", _ = c ? r : x, b = () => {
39
- g(a), v("remove-collaborator");
33
+ item: u,
34
+ setCollaborator: v
35
+ } = j(), {
36
+ permissions: x = {}
37
+ } = u, {
38
+ onModalViewChange: _
39
+ } = k(), b = I(r) ? o(N[`${y(r)}Role`]) : "", g = d ? r : b, R = () => {
40
+ v(a), _("remove-collaborator");
40
41
  };
41
42
  return /* @__PURE__ */ t(S, {
42
- id: d,
43
+ id: p,
43
44
  children: [/* @__PURE__ */ e(m, {
44
45
  children: /* @__PURE__ */ t("div", {
45
46
  className: l.nameCell,
46
- children: [/* @__PURE__ */ e(L, {
47
+ children: [/* @__PURE__ */ e(M, {
47
48
  collaborator: a,
48
49
  isBadgeable: !0,
49
50
  size: "large"
@@ -52,7 +53,7 @@ function J({
52
53
  children: [/* @__PURE__ */ e(n, {
53
54
  as: "span",
54
55
  variant: "bodyDefaultSemibold",
55
- children: f
56
+ children: h
56
57
  }), i && /* @__PURE__ */ e(n, {
57
58
  as: "span",
58
59
  color: "textOnLightSecondary",
@@ -61,20 +62,20 @@ function J({
61
62
  })]
62
63
  })]
63
64
  })
64
- }), /* @__PURE__ */ e(m, {
65
+ }), !c && /* @__PURE__ */ e(m, {
65
66
  children: /* @__PURE__ */ t("div", {
66
67
  className: l.roleCell,
67
68
  children: [/* @__PURE__ */ e(n, {
68
69
  as: "span",
69
70
  className: l.text,
70
71
  color: "textOnLightSecondary",
71
- children: p ? o(s.pendingRole) : _
72
- }), C && u.canRemoveCollaborator && /* @__PURE__ */ e(q, {
72
+ children: C ? o(s.pendingRole) : g
73
+ }), f && x.canRemoveCollaborator && /* @__PURE__ */ e(z, {
73
74
  content: o(s.removeButton),
74
- children: /* @__PURE__ */ e(y, {
75
+ children: /* @__PURE__ */ e(B, {
75
76
  "aria-label": o(s.removeButton),
76
- icon: B,
77
- onClick: b
77
+ icon: L,
78
+ onClick: R
78
79
  })
79
80
  })]
80
81
  })
@@ -82,5 +83,5 @@ function J({
82
83
  });
83
84
  }
84
85
  export {
85
- J as CollaboratorListItem
86
+ K as CollaboratorListItem
86
87
  };
@@ -1,88 +1,88 @@
1
1
  import { createPortal as C } from "react-dom";
2
- import { useIntl as p } from "react-intl";
3
- import { TextButton as B, Link as k, Table as v, TableHeader as x, Column as c, TableBody as A, Modal as l } from "@box/blueprint-web";
4
- import { CollaboratorListItem as F } from "./collaborator-list-item.js";
5
- import r from "./messages.js";
6
- import { jsxs as t, jsx as e, Fragment as L } from "react/jsx-runtime";
7
- import { useUnifiedShareModalContext as y } from "../../../contexts/unified-share-modal-context.js";
8
- import { useUnifiedShareFormContext as M } from "../../../contexts/unified-share-form-context.js";
9
- import '../../../../../styles/collaborators-view.css';const N = "_manage_8rmie_1", S = "_manageAllButton_8rmie_6", T = "_list_8rmie_13", H = "_scroll_8rmie_30", w = "_header_8rmie_36", a = {
10
- manage: N,
11
- manageAllButton: S,
12
- list: T,
13
- scroll: H,
14
- header: w
2
+ import { useIntl as k } from "react-intl";
3
+ import { useBreakpoint as B, Breakpoint as v, TextButton as S, Link as x, Table as A, TableHeader as F, Column as h, TableBody as L, Modal as n } from "@box/blueprint-web";
4
+ import { CollaboratorListItem as y } from "./collaborator-list-item.js";
5
+ import a from "./messages.js";
6
+ import { jsxs as t, jsx as e, Fragment as M } from "react/jsx-runtime";
7
+ import { useUnifiedShareModalContext as N } from "../../../contexts/unified-share-modal-context.js";
8
+ import { useUnifiedShareFormContext as T } from "../../../contexts/unified-share-form-context.js";
9
+ import '../../../../../styles/collaborators-view.css';const H = "_manage_8rmie_1", w = "_manageAllButton_8rmie_6", I = "_list_8rmie_13", j = "_scroll_8rmie_30", U = "_header_8rmie_36", r = {
10
+ manage: H,
11
+ manageAllButton: w,
12
+ list: I,
13
+ scroll: j,
14
+ header: U
15
15
  };
16
- function z() {
16
+ function J() {
17
17
  const {
18
18
  formatMessage: o
19
- } = p(), {
20
- collaborators: d,
21
- config: n,
22
- eventService: h,
23
- isFetching: i,
24
- item: u
25
- } = y(), {
26
- id: g,
27
- type: _
28
- } = u, {
29
- onCollaboratorsManagementClick: s
30
- } = h, {
31
- container: m,
19
+ } = k(), l = B() === v.Small, {
20
+ collaborators: u,
21
+ config: i,
22
+ eventService: g,
23
+ isFetching: s,
24
+ item: p
25
+ } = N(), {
26
+ id: _,
27
+ type: b
28
+ } = p, {
29
+ onCollaboratorsManagementClick: m
30
+ } = g, {
31
+ container: c,
32
32
  onShareViewChange: f
33
- } = M();
33
+ } = T();
34
34
  return /* @__PURE__ */ t("div", {
35
- inert: i ? "" : null,
36
- children: [n.collaboratorsManagement && /* @__PURE__ */ e("div", {
37
- className: a.manage,
38
- children: s ? /* @__PURE__ */ e(B, {
39
- className: a.manageAllButton,
35
+ inert: s ? "" : null,
36
+ children: [i.collaboratorsManagement && /* @__PURE__ */ e("div", {
37
+ className: r.manage,
38
+ children: m ? /* @__PURE__ */ e(S, {
39
+ className: r.manageAllButton,
40
40
  inheritFont: !0,
41
- onClick: s,
42
- children: o(r.manageAllLink)
43
- }) : /* @__PURE__ */ e(k, {
44
- href: `/${_}/${g}/collaborators`,
41
+ onClick: m,
42
+ children: o(a.manageAllLink)
43
+ }) : /* @__PURE__ */ e(x, {
44
+ href: `/${b}/${_}/collaborators`,
45
45
  rel: "noopener",
46
46
  target: "_blank",
47
47
  variant: "standalone",
48
- children: o(r.manageAllLink)
48
+ children: o(a.manageAllLink)
49
49
  })
50
50
  }), /* @__PURE__ */ e("div", {
51
- className: a.list,
51
+ className: r.list,
52
52
  children: /* @__PURE__ */ e("div", {
53
- className: a.scroll,
54
- children: /* @__PURE__ */ t(v, {
55
- "aria-label": o(r.listLabel),
56
- children: [/* @__PURE__ */ t(x, {
57
- className: a.header,
58
- children: [/* @__PURE__ */ e(c, {
53
+ className: r.scroll,
54
+ children: /* @__PURE__ */ t(A, {
55
+ "aria-label": o(a.listLabel),
56
+ children: [/* @__PURE__ */ t(F, {
57
+ className: r.header,
58
+ children: [/* @__PURE__ */ e(h, {
59
59
  hideHeader: !0,
60
60
  isRowHeader: !0,
61
- children: o(r.nameColumn)
62
- }), /* @__PURE__ */ e(c, {
61
+ children: o(a.nameColumn)
62
+ }), !l && /* @__PURE__ */ e(h, {
63
63
  hideHeader: !0,
64
- children: o(r.roleColumn)
64
+ children: o(a.roleColumn)
65
65
  })]
66
- }), /* @__PURE__ */ e(A, {
67
- items: d.slice(0, n.collaboratorsLimit),
68
- children: (b) => /* @__PURE__ */ e(F, {
69
- collaborator: b
70
- })
66
+ }), /* @__PURE__ */ e(L, {
67
+ children: u.slice(0, i.collaboratorsLimit).map((d) => /* @__PURE__ */ e(y, {
68
+ collaborator: d,
69
+ isSmall: l
70
+ }, d.id))
71
71
  })]
72
72
  })
73
73
  })
74
- }), m && /* @__PURE__ */ C(/* @__PURE__ */ t(L, {
75
- children: [!i && /* @__PURE__ */ e(l.Footer, {
76
- children: /* @__PURE__ */ e(l.Footer.SecondaryButton, {
74
+ }), c && /* @__PURE__ */ C(/* @__PURE__ */ t(M, {
75
+ children: [!s && /* @__PURE__ */ e(n.Footer, {
76
+ children: /* @__PURE__ */ e(n.Footer.SecondaryButton, {
77
77
  onClick: () => f("default"),
78
- children: o(r.doneButton)
78
+ children: o(a.doneButton)
79
79
  })
80
- }), /* @__PURE__ */ e(l.Close, {
81
- "aria-label": o(r.closeButton)
80
+ }), /* @__PURE__ */ e(n.Close, {
81
+ "aria-label": o(a.closeButton)
82
82
  })]
83
- }), m)]
83
+ }), c)]
84
84
  });
85
85
  }
86
86
  export {
87
- z as CollaboratorsView
87
+ J as CollaboratorsView
88
88
  };
@@ -1,70 +1,70 @@
1
1
  import k from "clsx";
2
2
  import { useState as M } from "react";
3
3
  import { useIntl as I } from "react-intl";
4
- import { DropdownMenu as n, TriggerButton as z, Tooltip as T, Focusable as q } from "@box/blueprint-web";
5
- import w from "./messages.js";
6
- import { jsxs as O, jsx as e } from "react/jsx-runtime";
7
- import { useUnifiedShareModalContext as j } from "../../../contexts/unified-share-modal-context.js";
8
- import { useSharingAction as y } from "../../../hooks/use-sharing-action.js";
9
- import { useAccessLevels as D } from "../../../hooks/use-access-levels.js";
10
- import '../../../../../styles/shared-link-access.css';const N = "_container_xhq4z_1", R = "_overrides_xhq4z_1", B = "_content_xhq4z_6", s = {
11
- container: N,
12
- overrides: R,
13
- content: B
4
+ import { DropdownMenu as n, TriggerButton as j, Tooltip as T, Focusable as w } from "@box/blueprint-web";
5
+ import O from "./messages.js";
6
+ import { jsxs as y, jsx as e } from "react/jsx-runtime";
7
+ import { useUnifiedShareModalContext as D } from "../../../contexts/unified-share-modal-context.js";
8
+ import { useSharingAction as N } from "../../../hooks/use-sharing-action.js";
9
+ import { useAccessLevels as R } from "../../../hooks/use-access-levels.js";
10
+ import '../../../../../styles/shared-link-access.css';const z = "_container_1jrg6_1", B = "_overrides_1jrg6_8", F = "_content_1jrg6_13", s = {
11
+ container: z,
12
+ overrides: B,
13
+ content: F
14
14
  };
15
15
  function V() {
16
16
  const {
17
17
  formatMessage: d
18
- } = I(), [c, m] = M(!1), {
18
+ } = I(), [r, m] = M(!1), {
19
19
  isSubmitting: h,
20
20
  item: p,
21
21
  sharedLink: u,
22
- sharingService: f
23
- } = j(), {
24
- permissions: g = {}
22
+ sharingService: g
23
+ } = D(), {
24
+ permissions: f = {}
25
25
  } = p, {
26
26
  access: S
27
27
  } = u, {
28
28
  changeSharedLinkAccess: b
29
- } = f, {
30
- isLoading: x,
31
- onAction: v
32
- } = y(b), {
33
- allowedLevels: r,
29
+ } = g, {
30
+ isLoading: v,
31
+ onAction: _
32
+ } = N(b), {
33
+ allowedLevels: c,
34
34
  selectedAccess: i
35
- } = D();
36
- if (!r.length || !i)
35
+ } = R();
36
+ if (!c.length || !i)
37
37
  return null;
38
38
  const {
39
- label: _
39
+ label: x
40
40
  } = i;
41
- return /* @__PURE__ */ O(n.Root, {
41
+ return /* @__PURE__ */ y(n.Root, {
42
42
  onOpenChange: m,
43
- open: c,
43
+ open: r,
44
44
  children: [/* @__PURE__ */ e(n.Trigger, {
45
- children: /* @__PURE__ */ e(z, {
46
- caretDirection: c ? "up" : "down",
45
+ children: /* @__PURE__ */ e(j, {
46
+ caretDirection: r ? "up" : "down",
47
47
  className: k(s.container, s.overrides),
48
- disabled: !g.canSetShareAccess || (h ?? x),
49
- label: _,
48
+ disabled: !f.canSetShareAccess || (h ?? v),
49
+ label: x,
50
50
  size: "extraSmall",
51
51
  variant: "tertiary"
52
52
  })
53
53
  }), /* @__PURE__ */ e(n.Content, {
54
54
  align: "start",
55
55
  className: s.content,
56
- children: r.map((A) => {
56
+ children: c.map((A) => {
57
57
  const {
58
58
  description: a,
59
59
  disabledReason: C,
60
60
  id: t,
61
61
  label: l
62
62
  } = A, o = S === t, L = () => {
63
- o || v(t);
63
+ o || _(t);
64
64
  };
65
65
  return C ? /* @__PURE__ */ e(T, {
66
- content: d(w.disabledAccessLevelTooltip),
67
- children: /* @__PURE__ */ e(q, {
66
+ content: d(O.disabledAccessLevelTooltip),
67
+ children: /* @__PURE__ */ e(w, {
68
68
  children: /* @__PURE__ */ e(n.CheckboxItem, {
69
69
  checked: o,
70
70
  disabled: !0,
@@ -1,47 +1,47 @@
1
1
  import p from "clsx";
2
2
  import { useState as I } from "react";
3
3
  import { useIntl as O } from "react-intl";
4
- import { Tooltip as z, Focusable as E, TriggerButton as h, DropdownMenu as t } from "@box/blueprint-web";
4
+ import { Tooltip as j, Focusable as E, TriggerButton as h, DropdownMenu as t } from "@box/blueprint-web";
5
5
  import { FILE_EXTENSION_BOX_NOTE as w } from "../../../constants.js";
6
6
  import D from "./messages.js";
7
7
  import { jsx as e, jsxs as P } from "react/jsx-runtime";
8
- import { usePermissionLevels as q } from "../../../hooks/use-permission-levels.js";
9
- import { useUnifiedShareModalContext as y } from "../../../contexts/unified-share-modal-context.js";
10
- import { useSharingAction as A } from "../../../hooks/use-sharing-action.js";
11
- import '../../../../../styles/shared-link-access.css';const B = "_container_xhq4z_1", j = "_overrides_xhq4z_1", F = "_content_xhq4z_6", n = {
12
- container: B,
13
- overrides: j,
14
- content: F
8
+ import { usePermissionLevels as y } from "../../../hooks/use-permission-levels.js";
9
+ import { useUnifiedShareModalContext as A } from "../../../contexts/unified-share-modal-context.js";
10
+ import { useSharingAction as B } from "../../../hooks/use-sharing-action.js";
11
+ import '../../../../../styles/shared-link-access.css';const z = "_container_1jrg6_1", F = "_overrides_1jrg6_8", X = "_content_1jrg6_13", n = {
12
+ container: z,
13
+ overrides: F,
14
+ content: X
15
15
  };
16
16
  function Y() {
17
17
  const {
18
- formatMessage: u
19
- } = O(), [s, f] = I(!1), {
20
- isSubmitting: g,
21
- item: r,
18
+ formatMessage: g
19
+ } = O(), [r, u] = I(!1), {
20
+ isSubmitting: f,
21
+ item: s,
22
22
  sharedLink: S,
23
23
  sharingService: b
24
- } = y(), {
25
- permissions: x = {}
26
- } = r, {
27
- access: _,
24
+ } = A(), {
25
+ permissions: _ = {}
26
+ } = s, {
27
+ access: v,
28
28
  permission: a
29
29
  } = S, {
30
- changeSharedLinkPermission: v
30
+ changeSharedLinkPermission: x
31
31
  } = b, {
32
32
  isLoading: L,
33
33
  onAction: M
34
- } = A(v), {
34
+ } = B(x), {
35
35
  allowedLevels: c,
36
36
  selectedPermission: l
37
- } = q();
38
- if (_ === "collaborators" || !c.length || !l)
37
+ } = y();
38
+ if (v === "collaborators" || !c.length || !l)
39
39
  return null;
40
40
  const {
41
41
  label: d
42
42
  } = l;
43
43
  let o = "";
44
- return r.extension === w && a === "can_edit" && (o = u(D.canEditBoxNoteDisabledTooltip)), o ? /* @__PURE__ */ e(z, {
44
+ return s.extension === w && a === "can_edit" && (o = g(D.canEditBoxNoteDisabledTooltip)), o ? /* @__PURE__ */ e(j, {
45
45
  align: "start",
46
46
  content: o,
47
47
  "data-testid": "shared-link-permission-tooltip",
@@ -57,13 +57,13 @@ function Y() {
57
57
  })
58
58
  })
59
59
  }) : /* @__PURE__ */ P(t.Root, {
60
- onOpenChange: f,
61
- open: s,
60
+ onOpenChange: u,
61
+ open: r,
62
62
  children: [/* @__PURE__ */ e(t.Trigger, {
63
63
  children: /* @__PURE__ */ e(h, {
64
- caretDirection: s ? "up" : "down",
64
+ caretDirection: r ? "up" : "down",
65
65
  className: p(n.container, n.overrides),
66
- disabled: !x.canSetShareAccess || (g ?? L),
66
+ disabled: !_.canSetShareAccess || (f ?? L),
67
67
  label: d,
68
68
  size: "extraSmall",
69
69
  variant: "tertiary"
@@ -1 +1 @@
1
- ._container_1fonq_1{align-self:flex-start}._container_1fonq_1._overrides_1fonq_4{min-height:unset;font-weight:var(--body-default-font-weight)}._focusable_1fonq_9{justify-self:flex-start}
1
+ ._container_120dl_1{align-self:flex-start;max-width:100%}._container_120dl_1 span:first-child{overflow:hidden;text-overflow:ellipsis}._container_120dl_1._overrides_120dl_9{min-height:unset;font-weight:var(--body-default-font-weight)}._focusable_120dl_14{justify-self:flex-start}
@@ -1 +1 @@
1
- ._container_wmqot_2{display:flex;flex-direction:column;gap:var(--space-4)}._label_wmqot_8{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);text-decoration:var(--body-default-bold-text-decoration);display:block;margin-block-end:var(--space-2);padding:var(--space-1) 0;color:var(--text-text-on-light);overflow-wrap:break-word}._securityIndicator_wmqot_23>svg{display:inline-block;margin-bottom:-3px;padding-right:var(--space-1)}._collaborationAccessContainer_wmqot_29{display:flex;gap:var(--space-2);margin-top:var(--space-3)}
1
+ ._container_1d5sq_2{display:flex;flex-direction:column;gap:var(--space-4)}._label_1d5sq_8{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);text-decoration:var(--body-default-bold-text-decoration);display:block;margin-block-end:var(--space-2);padding:var(--space-1) 0;color:var(--text-text-on-light);overflow-wrap:break-word}._securityIndicator_1d5sq_23>svg{display:inline-block;margin-bottom:-3px;padding-right:var(--space-1)}._collaborationAccessContainer_1d5sq_29{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-3)}
@@ -1 +1 @@
1
- ._nameCell_empqg_1{display:flex;gap:var(--space-3);align-items:center}._nameDetails_empqg_7{display:flex;flex-direction:column;justify-content:space-evenly;height:var(--size-10)}._roleCell_empqg_14{display:flex;gap:var(--space-2);align-items:center;justify-content:flex-end}._text_empqg_21{overflow:hidden;text-overflow:ellipsis}
1
+ ._nameCell_y1zd0_1{display:flex;gap:var(--space-3);align-items:center}._nameDetails_y1zd0_7{display:flex;flex-direction:column;justify-content:space-evenly;height:var(--size-10);overflow:hidden}._roleCell_y1zd0_15{display:flex;gap:var(--space-2);align-items:center;justify-content:flex-end}._text_y1zd0_22{overflow:hidden;text-overflow:ellipsis}
@@ -1 +1 @@
1
- ._container_xhq4z_1._overrides_xhq4z_1{min-height:unset;font-weight:var(--body-default-font-weight)}._content_xhq4z_6{z-index:2147483646}
1
+ ._container_1jrg6_1{max-width:100%}._container_1jrg6_1 span:first-child{overflow:hidden;text-overflow:ellipsis}._container_1jrg6_1._overrides_1jrg6_8{min-height:unset;font-weight:var(--body-default-font-weight)}._content_1jrg6_13{z-index:2147483646}
@@ -1,5 +1,6 @@
1
1
  import { Collaborator } from '../../../types';
2
2
  export interface CollaboratorListItemProps {
3
3
  collaborator: Collaborator;
4
+ isSmall: boolean;
4
5
  }
5
- export declare function CollaboratorListItem({ collaborator }: CollaboratorListItemProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function CollaboratorListItem({ collaborator, isSmall }: CollaboratorListItemProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/unified-share-modal",
3
- "version": "1.36.0",
3
+ "version": "1.36.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^12.112.2",