@uipath/apollo-react 6.44.2 → 6.45.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.
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPanelSurface.cjs +59 -0
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPanelSurface.d.ts +12 -0
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPanelSurface.d.ts.map +1 -0
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPanelSurface.js +22 -0
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPortal.cjs +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPortal.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/CanvasPortal.js +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +22 -36
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +22 -36
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.cjs +6 -45
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.js +6 -35
- package/dist/canvas/components/FloatingCanvasPanel/index.cjs +8 -1
- package/dist/canvas/components/FloatingCanvasPanel/index.d.ts +2 -0
- package/dist/canvas/components/FloatingCanvasPanel/index.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/index.js +2 -1
- package/dist/canvas/components/Toolbox/Header.cjs +6 -16
- package/dist/canvas/components/Toolbox/Header.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Header.js +6 -16
- package/dist/canvas/components/Toolbox/ListView.cjs +21 -15
- package/dist/canvas/components/Toolbox/ListView.d.ts +1 -1
- package/dist/canvas/components/Toolbox/ListView.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/ListView.js +23 -17
- package/dist/canvas/components/Toolbox/ListViewIconContainer.cjs +52 -0
- package/dist/canvas/components/Toolbox/ListViewIconContainer.d.ts +9 -0
- package/dist/canvas/components/Toolbox/ListViewIconContainer.d.ts.map +1 -0
- package/dist/canvas/components/Toolbox/ListViewIconContainer.js +18 -0
- package/dist/canvas/components/Toolbox/QuickActionsRow.cjs +9 -7
- package/dist/canvas/components/Toolbox/QuickActionsRow.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/QuickActionsRow.js +10 -8
- package/dist/canvas/components/Toolbox/SearchBox.cjs +24 -24
- package/dist/canvas/components/Toolbox/SearchBox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/SearchBox.js +24 -24
- package/dist/canvas/components/Toolbox/Toolbox.cjs +10 -6
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.js +10 -6
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/material/components/ap-chat/components/message/chat-message-content.cjs +35 -34
- package/dist/material/components/ap-chat/components/message/chat-message-content.d.ts.map +1 -1
- package/dist/material/components/ap-chat/components/message/chat-message-content.js +35 -34
- package/package.json +2 -2
- package/dist/canvas/components/Toolbox/ListView.styles.cjs +0 -136
- package/dist/canvas/components/Toolbox/ListView.styles.d.ts +0 -12
- package/dist/canvas/components/Toolbox/ListView.styles.d.ts.map +0 -1
- package/dist/canvas/components/Toolbox/ListView.styles.js +0 -86
- package/dist/canvas/components/Toolbox/SearchBox.styles.cjs +0 -114
- package/dist/canvas/components/Toolbox/SearchBox.styles.d.ts +0 -5
- package/dist/canvas/components/Toolbox/SearchBox.styles.d.ts.map +0 -1
- package/dist/canvas/components/Toolbox/SearchBox.styles.js +0 -70
- package/dist/canvas/components/Toolbox/Toolbox.styles.cjs +0 -115
- package/dist/canvas/components/Toolbox/Toolbox.styles.d.ts +0 -16
- package/dist/canvas/components/Toolbox/Toolbox.styles.d.ts.map +0 -1
- package/dist/canvas/components/Toolbox/Toolbox.styles.js +0 -65
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Row } from "../../layouts/index.js";
|
|
3
|
+
import { cx } from "../../utils/index.js";
|
|
3
4
|
import { Button } from "@uipath/apollo-wind";
|
|
4
5
|
import { memo } from "react";
|
|
5
6
|
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
7
|
+
const BACK_SLOT_CLASS = 'overflow-hidden transition-[width,opacity,transform,margin] duration-300 ease-in-out';
|
|
8
|
+
const BACK_SLOT_VISIBLE_CLASS = 'mr-2 w-8 translate-x-0 opacity-100';
|
|
9
|
+
const BACK_SLOT_HIDDEN_CLASS = 'mr-0 w-0 translate-x-5 opacity-0';
|
|
6
10
|
const Header_Header = /*#__PURE__*/ memo(function({ title, onBack, showBackButton }) {
|
|
7
11
|
const isBackButtonVisible = showBackButton && onBack;
|
|
8
12
|
return /*#__PURE__*/ jsxs(Row, {
|
|
@@ -10,23 +14,13 @@ const Header_Header = /*#__PURE__*/ memo(function({ title, onBack, showBackButto
|
|
|
10
14
|
align: "center",
|
|
11
15
|
children: [
|
|
12
16
|
/*#__PURE__*/ jsx("div", {
|
|
13
|
-
|
|
14
|
-
width: isBackButtonVisible ? '32px' : '0px',
|
|
15
|
-
opacity: isBackButtonVisible ? 1 : 0,
|
|
16
|
-
transform: isBackButtonVisible ? 'translateX(0)' : 'translateX(20px)',
|
|
17
|
-
marginRight: isBackButtonVisible ? '8px' : '0px',
|
|
18
|
-
transition: 'width 0.3s ease-in-out, opacity 0.3s ease-in-out, transform 0.3s ease-in-out',
|
|
19
|
-
overflow: 'hidden'
|
|
20
|
-
},
|
|
17
|
+
className: cx(BACK_SLOT_CLASS, isBackButtonVisible ? BACK_SLOT_VISIBLE_CLASS : BACK_SLOT_HIDDEN_CLASS),
|
|
21
18
|
children: isBackButtonVisible && /*#__PURE__*/ jsx(Button, {
|
|
22
19
|
variant: "ghost",
|
|
23
20
|
size: "icon",
|
|
24
|
-
className: "h-8 w-8",
|
|
21
|
+
className: "h-8 w-8 transition-transform duration-300 ease-in-out",
|
|
25
22
|
"aria-label": "Back",
|
|
26
23
|
onClick: onBack,
|
|
27
|
-
style: {
|
|
28
|
-
transition: 'transform 0.3s ease-in-out'
|
|
29
|
-
},
|
|
30
24
|
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
31
25
|
icon: "chevron-left",
|
|
32
26
|
size: 20
|
|
@@ -35,10 +29,6 @@ const Header_Header = /*#__PURE__*/ memo(function({ title, onBack, showBackButto
|
|
|
35
29
|
}),
|
|
36
30
|
/*#__PURE__*/ jsx("span", {
|
|
37
31
|
className: "text-base font-bold",
|
|
38
|
-
style: {
|
|
39
|
-
transition: 'transform 0.3s ease-in-out, margin 0.3s ease-in-out',
|
|
40
|
-
margin: 0
|
|
41
|
-
},
|
|
42
32
|
children: title
|
|
43
33
|
})
|
|
44
34
|
]
|
|
@@ -37,11 +37,13 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
37
37
|
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
38
38
|
const external_utils_index_cjs_namespaceObject = require("../../utils/index.cjs");
|
|
39
39
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
40
|
+
const react_namespaceObject = require("motion/react");
|
|
40
41
|
const external_react_namespaceObject = require("react");
|
|
42
|
+
const external_react_window_namespaceObject = require("react-window");
|
|
41
43
|
const CanvasThemeContext_cjs_namespaceObject = require("../BaseCanvas/CanvasThemeContext.cjs");
|
|
42
44
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
43
45
|
const InitialsBadge_cjs_namespaceObject = require("../shared/InitialsBadge.cjs");
|
|
44
|
-
const
|
|
46
|
+
const external_ListViewIconContainer_cjs_namespaceObject = require("./ListViewIconContainer.cjs");
|
|
45
47
|
const DEFAULT_SKELETON_COUNT = 3;
|
|
46
48
|
const ROW_HEIGHT_ITEM = 32;
|
|
47
49
|
const ROW_HEIGHT_ITEM_TWO_LINE = 44;
|
|
@@ -119,7 +121,8 @@ function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
|
119
121
|
if (skeletonConfig && !skeletonConfig.sections) pushSkeletons(baseSkeletonCount);
|
|
120
122
|
return result;
|
|
121
123
|
}
|
|
122
|
-
const
|
|
124
|
+
const ROW_BUTTON_CLASS = "box-border flex w-full cursor-pointer items-center gap-2.5 border-none bg-transparent text-left rounded-lg outline-1 outline-transparent [outline-offset:-1px] hover:bg-(--canvas-background-hover) aria-selected:bg-(--canvas-background-hover) aria-selected:outline-(--canvas-primary) disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 [&:disabled_*]:opacity-70 transition-[background-color,opacity,outline-color] duration-150";
|
|
125
|
+
const LIST_SCROLLBAR_CLASS = "[scrollbar-width:thin] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-(--canvas-border-de-emp) [&::-webkit-scrollbar-thumb:hover]:bg-(--canvas-border)";
|
|
123
126
|
const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ index, style, ariaAttributes, renderedItems, activeIndex, isLoading, isDarkMode, onItemClick, onItemHover })=>{
|
|
124
127
|
const renderItem = renderedItems[index];
|
|
125
128
|
const buttonStyle = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
@@ -171,8 +174,9 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
|
|
|
171
174
|
const item = renderItem.item;
|
|
172
175
|
const bgColor = isDarkMode ? item.colorDark ?? item.color : item.color;
|
|
173
176
|
const isActive = index === activeIndex;
|
|
174
|
-
const button = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
177
|
+
const button = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_namespaceObject.motion.button, {
|
|
175
178
|
...ariaAttributes,
|
|
179
|
+
type: "button",
|
|
176
180
|
tabIndex: -1,
|
|
177
181
|
id: `toolbox-item-${item.id}`,
|
|
178
182
|
role: "option",
|
|
@@ -180,15 +184,14 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
|
|
|
180
184
|
style: buttonStyle,
|
|
181
185
|
onClick: handleButtonClick,
|
|
182
186
|
onHoverStart: handleButtonHover,
|
|
183
|
-
className:
|
|
187
|
+
className: (0, external_utils_index_cjs_namespaceObject.cx)(ROW_BUTTON_CLASS, {
|
|
188
|
+
loading: !!isLoading
|
|
189
|
+
}),
|
|
184
190
|
disabled: isLoading,
|
|
185
191
|
children: [
|
|
186
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
color: item.contentColor
|
|
190
|
-
} : void 0,
|
|
191
|
-
"data-testid": "list-item-icon",
|
|
192
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_ListViewIconContainer_cjs_namespaceObject.ListViewIconContainer, {
|
|
193
|
+
background: bgColor,
|
|
194
|
+
color: item.contentColor,
|
|
192
195
|
children: [
|
|
193
196
|
item.icon?.url && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
194
197
|
src: item.icon?.url,
|
|
@@ -213,20 +216,22 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
|
|
|
213
216
|
overflow: "hidden",
|
|
214
217
|
children: [
|
|
215
218
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
216
|
-
className: "text-sm
|
|
219
|
+
className: "truncate text-sm",
|
|
217
220
|
style: item.contentColor ? {
|
|
218
221
|
color: item.contentColor
|
|
219
222
|
} : void 0,
|
|
220
223
|
children: item.name
|
|
221
224
|
}),
|
|
222
225
|
item.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
223
|
-
className: "text-xs
|
|
226
|
+
className: "truncate text-xs text-foreground-muted",
|
|
224
227
|
children: item.description
|
|
225
228
|
})
|
|
226
229
|
]
|
|
227
230
|
}),
|
|
228
231
|
item.badge && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
229
|
-
className:
|
|
232
|
+
className: (0, apollo_wind_namespaceObject.cn)((0, apollo_wind_namespaceObject.badgeVariants)({
|
|
233
|
+
variant: 'outline'
|
|
234
|
+
}), 'shrink-0 rounded border-border px-1 py-1 text-[8px] uppercase text-foreground-muted'),
|
|
230
235
|
"data-testid": "list-item-badge",
|
|
231
236
|
children: item.badge
|
|
232
237
|
}),
|
|
@@ -278,7 +283,7 @@ const ListItemSkeleton = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)
|
|
|
278
283
|
"data-testid": "list-item-skeleton",
|
|
279
284
|
children: [
|
|
280
285
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Skeleton, {
|
|
281
|
-
className: "h-6 w-6 shrink-0 rounded-md"
|
|
286
|
+
className: "h-6 w-6 shrink-0 rounded-md future:rounded-lg"
|
|
282
287
|
}),
|
|
283
288
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Skeleton, {
|
|
284
289
|
className: "h-3.5 w-1/2"
|
|
@@ -339,8 +344,9 @@ const ListViewInner = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRe
|
|
|
339
344
|
]
|
|
340
345
|
});
|
|
341
346
|
}
|
|
342
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
347
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_window_namespaceObject.List, {
|
|
343
348
|
id: "toolbox-listbox",
|
|
349
|
+
className: LIST_SCROLLBAR_CLASS,
|
|
344
350
|
role: "listbox",
|
|
345
351
|
"aria-busy": activeSkeleton ? true : void 0,
|
|
346
352
|
listRef: listRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAQ,KAAK,iBAAiB,EAA0B,MAAM,cAAc,CAAC;AAMpF,MAAM,WAAW,YAAY;IAI3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AAUD,MAAM,MAAM,mBAAmB,GAAG;IAKhC,KAAK,CAAC,EAAE,MAAM,CAAC;IAOf,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,aAAa,CAAC,EAAE,OAAO,CAAC;IAMxB,YAAY,CAAC,EAAE,MAAM,CAAC;IAMtB,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAQlF,eAAe,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,QAAQ,IACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAOxB,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAG3C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,QAAQ,EACpD,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,GACpC,MAAM,CAYR;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,QAAQ,EACnD,KAAK,EAAE,CAAC,EAAE,EACV,cAAc,EAAE,OAAO,EACvB,eAAe,CAAC,EAAE,OAAO,GAAG,mBAAmB,GAC9C,UAAU,CAAC,CAAC,CAAC,EAAE,CAsEjB;AA4BD,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,QAAQ;IAClD,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;CACjC;AAuKD,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IAC3D,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAChC;AAED,UAAU,aAAa,CAAC,CAAC,SAAS,QAAQ;IACxC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACpD,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IAQxB,gBAAgB,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IAOzB,eAAe,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;CACjD;AA6FD,eAAO,MAAM,QAAQ,EAA0B,CAAC,CAAC,SAAS,QAAQ,EAChE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,KAC7D,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Column } from "../../layouts/index.js";
|
|
3
|
-
import { CanvasIcon, partition } from "../../utils/index.js";
|
|
4
|
-
import { Skeleton } from "@uipath/apollo-wind";
|
|
3
|
+
import { CanvasIcon, cx, partition } from "../../utils/index.js";
|
|
4
|
+
import { Skeleton, badgeVariants, cn } from "@uipath/apollo-wind";
|
|
5
|
+
import { motion } from "motion/react";
|
|
5
6
|
import { forwardRef, memo, useCallback, useImperativeHandle, useMemo } from "react";
|
|
7
|
+
import { List } from "react-window";
|
|
6
8
|
import { useCanvasTheme } from "../BaseCanvas/CanvasThemeContext.js";
|
|
7
9
|
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
8
10
|
import { InitialsBadge } from "../shared/InitialsBadge.js";
|
|
9
|
-
import {
|
|
11
|
+
import { ListViewIconContainer } from "./ListViewIconContainer.js";
|
|
10
12
|
const DEFAULT_SKELETON_COUNT = 3;
|
|
11
13
|
const ROW_HEIGHT_ITEM = 32;
|
|
12
14
|
const ROW_HEIGHT_ITEM_TWO_LINE = 44;
|
|
@@ -84,7 +86,8 @@ function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
|
84
86
|
if (skeletonConfig && !skeletonConfig.sections) pushSkeletons(baseSkeletonCount);
|
|
85
87
|
return result;
|
|
86
88
|
}
|
|
87
|
-
const
|
|
89
|
+
const ROW_BUTTON_CLASS = "box-border flex w-full cursor-pointer items-center gap-2.5 border-none bg-transparent text-left rounded-lg outline-1 outline-transparent [outline-offset:-1px] hover:bg-(--canvas-background-hover) aria-selected:bg-(--canvas-background-hover) aria-selected:outline-(--canvas-primary) disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 [&:disabled_*]:opacity-70 transition-[background-color,opacity,outline-color] duration-150";
|
|
90
|
+
const LIST_SCROLLBAR_CLASS = "[scrollbar-width:thin] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-(--canvas-border-de-emp) [&::-webkit-scrollbar-thumb:hover]:bg-(--canvas-border)";
|
|
88
91
|
const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, renderedItems, activeIndex, isLoading, isDarkMode, onItemClick, onItemHover })=>{
|
|
89
92
|
const renderItem = renderedItems[index];
|
|
90
93
|
const buttonStyle = useMemo(()=>({
|
|
@@ -136,8 +139,9 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
136
139
|
const item = renderItem.item;
|
|
137
140
|
const bgColor = isDarkMode ? item.colorDark ?? item.color : item.color;
|
|
138
141
|
const isActive = index === activeIndex;
|
|
139
|
-
const button = /*#__PURE__*/ jsxs(
|
|
142
|
+
const button = /*#__PURE__*/ jsxs(motion.button, {
|
|
140
143
|
...ariaAttributes,
|
|
144
|
+
type: "button",
|
|
141
145
|
tabIndex: -1,
|
|
142
146
|
id: `toolbox-item-${item.id}`,
|
|
143
147
|
role: "option",
|
|
@@ -145,15 +149,14 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
145
149
|
style: buttonStyle,
|
|
146
150
|
onClick: handleButtonClick,
|
|
147
151
|
onHoverStart: handleButtonHover,
|
|
148
|
-
className:
|
|
152
|
+
className: cx(ROW_BUTTON_CLASS, {
|
|
153
|
+
loading: !!isLoading
|
|
154
|
+
}),
|
|
149
155
|
disabled: isLoading,
|
|
150
156
|
children: [
|
|
151
|
-
/*#__PURE__*/ jsxs(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
color: item.contentColor
|
|
155
|
-
} : void 0,
|
|
156
|
-
"data-testid": "list-item-icon",
|
|
157
|
+
/*#__PURE__*/ jsxs(ListViewIconContainer, {
|
|
158
|
+
background: bgColor,
|
|
159
|
+
color: item.contentColor,
|
|
157
160
|
children: [
|
|
158
161
|
item.icon?.url && /*#__PURE__*/ jsx("img", {
|
|
159
162
|
src: item.icon?.url,
|
|
@@ -178,20 +181,22 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
178
181
|
overflow: "hidden",
|
|
179
182
|
children: [
|
|
180
183
|
/*#__PURE__*/ jsx("span", {
|
|
181
|
-
className: "text-sm
|
|
184
|
+
className: "truncate text-sm",
|
|
182
185
|
style: item.contentColor ? {
|
|
183
186
|
color: item.contentColor
|
|
184
187
|
} : void 0,
|
|
185
188
|
children: item.name
|
|
186
189
|
}),
|
|
187
190
|
item.description && /*#__PURE__*/ jsx("span", {
|
|
188
|
-
className: "text-xs
|
|
191
|
+
className: "truncate text-xs text-foreground-muted",
|
|
189
192
|
children: item.description
|
|
190
193
|
})
|
|
191
194
|
]
|
|
192
195
|
}),
|
|
193
196
|
item.badge && /*#__PURE__*/ jsx("span", {
|
|
194
|
-
className:
|
|
197
|
+
className: cn(badgeVariants({
|
|
198
|
+
variant: 'outline'
|
|
199
|
+
}), 'shrink-0 rounded border-border px-1 py-1 text-[8px] uppercase text-foreground-muted'),
|
|
195
200
|
"data-testid": "list-item-badge",
|
|
196
201
|
children: item.badge
|
|
197
202
|
}),
|
|
@@ -243,7 +248,7 @@ const ListItemSkeleton = ()=>/*#__PURE__*/ jsxs("div", {
|
|
|
243
248
|
"data-testid": "list-item-skeleton",
|
|
244
249
|
children: [
|
|
245
250
|
/*#__PURE__*/ jsx(Skeleton, {
|
|
246
|
-
className: "h-6 w-6 shrink-0 rounded-md"
|
|
251
|
+
className: "h-6 w-6 shrink-0 rounded-md future:rounded-lg"
|
|
247
252
|
}),
|
|
248
253
|
/*#__PURE__*/ jsx(Skeleton, {
|
|
249
254
|
className: "h-3.5 w-1/2"
|
|
@@ -304,8 +309,9 @@ const ListViewInner = /*#__PURE__*/ forwardRef(function({ items, activeIndex = -
|
|
|
304
309
|
]
|
|
305
310
|
});
|
|
306
311
|
}
|
|
307
|
-
return /*#__PURE__*/ jsx(
|
|
312
|
+
return /*#__PURE__*/ jsx(List, {
|
|
308
313
|
id: "toolbox-listbox",
|
|
314
|
+
className: LIST_SCROLLBAR_CLASS,
|
|
309
315
|
role: "listbox",
|
|
310
316
|
"aria-busy": activeSkeleton ? true : void 0,
|
|
311
317
|
listRef: listRef,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ListViewIconContainer: ()=>ListViewIconContainer_ListViewIconContainer
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const ListViewIconContainer_ListViewIconContainer = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ background, color, children }) {
|
|
32
|
+
const style = (0, external_react_namespaceObject.useMemo)(()=>background || color ? {
|
|
33
|
+
background,
|
|
34
|
+
color
|
|
35
|
+
} : void 0, [
|
|
36
|
+
background,
|
|
37
|
+
color
|
|
38
|
+
]);
|
|
39
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
40
|
+
className: "flex size-6 shrink-0 items-center justify-center rounded-md text-(--canvas-foreground-emp) opacity-90 [z-index:-1] future:rounded-lg",
|
|
41
|
+
style: style,
|
|
42
|
+
"data-testid": "list-item-icon",
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
exports.ListViewIconContainer = __webpack_exports__.ListViewIconContainer;
|
|
47
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
48
|
+
"ListViewIconContainer"
|
|
49
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
50
|
+
Object.defineProperty(exports, '__esModule', {
|
|
51
|
+
value: true
|
|
52
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface ListViewIconContainerProps {
|
|
3
|
+
background?: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const ListViewIconContainer: import("react").NamedExoticComponent<ListViewIconContainerProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ListViewIconContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListViewIconContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListViewIconContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAEtD,UAAU,0BAA0B;IAKlC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,eAAO,MAAM,qBAAqB,kEAqBhC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
const ListViewIconContainer_ListViewIconContainer = /*#__PURE__*/ memo(function({ background, color, children }) {
|
|
4
|
+
const style = useMemo(()=>background || color ? {
|
|
5
|
+
background,
|
|
6
|
+
color
|
|
7
|
+
} : void 0, [
|
|
8
|
+
background,
|
|
9
|
+
color
|
|
10
|
+
]);
|
|
11
|
+
return /*#__PURE__*/ jsx("div", {
|
|
12
|
+
className: "flex size-6 shrink-0 items-center justify-center rounded-md text-(--canvas-foreground-emp) opacity-90 [z-index:-1] future:rounded-lg",
|
|
13
|
+
style: style,
|
|
14
|
+
"data-testid": "list-item-icon",
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
export { ListViewIconContainer_ListViewIconContainer as ListViewIconContainer };
|
|
@@ -31,6 +31,10 @@ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
32
|
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
33
33
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
34
|
+
const BLEED_TO_PANEL_EDGE_STYLE = {
|
|
35
|
+
paddingInline: external_constants_cjs_namespaceObject.TOOLBOX_PADDING_X,
|
|
36
|
+
marginInline: -external_constants_cjs_namespaceObject.TOOLBOX_PADDING_X
|
|
37
|
+
};
|
|
34
38
|
function QuickActionButton({ action, wide }) {
|
|
35
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
36
40
|
content: action.title,
|
|
@@ -54,18 +58,16 @@ const QuickActionsRow_QuickActionsRow = /*#__PURE__*/ (0, external_react_namespa
|
|
|
54
58
|
const leading = actions.filter((a)=>!a.trailing);
|
|
55
59
|
const trailing = actions.filter((a)=>a.trailing);
|
|
56
60
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
57
|
-
className: "flex items-center justify-center gap-3
|
|
58
|
-
style:
|
|
59
|
-
paddingInline: external_constants_cjs_namespaceObject.TOOLBOX_PADDING_X,
|
|
60
|
-
marginInline: -external_constants_cjs_namespaceObject.TOOLBOX_PADDING_X
|
|
61
|
-
},
|
|
61
|
+
className: "flex min-h-11 shrink-0 items-center justify-center gap-3 border-b border-border pb-2 future:border-border-subtle",
|
|
62
|
+
style: BLEED_TO_PANEL_EDGE_STYLE,
|
|
62
63
|
"data-testid": "toolbox-quick-actions",
|
|
63
64
|
children: [
|
|
64
65
|
leading.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(QuickActionButton, {
|
|
65
66
|
action: action
|
|
66
67
|
}, action.id)),
|
|
67
|
-
trailing.length > 0 && leading.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
68
|
-
|
|
68
|
+
trailing.length > 0 && leading.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Separator, {
|
|
69
|
+
orientation: "vertical",
|
|
70
|
+
className: "mx-1 h-auto shrink-0 self-stretch",
|
|
69
71
|
"data-testid": "toolbox-quick-actions-separator"
|
|
70
72
|
}),
|
|
71
73
|
trailing.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(QuickActionButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickActionsRow.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/QuickActionsRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"QuickActionsRow.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/QuickActionsRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAY9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAuBD,eAAO,MAAM,eAAe,4DA2B1B,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "@uipath/apollo-wind";
|
|
2
|
+
import { Button, Separator } from "@uipath/apollo-wind";
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { TOOLBOX_PADDING_X } from "../../constants.js";
|
|
5
5
|
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
6
|
+
const BLEED_TO_PANEL_EDGE_STYLE = {
|
|
7
|
+
paddingInline: TOOLBOX_PADDING_X,
|
|
8
|
+
marginInline: -TOOLBOX_PADDING_X
|
|
9
|
+
};
|
|
6
10
|
function QuickActionButton({ action, wide }) {
|
|
7
11
|
return /*#__PURE__*/ jsx(CanvasTooltip, {
|
|
8
12
|
content: action.title,
|
|
@@ -26,18 +30,16 @@ const QuickActionsRow_QuickActionsRow = /*#__PURE__*/ memo(function({ actions })
|
|
|
26
30
|
const leading = actions.filter((a)=>!a.trailing);
|
|
27
31
|
const trailing = actions.filter((a)=>a.trailing);
|
|
28
32
|
return /*#__PURE__*/ jsxs("div", {
|
|
29
|
-
className: "flex items-center justify-center gap-3
|
|
30
|
-
style:
|
|
31
|
-
paddingInline: TOOLBOX_PADDING_X,
|
|
32
|
-
marginInline: -TOOLBOX_PADDING_X
|
|
33
|
-
},
|
|
33
|
+
className: "flex min-h-11 shrink-0 items-center justify-center gap-3 border-b border-border pb-2 future:border-border-subtle",
|
|
34
|
+
style: BLEED_TO_PANEL_EDGE_STYLE,
|
|
34
35
|
"data-testid": "toolbox-quick-actions",
|
|
35
36
|
children: [
|
|
36
37
|
leading.map((action)=>/*#__PURE__*/ jsx(QuickActionButton, {
|
|
37
38
|
action: action
|
|
38
39
|
}, action.id)),
|
|
39
|
-
trailing.length > 0 && leading.length > 0 && /*#__PURE__*/ jsx(
|
|
40
|
-
|
|
40
|
+
trailing.length > 0 && leading.length > 0 && /*#__PURE__*/ jsx(Separator, {
|
|
41
|
+
orientation: "vertical",
|
|
42
|
+
className: "mx-1 h-auto shrink-0 self-stretch",
|
|
41
43
|
"data-testid": "toolbox-quick-actions-separator"
|
|
42
44
|
}),
|
|
43
45
|
trailing.map((action)=>/*#__PURE__*/ jsx(QuickActionButton, {
|
|
@@ -27,10 +27,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
SearchBox: ()=>SearchBox_SearchBox
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
32
|
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
|
|
33
|
-
const external_SearchBox_styles_cjs_namespaceObject = require("./SearchBox.styles.cjs");
|
|
34
33
|
const SearchBox_SearchBox = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ value, onChange, clear, placeholder = 'Search...', clearButtonAriaLabel = 'Clear search', inputRef: externalInputRef, clearButtonRef, onNavigationKeyDown, navigateToFirstItem, activeDescendantId }) {
|
|
35
34
|
const internalRef = (0, external_react_namespaceObject.useRef)(null);
|
|
36
35
|
const inputRef = externalInputRef ?? internalRef;
|
|
@@ -46,46 +45,47 @@ const SearchBox_SearchBox = /*#__PURE__*/ (0, external_react_namespaceObject.mem
|
|
|
46
45
|
if (!e.shiftKey) navigateToFirstItem?.();
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
48
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("form", {
|
|
50
49
|
autoComplete: "off",
|
|
51
|
-
className: "
|
|
50
|
+
className: "w-full",
|
|
52
51
|
onSubmit: (e)=>e.preventDefault(),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}),
|
|
52
|
+
"data-testid": "toolbox-search",
|
|
53
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.InputGroup, {
|
|
54
|
+
className: "h-8 future:h-9",
|
|
57
55
|
children: [
|
|
58
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
59
|
-
|
|
56
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.InputGroupAddon, {
|
|
57
|
+
align: "inline-start",
|
|
60
58
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
61
59
|
icon: "search",
|
|
62
60
|
size: 16
|
|
63
61
|
})
|
|
64
62
|
}),
|
|
65
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
63
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.InputGroupInput, {
|
|
66
64
|
ref: inputRef,
|
|
67
65
|
autoComplete: "off",
|
|
68
66
|
type: "text",
|
|
69
67
|
role: "combobox",
|
|
70
68
|
"aria-controls": "toolbox-listbox",
|
|
71
69
|
"aria-expanded": true,
|
|
72
|
-
|
|
70
|
+
"aria-activedescendant": activeDescendantId,
|
|
73
71
|
placeholder: placeholder,
|
|
74
72
|
value: value,
|
|
75
73
|
onChange: (e)=>onChange(e.target.value),
|
|
76
|
-
onKeyDown: onNavigationKeyDown
|
|
77
|
-
"aria-activedescendant": activeDescendantId
|
|
74
|
+
onKeyDown: onNavigationKeyDown
|
|
78
75
|
}),
|
|
79
|
-
value && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
value && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.InputGroupAddon, {
|
|
77
|
+
align: "inline-end",
|
|
78
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.InputGroupButton, {
|
|
79
|
+
ref: clearButtonRef,
|
|
80
|
+
icon: true,
|
|
81
|
+
size: "3xs",
|
|
82
|
+
"aria-label": clearButtonAriaLabel,
|
|
83
|
+
onClick: clear,
|
|
84
|
+
onKeyDown: handleClearButtonKeyDown,
|
|
85
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
86
|
+
icon: "x",
|
|
87
|
+
size: 16
|
|
88
|
+
})
|
|
89
89
|
})
|
|
90
90
|
})
|
|
91
91
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/SearchBox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/SearchBox.tsx"],"names":[],"mappings":"AAUA,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC3D,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IACvD,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,sDA4EpB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@uipath/apollo-wind";
|
|
3
3
|
import { memo, useEffect, useRef } from "react";
|
|
4
4
|
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
5
|
-
import { StyledSearchForm } from "./SearchBox.styles.js";
|
|
6
5
|
const SearchBox_SearchBox = /*#__PURE__*/ memo(function({ value, onChange, clear, placeholder = 'Search...', clearButtonAriaLabel = 'Clear search', inputRef: externalInputRef, clearButtonRef, onNavigationKeyDown, navigateToFirstItem, activeDescendantId }) {
|
|
7
6
|
const internalRef = useRef(null);
|
|
8
7
|
const inputRef = externalInputRef ?? internalRef;
|
|
@@ -18,46 +17,47 @@ const SearchBox_SearchBox = /*#__PURE__*/ memo(function({ value, onChange, clear
|
|
|
18
17
|
if (!e.shiftKey) navigateToFirstItem?.();
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
|
-
return /*#__PURE__*/ jsx(
|
|
20
|
+
return /*#__PURE__*/ jsx("form", {
|
|
22
21
|
autoComplete: "off",
|
|
23
|
-
className: "
|
|
22
|
+
className: "w-full",
|
|
24
23
|
onSubmit: (e)=>e.preventDefault(),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}),
|
|
24
|
+
"data-testid": "toolbox-search",
|
|
25
|
+
children: /*#__PURE__*/ jsxs(InputGroup, {
|
|
26
|
+
className: "h-8 future:h-9",
|
|
29
27
|
children: [
|
|
30
|
-
/*#__PURE__*/ jsx(
|
|
31
|
-
|
|
28
|
+
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
29
|
+
align: "inline-start",
|
|
32
30
|
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
33
31
|
icon: "search",
|
|
34
32
|
size: 16
|
|
35
33
|
})
|
|
36
34
|
}),
|
|
37
|
-
/*#__PURE__*/ jsx(
|
|
35
|
+
/*#__PURE__*/ jsx(InputGroupInput, {
|
|
38
36
|
ref: inputRef,
|
|
39
37
|
autoComplete: "off",
|
|
40
38
|
type: "text",
|
|
41
39
|
role: "combobox",
|
|
42
40
|
"aria-controls": "toolbox-listbox",
|
|
43
41
|
"aria-expanded": true,
|
|
44
|
-
|
|
42
|
+
"aria-activedescendant": activeDescendantId,
|
|
45
43
|
placeholder: placeholder,
|
|
46
44
|
value: value,
|
|
47
45
|
onChange: (e)=>onChange(e.target.value),
|
|
48
|
-
onKeyDown: onNavigationKeyDown
|
|
49
|
-
"aria-activedescendant": activeDescendantId
|
|
46
|
+
onKeyDown: onNavigationKeyDown
|
|
50
47
|
}),
|
|
51
|
-
value && /*#__PURE__*/ jsx(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
value && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
49
|
+
align: "inline-end",
|
|
50
|
+
children: /*#__PURE__*/ jsx(InputGroupButton, {
|
|
51
|
+
ref: clearButtonRef,
|
|
52
|
+
icon: true,
|
|
53
|
+
size: "3xs",
|
|
54
|
+
"aria-label": clearButtonAriaLabel,
|
|
55
|
+
onClick: clear,
|
|
56
|
+
onKeyDown: handleClearButtonKeyDown,
|
|
57
|
+
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
58
|
+
icon: "x",
|
|
59
|
+
size: 16
|
|
60
|
+
})
|
|
61
61
|
})
|
|
62
62
|
})
|
|
63
63
|
]
|