@uipath/apollo-wind 2.86.1 → 2.88.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.
- package/dist/components/ui/connection-picker/components/connection-actions-menu.cjs +129 -0
- package/dist/components/ui/connection-picker/components/connection-actions-menu.d.ts +21 -0
- package/dist/components/ui/connection-picker/components/connection-actions-menu.js +95 -0
- package/dist/components/ui/connection-picker/components/connection-status.cjs +81 -0
- package/dist/components/ui/connection-picker/components/connection-status.d.ts +22 -0
- package/dist/components/ui/connection-picker/components/connection-status.js +41 -0
- package/dist/components/ui/connection-picker/connection-picker.cjs +411 -0
- package/dist/components/ui/connection-picker/connection-picker.d.ts +12 -0
- package/dist/components/ui/connection-picker/connection-picker.js +374 -0
- package/dist/components/ui/connection-picker/index.cjs +39 -0
- package/dist/components/ui/connection-picker/index.d.ts +2 -0
- package/dist/components/ui/connection-picker/index.js +2 -0
- package/dist/components/ui/connection-picker/types.cjs +18 -0
- package/dist/components/ui/connection-picker/types.d.ts +124 -0
- package/dist/components/ui/connection-picker/types.js +0 -0
- package/dist/components/ui/field-addons/field-menu.cjs +41 -23
- package/dist/components/ui/field-addons/field-menu.d.ts +2 -0
- package/dist/components/ui/field-addons/field-menu.js +42 -24
- package/dist/components/ui/folder-picker/folder-picker.cjs +4 -3
- package/dist/components/ui/folder-picker/folder-picker.js +4 -3
- package/dist/components/ui/index.cjs +267 -241
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/{folder-picker/components/folder-picker-empty-state.cjs → picker-empty-state.cjs} +11 -11
- package/dist/components/ui/picker-empty-state.d.ts +33 -0
- package/dist/components/ui/{folder-picker/components/folder-picker-empty-state.js → picker-empty-state.js} +9 -9
- package/dist/components/ui/resource-picker/command-value.cjs +48 -0
- package/dist/components/ui/resource-picker/command-value.d.ts +11 -0
- package/dist/components/ui/resource-picker/command-value.js +11 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.cjs +102 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.d.ts +44 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.js +65 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.cjs +55 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.d.ts +14 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.js +21 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.cjs +136 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.d.ts +30 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.js +102 -0
- package/dist/components/ui/resource-picker/components/resource-row.cjs +115 -0
- package/dist/components/ui/resource-picker/components/resource-row.d.ts +16 -0
- package/dist/components/ui/resource-picker/components/resource-row.js +81 -0
- package/dist/components/ui/resource-picker/focus.cjs +66 -0
- package/dist/components/ui/resource-picker/focus.d.ts +1 -0
- package/dist/components/ui/resource-picker/focus.js +32 -0
- package/dist/components/ui/resource-picker/index.cjs +42 -0
- package/dist/components/ui/resource-picker/index.d.ts +2 -0
- package/dist/components/ui/resource-picker/index.js +2 -0
- package/dist/components/ui/resource-picker/resource-picker.cjs +606 -0
- package/dist/components/ui/resource-picker/resource-picker.d.ts +40 -0
- package/dist/components/ui/resource-picker/resource-picker.js +566 -0
- package/dist/components/ui/resource-picker/types.cjs +50 -0
- package/dist/components/ui/resource-picker/types.d.ts +209 -0
- package/dist/components/ui/resource-picker/types.js +16 -0
- package/dist/index.cjs +24 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -1
- package/dist/styles.css +75 -29
- package/package.json +1 -1
- package/dist/components/ui/folder-picker/components/folder-picker-empty-state.d.ts +0 -26
|
@@ -21,6 +21,7 @@ export * from './code-block';
|
|
|
21
21
|
export * from './collapsible';
|
|
22
22
|
export * from './combobox';
|
|
23
23
|
export * from './command';
|
|
24
|
+
export * from './connection-picker';
|
|
24
25
|
export * from './context-menu';
|
|
25
26
|
export * from './data-table';
|
|
26
27
|
export * from './date-picker';
|
|
@@ -69,6 +70,7 @@ export * from './radio-group';
|
|
|
69
70
|
export { ReferenceChip, type ReferenceChipProps } from './reference-chip';
|
|
70
71
|
export { getReferenceChipColors } from './reference-chip-colors';
|
|
71
72
|
export * from './resizable';
|
|
73
|
+
export * from './resource-picker';
|
|
72
74
|
export * from './scroll-area';
|
|
73
75
|
export * from './search';
|
|
74
76
|
export * from './select';
|
|
@@ -24,6 +24,7 @@ export * from "./code-block.js";
|
|
|
24
24
|
export * from "./collapsible.js";
|
|
25
25
|
export * from "./combobox.js";
|
|
26
26
|
export * from "./command.js";
|
|
27
|
+
export * from "./connection-picker/index.js";
|
|
27
28
|
export * from "./context-menu.js";
|
|
28
29
|
export * from "./data-table.js";
|
|
29
30
|
export * from "./date-picker.js";
|
|
@@ -70,6 +71,7 @@ export * from "./prompt-value-control.js";
|
|
|
70
71
|
export * from "./quick-form-field/index.js";
|
|
71
72
|
export * from "./radio-group.js";
|
|
72
73
|
export * from "./resizable.js";
|
|
74
|
+
export * from "./resource-picker/index.js";
|
|
73
75
|
export * from "./scroll-area.js";
|
|
74
76
|
export * from "./search.js";
|
|
75
77
|
export * from "./select.js";
|
|
@@ -24,19 +24,19 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
27
|
+
PickerEmptyState: ()=>PickerEmptyState
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const external_button_cjs_namespaceObject = require("
|
|
31
|
-
const external_spinner_cjs_namespaceObject = require("
|
|
32
|
-
const defaultNoMatchText = (query)=>`No
|
|
33
|
-
function
|
|
30
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
31
|
+
const external_spinner_cjs_namespaceObject = require("./spinner.cjs");
|
|
32
|
+
const defaultNoMatchText = (query)=>`No results match “${query}”.`;
|
|
33
|
+
function PickerEmptyState({ error, loading = false, query = '', emptyText = 'No results.', noMatchText = defaultNoMatchText, loadingText = 'Loading…', onRetry, retryLabel = 'Retry', announce = true }) {
|
|
34
34
|
if (error) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
35
35
|
className: "flex items-center justify-between gap-2 px-3 py-2",
|
|
36
36
|
children: [
|
|
37
37
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
38
|
-
role:
|
|
39
|
-
className: "text-xs text-
|
|
38
|
+
role: announce ? 'alert' : void 0,
|
|
39
|
+
className: "text-xs text-error",
|
|
40
40
|
children: error
|
|
41
41
|
}),
|
|
42
42
|
onRetry && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
@@ -50,7 +50,7 @@ function FolderPickerEmptyState({ error, loading = false, query = '', emptyText
|
|
|
50
50
|
]
|
|
51
51
|
});
|
|
52
52
|
if (loading) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
53
|
-
role:
|
|
53
|
+
role: announce ? 'status' : void 0,
|
|
54
54
|
className: "flex items-center gap-2 px-3 py-2 text-xs text-foreground-muted",
|
|
55
55
|
children: [
|
|
56
56
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner, {
|
|
@@ -61,14 +61,14 @@ function FolderPickerEmptyState({ error, loading = false, query = '', emptyText
|
|
|
61
61
|
]
|
|
62
62
|
});
|
|
63
63
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
64
|
-
role:
|
|
64
|
+
role: announce ? 'status' : void 0,
|
|
65
65
|
className: "px-3 py-2 text-xs text-foreground-muted",
|
|
66
66
|
children: query ? noMatchText(query) : emptyText
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
exports.
|
|
69
|
+
exports.PickerEmptyState = __webpack_exports__.PickerEmptyState;
|
|
70
70
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
71
|
-
"
|
|
71
|
+
"PickerEmptyState"
|
|
72
72
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
73
73
|
Object.defineProperty(exports, '__esModule', {
|
|
74
74
|
value: true
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface PickerEmptyStateProps {
|
|
2
|
+
/** A load that failed. Takes precedence over every other state. */
|
|
3
|
+
error?: string | null;
|
|
4
|
+
/** The list on screen has never resolved, so its contents are unknown. */
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
/** The active search text, trimmed. Empty when the list is unfiltered. */
|
|
7
|
+
query?: string;
|
|
8
|
+
emptyText?: string;
|
|
9
|
+
noMatchText?: (query: string) => string;
|
|
10
|
+
loadingText?: string;
|
|
11
|
+
/** Requests the failed list again. Without it, the error offers no action. */
|
|
12
|
+
onRetry?: () => void;
|
|
13
|
+
retryLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Makes each message its own live region. Pass `false` when the caller
|
|
16
|
+
* keeps a region mounted around it, so the message is announced as it
|
|
17
|
+
* arrives in an existing region rather than as a new one, and not twice.
|
|
18
|
+
*/
|
|
19
|
+
announce?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* What a picker's list shows when it has no rows. Shared by FolderPicker and
|
|
23
|
+
* ResourcePicker, and not exported from the package.
|
|
24
|
+
*
|
|
25
|
+
* The four cases say different things and must not collapse into one message:
|
|
26
|
+
* a list still loading is not an empty one, an empty list is not a failed
|
|
27
|
+
* search, and neither is an error. Ordered by precedence, so a list that
|
|
28
|
+
* fails to load reports the failure rather than claiming to be empty.
|
|
29
|
+
*
|
|
30
|
+
* Always renders one of the four messages, falling back to the empty-folder
|
|
31
|
+
* text, so the caller renders it only when the list has no rows.
|
|
32
|
+
*/
|
|
33
|
+
export declare function PickerEmptyState({ error, loading, query, emptyText, noMatchText, loadingText, onRetry, retryLabel, announce, }: PickerEmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "
|
|
3
|
-
import { Spinner } from "
|
|
4
|
-
const defaultNoMatchText = (query)=>`No
|
|
5
|
-
function
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { Spinner } from "./spinner.js";
|
|
4
|
+
const defaultNoMatchText = (query)=>`No results match “${query}”.`;
|
|
5
|
+
function PickerEmptyState({ error, loading = false, query = '', emptyText = 'No results.', noMatchText = defaultNoMatchText, loadingText = 'Loading…', onRetry, retryLabel = 'Retry', announce = true }) {
|
|
6
6
|
if (error) return /*#__PURE__*/ jsxs("div", {
|
|
7
7
|
className: "flex items-center justify-between gap-2 px-3 py-2",
|
|
8
8
|
children: [
|
|
9
9
|
/*#__PURE__*/ jsx("span", {
|
|
10
|
-
role:
|
|
11
|
-
className: "text-xs text-
|
|
10
|
+
role: announce ? 'alert' : void 0,
|
|
11
|
+
className: "text-xs text-error",
|
|
12
12
|
children: error
|
|
13
13
|
}),
|
|
14
14
|
onRetry && /*#__PURE__*/ jsx(Button, {
|
|
@@ -22,7 +22,7 @@ function FolderPickerEmptyState({ error, loading = false, query = '', emptyText
|
|
|
22
22
|
]
|
|
23
23
|
});
|
|
24
24
|
if (loading) return /*#__PURE__*/ jsxs("div", {
|
|
25
|
-
role:
|
|
25
|
+
role: announce ? 'status' : void 0,
|
|
26
26
|
className: "flex items-center gap-2 px-3 py-2 text-xs text-foreground-muted",
|
|
27
27
|
children: [
|
|
28
28
|
/*#__PURE__*/ jsx(Spinner, {
|
|
@@ -33,9 +33,9 @@ function FolderPickerEmptyState({ error, loading = false, query = '', emptyText
|
|
|
33
33
|
]
|
|
34
34
|
});
|
|
35
35
|
return /*#__PURE__*/ jsx("div", {
|
|
36
|
-
role:
|
|
36
|
+
role: announce ? 'status' : void 0,
|
|
37
37
|
className: "px-3 py-2 text-xs text-foreground-muted",
|
|
38
38
|
children: query ? noMatchText(query) : emptyText
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
export {
|
|
41
|
+
export { PickerEmptyState };
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
fromCommandValue: ()=>fromCommandValue,
|
|
28
|
+
toCommandValue: ()=>toCommandValue
|
|
29
|
+
});
|
|
30
|
+
const toCommandValue = (value)=>JSON.stringify(value);
|
|
31
|
+
const fromCommandValue = (value)=>{
|
|
32
|
+
if (!value) return '';
|
|
33
|
+
try {
|
|
34
|
+
const decoded = JSON.parse(value);
|
|
35
|
+
return 'string' == typeof decoded ? decoded : '';
|
|
36
|
+
} catch {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.fromCommandValue = __webpack_exports__.fromCommandValue;
|
|
41
|
+
exports.toCommandValue = __webpack_exports__.toCommandValue;
|
|
42
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
43
|
+
"fromCommandValue",
|
|
44
|
+
"toCommandValue"
|
|
45
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
46
|
+
Object.defineProperty(exports, '__esModule', {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cmdk trims every item value, so two distinct consumer ids such as `a` and
|
|
3
|
+
* ` a ` would meet as one, and an id with outer whitespace would no longer
|
|
4
|
+
* match itself when read back from the DOM. Every value the picker hands
|
|
5
|
+
* cmdk is therefore encoded losslessly, as a JSON string literal, whose
|
|
6
|
+
* quotes keep any whitespace inside them, and decoded wherever a cmdk or DOM
|
|
7
|
+
* value is matched against an id.
|
|
8
|
+
*/
|
|
9
|
+
export declare const toCommandValue: (value: string) => string;
|
|
10
|
+
/** The id a cmdk value encodes. `''` for no value, or one the picker did not encode. */
|
|
11
|
+
export declare const fromCommandValue: (value: string | null | undefined) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const toCommandValue = (value)=>JSON.stringify(value);
|
|
2
|
+
const fromCommandValue = (value)=>{
|
|
3
|
+
if (!value) return '';
|
|
4
|
+
try {
|
|
5
|
+
const decoded = JSON.parse(value);
|
|
6
|
+
return 'string' == typeof decoded ? decoded : '';
|
|
7
|
+
} catch {
|
|
8
|
+
return '';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export { fromCommandValue, toCommandValue };
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
ResourceGroupHeader: ()=>ResourceGroupHeader,
|
|
28
|
+
ResourceGroupHeadingOption: ()=>ResourceGroupHeadingOption
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const external_command_cjs_namespaceObject = require("../../command.cjs");
|
|
33
|
+
const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
34
|
+
const external_command_value_cjs_namespaceObject = require("../command-value.cjs");
|
|
35
|
+
function GroupHeading({ label, labelId, count, collapsed, showCount, icon }) {
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
39
|
+
"aria-hidden": true,
|
|
40
|
+
className: "grid size-4 shrink-0 place-items-center",
|
|
41
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronRight, {
|
|
42
|
+
className: (0, index_cjs_namespaceObject.cn)('size-4 text-foreground-subtle transition-transform', !collapsed && 'rotate-90')
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
46
|
+
"aria-hidden": true,
|
|
47
|
+
className: "grid size-4 shrink-0 place-items-center text-foreground-muted [&_svg]:size-4",
|
|
48
|
+
children: icon ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Folder, {
|
|
49
|
+
className: "size-4"
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
53
|
+
id: labelId,
|
|
54
|
+
className: "min-w-0 flex-1 truncate",
|
|
55
|
+
children: label
|
|
56
|
+
}),
|
|
57
|
+
showCount && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
58
|
+
"aria-hidden": true,
|
|
59
|
+
className: "shrink-0 text-xs font-medium text-foreground-subtle",
|
|
60
|
+
children: count
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const keepSearchFocus = {
|
|
66
|
+
onPointerDown: (event)=>event.preventDefault(),
|
|
67
|
+
onMouseDown: (event)=>event.preventDefault()
|
|
68
|
+
};
|
|
69
|
+
const headingClassName = 'flex w-full items-center gap-2 py-1.5 pl-3 pr-3 text-left text-sm font-medium text-foreground-muted';
|
|
70
|
+
function ResourceGroupHeader({ disabled = false, onToggle, ...heading }) {
|
|
71
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
72
|
+
"data-slot": "resource-group-header",
|
|
73
|
+
className: (0, index_cjs_namespaceObject.cn)(headingClassName, disabled ? 'cursor-default' : 'cursor-pointer hover:bg-surface-overlay'),
|
|
74
|
+
onClick: disabled ? void 0 : onToggle,
|
|
75
|
+
...keepSearchFocus,
|
|
76
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(GroupHeading, {
|
|
77
|
+
...heading
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function ResourceGroupHeadingOption({ value, ariaLabel, onToggle, ...heading }) {
|
|
82
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_command_cjs_namespaceObject.CommandItem, {
|
|
83
|
+
value: (0, external_command_value_cjs_namespaceObject.toCommandValue)(value),
|
|
84
|
+
"aria-label": ariaLabel,
|
|
85
|
+
"data-slot": heading.collapsed ? 'resource-group-collapsed' : 'resource-group-heading-option',
|
|
86
|
+
onSelect: onToggle,
|
|
87
|
+
...keepSearchFocus,
|
|
88
|
+
className: (0, index_cjs_namespaceObject.cn)(headingClassName, 'cursor-pointer rounded-none data-[selected=true]:bg-surface-overlay'),
|
|
89
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(GroupHeading, {
|
|
90
|
+
...heading
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
exports.ResourceGroupHeader = __webpack_exports__.ResourceGroupHeader;
|
|
95
|
+
exports.ResourceGroupHeadingOption = __webpack_exports__.ResourceGroupHeadingOption;
|
|
96
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
97
|
+
"ResourceGroupHeader",
|
|
98
|
+
"ResourceGroupHeadingOption"
|
|
99
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
100
|
+
Object.defineProperty(exports, '__esModule', {
|
|
101
|
+
value: true
|
|
102
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface GroupHeadingProps {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Id for the label, which names the group the heading heads. */
|
|
5
|
+
labelId: string;
|
|
6
|
+
/** The group's row count, already formatted for the picker's locale. */
|
|
7
|
+
count: string;
|
|
8
|
+
collapsed: boolean;
|
|
9
|
+
showCount: boolean;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface ResourceGroupHeaderProps extends GroupHeadingProps {
|
|
13
|
+
/** Set while a search force-expands every group, so the toggle is inert. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onToggle: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The heading over an open group: the label that names its `role="group"`.
|
|
19
|
+
*
|
|
20
|
+
* Not a control. The listbox may hold only options and groups, so nothing
|
|
21
|
+
* interactive sits in it. A click anywhere on the heading collapses the group
|
|
22
|
+
* for the pointer; the keyboard does it with ArrowLeft from any of its rows,
|
|
23
|
+
* which the picker handles from the search.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ResourceGroupHeader({ disabled, onToggle, ...heading }: ResourceGroupHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export interface ResourceGroupHeadingOptionProps extends GroupHeadingProps {
|
|
27
|
+
/** The option's cmdk value, unique beside every row id. */
|
|
28
|
+
value: string;
|
|
29
|
+
/** Spoken name, which says whether the group is collapsed or open. */
|
|
30
|
+
ariaLabel: string;
|
|
31
|
+
onToggle: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A group's heading kept as an option, for when the group has no row the
|
|
35
|
+
* keyboard cursor can reach.
|
|
36
|
+
*
|
|
37
|
+
* Collapsed, its rows are unmounted; open with every row disabled, cmdk skips
|
|
38
|
+
* them all. Either way, without this the cursor could never reach the group
|
|
39
|
+
* to fold or unfold it. As an option it is a cursor stop that says the
|
|
40
|
+
* group's state, and Enter or a click toggles it, as ArrowRight opens and
|
|
41
|
+
* ArrowLeft folds it. It commits nothing.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ResourceGroupHeadingOption({ value, ariaLabel, onToggle, ...heading }: ResourceGroupHeadingOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight, Folder } from "lucide-react";
|
|
3
|
+
import { CommandItem } from "../../command.js";
|
|
4
|
+
import { cn } from "../../../../lib/index.js";
|
|
5
|
+
import { toCommandValue } from "../command-value.js";
|
|
6
|
+
function GroupHeading({ label, labelId, count, collapsed, showCount, icon }) {
|
|
7
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx("span", {
|
|
10
|
+
"aria-hidden": true,
|
|
11
|
+
className: "grid size-4 shrink-0 place-items-center",
|
|
12
|
+
children: /*#__PURE__*/ jsx(ChevronRight, {
|
|
13
|
+
className: cn('size-4 text-foreground-subtle transition-transform', !collapsed && 'rotate-90')
|
|
14
|
+
})
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx("span", {
|
|
17
|
+
"aria-hidden": true,
|
|
18
|
+
className: "grid size-4 shrink-0 place-items-center text-foreground-muted [&_svg]:size-4",
|
|
19
|
+
children: icon ?? /*#__PURE__*/ jsx(Folder, {
|
|
20
|
+
className: "size-4"
|
|
21
|
+
})
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx("span", {
|
|
24
|
+
id: labelId,
|
|
25
|
+
className: "min-w-0 flex-1 truncate",
|
|
26
|
+
children: label
|
|
27
|
+
}),
|
|
28
|
+
showCount && /*#__PURE__*/ jsx("span", {
|
|
29
|
+
"aria-hidden": true,
|
|
30
|
+
className: "shrink-0 text-xs font-medium text-foreground-subtle",
|
|
31
|
+
children: count
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const keepSearchFocus = {
|
|
37
|
+
onPointerDown: (event)=>event.preventDefault(),
|
|
38
|
+
onMouseDown: (event)=>event.preventDefault()
|
|
39
|
+
};
|
|
40
|
+
const headingClassName = 'flex w-full items-center gap-2 py-1.5 pl-3 pr-3 text-left text-sm font-medium text-foreground-muted';
|
|
41
|
+
function ResourceGroupHeader({ disabled = false, onToggle, ...heading }) {
|
|
42
|
+
return /*#__PURE__*/ jsx("div", {
|
|
43
|
+
"data-slot": "resource-group-header",
|
|
44
|
+
className: cn(headingClassName, disabled ? 'cursor-default' : 'cursor-pointer hover:bg-surface-overlay'),
|
|
45
|
+
onClick: disabled ? void 0 : onToggle,
|
|
46
|
+
...keepSearchFocus,
|
|
47
|
+
children: /*#__PURE__*/ jsx(GroupHeading, {
|
|
48
|
+
...heading
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function ResourceGroupHeadingOption({ value, ariaLabel, onToggle, ...heading }) {
|
|
53
|
+
return /*#__PURE__*/ jsx(CommandItem, {
|
|
54
|
+
value: toCommandValue(value),
|
|
55
|
+
"aria-label": ariaLabel,
|
|
56
|
+
"data-slot": heading.collapsed ? 'resource-group-collapsed' : 'resource-group-heading-option',
|
|
57
|
+
onSelect: onToggle,
|
|
58
|
+
...keepSearchFocus,
|
|
59
|
+
className: cn(headingClassName, 'cursor-pointer rounded-none data-[selected=true]:bg-surface-overlay'),
|
|
60
|
+
children: /*#__PURE__*/ jsx(GroupHeading, {
|
|
61
|
+
...heading
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export { ResourceGroupHeader, ResourceGroupHeadingOption };
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
ResourcePickerFooter: ()=>ResourcePickerFooter
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
function ResourcePickerFooter({ leading, trailing }) {
|
|
31
|
+
if (!leading && !trailing) return null;
|
|
32
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
33
|
+
className: "flex shrink-0 items-center justify-between gap-2 border-t border-border bg-popover px-3 py-2",
|
|
34
|
+
onKeyDown: (event)=>{
|
|
35
|
+
if ('Escape' !== event.key && 'Tab' !== event.key) event.stopPropagation();
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
39
|
+
className: "flex min-w-0 items-center gap-1",
|
|
40
|
+
children: leading
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
43
|
+
className: "flex shrink-0 items-center gap-1",
|
|
44
|
+
children: trailing
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.ResourcePickerFooter = __webpack_exports__.ResourcePickerFooter;
|
|
50
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
51
|
+
"ResourcePickerFooter"
|
|
52
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
53
|
+
Object.defineProperty(exports, '__esModule', {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ResourcePickerFooterProps {
|
|
3
|
+
leading?: ReactNode;
|
|
4
|
+
trailing?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The link row that ends the list.
|
|
8
|
+
*
|
|
9
|
+
* Two slots rather than a Cancel and Select pair: rows commit on click, so
|
|
10
|
+
* there is nothing left to confirm, and the space belongs instead to the ways
|
|
11
|
+
* out of the picker. Renders nothing when neither slot is filled, so a picker
|
|
12
|
+
* with no links does not end in an empty rule.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ResourcePickerFooter({ leading, trailing }: ResourcePickerFooterProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function ResourcePickerFooter({ leading, trailing }) {
|
|
3
|
+
if (!leading && !trailing) return null;
|
|
4
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
5
|
+
className: "flex shrink-0 items-center justify-between gap-2 border-t border-border bg-popover px-3 py-2",
|
|
6
|
+
onKeyDown: (event)=>{
|
|
7
|
+
if ('Escape' !== event.key && 'Tab' !== event.key) event.stopPropagation();
|
|
8
|
+
},
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ jsx("div", {
|
|
11
|
+
className: "flex min-w-0 items-center gap-1",
|
|
12
|
+
children: leading
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ jsx("div", {
|
|
15
|
+
className: "flex shrink-0 items-center gap-1",
|
|
16
|
+
children: trailing
|
|
17
|
+
})
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export { ResourcePickerFooter };
|