@box/collaboration-popover 2.1.33 → 2.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/collaboration-popover.module.js +1 -15
- package/dist/chunks/user-info-footer.js +1 -29
- package/dist/esm/index.js +1 -6
- package/dist/esm/lib/collaboration-popover.js +1 -60
- package/dist/esm/lib/components/user-avatar.js +1 -25
- package/dist/esm/lib/components/user-details.js +1 -56
- package/dist/esm/lib/components/user-info-footer.js +1 -2
- package/dist/esm/lib/components/user-invite-dropdown.js +1 -47
- package/dist/esm/lib/messages.js +1 -48
- package/dist/esm/lib/utils/getInitials.js +1 -2
- package/package.json +7 -7
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import '../styles/collaboration-popover.css';var
|
|
2
|
-
popoverContainer: "_popoverContainer_5hpmm_1",
|
|
3
|
-
collaborationPopoverContent: "_collaborationPopoverContent_5hpmm_5",
|
|
4
|
-
isCollaborator: "_isCollaborator_5hpmm_14",
|
|
5
|
-
userDetails: "_userDetails_5hpmm_19",
|
|
6
|
-
userInfo: "_userInfo_5hpmm_35",
|
|
7
|
-
userName: "_userName_5hpmm_43",
|
|
8
|
-
userEmail: "_userEmail_5hpmm_44",
|
|
9
|
-
userInfoFooter: "_userInfoFooter_5hpmm_54",
|
|
10
|
-
inviteTriggerButton: "_inviteTriggerButton_5hpmm_62",
|
|
11
|
-
copySharedLinkButton: "_copySharedLinkButton_5hpmm_66",
|
|
12
|
-
userAvatar: "_userAvatar_5hpmm_70",
|
|
13
|
-
inviteDropdownMenu: "_inviteDropdownMenu_5hpmm_74"
|
|
14
|
-
};
|
|
15
|
-
export { e as t };
|
|
1
|
+
import '../styles/collaboration-popover.css';var collaboration_popover_module_default={popoverContainer:`_popoverContainer_5hpmm_1`,collaborationPopoverContent:`_collaborationPopoverContent_5hpmm_5`,isCollaborator:`_isCollaborator_5hpmm_14`,userDetails:`_userDetails_5hpmm_19`,userInfo:`_userInfo_5hpmm_35`,userName:`_userName_5hpmm_43`,userEmail:`_userEmail_5hpmm_44`,userInfoFooter:`_userInfoFooter_5hpmm_54`,inviteTriggerButton:`_inviteTriggerButton_5hpmm_62`,copySharedLinkButton:`_copySharedLinkButton_5hpmm_66`,userAvatar:`_userAvatar_5hpmm_70`,inviteDropdownMenu:`_inviteDropdownMenu_5hpmm_74`};export{collaboration_popover_module_default as t};
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../esm/lib/messages.js";
|
|
3
|
-
import { UserInviteDropdown as n } from "../esm/lib/components/user-invite-dropdown.js";
|
|
4
|
-
import { Button as r } from "@box/blueprint-web";
|
|
5
|
-
import { useIntl as i } from "react-intl";
|
|
6
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
-
var o = /* @__PURE__ */ function(e) {
|
|
8
|
-
return e.Invite = "invite", e.CopySharedLink = "copySharedLink", e.Collaborator = "collaborator", e;
|
|
9
|
-
}({}), s = ({ userInfo: s, defaultInviteType: c, loading: l = !1, onInviteTypeChange: u, onClose: d, onSubmit: f, type: p }) => {
|
|
10
|
-
let { formatMessage: m } = i(), h = async (e) => {
|
|
11
|
-
await f?.(s, e), d?.();
|
|
12
|
-
};
|
|
13
|
-
return /* @__PURE__ */ a("div", {
|
|
14
|
-
className: e.userInfoFooter,
|
|
15
|
-
children: p === o.Invite ? /* @__PURE__ */ a(n, {
|
|
16
|
-
defaultInviteType: c,
|
|
17
|
-
loading: l,
|
|
18
|
-
onInvite: h,
|
|
19
|
-
onInviteTypeChange: u
|
|
20
|
-
}) : /* @__PURE__ */ a(r, {
|
|
21
|
-
"aria-label": m(t.copySharedLinkButton),
|
|
22
|
-
className: e.copySharedLinkButton,
|
|
23
|
-
disabled: l,
|
|
24
|
-
onClick: () => h(),
|
|
25
|
-
children: m(t.copySharedLinkButton)
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export { o as n, s as t };
|
|
1
|
+
import{t as collaboration_popover_module_default}from"./collaboration-popover.module.js";import messages from"../esm/lib/messages.js";import{UserInviteDropdown}from"../esm/lib/components/user-invite-dropdown.js";import{Button}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";var CollaborationPopoverType=function(CollaborationPopoverType){return CollaborationPopoverType.Invite=`invite`,CollaborationPopoverType.CopySharedLink=`copySharedLink`,CollaborationPopoverType.Collaborator=`collaborator`,CollaborationPopoverType}({}),UserInfoFooter=({userInfo,defaultInviteType,loading=!1,onInviteTypeChange,onClose,onSubmit,type})=>{let{formatMessage}=useIntl(),handleSubmit=async inviteType=>{await onSubmit?.(userInfo,inviteType),onClose?.()};return jsx(`div`,{className:collaboration_popover_module_default.userInfoFooter,children:type===CollaborationPopoverType.Invite?jsx(UserInviteDropdown,{defaultInviteType,loading,onInvite:handleSubmit,onInviteTypeChange}):jsx(Button,{"aria-label":formatMessage(messages.copySharedLinkButton),className:collaboration_popover_module_default.copySharedLinkButton,disabled:loading,onClick:()=>handleSubmit(),children:formatMessage(messages.copySharedLinkButton)})})};export{CollaborationPopoverType as n,UserInfoFooter as t};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { UserDetails as t } from "./lib/components/user-details.js";
|
|
3
|
-
import { n, t as r } from "../chunks/user-info-footer.js";
|
|
4
|
-
import { UserInviteDropdown as i } from "./lib/components/user-invite-dropdown.js";
|
|
5
|
-
import { CollaborationPopover as a } from "./lib/collaboration-popover.js";
|
|
6
|
-
export { a as CollaborationPopover, n as CollaborationPopoverType, e as UserAvatar, t as UserDetails, r as UserInfoFooter, i as UserInviteDropdown };
|
|
1
|
+
import{UserAvatar}from"./lib/components/user-avatar.js";import{UserDetails}from"./lib/components/user-details.js";import{n as CollaborationPopoverType,t as UserInfoFooter}from"../chunks/user-info-footer.js";import{UserInviteDropdown}from"./lib/components/user-invite-dropdown.js";import{CollaborationPopover}from"./lib/collaboration-popover.js";export{CollaborationPopover,CollaborationPopoverType,UserAvatar,UserDetails,UserInfoFooter,UserInviteDropdown};
|
|
@@ -1,60 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./messages.js";
|
|
3
|
-
import { UserDetails as n } from "./components/user-details.js";
|
|
4
|
-
import { n as r, t as i } from "../../chunks/user-info-footer.js";
|
|
5
|
-
import { InlineNotice as a, Popover as o } from "@box/blueprint-web";
|
|
6
|
-
import s from "classnames";
|
|
7
|
-
import c from "clsx";
|
|
8
|
-
import { useMemo as l } from "react";
|
|
9
|
-
import { useIntl as u } from "react-intl";
|
|
10
|
-
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
-
var m = 8;
|
|
12
|
-
function h({ userInfo: h, open: g = !1, anchor: _, align: v = "start", side: y = "bottom", sideOffset: b = m, type: x = r.Collaborator, onSubmit: S, onUserClick: C, onClose: w, onInviteTypeChange: T, loading: E = !1, onOpenChange: D, popoverContentContainerProps: O }) {
|
|
13
|
-
let { formatMessage: k } = u(), A = l(() => {
|
|
14
|
-
let e = typeof x == "function" ? x(h) : x;
|
|
15
|
-
return !h.email && e === r.Invite ? r.CopySharedLink : e;
|
|
16
|
-
}, [x, h]), j = l(() => A === r.Invite ? k(t.noAccessInvite) : k(t.noAccessSharedLink), [k, A]), M = () => {
|
|
17
|
-
w?.();
|
|
18
|
-
};
|
|
19
|
-
return /* @__PURE__ */ p(o.Root, {
|
|
20
|
-
modal: !1,
|
|
21
|
-
onOpenChange: D,
|
|
22
|
-
open: g,
|
|
23
|
-
children: [/* @__PURE__ */ f(o.Anchor, {
|
|
24
|
-
asChild: !0,
|
|
25
|
-
children: _
|
|
26
|
-
}), /* @__PURE__ */ f(o.ContentContainer, {
|
|
27
|
-
...O,
|
|
28
|
-
align: v,
|
|
29
|
-
"aria-label": k(t.userInfoPopover),
|
|
30
|
-
className: c(e.popoverContainer, O?.className),
|
|
31
|
-
onInteractOutside: () => {
|
|
32
|
-
w?.();
|
|
33
|
-
},
|
|
34
|
-
onOpenAutoFocus: (e) => {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
},
|
|
37
|
-
side: y,
|
|
38
|
-
sideOffset: b,
|
|
39
|
-
children: /* @__PURE__ */ f(o.MainContent, { children: /* @__PURE__ */ p("div", {
|
|
40
|
-
className: s(e.collaborationPopoverContent, { [e.isCollaborator]: A === r.Collaborator }),
|
|
41
|
-
children: [/* @__PURE__ */ f(n, {
|
|
42
|
-
onClick: C,
|
|
43
|
-
...h
|
|
44
|
-
}), A !== r.Collaborator && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a, {
|
|
45
|
-
variant: "info",
|
|
46
|
-
variantIconAriaLabel: k(t.variantIconAriaLabel),
|
|
47
|
-
children: j
|
|
48
|
-
}), /* @__PURE__ */ f(i, {
|
|
49
|
-
loading: E,
|
|
50
|
-
onClose: M,
|
|
51
|
-
onInviteTypeChange: T,
|
|
52
|
-
onSubmit: S,
|
|
53
|
-
type: A,
|
|
54
|
-
userInfo: h
|
|
55
|
-
})] })]
|
|
56
|
-
}) })
|
|
57
|
-
})]
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
export { h as CollaborationPopover, h as default };
|
|
1
|
+
import{t as collaboration_popover_module_default}from"../../chunks/collaboration-popover.module.js";import messages from"./messages.js";import{UserDetails}from"./components/user-details.js";import{n as CollaborationPopoverType,t as UserInfoFooter}from"../../chunks/user-info-footer.js";import{InlineNotice,Popover}from"@box/blueprint-web";import classNames from"classnames";import clsx from"clsx";import{useMemo}from"react";import{useIntl}from"react-intl";import{Fragment,jsx,jsxs}from"react/jsx-runtime";var DEFAULT_SIDE_OFFSET=8;function CollaborationPopover({userInfo,open=!1,anchor,align=`start`,side=`bottom`,sideOffset=DEFAULT_SIDE_OFFSET,type=CollaborationPopoverType.Collaborator,onSubmit,onUserClick,onClose,onInviteTypeChange,loading=!1,onOpenChange,popoverContentContainerProps}){let{formatMessage}=useIntl(),computedType=useMemo(()=>{let resolved=typeof type==`function`?type(userInfo):type;return!userInfo.email&&resolved===CollaborationPopoverType.Invite?CollaborationPopoverType.CopySharedLink:resolved},[type,userInfo]),computedInviteMessage=useMemo(()=>computedType===CollaborationPopoverType.Invite?formatMessage(messages.noAccessInvite):formatMessage(messages.noAccessSharedLink),[formatMessage,computedType]),handleClose=()=>{onClose?.()};return jsxs(Popover.Root,{modal:!1,onOpenChange,open,children:[jsx(Popover.Anchor,{asChild:!0,children:anchor}),jsx(Popover.ContentContainer,{...popoverContentContainerProps,align,"aria-label":formatMessage(messages.userInfoPopover),className:clsx(collaboration_popover_module_default.popoverContainer,popoverContentContainerProps?.className),onInteractOutside:()=>{onClose?.()},onOpenAutoFocus:e=>{e.preventDefault()},side,sideOffset,children:jsx(Popover.MainContent,{children:jsxs(`div`,{className:classNames(collaboration_popover_module_default.collaborationPopoverContent,{[collaboration_popover_module_default.isCollaborator]:computedType===CollaborationPopoverType.Collaborator}),children:[jsx(UserDetails,{onClick:onUserClick,...userInfo}),computedType!==CollaborationPopoverType.Collaborator&&jsxs(Fragment,{children:[jsx(InlineNotice,{variant:`info`,variantIconAriaLabel:formatMessage(messages.variantIconAriaLabel),children:computedInviteMessage}),jsx(UserInfoFooter,{loading,onClose:handleClose,onInviteTypeChange,onSubmit,type:computedType,userInfo})]})]})})})]})}export{CollaborationPopover,CollaborationPopover as default};
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../messages.js";
|
|
3
|
-
import { getInitials as n } from "../utils/getInitials.js";
|
|
4
|
-
import { Avatar as r, IconBadge as i } from "@box/blueprint-web";
|
|
5
|
-
import { useIntl as a } from "react-intl";
|
|
6
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
-
var s = ({ avatar: s, isExternalUser: c = !1, name: l, id: u }) => {
|
|
8
|
-
let { formatMessage: d } = a(), f = /* @__PURE__ */ o(r, {
|
|
9
|
-
alt: d(t.userAvatarAlt, { name: l }),
|
|
10
|
-
className: e.userAvatar,
|
|
11
|
-
colorIndex: Number(u) || 0,
|
|
12
|
-
src: s || "",
|
|
13
|
-
text: n(l)
|
|
14
|
-
});
|
|
15
|
-
return c ? /* @__PURE__ */ o(i, {
|
|
16
|
-
offset: {
|
|
17
|
-
right: -4,
|
|
18
|
-
bottom: -4
|
|
19
|
-
},
|
|
20
|
-
size: "medium",
|
|
21
|
-
variant: "collaborator-external",
|
|
22
|
-
children: f
|
|
23
|
-
}) : f;
|
|
24
|
-
};
|
|
25
|
-
export { s as UserAvatar, s as default };
|
|
1
|
+
import{t as collaboration_popover_module_default}from"../../../chunks/collaboration-popover.module.js";import messages from"../messages.js";import{getInitials}from"../utils/getInitials.js";import{Avatar,IconBadge}from"@box/blueprint-web";import{useIntl}from"react-intl";import{jsx}from"react/jsx-runtime";var UserAvatar=({avatar,isExternalUser=!1,name,id})=>{let{formatMessage}=useIntl(),userAvatar=jsx(Avatar,{alt:formatMessage(messages.userAvatarAlt,{name}),className:collaboration_popover_module_default.userAvatar,colorIndex:Number(id)||0,src:avatar||``,text:getInitials(name)});return isExternalUser?jsx(IconBadge,{offset:{right:-4,bottom:-4},size:`medium`,variant:`collaborator-external`,children:userAvatar}):userAvatar};export{UserAvatar,UserAvatar as default};
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../messages.js";
|
|
3
|
-
import { UserAvatar as n } from "./user-avatar.js";
|
|
4
|
-
import { Text as r } from "@box/blueprint-web";
|
|
5
|
-
import { useCallback as i } from "react";
|
|
6
|
-
import { useIntl as a } from "react-intl";
|
|
7
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
var c = ({ name: c, email: l, id: u, avatarUrl: d, isExternalUser: f, onClick: p }) => {
|
|
9
|
-
let { formatMessage: m } = a(), h = i(() => {
|
|
10
|
-
p && p({
|
|
11
|
-
name: c,
|
|
12
|
-
email: l,
|
|
13
|
-
id: u,
|
|
14
|
-
avatarUrl: d,
|
|
15
|
-
isExternalUser: f
|
|
16
|
-
});
|
|
17
|
-
}, [
|
|
18
|
-
p,
|
|
19
|
-
c,
|
|
20
|
-
l,
|
|
21
|
-
u,
|
|
22
|
-
d,
|
|
23
|
-
f
|
|
24
|
-
]), g = i((e) => {
|
|
25
|
-
e.key === "Enter" && p && (e.preventDefault(), h());
|
|
26
|
-
}, [h, p]);
|
|
27
|
-
return /* @__PURE__ */ s("div", {
|
|
28
|
-
"aria-label": m(t.userDetailsAriaLabel, { name: c }),
|
|
29
|
-
className: e.userDetails,
|
|
30
|
-
onClick: h,
|
|
31
|
-
onKeyDown: g,
|
|
32
|
-
role: "button",
|
|
33
|
-
tabIndex: 0,
|
|
34
|
-
children: [/* @__PURE__ */ o(n, {
|
|
35
|
-
avatar: d,
|
|
36
|
-
id: u,
|
|
37
|
-
isExternalUser: f,
|
|
38
|
-
name: c
|
|
39
|
-
}), /* @__PURE__ */ s("div", {
|
|
40
|
-
className: e.userInfo,
|
|
41
|
-
children: [/* @__PURE__ */ o(r, {
|
|
42
|
-
as: "span",
|
|
43
|
-
className: e.userName,
|
|
44
|
-
variant: "bodyDefaultSemibold",
|
|
45
|
-
children: c
|
|
46
|
-
}), l && /* @__PURE__ */ o(r, {
|
|
47
|
-
as: "span",
|
|
48
|
-
className: e.userEmail,
|
|
49
|
-
color: "textOnLightSecondary",
|
|
50
|
-
variant: "caption",
|
|
51
|
-
children: l
|
|
52
|
-
})]
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
export { c as UserDetails, c as default };
|
|
1
|
+
import{t as collaboration_popover_module_default}from"../../../chunks/collaboration-popover.module.js";import messages from"../messages.js";import{UserAvatar}from"./user-avatar.js";import{Text}from"@box/blueprint-web";import{useCallback}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";var UserDetails=({name,email,id,avatarUrl,isExternalUser,onClick})=>{let{formatMessage}=useIntl(),handleClick=useCallback(()=>{onClick&&onClick({name,email,id,avatarUrl,isExternalUser})},[onClick,name,email,id,avatarUrl,isExternalUser]),handleKeyDown=useCallback(e=>{e.key===`Enter`&&onClick&&(e.preventDefault(),handleClick())},[handleClick,onClick]);return jsxs(`div`,{"aria-label":formatMessage(messages.userDetailsAriaLabel,{name}),className:collaboration_popover_module_default.userDetails,onClick:handleClick,onKeyDown:handleKeyDown,role:`button`,tabIndex:0,children:[jsx(UserAvatar,{avatar:avatarUrl,id,isExternalUser,name}),jsxs(`div`,{className:collaboration_popover_module_default.userInfo,children:[jsx(Text,{as:`span`,className:collaboration_popover_module_default.userName,variant:`bodyDefaultSemibold`,children:name}),email&&jsx(Text,{as:`span`,className:collaboration_popover_module_default.userEmail,color:`textOnLightSecondary`,variant:`caption`,children:email})]})]})};export{UserDetails,UserDetails as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as UserInfoFooter, e as default };
|
|
1
|
+
import{t as UserInfoFooter}from"../../../chunks/user-info-footer.js";export{UserInfoFooter,UserInfoFooter as default};
|
|
@@ -1,47 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "../messages.js";
|
|
3
|
-
import { Button as n, DropdownMenu as r, TriggerButton as i } from "@box/blueprint-web";
|
|
4
|
-
import { useMemo as a, useState as o } from "react";
|
|
5
|
-
import { useIntl as s } from "react-intl";
|
|
6
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
-
var d = ({ defaultInviteType: d = "Editor", onInvite: f, onInviteTypeChange: p, loading: m = !1 }) => {
|
|
8
|
-
let { formatMessage: h } = s(), [g, _] = o(d), v = a(() => h(t.inviteAs, { type: h(t[g.toLowerCase()]) }), [g, h]);
|
|
9
|
-
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u(r.Root, {
|
|
10
|
-
modal: !1,
|
|
11
|
-
onOpenChange: p,
|
|
12
|
-
children: [/* @__PURE__ */ l(r.Trigger, { children: /* @__PURE__ */ l(i, {
|
|
13
|
-
"aria-label": v,
|
|
14
|
-
caretDirection: "down",
|
|
15
|
-
className: e.inviteTriggerButton,
|
|
16
|
-
disabled: m,
|
|
17
|
-
label: v,
|
|
18
|
-
size: "small",
|
|
19
|
-
variant: "tertiary"
|
|
20
|
-
}) }), /* @__PURE__ */ l(r.Content, {
|
|
21
|
-
align: "start",
|
|
22
|
-
className: e.inviteDropdownMenu,
|
|
23
|
-
side: "top",
|
|
24
|
-
children: /* @__PURE__ */ u(r.RadioGroup, {
|
|
25
|
-
onValueChange: (e) => {
|
|
26
|
-
_(e);
|
|
27
|
-
},
|
|
28
|
-
value: g,
|
|
29
|
-
children: [/* @__PURE__ */ l(r.RadioSelectItem, {
|
|
30
|
-
value: "Editor",
|
|
31
|
-
children: h(t.editor)
|
|
32
|
-
}), /* @__PURE__ */ l(r.RadioSelectItem, {
|
|
33
|
-
value: "Viewer",
|
|
34
|
-
children: h(t.viewer)
|
|
35
|
-
})]
|
|
36
|
-
})
|
|
37
|
-
})]
|
|
38
|
-
}), /* @__PURE__ */ l(n, {
|
|
39
|
-
"aria-label": h(t.inviteButton),
|
|
40
|
-
disabled: m,
|
|
41
|
-
onClick: async () => {
|
|
42
|
-
await f(g);
|
|
43
|
-
},
|
|
44
|
-
children: h(t.inviteButton)
|
|
45
|
-
})] });
|
|
46
|
-
};
|
|
47
|
-
export { d as UserInviteDropdown, d as default };
|
|
1
|
+
import{t as collaboration_popover_module_default}from"../../../chunks/collaboration-popover.module.js";import messages from"../messages.js";import{Button,DropdownMenu,TriggerButton}from"@box/blueprint-web";import{useMemo,useState}from"react";import{useIntl}from"react-intl";import{Fragment,jsx,jsxs}from"react/jsx-runtime";var UserInviteDropdown=({defaultInviteType=`Editor`,onInvite,onInviteTypeChange,loading=!1})=>{let{formatMessage}=useIntl(),[inviteType,setInviteType]=useState(defaultInviteType),triggerButtonLabel=useMemo(()=>formatMessage(messages.inviteAs,{type:formatMessage(messages[inviteType.toLowerCase()])}),[inviteType,formatMessage]);return jsxs(Fragment,{children:[jsxs(DropdownMenu.Root,{modal:!1,onOpenChange:onInviteTypeChange,children:[jsx(DropdownMenu.Trigger,{children:jsx(TriggerButton,{"aria-label":triggerButtonLabel,caretDirection:`down`,className:collaboration_popover_module_default.inviteTriggerButton,disabled:loading,label:triggerButtonLabel,size:`small`,variant:`tertiary`})}),jsx(DropdownMenu.Content,{align:`start`,className:collaboration_popover_module_default.inviteDropdownMenu,side:`top`,children:jsxs(DropdownMenu.RadioGroup,{onValueChange:value=>{setInviteType(value)},value:inviteType,children:[jsx(DropdownMenu.RadioSelectItem,{value:`Editor`,children:formatMessage(messages.editor)}),jsx(DropdownMenu.RadioSelectItem,{value:`Viewer`,children:formatMessage(messages.viewer)})]})})]}),jsx(Button,{"aria-label":formatMessage(messages.inviteButton),disabled:loading,onClick:async()=>{await onInvite(inviteType)},children:formatMessage(messages.inviteButton)})]})};export{UserInviteDropdown,UserInviteDropdown as default};
|
package/dist/esm/lib/messages.js
CHANGED
|
@@ -1,48 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var t = e({
|
|
3
|
-
inviteAs: {
|
|
4
|
-
id: "boxui.collaborationPopover.inviteAs",
|
|
5
|
-
defaultMessage: "Invite as {type}"
|
|
6
|
-
},
|
|
7
|
-
editor: {
|
|
8
|
-
id: "boxui.collaborationPopover.editor",
|
|
9
|
-
defaultMessage: "Editor"
|
|
10
|
-
},
|
|
11
|
-
viewer: {
|
|
12
|
-
id: "boxui.collaborationPopover.viewer",
|
|
13
|
-
defaultMessage: "Viewer"
|
|
14
|
-
},
|
|
15
|
-
copySharedLinkButton: {
|
|
16
|
-
id: "boxui.collaborationPopover.copySharedLinkButton",
|
|
17
|
-
defaultMessage: "Copy shared link"
|
|
18
|
-
},
|
|
19
|
-
inviteButton: {
|
|
20
|
-
id: "boxui.collaborationPopover.inviteButton",
|
|
21
|
-
defaultMessage: "Invite"
|
|
22
|
-
},
|
|
23
|
-
noAccessInvite: {
|
|
24
|
-
id: "boxui.collaborationPopover.noAccessInvite",
|
|
25
|
-
defaultMessage: "This person doesn't have access and won't be notified unless invited."
|
|
26
|
-
},
|
|
27
|
-
noAccessSharedLink: {
|
|
28
|
-
id: "boxui.collaborationPopover.noAccessSharedLink",
|
|
29
|
-
defaultMessage: "This person doesn't have access and won't be notified unless invited."
|
|
30
|
-
},
|
|
31
|
-
userAvatarAlt: {
|
|
32
|
-
id: "boxui.collaborationPopover.userAvatarAlt",
|
|
33
|
-
defaultMessage: "{name} avatar"
|
|
34
|
-
},
|
|
35
|
-
userInfoPopover: {
|
|
36
|
-
id: "boxui.collaborationPopover.userInfoPopover",
|
|
37
|
-
defaultMessage: "User information popover"
|
|
38
|
-
},
|
|
39
|
-
userDetailsAriaLabel: {
|
|
40
|
-
id: "boxui.collaborationPopover.userDetailsAriaLabel",
|
|
41
|
-
defaultMessage: "{name} details"
|
|
42
|
-
},
|
|
43
|
-
variantIconAriaLabel: {
|
|
44
|
-
id: "boxui.collaborationPopover.variantIconAriaLabel",
|
|
45
|
-
defaultMessage: "Info"
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({inviteAs:{id:`boxui.collaborationPopover.inviteAs`,defaultMessage:`Invite as {type}`},editor:{id:`boxui.collaborationPopover.editor`,defaultMessage:`Editor`},viewer:{id:`boxui.collaborationPopover.viewer`,defaultMessage:`Viewer`},copySharedLinkButton:{id:`boxui.collaborationPopover.copySharedLinkButton`,defaultMessage:`Copy shared link`},inviteButton:{id:`boxui.collaborationPopover.inviteButton`,defaultMessage:`Invite`},noAccessInvite:{id:`boxui.collaborationPopover.noAccessInvite`,defaultMessage:`This person doesn't have access and won't be notified unless invited.`},noAccessSharedLink:{id:`boxui.collaborationPopover.noAccessSharedLink`,defaultMessage:`This person doesn't have access and won't be notified unless invited.`},userAvatarAlt:{id:`boxui.collaborationPopover.userAvatarAlt`,defaultMessage:`{name} avatar`},userInfoPopover:{id:`boxui.collaborationPopover.userInfoPopover`,defaultMessage:`User information popover`},userDetailsAriaLabel:{id:`boxui.collaborationPopover.userDetailsAriaLabel`,defaultMessage:`{name} details`},variantIconAriaLabel:{id:`boxui.collaborationPopover.variantIconAriaLabel`,defaultMessage:`Info`}});export{messages as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
export { e as getInitials };
|
|
1
|
+
var getInitials=name=>name.replace(/[[({<]+.*[\])}>]+/g,``).trim().slice(0,1).toUpperCase();export{getInitials};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/collaboration-popover",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.35",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^16.
|
|
7
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
6
|
+
"@box/blueprint-web": "^16.13.1",
|
|
7
|
+
"@box/blueprint-web-assets": "^5.5.10",
|
|
8
8
|
"classnames": "^2.3.2",
|
|
9
9
|
"react": "^18.0.0",
|
|
10
10
|
"react-dom": "^18.0.0",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@box/blueprint-web": "^16.
|
|
18
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
19
|
-
"@box/eslint-plugin-blueprint": "2.1.
|
|
20
|
-
"@box/storybook-utils": "1.1.
|
|
17
|
+
"@box/blueprint-web": "^16.13.1",
|
|
18
|
+
"@box/blueprint-web-assets": "^5.5.10",
|
|
19
|
+
"@box/eslint-plugin-blueprint": "2.1.11",
|
|
20
|
+
"@box/storybook-utils": "1.1.34",
|
|
21
21
|
"react-intl": "^6.4.2"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|