@uipath/apollo-wind 2.61.0 → 2.63.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/checkbox.cjs +10 -5
- package/dist/components/ui/checkbox.js +12 -7
- package/dist/components/ui/folder-picker/components/folder-breadcrumb.cjs +72 -0
- package/dist/components/ui/folder-picker/components/folder-breadcrumb.d.ts +14 -0
- package/dist/components/ui/folder-picker/components/folder-breadcrumb.js +38 -0
- package/dist/components/ui/folder-picker/components/folder-picker-empty-state.cjs +75 -0
- package/dist/components/ui/folder-picker/components/folder-picker-empty-state.d.ts +26 -0
- package/dist/components/ui/folder-picker/components/folder-picker-empty-state.js +41 -0
- package/dist/components/ui/folder-picker/components/folder-picker-footer.cjs +70 -0
- package/dist/components/ui/folder-picker/components/folder-picker-footer.d.ts +20 -0
- package/dist/components/ui/folder-picker/components/folder-picker-footer.js +36 -0
- package/dist/components/ui/folder-picker/components/folder-picker-search.cjs +79 -0
- package/dist/components/ui/folder-picker/components/folder-picker-search.d.ts +14 -0
- package/dist/components/ui/folder-picker/components/folder-picker-search.js +45 -0
- package/dist/components/ui/folder-picker/components/folder-row.cjs +107 -0
- package/dist/components/ui/folder-picker/components/folder-row.d.ts +27 -0
- package/dist/components/ui/folder-picker/components/folder-row.js +73 -0
- package/dist/components/ui/folder-picker/folder-picker.cjs +465 -0
- package/dist/components/ui/folder-picker/folder-picker.d.ts +34 -0
- package/dist/components/ui/folder-picker/folder-picker.js +425 -0
- package/dist/components/ui/folder-picker/index.cjs +42 -0
- package/dist/components/ui/folder-picker/index.d.ts +2 -0
- package/dist/components/ui/folder-picker/index.js +2 -0
- package/dist/components/ui/folder-picker/types.cjs +44 -0
- package/dist/components/ui/folder-picker/types.d.ts +97 -0
- package/dist/components/ui/folder-picker/types.js +4 -0
- package/dist/components/ui/index.cjs +18 -18
- package/dist/index.cjs +13 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/styles.css +74 -0
- package/package.json +1 -1
|
@@ -34,13 +34,18 @@ const utils_cjs_namespaceObject = require("../../lib/utils.cjs");
|
|
|
34
34
|
const Checkbox = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_checkbox_namespaceObject.Root, {
|
|
35
35
|
ref: ref,
|
|
36
36
|
"data-slot": "checkbox",
|
|
37
|
-
className: (0, utils_cjs_namespaceObject.cn)('peer h-4 w-4 shrink-0 cursor-pointer rounded-sm border border-border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'future:hover:border-border-hover future:data-[state=checked]:border-foreground-accent future:data-[state=checked]:bg-foreground-accent future:data-[state=checked]:text-current', 'future:aria-invalid:border-error future:aria-invalid:hover:border-error future:aria-invalid:data-[state=checked]:border-error', className),
|
|
37
|
+
className: (0, utils_cjs_namespaceObject.cn)('group/checkbox peer h-4 w-4 shrink-0 cursor-pointer rounded-sm border border-border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'future:hover:border-border-hover future:data-[state=checked]:border-foreground-accent future:data-[state=checked]:bg-foreground-accent future:data-[state=checked]:text-current future:data-[state=indeterminate]:border-foreground-accent future:data-[state=indeterminate]:bg-foreground-accent future:data-[state=indeterminate]:text-current', 'future:aria-invalid:border-error future:aria-invalid:hover:border-error future:aria-invalid:data-[state=checked]:border-error future:aria-invalid:data-[state=indeterminate]:border-error', className),
|
|
38
38
|
...props,
|
|
39
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
39
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_checkbox_namespaceObject.Indicator, {
|
|
40
40
|
className: (0, utils_cjs_namespaceObject.cn)('flex items-center justify-center text-current future:text-foreground-inverse'),
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Check, {
|
|
43
|
+
className: "h-4 w-4 group-data-[state=indeterminate]/checkbox:hidden future:h-3.5 future:w-3.5"
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Minus, {
|
|
46
|
+
className: "hidden h-4 w-4 group-data-[state=indeterminate]/checkbox:block future:h-3.5 future:w-3.5"
|
|
47
|
+
})
|
|
48
|
+
]
|
|
44
49
|
})
|
|
45
50
|
}));
|
|
46
51
|
Checkbox.displayName = react_checkbox_namespaceObject.Root.displayName;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Indicator, Root } from "@radix-ui/react-checkbox";
|
|
3
|
-
import { Check } from "lucide-react";
|
|
3
|
+
import { Check, Minus } from "lucide-react";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
const Checkbox = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Root, {
|
|
7
7
|
ref: ref,
|
|
8
8
|
"data-slot": "checkbox",
|
|
9
|
-
className: cn('peer h-4 w-4 shrink-0 cursor-pointer rounded-sm border border-border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'future:hover:border-border-hover future:data-[state=checked]:border-foreground-accent future:data-[state=checked]:bg-foreground-accent future:data-[state=checked]:text-current', 'future:aria-invalid:border-error future:aria-invalid:hover:border-error future:aria-invalid:data-[state=checked]:border-error', className),
|
|
9
|
+
className: cn('group/checkbox peer h-4 w-4 shrink-0 cursor-pointer rounded-sm border border-border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'future:hover:border-border-hover future:data-[state=checked]:border-foreground-accent future:data-[state=checked]:bg-foreground-accent future:data-[state=checked]:text-current future:data-[state=indeterminate]:border-foreground-accent future:data-[state=indeterminate]:bg-foreground-accent future:data-[state=indeterminate]:text-current', 'future:aria-invalid:border-error future:aria-invalid:hover:border-error future:aria-invalid:data-[state=checked]:border-error future:aria-invalid:data-[state=indeterminate]:border-error', className),
|
|
10
10
|
...props,
|
|
11
|
-
children: /*#__PURE__*/
|
|
11
|
+
children: /*#__PURE__*/ jsxs(Indicator, {
|
|
12
12
|
className: cn('flex items-center justify-center text-current future:text-foreground-inverse'),
|
|
13
|
-
children:
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ jsx(Check, {
|
|
15
|
+
className: "h-4 w-4 group-data-[state=indeterminate]/checkbox:hidden future:h-3.5 future:w-3.5"
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsx(Minus, {
|
|
18
|
+
className: "hidden h-4 w-4 group-data-[state=indeterminate]/checkbox:block future:h-3.5 future:w-3.5"
|
|
19
|
+
})
|
|
20
|
+
]
|
|
16
21
|
})
|
|
17
22
|
}));
|
|
18
23
|
Checkbox.displayName = Root.displayName;
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
FolderBreadcrumb: ()=>FolderBreadcrumb
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_breadcrumb_cjs_namespaceObject = require("../../breadcrumb.cjs");
|
|
32
|
+
function FolderBreadcrumb({ crumbs, onJump, label = 'breadcrumb' }) {
|
|
33
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_breadcrumb_cjs_namespaceObject.Breadcrumb, {
|
|
34
|
+
"aria-label": label,
|
|
35
|
+
className: "border-b border-border px-3 py-2",
|
|
36
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_breadcrumb_cjs_namespaceObject.BreadcrumbList, {
|
|
37
|
+
className: "flex-nowrap gap-0.5 overflow-hidden text-xs sm:gap-0.5",
|
|
38
|
+
children: crumbs.map((crumb, index)=>{
|
|
39
|
+
const isCurrent = index === crumbs.length - 1;
|
|
40
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
|
|
41
|
+
children: [
|
|
42
|
+
index > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_breadcrumb_cjs_namespaceObject.BreadcrumbSeparator, {
|
|
43
|
+
className: "shrink-0 text-foreground-subtle [&>svg]:size-3"
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_breadcrumb_cjs_namespaceObject.BreadcrumbItem, {
|
|
46
|
+
className: "min-w-0",
|
|
47
|
+
children: isCurrent ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_breadcrumb_cjs_namespaceObject.BreadcrumbPage, {
|
|
48
|
+
className: "truncate text-xs font-medium text-foreground",
|
|
49
|
+
children: crumb.label
|
|
50
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_breadcrumb_cjs_namespaceObject.BreadcrumbLink, {
|
|
51
|
+
asChild: true,
|
|
52
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
className: "cursor-pointer truncate rounded px-0.5 text-xs text-foreground-muted transition-colors hover:text-foreground",
|
|
55
|
+
onClick: ()=>onJump(crumb.stack),
|
|
56
|
+
children: crumb.label
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}, crumb.key);
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.FolderBreadcrumb = __webpack_exports__.FolderBreadcrumb;
|
|
67
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
68
|
+
"FolderBreadcrumb"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FolderCrumb {
|
|
2
|
+
/** The path this crumb jumps to, unique down the trail. */
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
stack: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface FolderBreadcrumbProps {
|
|
8
|
+
crumbs: FolderCrumb[];
|
|
9
|
+
onJump: (stack: string[]) => void;
|
|
10
|
+
/** Accessible name for the breadcrumb's navigation landmark. */
|
|
11
|
+
label?: string;
|
|
12
|
+
}
|
|
13
|
+
/** The path above the list. Every segment but the last jumps back up. */
|
|
14
|
+
export declare function FolderBreadcrumb({ crumbs, onJump, label }: FolderBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../../breadcrumb.js";
|
|
4
|
+
function FolderBreadcrumb({ crumbs, onJump, label = 'breadcrumb' }) {
|
|
5
|
+
return /*#__PURE__*/ jsx(Breadcrumb, {
|
|
6
|
+
"aria-label": label,
|
|
7
|
+
className: "border-b border-border px-3 py-2",
|
|
8
|
+
children: /*#__PURE__*/ jsx(BreadcrumbList, {
|
|
9
|
+
className: "flex-nowrap gap-0.5 overflow-hidden text-xs sm:gap-0.5",
|
|
10
|
+
children: crumbs.map((crumb, index)=>{
|
|
11
|
+
const isCurrent = index === crumbs.length - 1;
|
|
12
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
13
|
+
children: [
|
|
14
|
+
index > 0 && /*#__PURE__*/ jsx(BreadcrumbSeparator, {
|
|
15
|
+
className: "shrink-0 text-foreground-subtle [&>svg]:size-3"
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsx(BreadcrumbItem, {
|
|
18
|
+
className: "min-w-0",
|
|
19
|
+
children: isCurrent ? /*#__PURE__*/ jsx(BreadcrumbPage, {
|
|
20
|
+
className: "truncate text-xs font-medium text-foreground",
|
|
21
|
+
children: crumb.label
|
|
22
|
+
}) : /*#__PURE__*/ jsx(BreadcrumbLink, {
|
|
23
|
+
asChild: true,
|
|
24
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
className: "cursor-pointer truncate rounded px-0.5 text-xs text-foreground-muted transition-colors hover:text-foreground",
|
|
27
|
+
onClick: ()=>onJump(crumb.stack),
|
|
28
|
+
children: crumb.label
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
}, crumb.key);
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export { FolderBreadcrumb };
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
FolderPickerEmptyState: ()=>FolderPickerEmptyState
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_button_cjs_namespaceObject = require("../../button.cjs");
|
|
31
|
+
const external_spinner_cjs_namespaceObject = require("../../spinner.cjs");
|
|
32
|
+
const defaultNoMatchText = (query)=>`No folders match “${query}”.`;
|
|
33
|
+
function FolderPickerEmptyState({ error, loading = false, query = '', emptyText = 'No subfolders.', noMatchText = defaultNoMatchText, loadingText = 'Loading…', onRetry, retryLabel = 'Retry' }) {
|
|
34
|
+
if (error) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
35
|
+
className: "flex items-center justify-between gap-2 px-3 py-2",
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
38
|
+
role: "alert",
|
|
39
|
+
className: "text-xs text-destructive",
|
|
40
|
+
children: error
|
|
41
|
+
}),
|
|
42
|
+
onRetry && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
43
|
+
variant: "ghost",
|
|
44
|
+
size: "xs",
|
|
45
|
+
type: "button",
|
|
46
|
+
className: "h-7",
|
|
47
|
+
onClick: onRetry,
|
|
48
|
+
children: retryLabel
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
if (loading) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
53
|
+
role: "status",
|
|
54
|
+
className: "flex items-center gap-2 px-3 py-2 text-xs text-foreground-muted",
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner, {
|
|
57
|
+
className: "[&_svg]:size-3.5",
|
|
58
|
+
"aria-hidden": "true"
|
|
59
|
+
}),
|
|
60
|
+
loadingText
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
64
|
+
role: "status",
|
|
65
|
+
className: "px-3 py-2 text-xs text-foreground-muted",
|
|
66
|
+
children: query ? noMatchText(query) : emptyText
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
exports.FolderPickerEmptyState = __webpack_exports__.FolderPickerEmptyState;
|
|
70
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
71
|
+
"FolderPickerEmptyState"
|
|
72
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
73
|
+
Object.defineProperty(exports, '__esModule', {
|
|
74
|
+
value: true
|
|
75
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface FolderPickerEmptyStateProps {
|
|
2
|
+
/** A load that failed. Takes precedence over every other state. */
|
|
3
|
+
error?: string | null;
|
|
4
|
+
/** The level 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 level again. Without it, the error offers no action. */
|
|
12
|
+
onRetry?: () => void;
|
|
13
|
+
retryLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* What the list shows when it has no rows.
|
|
17
|
+
*
|
|
18
|
+
* The four cases say different things and must not collapse into one message:
|
|
19
|
+
* a level still loading is not an empty folder, an empty folder is not a failed
|
|
20
|
+
* search, and neither is an error. Ordered by precedence, so a folder that
|
|
21
|
+
* fails to load reports the failure rather than claiming to be empty.
|
|
22
|
+
*
|
|
23
|
+
* Always renders one of the four messages, falling back to the empty-folder
|
|
24
|
+
* text, so the caller renders it only when the list has no rows.
|
|
25
|
+
*/
|
|
26
|
+
export declare function FolderPickerEmptyState({ error, loading, query, emptyText, noMatchText, loadingText, onRetry, retryLabel, }: FolderPickerEmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../button.js";
|
|
3
|
+
import { Spinner } from "../../spinner.js";
|
|
4
|
+
const defaultNoMatchText = (query)=>`No folders match “${query}”.`;
|
|
5
|
+
function FolderPickerEmptyState({ error, loading = false, query = '', emptyText = 'No subfolders.', noMatchText = defaultNoMatchText, loadingText = 'Loading…', onRetry, retryLabel = 'Retry' }) {
|
|
6
|
+
if (error) return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: "flex items-center justify-between gap-2 px-3 py-2",
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx("span", {
|
|
10
|
+
role: "alert",
|
|
11
|
+
className: "text-xs text-destructive",
|
|
12
|
+
children: error
|
|
13
|
+
}),
|
|
14
|
+
onRetry && /*#__PURE__*/ jsx(Button, {
|
|
15
|
+
variant: "ghost",
|
|
16
|
+
size: "xs",
|
|
17
|
+
type: "button",
|
|
18
|
+
className: "h-7",
|
|
19
|
+
onClick: onRetry,
|
|
20
|
+
children: retryLabel
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
if (loading) return /*#__PURE__*/ jsxs("div", {
|
|
25
|
+
role: "status",
|
|
26
|
+
className: "flex items-center gap-2 px-3 py-2 text-xs text-foreground-muted",
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ jsx(Spinner, {
|
|
29
|
+
className: "[&_svg]:size-3.5",
|
|
30
|
+
"aria-hidden": "true"
|
|
31
|
+
}),
|
|
32
|
+
loadingText
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
return /*#__PURE__*/ jsx("div", {
|
|
36
|
+
role: "status",
|
|
37
|
+
className: "px-3 py-2 text-xs text-foreground-muted",
|
|
38
|
+
children: query ? noMatchText(query) : emptyText
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { FolderPickerEmptyState };
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
FolderPickerFooter: ()=>FolderPickerFooter
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_button_cjs_namespaceObject = require("../../button.cjs");
|
|
31
|
+
function FolderPickerFooter({ leading, onCancel, onSelect, selectDisabled = false, cancelLabel = 'Cancel', selectLabel = 'Select' }) {
|
|
32
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
33
|
+
className: "flex shrink-0 items-center justify-between gap-2 border-t border-border px-3 py-2",
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
36
|
+
className: "flex min-w-0 items-center gap-1",
|
|
37
|
+
children: leading
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
40
|
+
className: "flex shrink-0 items-center gap-1",
|
|
41
|
+
children: [
|
|
42
|
+
onCancel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
43
|
+
variant: "ghost",
|
|
44
|
+
size: "xs",
|
|
45
|
+
type: "button",
|
|
46
|
+
className: "h-7",
|
|
47
|
+
onClick: onCancel,
|
|
48
|
+
children: cancelLabel
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
51
|
+
variant: "default",
|
|
52
|
+
size: "xs",
|
|
53
|
+
type: "button",
|
|
54
|
+
className: "h-7",
|
|
55
|
+
disabled: selectDisabled,
|
|
56
|
+
onClick: onSelect,
|
|
57
|
+
children: selectLabel
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.FolderPickerFooter = __webpack_exports__.FolderPickerFooter;
|
|
65
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
66
|
+
"FolderPickerFooter"
|
|
67
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
68
|
+
Object.defineProperty(exports, '__esModule', {
|
|
69
|
+
value: true
|
|
70
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface FolderPickerFooterProps {
|
|
3
|
+
/** Whatever the picker wants to say about the pending choice. */
|
|
4
|
+
leading?: ReactNode;
|
|
5
|
+
/** Omitted when there is nothing to dismiss, which hides the button. */
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
onSelect: () => void;
|
|
8
|
+
selectDisabled?: boolean;
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
selectLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The action row that ends the interaction.
|
|
14
|
+
*
|
|
15
|
+
* "Select", not "Apply": the button finishes choosing a value, where "Apply"
|
|
16
|
+
* would belong on a form that has been edited. Cancel renders only when the
|
|
17
|
+
* consumer supplies a handler, so an embedded surface with nothing to dismiss
|
|
18
|
+
* does not show a button that does nothing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function FolderPickerFooter({ leading, onCancel, onSelect, selectDisabled, cancelLabel, selectLabel, }: FolderPickerFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../button.js";
|
|
3
|
+
function FolderPickerFooter({ leading, onCancel, onSelect, selectDisabled = false, cancelLabel = 'Cancel', selectLabel = 'Select' }) {
|
|
4
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
5
|
+
className: "flex shrink-0 items-center justify-between gap-2 border-t border-border px-3 py-2",
|
|
6
|
+
children: [
|
|
7
|
+
/*#__PURE__*/ jsx("div", {
|
|
8
|
+
className: "flex min-w-0 items-center gap-1",
|
|
9
|
+
children: leading
|
|
10
|
+
}),
|
|
11
|
+
/*#__PURE__*/ jsxs("div", {
|
|
12
|
+
className: "flex shrink-0 items-center gap-1",
|
|
13
|
+
children: [
|
|
14
|
+
onCancel && /*#__PURE__*/ jsx(Button, {
|
|
15
|
+
variant: "ghost",
|
|
16
|
+
size: "xs",
|
|
17
|
+
type: "button",
|
|
18
|
+
className: "h-7",
|
|
19
|
+
onClick: onCancel,
|
|
20
|
+
children: cancelLabel
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsx(Button, {
|
|
23
|
+
variant: "default",
|
|
24
|
+
size: "xs",
|
|
25
|
+
type: "button",
|
|
26
|
+
className: "h-7",
|
|
27
|
+
disabled: selectDisabled,
|
|
28
|
+
onClick: onSelect,
|
|
29
|
+
children: selectLabel
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { FolderPickerFooter };
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
FolderPickerSearch: ()=>FolderPickerSearch
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
function FolderPickerSearch({ value, onChange, placeholder = 'Search...', clearLabel = 'Clear search' }) {
|
|
33
|
+
const inputRef = (0, external_react_namespaceObject.useRef)(null);
|
|
34
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
35
|
+
className: "flex items-center border-b border-border px-3",
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Search, {
|
|
38
|
+
className: "mr-2 size-4 shrink-0 opacity-50"
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
|
|
41
|
+
ref: inputRef,
|
|
42
|
+
"data-slot": "folder-picker-search",
|
|
43
|
+
type: "text",
|
|
44
|
+
autoComplete: "off",
|
|
45
|
+
"aria-label": placeholder,
|
|
46
|
+
placeholder: placeholder,
|
|
47
|
+
value: value,
|
|
48
|
+
onChange: (event)=>onChange(event.target.value),
|
|
49
|
+
className: "flex h-9 w-full rounded-md bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
50
|
+
onKeyDown: (event)=>{
|
|
51
|
+
if ('Escape' === event.key && value) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
onChange('');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
value && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
59
|
+
type: "button",
|
|
60
|
+
"aria-label": clearLabel,
|
|
61
|
+
className: "ml-1 grid size-5 shrink-0 cursor-pointer place-items-center rounded text-muted-foreground transition-colors hover:text-foreground",
|
|
62
|
+
onClick: ()=>{
|
|
63
|
+
inputRef.current?.focus();
|
|
64
|
+
onChange('');
|
|
65
|
+
},
|
|
66
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
67
|
+
className: "size-3.5"
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
exports.FolderPickerSearch = __webpack_exports__.FolderPickerSearch;
|
|
74
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
75
|
+
"FolderPickerSearch"
|
|
76
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
77
|
+
Object.defineProperty(exports, '__esModule', {
|
|
78
|
+
value: true
|
|
79
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FolderPickerSearchProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
clearLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Filters the level being browsed.
|
|
9
|
+
*
|
|
10
|
+
* Matches `CommandInput`: no field of its own, just a leading magnifier and
|
|
11
|
+
* the rule under the row, so the search reads as part of the popover rather
|
|
12
|
+
* than as a control sitting inside it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function FolderPickerSearch({ value, onChange, placeholder, clearLabel, }: FolderPickerSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Search, X } from "lucide-react";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
function FolderPickerSearch({ value, onChange, placeholder = 'Search...', clearLabel = 'Clear search' }) {
|
|
5
|
+
const inputRef = useRef(null);
|
|
6
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: "flex items-center border-b border-border px-3",
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx(Search, {
|
|
10
|
+
className: "mr-2 size-4 shrink-0 opacity-50"
|
|
11
|
+
}),
|
|
12
|
+
/*#__PURE__*/ jsx("input", {
|
|
13
|
+
ref: inputRef,
|
|
14
|
+
"data-slot": "folder-picker-search",
|
|
15
|
+
type: "text",
|
|
16
|
+
autoComplete: "off",
|
|
17
|
+
"aria-label": placeholder,
|
|
18
|
+
placeholder: placeholder,
|
|
19
|
+
value: value,
|
|
20
|
+
onChange: (event)=>onChange(event.target.value),
|
|
21
|
+
className: "flex h-9 w-full rounded-md bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
22
|
+
onKeyDown: (event)=>{
|
|
23
|
+
if ('Escape' === event.key && value) {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
event.stopPropagation();
|
|
26
|
+
onChange('');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
value && /*#__PURE__*/ jsx("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": clearLabel,
|
|
33
|
+
className: "ml-1 grid size-5 shrink-0 cursor-pointer place-items-center rounded text-muted-foreground transition-colors hover:text-foreground",
|
|
34
|
+
onClick: ()=>{
|
|
35
|
+
inputRef.current?.focus();
|
|
36
|
+
onChange('');
|
|
37
|
+
},
|
|
38
|
+
children: /*#__PURE__*/ jsx(X, {
|
|
39
|
+
className: "size-3.5"
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export { FolderPickerSearch };
|