@box/box-ai-agent-selector 0.34.6 → 0.35.0
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,32 +1,26 @@
|
|
1
|
-
import {
|
2
|
-
import { BoxAiLogo as
|
3
|
-
import { SurfaceStatusSurfaceGray as
|
4
|
-
import {
|
5
|
-
import { useIntl as
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
import '../../styles/box-ai-agent.css';const
|
9
|
-
agentListItem:
|
10
|
-
|
1
|
+
import { TooltipProvider as c, Text as n, Tooltip as i, Status as m } from "@box/blueprint-web";
|
2
|
+
import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
|
3
|
+
import { SurfaceStatusSurfaceGray as u } from "@box/blueprint-web-assets/tokens/tokens";
|
4
|
+
import { forwardRef as f, useMemo as g } from "react";
|
5
|
+
import { useIntl as _ } from "react-intl";
|
6
|
+
import I from "./messages.js";
|
7
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
8
|
+
import '../../styles/box-ai-agent.css';const h = "_agentListItem_xtqqd_1", q = "_agentInfo_xtqqd_11", A = "_thumbnailWrapper_xtqqd_20", x = "_agentListItemIcon_xtqqd_23", v = "_defaultAgentHeader_xtqqd_33", L = "_agentHeader_xtqqd_44", N = "_defaultAgentName_xtqqd_51", S = "_agentDescription_xtqqd_59", b = "_defaultAgentStatusWrapper_xtqqd_69", a = {
|
9
|
+
agentListItem: h,
|
10
|
+
agentInfo: q,
|
11
|
+
thumbnailWrapper: A,
|
11
12
|
agentListItemIcon: x,
|
12
|
-
defaultAgentHeader:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}) {
|
13
|
+
defaultAgentHeader: v,
|
14
|
+
agentHeader: L,
|
15
|
+
defaultAgentName: N,
|
16
|
+
agentDescription: S,
|
17
|
+
defaultAgentStatusWrapper: b
|
18
|
+
}, w = /* @__PURE__ */ f(({
|
19
|
+
agent: e
|
20
|
+
}, d) => {
|
20
21
|
const {
|
21
|
-
formatMessage:
|
22
|
-
} =
|
23
|
-
Wrapper: o,
|
24
|
-
wrapperProps: u
|
25
|
-
} = c({
|
26
|
-
ref: n,
|
27
|
-
textValue: e.name,
|
28
|
-
skipOverflowCheck: !s
|
29
|
-
}), l = _(() => {
|
22
|
+
formatMessage: l
|
23
|
+
} = _(), r = e.isEnterpriseDefault, s = g(() => {
|
30
24
|
if (e.imageURL)
|
31
25
|
try {
|
32
26
|
return new URL(e.imageURL).toString();
|
@@ -34,51 +28,65 @@ function k({
|
|
34
28
|
return;
|
35
29
|
}
|
36
30
|
}, [e]);
|
37
|
-
return /* @__PURE__ */
|
31
|
+
return /* @__PURE__ */ t("div", {
|
32
|
+
ref: d,
|
38
33
|
className: a.agentListItem,
|
39
34
|
"data-target-id": "SmallList.Item-boxAIAgent",
|
40
35
|
id: e.id,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
36
|
+
children: /* @__PURE__ */ o(c, {
|
37
|
+
children: [/* @__PURE__ */ t("div", {
|
38
|
+
className: a.thumbnailWrapper,
|
39
|
+
children: /* @__PURE__ */ t("div", {
|
40
|
+
className: a.agentListItemIcon,
|
41
|
+
children: s ? /* @__PURE__ */ t("img", {
|
42
|
+
"aria-label": e.name,
|
43
|
+
src: s
|
44
|
+
}) : /* @__PURE__ */ t(p, {
|
45
|
+
"aria-label": e.name
|
46
|
+
})
|
51
47
|
})
|
52
|
-
})
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
}), /* @__PURE__ */ o("div", {
|
49
|
+
className: a.agentInfo,
|
50
|
+
children: [/* @__PURE__ */ t(n, {
|
51
|
+
as: "span",
|
52
|
+
className: r ? a.defaultAgentHeader : a.agentHeader,
|
53
|
+
children: r ? /* @__PURE__ */ t(i, {
|
54
|
+
content: e.name,
|
55
|
+
children: /* @__PURE__ */ t(n, {
|
56
|
+
as: "span",
|
57
|
+
className: a.defaultAgentName,
|
58
|
+
variant: "subtitle",
|
59
|
+
children: e.name
|
60
|
+
})
|
61
|
+
}) : /* @__PURE__ */ t(n, {
|
61
62
|
as: "span",
|
62
|
-
|
63
|
-
variant: "bodyDefaultSemibold",
|
63
|
+
variant: "subtitle",
|
64
64
|
children: e.name
|
65
65
|
})
|
66
|
+
}), e.description && /* @__PURE__ */ t(i, {
|
67
|
+
content: e.description,
|
68
|
+
children: /* @__PURE__ */ t(n, {
|
69
|
+
as: "span",
|
70
|
+
className: a.agentDescription,
|
71
|
+
variant: "caption",
|
72
|
+
children: e.description
|
73
|
+
})
|
74
|
+
})]
|
75
|
+
}), /* @__PURE__ */ t("div", {
|
76
|
+
children: /* @__PURE__ */ t(n, {
|
77
|
+
as: "span",
|
78
|
+
className: a.defaultAgentStatusWrapper,
|
79
|
+
children: r && /* @__PURE__ */ t(m, {
|
80
|
+
className: a.defaultAgentStatus,
|
81
|
+
color: u,
|
82
|
+
text: l(I.defaultStatus)
|
83
|
+
})
|
66
84
|
})
|
67
|
-
})
|
68
|
-
})
|
69
|
-
className: a.defaultAgentStatusWrapper,
|
70
|
-
children: s && /* @__PURE__ */ t(p, {
|
71
|
-
className: a.defaultAgentStatus,
|
72
|
-
color: g,
|
73
|
-
text: m(h.defaultStatus)
|
74
|
-
})
|
75
|
-
}), e.description && /* @__PURE__ */ t(r.Subtitle, {
|
76
|
-
className: a.agentDescription,
|
77
|
-
children: e.description
|
78
|
-
})]
|
85
|
+
})]
|
86
|
+
})
|
79
87
|
});
|
80
|
-
}
|
88
|
+
});
|
81
89
|
export {
|
82
|
-
|
83
|
-
|
90
|
+
w as BoxAiAgent,
|
91
|
+
w as default
|
84
92
|
};
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
._agentSelector_wit17_1{margin-inline-start:.75rem}._agentSelectorButton_wit17_4{background:transparent;border:0}._agentSelector_wit17_1 ._agentStatus_wit17_8{margin-inline-start:.5rem}._agentSelector_wit17_1 ._agentStatus_wit17_8>span{background:linear-gradient(#f4f4f4 0,#f4f4f4 0) padding-box,linear-gradient(135deg,#fe01da,#2486fc) border-box;border:.0625rem solid rgba(0,0,0,0)}._agentSelector_wit17_1 ._agentStatus_wit17_8>span span{color:transparent;text-transform:uppercase;background:linear-gradient(135deg,#fe01da,#2486fc);-webkit-background-clip:text;background-clip:text}._agentSelector_wit17_1 ._agentLoader_wit17_21{position:inherit}._agentSelector_wit17_1 ._agentError_wit17_24 path{fill:#d5324e}._agentSelector_wit17_1 ._triggerChip_wit17_27{display:flex;max-width:376px;text-align:start;background-color:#faf5fe}._agentSelector_wit17_1 ._triggerChip_wit17_27 ._agentLabel_wit17_33{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._agentSelector_wit17_1 ._triggerChip_wit17_27 ._dropdownIndicator_wit17_39{flex-shrink:0;margin-inline-start:0}._agentSelector_wit17_1 ._triggerChip_wit17_27 ._dropdownIndicator_wit17_39 svg{margin-inline-start:0}._agentSelector_wit17_1 ._triggerChip_wit17_27:disabled ._dropdownIndicator_wit17_39{opacity:.3}@media (max-width: 374px){._agentSelector_wit17_1 ._triggerChip_wit17_27{width:100%}}._agentSelector_wit17_1._sidebar_wit17_54{margin:0 .25rem 0 0;margin-inline-start:0}@media (max-width: 767px){._agentSelector_wit17_1._sidebar_wit17_54{width:100%}}._agentSelector_wit17_1._sidebar_wit17_54 ._triggerChip_wit17_27{max-width:246px}._agentListRetryButton_wit17_67[data-target-id]{max-width:320px;margin:.25rem;text-wrap:wrap}._agentListRetryButton_wit17_67[data-target-id]._sidebar_wit17_54{max-width:184px}._agentList_wit17_67{display:flex;flex-wrap:wrap;row-gap:var(--space-2)}._agentList_wit17_67:focus-visible{outline:0}._agentList_wit17_67>[role=option]{display:flex;width:100%;overflow:hidden;border-radius:var(--radius-4)}._agentList_wit17_67>[role=option][data-focus-visible],._agentList_wit17_67>[role=option][data-active-item]{background:var(--item-hover)}._agentList_wit17_67>[role=option][data-focus-visible]{--actions-opacity: 1;outline:var(--border-2) solid var(--outline-focus-on-light);outline-offset:calc(var(--border-4) * -1)}._agentListItemIcon_wit17_99{width:2rem;height:2rem}._agentListContainer_wit17_104{--item-hover: var(--surface-item-small-surface-hover);min-width:320px;max-width:376px;box-sizing:border-box;width:360px;padding:var(--space-3);overflow:hidden;background:var(--surface-card-surface);border-radius:var(--radius-4);box-shadow:var(--dropshadow-3);margin-block:var(--space-1)}@media (max-width: 376px){._agentListContainer_wit17_104{max-width:320px;margin-left:-.5rem}}._agentListContainer_wit17_104:focus-visible{outline:0}._agentListContainer_wit17_104>[role=listbox]{display:flex;width:100%;max-height:32.5rem;overflow:hidden auto;border-radius:var(--radius-4)}._agentListContainer_wit17_104>[role=listbox][data-focus-visible]{outline:0}._agentListContainer_wit17_104._sidebar_wit17_54{min-width:320px;max-width:360px;transform:translate(-6px)}@media (max-width: 360px){._agentListContainer_wit17_104._sidebar_wit17_54{max-width:320px;margin-left:-.5rem}}@media (max-width: 767px){._agentListContainer_wit17_104._sidebar_wit17_54{width:auto;max-width:unset}}
|
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
._agentListItem_xtqqd_1{display:flex;grid-template-columns:1rem auto auto;align-items:center;width:100%;padding:var(--space-2) var(--space-3);overflow:hidden;column-gap:var(--space-4);border-radius:var(--radius-4)}._agentListItem_xtqqd_1 ._agentInfo_xtqqd_11{display:flex;flex-direction:column;flex-grow:1;justify-content:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._agentListItem_xtqqd_1 ._thumbnailWrapper_xtqqd_20{aspect-ratio:auto}._agentListItem_xtqqd_1 ._thumbnailWrapper_xtqqd_20 ._agentListItemIcon_xtqqd_23{width:1rem;height:1rem}._agentListItem_xtqqd_1 ._thumbnailWrapper_xtqqd_20 ._agentListItemIcon_xtqqd_23 svg,._agentListItem_xtqqd_1 ._thumbnailWrapper_xtqqd_20 ._agentListItemIcon_xtqqd_23 img{vertical-align:top;width:100%;height:100%}._agentListItem_xtqqd_1 ._defaultAgentHeader_xtqqd_33{display:inline-block;width:fit-content;max-width:100%;padding:0;text-transform:none;text-decoration:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._agentListItem_xtqqd_1 ._agentHeader_xtqqd_44{text-transform:none;text-decoration:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._agentListItem_xtqqd_1 ._defaultAgentName_xtqqd_51{display:inline-block;flex-grow:0;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._agentListItem_xtqqd_1 ._agentDescription_xtqqd_59{width:fit-content;max-width:100%;color:var(--text-text-on-light-secondary);text-transform:none;text-decoration:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._agentListItem_xtqqd_1 ._defaultAgentStatusWrapper_xtqqd_69{--default-opacity: 1;opacity:var(--default-opacity)}._agentListItem_xtqqd_1 ._defaultAgentStatusWrapper_xtqqd_69>div{background:transparent}
|
@@ -4,10 +4,6 @@ export interface BoxAiAgentProps {
|
|
4
4
|
* Object representation of agent.
|
5
5
|
*/
|
6
6
|
agent: AgentType;
|
7
|
-
/**
|
8
|
-
* Callback function triggered when an agent is selected
|
9
|
-
*/
|
10
|
-
onAction: () => void;
|
11
7
|
}
|
12
|
-
export declare
|
8
|
+
export declare const BoxAiAgent: import('react').ForwardRefExoticComponent<BoxAiAgentProps & import('react').RefAttributes<HTMLDivElement>>;
|
13
9
|
export default BoxAiAgent;
|
package/package.json
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/box-ai-agent-selector",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.35.0",
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
5
5
|
"peerDependencies": {
|
6
|
+
"@ariakit/react": "^0.4.15",
|
6
7
|
"@box/blueprint-web": "^7.31.1",
|
7
8
|
"@box/blueprint-web-assets": "^4.26.0",
|
8
9
|
"react": "^17.0.0 || ^18.0.0",
|
@@ -10,9 +11,10 @@
|
|
10
11
|
"react-intl": "^6.4.2"
|
11
12
|
},
|
12
13
|
"devDependencies": {
|
14
|
+
"@ariakit/react": "^0.4.15",
|
13
15
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
14
|
-
"@box/blueprint-web": "^10.
|
15
|
-
"@box/blueprint-web-assets": "^4.
|
16
|
+
"@box/blueprint-web": "^10.4.0",
|
17
|
+
"@box/blueprint-web-assets": "^4.39.0",
|
16
18
|
"@box/eslint-plugin-blueprint": "^1.0.3",
|
17
19
|
"@box/storybook-utils": "^0.9.0",
|
18
20
|
"react-intl": "^6.4.2"
|