@uipath/apollo-react 3.58.0 → 3.58.2

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.
Files changed (24) hide show
  1. package/dist/canvas/components/StageNode/DraggableTask.cjs +5 -3
  2. package/dist/canvas/components/StageNode/DraggableTask.d.ts.map +1 -1
  3. package/dist/canvas/components/StageNode/DraggableTask.js +6 -4
  4. package/dist/canvas/components/StageNode/StageNode.stories.cjs +44 -0
  5. package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
  6. package/dist/canvas/components/StageNode/StageNode.stories.js +44 -0
  7. package/dist/canvas/components/StageNode/StageNode.styles.cjs +0 -4
  8. package/dist/canvas/components/StageNode/StageNode.styles.d.ts +0 -1
  9. package/dist/canvas/components/StageNode/StageNode.styles.d.ts.map +1 -1
  10. package/dist/canvas/components/StageNode/StageNode.styles.js +0 -4
  11. package/dist/canvas/components/Toolbox/ListView.cjs +1 -1
  12. package/dist/canvas/components/Toolbox/ListView.d.ts +2 -2
  13. package/dist/canvas/components/Toolbox/ListView.d.ts.map +1 -1
  14. package/dist/canvas/components/Toolbox/ListView.js +1 -1
  15. package/dist/canvas/components/Toolbox/SearchBox.cjs +10 -1
  16. package/dist/canvas/components/Toolbox/SearchBox.d.ts +2 -0
  17. package/dist/canvas/components/Toolbox/SearchBox.d.ts.map +1 -1
  18. package/dist/canvas/components/Toolbox/SearchBox.js +10 -1
  19. package/dist/canvas/components/Toolbox/Toolbox.cjs +55 -33
  20. package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
  21. package/dist/canvas/components/Toolbox/Toolbox.js +55 -33
  22. package/dist/core/tokens/css/theme-variables.css +4 -4
  23. package/dist/core/tokens/scss/theme-variables.scss +4 -4
  24. package/package.json +3 -3
@@ -127,8 +127,11 @@ const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ ta
127
127
  taskExecution?.status && (taskExecution.message ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
128
128
  content: taskExecution.message,
129
129
  placement: "top",
130
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
131
- status: taskExecution.status
130
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
131
+ size: "small",
132
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
133
+ status: taskExecution.status
134
+ })
132
135
  })
133
136
  }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
134
137
  status: taskExecution.status
@@ -229,7 +232,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
229
232
  status: taskExecution?.status,
230
233
  isParallel: isParallel,
231
234
  isDragEnabled: !isDragDisabled,
232
- isMenuOpen: isMenuOpen,
233
235
  onClick: handleClick,
234
236
  ...contextMenuItems.length > 0 && {
235
237
  onContextMenu: handleContextMenu
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAsEpF,CAAC;AAqHH,eAAO,MAAM,aAAa,0KAxGvB,kBAAkB,6CAwGoC,CAAC"}
1
+ {"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAwEpF,CAAC;AAoHH,eAAO,MAAM,aAAa,0KAvGvB,kBAAkB,6CAuGoC,CAAC"}
@@ -3,7 +3,7 @@ import { useSortable } from "@dnd-kit/sortable";
3
3
  import { CSS } from "@dnd-kit/utilities";
4
4
  import { FontVariantToken, Padding, Spacing } from "@uipath/apollo-core";
5
5
  import { Column, Row } from "../../layouts/index.js";
6
- import { ApBadge, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
6
+ import { ApBadge, ApIconButton, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
7
7
  import { memo, useCallback, useMemo, useRef, useState } from "react";
8
8
  import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
9
9
  import { INDENTATION_WIDTH, StageTask, StageTaskDragPlaceholder, StageTaskDragPlaceholderWrapper, StageTaskIcon, StageTaskRetryDuration, StageTaskWrapper } from "./StageNode.styles.js";
@@ -98,8 +98,11 @@ const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging })=>/*
98
98
  taskExecution?.status && (taskExecution.message ? /*#__PURE__*/ jsx(ApTooltip, {
99
99
  content: taskExecution.message,
100
100
  placement: "top",
101
- children: /*#__PURE__*/ jsx(ExecutionStatusIcon, {
102
- status: taskExecution.status
101
+ children: /*#__PURE__*/ jsx(ApIconButton, {
102
+ size: "small",
103
+ children: /*#__PURE__*/ jsx(ExecutionStatusIcon, {
104
+ status: taskExecution.status
105
+ })
103
106
  })
104
107
  }) : /*#__PURE__*/ jsx(ExecutionStatusIcon, {
105
108
  status: taskExecution.status
@@ -200,7 +203,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
200
203
  status: taskExecution?.status,
201
204
  isParallel: isParallel,
202
205
  isDragEnabled: !isDragDisabled,
203
- isMenuOpen: isMenuOpen,
204
206
  onClick: handleClick,
205
207
  ...contextMenuItems.length > 0 && {
206
208
  onContextMenu: handleContextMenu
@@ -309,6 +309,50 @@ const Default = {
309
309
  }
310
310
  }))
311
311
  }
312
+ },
313
+ {
314
+ id: '2',
315
+ type: 'stage',
316
+ position: {
317
+ x: 752,
318
+ y: 96
319
+ },
320
+ width: 304,
321
+ data: {
322
+ onReplaceTaskFromToolbox: ()=>{},
323
+ stageDetails: {
324
+ label: 'Validation - Failed',
325
+ isReadOnly: true,
326
+ tasks: [
327
+ [
328
+ {
329
+ id: '1',
330
+ label: 'Data Validation',
331
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
332
+ }
333
+ ],
334
+ [
335
+ {
336
+ id: '2',
337
+ label: 'Compliance Check',
338
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {})
339
+ }
340
+ ]
341
+ ]
342
+ },
343
+ execution: {
344
+ stageStatus: {
345
+ label: 'error message',
346
+ status: 'Failed'
347
+ },
348
+ taskStatus: {
349
+ 2: {
350
+ status: 'Failed',
351
+ message: 'Compliance requirements not met'
352
+ }
353
+ }
354
+ }
355
+ }
312
356
  }
313
357
  ]
314
358
  },
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KA2DrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAkVF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAiJF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC"}
1
+ {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAwFrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAkVF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAiJF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC"}
@@ -273,6 +273,50 @@ const Default = {
273
273
  }
274
274
  }))
275
275
  }
276
+ },
277
+ {
278
+ id: '2',
279
+ type: 'stage',
280
+ position: {
281
+ x: 752,
282
+ y: 96
283
+ },
284
+ width: 304,
285
+ data: {
286
+ onReplaceTaskFromToolbox: ()=>{},
287
+ stageDetails: {
288
+ label: 'Validation - Failed',
289
+ isReadOnly: true,
290
+ tasks: [
291
+ [
292
+ {
293
+ id: '1',
294
+ label: 'Data Validation',
295
+ icon: /*#__PURE__*/ jsx(VerificationIcon, {})
296
+ }
297
+ ],
298
+ [
299
+ {
300
+ id: '2',
301
+ label: 'Compliance Check',
302
+ icon: /*#__PURE__*/ jsx(DocumentIcon, {})
303
+ }
304
+ ]
305
+ ]
306
+ },
307
+ execution: {
308
+ stageStatus: {
309
+ label: 'error message',
310
+ status: 'Failed'
311
+ },
312
+ taskStatus: {
313
+ 2: {
314
+ status: 'Failed',
315
+ message: 'Compliance requirements not met'
316
+ }
317
+ }
318
+ }
319
+ }
276
320
  }
277
321
  ]
278
322
  },
@@ -203,10 +203,6 @@ const StageTask = styled_default().div`
203
203
  height: ${({ isDragEnabled })=>isDragEnabled ? '100%' : 'auto'};
204
204
 
205
205
  .task-menu-icon-button {
206
- display: ${({ isMenuOpen })=>isMenuOpen ? 'flex' : 'none'};
207
- }
208
-
209
- &:hover .task-menu-icon-button {
210
206
  display: flex;
211
207
  }
212
208
 
@@ -67,7 +67,6 @@ export declare const StageTask: import("@emotion/styled").StyledComponent<{
67
67
  selected?: boolean;
68
68
  isParallel?: boolean;
69
69
  isDragEnabled?: boolean;
70
- isMenuOpen?: boolean;
71
70
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
72
71
  export declare const StageTaskIcon: import("@emotion/styled").StyledComponent<{
73
72
  theme?: import("@emotion/react").Theme;
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.styles.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.styles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,mBAAmB,QAAuD,CAAC;AAExF,eAAO,MAAM,cAAc;;;;eACd,OAAO;aACT,WAAW;Y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AM,WAAW;;;;kBAA8B,OAAO;yGAS5D,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;gBAA4B,OAAO;yGAKlE,CAAC;AAEF,eAAO,MAAM,eAAe;;;;gBACd,OAAO;2BACI,OAAO;YACtB,MAAM;kHAsBf,CAAC;AAEF,eAAO,MAAM,YAAY;;;yGAQxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;yGAKzB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;iBAA6B,OAAO;yGAM9D,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;yGAa9B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;yGAMhC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;iBAA6B,OAAO;yGAKhE,CAAC;AAEF,eAAO,MAAM,SAAS;;;;aACX,WAAW;eACT,OAAO;iBACL,OAAO;oBACJ,OAAO;yGA6DxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;yGAYzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;aAAyB,SAAS,GAAG,MAAM,GAAG,OAAO;yGAoBvF,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;yGAG3C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;uBAAmC,OAAO;yGAW9E,CAAC"}
@@ -147,10 +147,6 @@ const StageTask = styled.div`
147
147
  height: ${({ isDragEnabled })=>isDragEnabled ? '100%' : 'auto'};
148
148
 
149
149
  .task-menu-icon-button {
150
- display: ${({ isMenuOpen })=>isMenuOpen ? 'flex' : 'none'};
151
- }
152
-
153
- &:hover .task-menu-icon-button {
154
150
  display: flex;
155
151
  }
156
152
 
@@ -79,7 +79,7 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
79
79
  ]);
80
80
  const handleButtonClick = (0, external_react_namespaceObject.useCallback)(()=>{
81
81
  const clickTarget = renderedItems[index];
82
- if (clickTarget?.type === 'item') onItemClick(clickTarget.item);
82
+ if (clickTarget?.type === 'item') onItemClick(clickTarget.item, index);
83
83
  }, [
84
84
  onItemClick,
85
85
  renderedItems,
@@ -28,7 +28,7 @@ export interface ListViewRowProps<T extends ListItem> {
28
28
  activeIndex: number;
29
29
  isLoading?: boolean;
30
30
  isDarkMode?: boolean;
31
- onItemClick: (item: T) => void;
31
+ onItemClick: (item: T, index: number) => void;
32
32
  onItemHover?: (item: T) => void;
33
33
  }
34
34
  export interface ListViewHandle<T extends ListItem = ListItem> {
@@ -38,7 +38,7 @@ interface ListViewProps<T extends ListItem> {
38
38
  items: T[];
39
39
  activeIndex?: number;
40
40
  listRef?: React.RefObject<ListImperativeAPI | null>;
41
- onItemClick: (item: T) => void;
41
+ onItemClick: (item: T, index: number) => void;
42
42
  onItemHover?: (item: T) => void;
43
43
  emptyStateMessage?: string;
44
44
  emptyStateIcon?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,cAAc,CAAC;AAIzE,MAAM,WAAW,YAAY;IAI3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AAED,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;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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,I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CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAsED,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"}
@@ -50,7 +50,7 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
50
50
  ]);
51
51
  const handleButtonClick = useCallback(()=>{
52
52
  const clickTarget = renderedItems[index];
53
- if (clickTarget?.type === 'item') onItemClick(clickTarget.item);
53
+ if (clickTarget?.type === 'item') onItemClick(clickTarget.item, index);
54
54
  }, [
55
55
  onItemClick,
56
56
  renderedItems,
@@ -31,7 +31,7 @@ const index_cjs_namespaceObject = require("../../utils/index.cjs");
31
31
  const components_index_cjs_namespaceObject = require("../../../material/components/index.cjs");
32
32
  const external_react_namespaceObject = require("react");
33
33
  const external_SearchBox_styles_cjs_namespaceObject = require("./SearchBox.styles.cjs");
34
- const SearchBox_SearchBox = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ value, onChange, clear, placeholder = 'Search...', inputRef: externalInputRef, onNavigationKeyDown, activeDescendantId }) {
34
+ const SearchBox_SearchBox = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ value, onChange, clear, placeholder = 'Search...', inputRef: externalInputRef, clearButtonRef, onNavigationKeyDown, navigateToFirstItem, activeDescendantId }) {
35
35
  const internalRef = (0, external_react_namespaceObject.useRef)(null);
36
36
  const inputRef = externalInputRef ?? internalRef;
37
37
  (0, external_react_namespaceObject.useEffect)(()=>{
@@ -39,6 +39,13 @@ const SearchBox_SearchBox = /*#__PURE__*/ (0, external_react_namespaceObject.mem
39
39
  }, [
40
40
  inputRef
41
41
  ]);
42
+ const handleClearButtonKeyDown = (e)=>{
43
+ if ('Tab' === e.key) {
44
+ e.preventDefault();
45
+ inputRef.current?.focus();
46
+ if (!e.shiftKey) navigateToFirstItem?.();
47
+ }
48
+ };
42
49
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_SearchBox_styles_cjs_namespaceObject.StyledSearchForm, {
43
50
  autoComplete: "off",
44
51
  className: "searchbox-form",
@@ -70,9 +77,11 @@ const SearchBox_SearchBox = /*#__PURE__*/ (0, external_react_namespaceObject.mem
70
77
  "aria-activedescendant": activeDescendantId
71
78
  }),
72
79
  value && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
80
+ ref: clearButtonRef,
73
81
  type: "button",
74
82
  className: "searchbox-clear",
75
83
  onClick: clear,
84
+ onKeyDown: handleClearButtonKeyDown,
76
85
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(components_index_cjs_namespaceObject.ApIcon, {
77
86
  name: "close",
78
87
  size: "16px"
@@ -4,7 +4,9 @@ interface SearchBoxProps {
4
4
  clear: () => void;
5
5
  placeholder?: string;
6
6
  inputRef?: React.RefObject<HTMLInputElement | null>;
7
+ clearButtonRef?: React.RefObject<HTMLButtonElement | null>;
7
8
  onNavigationKeyDown?: (e: React.KeyboardEvent) => void;
9
+ navigateToFirstItem?: () => void;
8
10
  activeDescendantId?: string;
9
11
  }
10
12
  export declare const SearchBox: import("react").NamedExoticComponent<SearchBoxProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/SearchBox.tsx"],"names":[],"mappings":"AAKA,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,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACpD,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,sDAgDpB,CAAC"}
1
+ {"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/SearchBox.tsx"],"names":[],"mappings":"AAKA,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,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,sDAmEpB,CAAC"}
@@ -3,7 +3,7 @@ import { cx } from "../../utils/index.js";
3
3
  import { ApIcon } from "../../../material/components/index.js";
4
4
  import { memo, useEffect, useRef } from "react";
5
5
  import { StyledSearchForm } from "./SearchBox.styles.js";
6
- const SearchBox_SearchBox = /*#__PURE__*/ memo(function({ value, onChange, clear, placeholder = 'Search...', inputRef: externalInputRef, onNavigationKeyDown, activeDescendantId }) {
6
+ const SearchBox_SearchBox = /*#__PURE__*/ memo(function({ value, onChange, clear, placeholder = 'Search...', inputRef: externalInputRef, clearButtonRef, onNavigationKeyDown, navigateToFirstItem, activeDescendantId }) {
7
7
  const internalRef = useRef(null);
8
8
  const inputRef = externalInputRef ?? internalRef;
9
9
  useEffect(()=>{
@@ -11,6 +11,13 @@ const SearchBox_SearchBox = /*#__PURE__*/ memo(function({ value, onChange, clear
11
11
  }, [
12
12
  inputRef
13
13
  ]);
14
+ const handleClearButtonKeyDown = (e)=>{
15
+ if ('Tab' === e.key) {
16
+ e.preventDefault();
17
+ inputRef.current?.focus();
18
+ if (!e.shiftKey) navigateToFirstItem?.();
19
+ }
20
+ };
14
21
  return /*#__PURE__*/ jsx(StyledSearchForm, {
15
22
  autoComplete: "off",
16
23
  className: "searchbox-form",
@@ -42,9 +49,11 @@ const SearchBox_SearchBox = /*#__PURE__*/ memo(function({ value, onChange, clear
42
49
  "aria-activedescendant": activeDescendantId
43
50
  }),
44
51
  value && /*#__PURE__*/ jsx("button", {
52
+ ref: clearButtonRef,
45
53
  type: "button",
46
54
  className: "searchbox-clear",
47
55
  onClick: clear,
56
+ onKeyDown: handleClearButtonKeyDown,
48
57
  children: /*#__PURE__*/ jsx(ApIcon, {
49
58
  name: "close",
50
59
  size: "16px"
@@ -98,6 +98,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
98
98
  const listRef = (0, external_react_window_namespaceObject.useListRef)(null);
99
99
  const listViewRef = (0, external_react_namespaceObject.useRef)(null);
100
100
  const searchInputRef = (0, external_react_namespaceObject.useRef)(null);
101
+ const clearButtonRef = (0, external_react_namespaceObject.useRef)(null);
101
102
  const isSearching = (0, external_react_namespaceObject.useMemo)(()=>search.length > 0, [
102
103
  search
103
104
  ]);
@@ -117,21 +118,32 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
117
118
  }, []);
118
119
  const navigateToIndex = (0, external_react_namespaceObject.useCallback)((index)=>{
119
120
  setActiveIndex(index);
120
- if (index === SEARCH_BAR_INDEX) return void searchInputRef.current?.focus();
121
- listRef.current?.scrollToRow({
122
- index,
123
- align: 'auto'
121
+ searchInputRef.current?.focus();
122
+ if (index !== SEARCH_BAR_INDEX) requestAnimationFrame(()=>{
123
+ listRef.current?.scrollToRow({
124
+ index,
125
+ align: 'auto'
126
+ });
124
127
  });
125
128
  }, [
126
129
  listRef
127
130
  ]);
131
+ const navigateToFirstItem = (0, external_react_namespaceObject.useCallback)(()=>{
132
+ const renderedItems = listViewRef.current?.renderedItems ?? [];
133
+ const firstIndex = getFirstSelectableIndex(renderedItems);
134
+ if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
135
+ }, [
136
+ navigateToIndex
137
+ ]);
128
138
  const clearSearch = (0, external_react_namespaceObject.useCallback)(()=>{
129
139
  setSearch('');
130
140
  setSearchedItems([]);
131
141
  setSearchLoading(false);
132
142
  setIsSearchingInitialItems(true);
133
- setActiveIndex(SEARCH_BAR_INDEX);
134
- }, []);
143
+ navigateToIndex(SEARCH_BAR_INDEX);
144
+ }, [
145
+ navigateToIndex
146
+ ]);
135
147
  const handleSearch = (0, external_react_namespaceObject.useCallback)(async (query)=>{
136
148
  if (!query.trim()) {
137
149
  setSearchLoading(false);
@@ -162,30 +174,35 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
162
174
  ]);
163
175
  const handleBackTransition = (0, external_react_namespaceObject.useCallback)(()=>{
164
176
  startTransition('back');
165
- setActiveIndex(SEARCH_BAR_INDEX);
166
177
  const previousState = navigationStack.pop();
167
178
  if (previousState) {
168
179
  setItems(previousState.data.items);
169
180
  setCurrentParentItem(previousState.data.parentItem);
170
181
  }
171
- if (isSearching) clearSearch();
182
+ setSearch('');
183
+ setSearchedItems([]);
184
+ setSearchLoading(false);
185
+ setIsSearchingInitialItems(true);
186
+ const restoredIndex = previousState?.data.activeIndex ?? SEARCH_BAR_INDEX;
187
+ navigateToIndex(restoredIndex);
172
188
  onBack?.();
173
189
  }, [
174
190
  navigationStack,
175
- isSearching,
176
191
  onBack,
177
- clearSearch,
178
- startTransition
192
+ startTransition,
193
+ navigateToIndex
179
194
  ]);
180
- const handleItemSelect = (0, external_react_namespaceObject.useCallback)(async (item)=>{
195
+ const handleItemSelect = (0, external_react_namespaceObject.useCallback)(async (item, index)=>{
181
196
  if (!item.children) return void onItemSelect(item);
182
197
  setChildrenLoading(true);
183
198
  const nestedItems = 'function' == typeof item.children ? await item.children(item.id, item.name) : item.children;
199
+ const savedIndex = isSearching ? SEARCH_BAR_INDEX : index ?? activeIndex;
184
200
  navigationStack.push({
185
201
  title: currentParentItem?.name || title,
186
202
  data: {
187
203
  items,
188
- parentItem: currentParentItem
204
+ parentItem: currentParentItem,
205
+ activeIndex: savedIndex
189
206
  }
190
207
  });
191
208
  setItems(nestedItems);
@@ -199,6 +216,8 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
199
216
  currentParentItem,
200
217
  title,
201
218
  items,
219
+ activeIndex,
220
+ isSearching,
202
221
  clearSearch,
203
222
  startTransition,
204
223
  onItemSelect
@@ -221,7 +240,8 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
221
240
  ...stackItem,
222
241
  data: {
223
242
  items: newInitialItems,
224
- parentItem: null
243
+ parentItem: null,
244
+ activeIndex: stackItem.data.activeIndex
225
245
  }
226
246
  };
227
247
  const updatedParentItem = findItemById(newInitialItems, stackItem.data.parentItem.id);
@@ -231,7 +251,8 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
231
251
  ...stackItem,
232
252
  data: {
233
253
  items: updatedItems,
234
- parentItem: updatedParentItem
254
+ parentItem: updatedParentItem,
255
+ activeIndex: stackItem.data.activeIndex
235
256
  }
236
257
  };
237
258
  });
@@ -260,16 +281,11 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
260
281
  if (isTransitioning) return;
261
282
  const renderedItems = listViewRef.current?.renderedItems ?? [];
262
283
  const navigateDown = ()=>{
263
- if (activeIndex === SEARCH_BAR_INDEX) {
264
- const firstIndex = getFirstSelectableIndex(renderedItems);
265
- if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
266
- } else {
284
+ if (activeIndex === SEARCH_BAR_INDEX) navigateToFirstItem();
285
+ else {
267
286
  const nextIndex = getNextSelectableIndex(renderedItems, activeIndex, 'down');
268
287
  if (nextIndex !== SEARCH_BAR_INDEX) navigateToIndex(nextIndex);
269
- else {
270
- const firstIndex = getFirstSelectableIndex(renderedItems);
271
- if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
272
- }
288
+ else navigateToFirstItem();
273
289
  }
274
290
  };
275
291
  const navigateUp = ()=>{
@@ -284,9 +300,10 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
284
300
  e.preventDefault();
285
301
  navigateUp();
286
302
  break;
303
+ case ' ':
287
304
  case 'Enter':
288
305
  {
289
- if (activeIndex === SEARCH_BAR_INDEX) break;
306
+ if (activeIndex === SEARCH_BAR_INDEX) return;
290
307
  const renderItem = renderedItems[activeIndex];
291
308
  if (renderItem?.type === 'item') {
292
309
  e.preventDefault();
@@ -309,18 +326,20 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
309
326
  handleBackTransition();
310
327
  break;
311
328
  case 'Tab':
329
+ if (activeIndex === SEARCH_BAR_INDEX && search.length > 0 && !e.shiftKey) break;
312
330
  e.preventDefault();
313
- if (e.shiftKey) navigateUp();
314
- else navigateDown();
331
+ if (activeIndex === SEARCH_BAR_INDEX && e.shiftKey) break;
332
+ if (e.shiftKey) {
333
+ navigateUp();
334
+ const nextUp = getNextSelectableIndex(renderedItems, activeIndex, 'up');
335
+ if (nextUp === SEARCH_BAR_INDEX && search.length > 0) clearButtonRef.current?.focus();
336
+ } else navigateDown();
315
337
  break;
316
338
  case 'Home':
317
- {
318
- if (activeIndex === SEARCH_BAR_INDEX) break;
319
- e.preventDefault();
320
- const firstIndex = getFirstSelectableIndex(renderedItems);
321
- if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
322
- break;
323
- }
339
+ if (activeIndex === SEARCH_BAR_INDEX) break;
340
+ e.preventDefault();
341
+ navigateToFirstItem();
342
+ break;
324
343
  case 'End':
325
344
  {
326
345
  if (activeIndex === SEARCH_BAR_INDEX) break;
@@ -336,6 +355,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
336
355
  activeIndex,
337
356
  navigationStack.canGoBack,
338
357
  navigateToIndex,
358
+ navigateToFirstItem,
339
359
  handleItemSelect,
340
360
  handleBackTransition
341
361
  ]);
@@ -386,7 +406,9 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
386
406
  clear: clearSearch,
387
407
  placeholder: "Search",
388
408
  inputRef: searchInputRef,
409
+ clearButtonRef: clearButtonRef,
389
410
  onNavigationKeyDown: handleNavigationKeyDown,
411
+ navigateToFirstItem: navigateToFirstItem,
390
412
  activeDescendantId: activeDescendantId
391
413
  }),
392
414
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbox_styles_cjs_namespaceObject.AnimatedContainer, {
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbox.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/Toolbox.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAAkD,MAAM,YAAY,CAAC;AAwC3F,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,GAAG,IAAI,CAC1C,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5E,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,QAAQ,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,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;CACpC;AAgDD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,OAAO,EACP,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,GACR,EAAE,YAAY,CAAC,CAAC,CAAC,2CAocjB"}
@@ -70,6 +70,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
70
70
  const listRef = useListRef(null);
71
71
  const listViewRef = useRef(null);
72
72
  const searchInputRef = useRef(null);
73
+ const clearButtonRef = useRef(null);
73
74
  const isSearching = useMemo(()=>search.length > 0, [
74
75
  search
75
76
  ]);
@@ -89,21 +90,32 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
89
90
  }, []);
90
91
  const navigateToIndex = useCallback((index)=>{
91
92
  setActiveIndex(index);
92
- if (index === SEARCH_BAR_INDEX) return void searchInputRef.current?.focus();
93
- listRef.current?.scrollToRow({
94
- index,
95
- align: 'auto'
93
+ searchInputRef.current?.focus();
94
+ if (index !== SEARCH_BAR_INDEX) requestAnimationFrame(()=>{
95
+ listRef.current?.scrollToRow({
96
+ index,
97
+ align: 'auto'
98
+ });
96
99
  });
97
100
  }, [
98
101
  listRef
99
102
  ]);
103
+ const navigateToFirstItem = useCallback(()=>{
104
+ const renderedItems = listViewRef.current?.renderedItems ?? [];
105
+ const firstIndex = getFirstSelectableIndex(renderedItems);
106
+ if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
107
+ }, [
108
+ navigateToIndex
109
+ ]);
100
110
  const clearSearch = useCallback(()=>{
101
111
  setSearch('');
102
112
  setSearchedItems([]);
103
113
  setSearchLoading(false);
104
114
  setIsSearchingInitialItems(true);
105
- setActiveIndex(SEARCH_BAR_INDEX);
106
- }, []);
115
+ navigateToIndex(SEARCH_BAR_INDEX);
116
+ }, [
117
+ navigateToIndex
118
+ ]);
107
119
  const handleSearch = useCallback(async (query)=>{
108
120
  if (!query.trim()) {
109
121
  setSearchLoading(false);
@@ -134,30 +146,35 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
134
146
  ]);
135
147
  const handleBackTransition = useCallback(()=>{
136
148
  startTransition('back');
137
- setActiveIndex(SEARCH_BAR_INDEX);
138
149
  const previousState = navigationStack.pop();
139
150
  if (previousState) {
140
151
  setItems(previousState.data.items);
141
152
  setCurrentParentItem(previousState.data.parentItem);
142
153
  }
143
- if (isSearching) clearSearch();
154
+ setSearch('');
155
+ setSearchedItems([]);
156
+ setSearchLoading(false);
157
+ setIsSearchingInitialItems(true);
158
+ const restoredIndex = previousState?.data.activeIndex ?? SEARCH_BAR_INDEX;
159
+ navigateToIndex(restoredIndex);
144
160
  onBack?.();
145
161
  }, [
146
162
  navigationStack,
147
- isSearching,
148
163
  onBack,
149
- clearSearch,
150
- startTransition
164
+ startTransition,
165
+ navigateToIndex
151
166
  ]);
152
- const handleItemSelect = useCallback(async (item)=>{
167
+ const handleItemSelect = useCallback(async (item, index)=>{
153
168
  if (!item.children) return void onItemSelect(item);
154
169
  setChildrenLoading(true);
155
170
  const nestedItems = 'function' == typeof item.children ? await item.children(item.id, item.name) : item.children;
171
+ const savedIndex = isSearching ? SEARCH_BAR_INDEX : index ?? activeIndex;
156
172
  navigationStack.push({
157
173
  title: currentParentItem?.name || title,
158
174
  data: {
159
175
  items,
160
- parentItem: currentParentItem
176
+ parentItem: currentParentItem,
177
+ activeIndex: savedIndex
161
178
  }
162
179
  });
163
180
  setItems(nestedItems);
@@ -171,6 +188,8 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
171
188
  currentParentItem,
172
189
  title,
173
190
  items,
191
+ activeIndex,
192
+ isSearching,
174
193
  clearSearch,
175
194
  startTransition,
176
195
  onItemSelect
@@ -193,7 +212,8 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
193
212
  ...stackItem,
194
213
  data: {
195
214
  items: newInitialItems,
196
- parentItem: null
215
+ parentItem: null,
216
+ activeIndex: stackItem.data.activeIndex
197
217
  }
198
218
  };
199
219
  const updatedParentItem = findItemById(newInitialItems, stackItem.data.parentItem.id);
@@ -203,7 +223,8 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
203
223
  ...stackItem,
204
224
  data: {
205
225
  items: updatedItems,
206
- parentItem: updatedParentItem
226
+ parentItem: updatedParentItem,
227
+ activeIndex: stackItem.data.activeIndex
207
228
  }
208
229
  };
209
230
  });
@@ -232,16 +253,11 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
232
253
  if (isTransitioning) return;
233
254
  const renderedItems = listViewRef.current?.renderedItems ?? [];
234
255
  const navigateDown = ()=>{
235
- if (activeIndex === SEARCH_BAR_INDEX) {
236
- const firstIndex = getFirstSelectableIndex(renderedItems);
237
- if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
238
- } else {
256
+ if (activeIndex === SEARCH_BAR_INDEX) navigateToFirstItem();
257
+ else {
239
258
  const nextIndex = getNextSelectableIndex(renderedItems, activeIndex, 'down');
240
259
  if (nextIndex !== SEARCH_BAR_INDEX) navigateToIndex(nextIndex);
241
- else {
242
- const firstIndex = getFirstSelectableIndex(renderedItems);
243
- if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
244
- }
260
+ else navigateToFirstItem();
245
261
  }
246
262
  };
247
263
  const navigateUp = ()=>{
@@ -256,9 +272,10 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
256
272
  e.preventDefault();
257
273
  navigateUp();
258
274
  break;
275
+ case ' ':
259
276
  case 'Enter':
260
277
  {
261
- if (activeIndex === SEARCH_BAR_INDEX) break;
278
+ if (activeIndex === SEARCH_BAR_INDEX) return;
262
279
  const renderItem = renderedItems[activeIndex];
263
280
  if (renderItem?.type === 'item') {
264
281
  e.preventDefault();
@@ -281,18 +298,20 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
281
298
  handleBackTransition();
282
299
  break;
283
300
  case 'Tab':
301
+ if (activeIndex === SEARCH_BAR_INDEX && search.length > 0 && !e.shiftKey) break;
284
302
  e.preventDefault();
285
- if (e.shiftKey) navigateUp();
286
- else navigateDown();
303
+ if (activeIndex === SEARCH_BAR_INDEX && e.shiftKey) break;
304
+ if (e.shiftKey) {
305
+ navigateUp();
306
+ const nextUp = getNextSelectableIndex(renderedItems, activeIndex, 'up');
307
+ if (nextUp === SEARCH_BAR_INDEX && search.length > 0) clearButtonRef.current?.focus();
308
+ } else navigateDown();
287
309
  break;
288
310
  case 'Home':
289
- {
290
- if (activeIndex === SEARCH_BAR_INDEX) break;
291
- e.preventDefault();
292
- const firstIndex = getFirstSelectableIndex(renderedItems);
293
- if (firstIndex !== SEARCH_BAR_INDEX) navigateToIndex(firstIndex);
294
- break;
295
- }
311
+ if (activeIndex === SEARCH_BAR_INDEX) break;
312
+ e.preventDefault();
313
+ navigateToFirstItem();
314
+ break;
296
315
  case 'End':
297
316
  {
298
317
  if (activeIndex === SEARCH_BAR_INDEX) break;
@@ -308,6 +327,7 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
308
327
  activeIndex,
309
328
  navigationStack.canGoBack,
310
329
  navigateToIndex,
330
+ navigateToFirstItem,
311
331
  handleItemSelect,
312
332
  handleBackTransition
313
333
  ]);
@@ -358,7 +378,9 @@ function Toolbox({ onClose, onBack, onItemSelect, onSearch, onItemHover, title,
358
378
  clear: clearSearch,
359
379
  placeholder: "Search",
360
380
  inputRef: searchInputRef,
381
+ clearButtonRef: clearButtonRef,
361
382
  onNavigationKeyDown: handleNavigationKeyDown,
383
+ navigateToFirstItem: navigateToFirstItem,
362
384
  activeDescendantId: activeDescendantId
363
385
  }),
364
386
  /*#__PURE__*/ jsx(AnimatedContainer, {
@@ -1,6 +1,6 @@
1
1
  @import "./variables.css";
2
2
 
3
- body.light, .light {
3
+ body.light, .apollo-design.light {
4
4
  --color-background: #ffffff;
5
5
  --color-background-secondary: #f4f5f7;
6
6
  --color-background-inverse: #182027;
@@ -125,7 +125,7 @@ body.light, .light {
125
125
  color-scheme: light;
126
126
  }
127
127
 
128
- body.light-hc, .light-hc {
128
+ body.light-hc, .apollo-design.light-hc {
129
129
  --color-background: #ffffff;
130
130
  --color-background-secondary: #f4f5f7;
131
131
  --color-background-inverse: #182027;
@@ -250,7 +250,7 @@ body.light-hc, .light-hc {
250
250
  color-scheme: light;
251
251
  }
252
252
 
253
- body.dark, .dark {
253
+ body.dark, .apollo-design.dark {
254
254
  --color-background: #182027;
255
255
  --color-background-secondary: #273139;
256
256
  --color-background-inverse: #f8f9fa;
@@ -375,7 +375,7 @@ body.dark, .dark {
375
375
  color-scheme: dark;
376
376
  }
377
377
 
378
- body.dark-hc, .dark-hc {
378
+ body.dark-hc, .apollo-design.dark-hc {
379
379
  --color-background: #182027;
380
380
  --color-background-secondary: #273139;
381
381
  --color-background-inverse: #f8f9fa;
@@ -1,6 +1,6 @@
1
1
  @import "./variables";
2
2
 
3
- body.light, .light {
3
+ body.light, .apollo-design.light {
4
4
  --color-background: #{$color-background-light};
5
5
  --color-background-secondary: #{$color-background-secondary-light};
6
6
  --color-background-inverse: #{$color-background-inverse-light};
@@ -125,7 +125,7 @@ body.light, .light {
125
125
  color-scheme: light;
126
126
  }
127
127
 
128
- body.light-hc, .light-hc {
128
+ body.light-hc, .apollo-design.light-hc {
129
129
  --color-background: #{$color-background-light-hc};
130
130
  --color-background-secondary: #{$color-background-secondary-light-hc};
131
131
  --color-background-inverse: #{$color-background-inverse-light-hc};
@@ -250,7 +250,7 @@ body.light-hc, .light-hc {
250
250
  color-scheme: light;
251
251
  }
252
252
 
253
- body.dark, .dark {
253
+ body.dark, .apollo-design.dark {
254
254
  --color-background: #{$color-background-dark};
255
255
  --color-background-secondary: #{$color-background-secondary-dark};
256
256
  --color-background-inverse: #{$color-background-inverse-dark};
@@ -375,7 +375,7 @@ body.dark, .dark {
375
375
  color-scheme: dark;
376
376
  }
377
377
 
378
- body.dark-hc, .dark-hc {
378
+ body.dark-hc, .apollo-design.dark-hc {
379
379
  --color-background: #{$color-background-dark-hc};
380
380
  --color-background-secondary: #{$color-background-secondary-dark-hc};
381
381
  --color-background-inverse: #{$color-background-inverse-dark-hc};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "3.58.0",
3
+ "version": "3.58.2",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",
@@ -200,8 +200,8 @@
200
200
  "use-sync-external-store": "^1.2.0",
201
201
  "zod": "^4.3.5",
202
202
  "zustand": "^5.0.9",
203
- "@uipath/apollo-core": "5.7.3",
204
- "@uipath/apollo-wind": "1.2.0"
203
+ "@uipath/apollo-core": "5.7.4",
204
+ "@uipath/apollo-wind": "1.2.1"
205
205
  },
206
206
  "devDependencies": {
207
207
  "@lingui/cli": "^5.6.1",