@uipath/apollo-wind 2.62.0 → 2.64.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.
Files changed (72) hide show
  1. package/dist/components/forms/aria-ids.cjs +38 -0
  2. package/dist/components/forms/aria-ids.d.ts +2 -0
  3. package/dist/components/forms/aria-ids.js +4 -0
  4. package/dist/components/forms/demo-mocks.cjs +0 -448
  5. package/dist/components/forms/demo-mocks.js +0 -448
  6. package/dist/components/forms/field-control.cjs +21 -17
  7. package/dist/components/forms/field-control.d.ts +3 -1
  8. package/dist/components/forms/field-control.js +21 -17
  9. package/dist/components/forms/field-renderer.cjs +65 -37
  10. package/dist/components/forms/field-renderer.js +66 -38
  11. package/dist/components/forms/form-designer.cjs +204 -3
  12. package/dist/components/forms/form-designer.js +204 -3
  13. package/dist/components/forms/form-examples.cjs +3 -190
  14. package/dist/components/forms/form-examples.d.ts +0 -10
  15. package/dist/components/forms/form-examples.js +3 -184
  16. package/dist/components/forms/form-schema.d.ts +6 -0
  17. package/dist/components/forms/metadata-form.cjs +9 -1
  18. package/dist/components/forms/metadata-form.d.ts +8 -1
  19. package/dist/components/forms/metadata-form.js +9 -1
  20. package/dist/components/forms/mode-aware-field.cjs +11 -6
  21. package/dist/components/forms/mode-aware-field.d.ts +2 -0
  22. package/dist/components/forms/mode-aware-field.js +11 -6
  23. package/dist/components/forms/string-list-field.cjs +5 -4
  24. package/dist/components/forms/string-list-field.d.ts +4 -2
  25. package/dist/components/forms/string-list-field.js +5 -4
  26. package/dist/components/ui/folder-picker/components/folder-breadcrumb.cjs +72 -0
  27. package/dist/components/ui/folder-picker/components/folder-breadcrumb.d.ts +14 -0
  28. package/dist/components/ui/folder-picker/components/folder-breadcrumb.js +38 -0
  29. package/dist/components/ui/folder-picker/components/folder-picker-empty-state.cjs +75 -0
  30. package/dist/components/ui/folder-picker/components/folder-picker-empty-state.d.ts +26 -0
  31. package/dist/components/ui/folder-picker/components/folder-picker-empty-state.js +41 -0
  32. package/dist/components/ui/folder-picker/components/folder-picker-footer.cjs +70 -0
  33. package/dist/components/ui/folder-picker/components/folder-picker-footer.d.ts +20 -0
  34. package/dist/components/ui/folder-picker/components/folder-picker-footer.js +36 -0
  35. package/dist/components/ui/folder-picker/components/folder-picker-search.cjs +79 -0
  36. package/dist/components/ui/folder-picker/components/folder-picker-search.d.ts +14 -0
  37. package/dist/components/ui/folder-picker/components/folder-picker-search.js +45 -0
  38. package/dist/components/ui/folder-picker/components/folder-row.cjs +107 -0
  39. package/dist/components/ui/folder-picker/components/folder-row.d.ts +27 -0
  40. package/dist/components/ui/folder-picker/components/folder-row.js +73 -0
  41. package/dist/components/ui/folder-picker/folder-picker.cjs +465 -0
  42. package/dist/components/ui/folder-picker/folder-picker.d.ts +34 -0
  43. package/dist/components/ui/folder-picker/folder-picker.js +425 -0
  44. package/dist/components/ui/folder-picker/index.cjs +42 -0
  45. package/dist/components/ui/folder-picker/index.d.ts +2 -0
  46. package/dist/components/ui/folder-picker/index.js +2 -0
  47. package/dist/components/ui/folder-picker/types.cjs +44 -0
  48. package/dist/components/ui/folder-picker/types.d.ts +97 -0
  49. package/dist/components/ui/folder-picker/types.js +4 -0
  50. package/dist/components/ui/index.cjs +26 -26
  51. package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +13 -0
  52. package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +2 -1
  53. package/dist/components/ui/json-tree-view/JsonTreeRow.js +2 -1
  54. package/dist/components/ui/json-tree-view/JsonTypeBadge.cjs +43 -6
  55. package/dist/components/ui/json-tree-view/JsonTypeBadge.d.ts +6 -3
  56. package/dist/components/ui/json-tree-view/JsonTypeBadge.js +44 -7
  57. package/dist/components/ui/json-tree-view/index.d.ts +1 -1
  58. package/dist/components/ui/json-tree-view/strings.cjs +1 -0
  59. package/dist/components/ui/json-tree-view/strings.d.ts +10 -2
  60. package/dist/components/ui/json-tree-view/strings.js +1 -0
  61. package/dist/components/ui/prompt-value-control.cjs +3 -1
  62. package/dist/components/ui/prompt-value-control.d.ts +5 -0
  63. package/dist/components/ui/prompt-value-control.js +3 -1
  64. package/dist/components/ui/variable-value-control.cjs +3 -1
  65. package/dist/components/ui/variable-value-control.d.ts +5 -0
  66. package/dist/components/ui/variable-value-control.js +3 -1
  67. package/dist/index.cjs +13 -3
  68. package/dist/index.d.ts +3 -1
  69. package/dist/index.js +2 -1
  70. package/dist/styles.css +41 -0
  71. package/package.json +1 -1
  72. package/dist/templates/Forms/form-builder-example.d.ts +0 -1
@@ -10,6 +10,7 @@ import { Input } from "../ui/input.js";
10
10
  import { InputGroup, InputGroupAddon } from "../ui/input-group.js";
11
11
  import { PromptValueControl } from "../ui/prompt-value-control.js";
12
12
  import { VariableValueControl } from "../ui/variable-value-control.js";
13
+ import { joinIds } from "./aria-ids.js";
13
14
  import { DEFAULT_FIELD_ACTION_REGISTRY, resolveFieldActions, resolveVariables } from "./field-actions.js";
14
15
  import { FIELD_CONTROL_GEOMETRY, FieldControl } from "./field-control.js";
15
16
  import { DEFAULT_METADATA_FORM_STRINGS } from "./form-strings.js";
@@ -67,7 +68,7 @@ const TEXT_GEOMETRY = {
67
68
  labelTarget: 'control',
68
69
  insertable: true
69
70
  };
70
- function FieldAnatomy({ field, context, customComponents, disabled, required, options, formField, error }) {
71
+ function FieldAnatomy({ field, context, customComponents, disabled, required, options, formField, error, describedBy }) {
71
72
  const form = useFormContext();
72
73
  const registry = context.valueModes ?? DEFAULT_VALUE_MODE_REGISTRY;
73
74
  const actionRegistry = context.fieldActions ?? DEFAULT_FIELD_ACTION_REGISTRY;
@@ -76,6 +77,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
76
77
  const { name } = field;
77
78
  const errorId = `${name}-error`;
78
79
  const labelId = `${name}-label`;
80
+ const controlDescribedBy = joinIds(error && errorId, describedBy);
79
81
  const formVariables = context.variables;
80
82
  const variables = useCallback(()=>resolveVariables(formVariables, field), [
81
83
  formVariables,
@@ -235,6 +237,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
235
237
  required,
236
238
  error,
237
239
  errorId,
240
+ describedBy,
238
241
  valueModeProps: ()=>({
239
242
  value: inner,
240
243
  onChange: (next)=>writeInner(next),
@@ -258,7 +261,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
258
261
  controlProps: {
259
262
  'data-slot': 'input-group-control',
260
263
  'aria-invalid': error ? true : void 0,
261
- 'aria-describedby': error ? errorId : void 0,
264
+ 'aria-describedby': controlDescribedBy,
262
265
  'aria-errormessage': error ? errorId : void 0
263
266
  }
264
267
  })
@@ -492,7 +495,7 @@ function resolveControl(input) {
492
495
  source: 'fallback'
493
496
  };
494
497
  }
495
- function FallbackControl({ field, binding, disabled, error, errorId }) {
498
+ function FallbackControl({ field, binding, disabled, error, errorId, describedBy }) {
496
499
  const { value } = binding;
497
500
  return /*#__PURE__*/ jsx(Input, {
498
501
  id: field.name,
@@ -504,7 +507,7 @@ function FallbackControl({ field, binding, disabled, error, errorId }) {
504
507
  placeholder: field.placeholder,
505
508
  disabled: disabled,
506
509
  "aria-invalid": error ? true : void 0,
507
- "aria-describedby": error ? errorId : void 0,
510
+ "aria-describedby": joinIds(error && errorId, describedBy),
508
511
  "aria-errormessage": error ? errorId : void 0
509
512
  });
510
513
  }
@@ -533,7 +536,8 @@ function builtInLiteral(input) {
533
536
  required: required,
534
537
  error: error,
535
538
  controlRef: input.controlRef,
536
- labelId: input.labelId
539
+ labelId: input.labelId,
540
+ "aria-describedby": joinIds(field.componentProps?.['aria-describedby'], input.describedBy)
537
541
  }),
538
542
  geometry: registrationGeometry(registration),
539
543
  source: 'custom'
@@ -546,7 +550,8 @@ function builtInLiteral(input) {
546
550
  options: options,
547
551
  disabled: disabled,
548
552
  invalid: !!error,
549
- strings: strings.boolean
553
+ strings: strings.boolean,
554
+ describedBy: input.describedBy
550
555
  }),
551
556
  geometry: FIELD_CONTROL_GEOMETRY[field.type] ?? unfittedGeometry(field),
552
557
  source: 'field-type'
@@ -37,7 +37,7 @@ const textarea_cjs_namespaceObject = require("../ui/textarea.cjs");
37
37
  function formatTemplate(template, values) {
38
38
  return template.replace(/\{\{(\w+)\}\}/g, (match, token)=>token in values ? String(values[token]) : match);
39
39
  }
40
- function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef }) {
40
+ function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy = error ? `${field.name}-error` : void 0 }) {
41
41
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(form_field_cjs_namespaceObject.FormField, {
42
42
  "data-slot": "string-list-field",
43
43
  children: [
@@ -54,7 +54,8 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
54
54
  onBlur: onBlur,
55
55
  invalid: !!error,
56
56
  disabled: disabled,
57
- inputRef: inputRef
57
+ inputRef: inputRef,
58
+ ariaDescribedBy: ariaDescribedBy
58
59
  }),
59
60
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(form_field_cjs_namespaceObject.FormFieldDescription, {
60
61
  children: field.description
@@ -66,7 +67,7 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
66
67
  ]
67
68
  });
68
69
  }
69
- function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef }) {
70
+ function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy = invalid ? `${field.name}-error` : void 0 }) {
70
71
  const items = value ?? [];
71
72
  const maxItems = field.maxItems ?? 1 / 0;
72
73
  const canAdd = !disabled && items.length < maxItems;
@@ -126,7 +127,7 @@ function StringListControl({ field, value, onChange, onBlur, invalid = false, di
126
127
  disabled: disabled,
127
128
  "aria-label": `${field.label} ${index + 1}`,
128
129
  "aria-invalid": invalid || void 0,
129
- "aria-describedby": invalid ? `${field.name}-error` : void 0,
130
+ "aria-describedby": ariaDescribedBy,
130
131
  "aria-errormessage": invalid ? `${field.name}-error` : void 0,
131
132
  className: "flex-1"
132
133
  }),
@@ -18,6 +18,8 @@ export interface StringListFieldProps {
18
18
  * indication of where it is.
19
19
  */
20
20
  inputRef?: React.Ref<HTMLTextAreaElement>;
21
+ /** Every row's aria-describedby. Defaults to the error message's id while there is an error. */
22
+ ariaDescribedBy?: string;
21
23
  }
22
24
  /**
23
25
  * Repeated multiline rows with Add / Remove — the `string-list` field type.
@@ -26,10 +28,10 @@ export interface StringListFieldProps {
26
28
  * the info trigger is a Radix tooltip, which throws without one. Inside `MetadataForm` this
27
29
  * is handled for you — it mounts a provider for schemas that use tooltip metadata.
28
30
  */
29
- export declare function StringListField({ field, value, onChange, onBlur, error, disabled, required, inputRef, }: StringListFieldProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function StringListField({ field, value, onChange, onBlur, error, disabled, required, inputRef, ariaDescribedBy, }: StringListFieldProps): import("react/jsx-runtime").JSX.Element;
30
32
  export interface StringListControlProps extends Omit<StringListFieldProps, 'error' | 'required'> {
31
33
  /** Marks every row invalid and points it at the `${field.name}-error` message. */
32
34
  invalid?: boolean;
33
35
  }
34
36
  /** The rows and Add button of a string list, without its label, description or error. */
35
- export declare function StringListControl({ field, value, onChange, onBlur, invalid, disabled, inputRef, }: StringListControlProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare function StringListControl({ field, value, onChange, onBlur, invalid, disabled, inputRef, ariaDescribedBy, }: StringListControlProps): import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ import { Textarea } from "../ui/textarea.js";
7
7
  function formatTemplate(template, values) {
8
8
  return template.replace(/\{\{(\w+)\}\}/g, (match, token)=>token in values ? String(values[token]) : match);
9
9
  }
10
- function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef }) {
10
+ function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy = error ? `${field.name}-error` : void 0 }) {
11
11
  return /*#__PURE__*/ jsxs(FormField, {
12
12
  "data-slot": "string-list-field",
13
13
  children: [
@@ -24,7 +24,8 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
24
24
  onBlur: onBlur,
25
25
  invalid: !!error,
26
26
  disabled: disabled,
27
- inputRef: inputRef
27
+ inputRef: inputRef,
28
+ ariaDescribedBy: ariaDescribedBy
28
29
  }),
29
30
  /*#__PURE__*/ jsx(FormFieldDescription, {
30
31
  children: field.description
@@ -36,7 +37,7 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
36
37
  ]
37
38
  });
38
39
  }
39
- function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef }) {
40
+ function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy = invalid ? `${field.name}-error` : void 0 }) {
40
41
  const items = value ?? [];
41
42
  const maxItems = field.maxItems ?? 1 / 0;
42
43
  const canAdd = !disabled && items.length < maxItems;
@@ -96,7 +97,7 @@ function StringListControl({ field, value, onChange, onBlur, invalid = false, di
96
97
  disabled: disabled,
97
98
  "aria-label": `${field.label} ${index + 1}`,
98
99
  "aria-invalid": invalid || void 0,
99
- "aria-describedby": invalid ? `${field.name}-error` : void 0,
100
+ "aria-describedby": ariaDescribedBy,
100
101
  "aria-errormessage": invalid ? `${field.name}-error` : void 0,
101
102
  className: "flex-1"
102
103
  }),
@@ -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
+ });