@uipath/apollo-wind 2.88.0 → 2.90.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 (34) hide show
  1. package/dist/components/ui/field-actions/ai-assist-action.cjs +32 -8
  2. package/dist/components/ui/field-actions/ai-assist-action.d.ts +25 -2
  3. package/dist/components/ui/field-actions/ai-assist-action.js +33 -9
  4. package/dist/components/ui/field-actions/collapse.cjs +7 -3
  5. package/dist/components/ui/field-actions/collapse.d.ts +2 -0
  6. package/dist/components/ui/field-actions/collapse.js +3 -2
  7. package/dist/components/ui/field-actions/insert-variable-action.d.ts +4 -1
  8. package/dist/components/ui/index.cjs +162 -149
  9. package/dist/components/ui/index.d.ts +2 -1
  10. package/dist/components/ui/index.js +1 -0
  11. package/dist/components/ui/input-group.cjs +57 -5
  12. package/dist/components/ui/input-group.d.ts +2 -0
  13. package/dist/components/ui/input-group.js +58 -6
  14. package/dist/components/ui/password-input.cjs +95 -0
  15. package/dist/components/ui/password-input.d.ts +14 -0
  16. package/dist/components/ui/password-input.js +61 -0
  17. package/dist/components/ui/prompt-editor/components/TokenPill.cjs +1 -1
  18. package/dist/components/ui/prompt-editor/components/TokenPill.js +1 -1
  19. package/dist/components/ui/prompt-editor/types.d.ts +6 -0
  20. package/dist/components/ui/reference-chip-colors.cjs +6 -0
  21. package/dist/components/ui/reference-chip-colors.d.ts +14 -0
  22. package/dist/components/ui/reference-chip-colors.js +6 -0
  23. package/dist/components/ui/reference-chip.cjs +6 -7
  24. package/dist/components/ui/reference-chip.d.ts +3 -0
  25. package/dist/components/ui/reference-chip.js +6 -7
  26. package/dist/components/ui/variable-picker/variable-picker.cjs +1 -1
  27. package/dist/components/ui/variable-picker/variable-picker.d.ts +2 -1
  28. package/dist/components/ui/variable-picker/variable-picker.js +1 -1
  29. package/dist/components/ui/variable-value-control.d.ts +5 -2
  30. package/dist/index.cjs +5 -1
  31. package/dist/index.d.ts +3 -1
  32. package/dist/index.js +2 -1
  33. package/dist/styles.css +104 -10
  34. package/package.json +1 -1
@@ -59,6 +59,7 @@ export * from './model-picker';
59
59
  export * from './multi-select';
60
60
  export * from './pagination';
61
61
  export * from './panel-tabs';
62
+ export * from './password-input';
62
63
  export * from './popover';
63
64
  export * from './portal-container';
64
65
  export * from './progress';
@@ -68,7 +69,7 @@ export * from './prompt-value-control';
68
69
  export * from './quick-form-field';
69
70
  export * from './radio-group';
70
71
  export { ReferenceChip, type ReferenceChipProps } from './reference-chip';
71
- export { getReferenceChipColors } from './reference-chip-colors';
72
+ export { getReferenceChipColors, type ReferenceChipVariant } from './reference-chip-colors';
72
73
  export * from './resizable';
73
74
  export * from './resource-picker';
74
75
  export * from './scroll-area';
@@ -62,6 +62,7 @@ export * from "./model-picker/index.js";
62
62
  export * from "./multi-select.js";
63
63
  export * from "./pagination.js";
64
64
  export * from "./panel-tabs.js";
65
+ export * from "./password-input.js";
65
66
  export * from "./popover.js";
66
67
  export * from "./portal-container.js";
67
68
  export * from "./progress.js";
@@ -142,10 +142,14 @@ const inputGroupVariants = (0, external_class_variance_authority_namespaceObject
142
142
  invalid: true,
143
143
  class: 'ring-error/20 future:ring-1 future:ring-error/40'
144
144
  },
145
+ {
146
+ layout: ROW_LAYOUTS,
147
+ class: 'has-[button[data-slot=input-group-control]:not(:disabled)]:cursor-pointer'
148
+ },
145
149
  {
146
150
  variant: FILLED,
147
151
  layout: ROW_LAYOUTS,
148
- class: 'has-[button[data-slot=input-group-control]:not(:disabled):hover]:bg-accent future:has-[button[data-slot=input-group-control]:not(:disabled):hover]:bg-surface-overlay future:has-[button[data-slot=input-group-control]:not(:disabled):hover]:not-has-[[data-slot=input-group-control]_[data-slot=badge]:hover]:bg-surface-hover'
152
+ class: 'hover:has-[button[data-slot=input-group-control]:not(:disabled)]:not-has-[[data-slot=input-group-addon]:hover]:bg-accent future:hover:has-[button[data-slot=input-group-control]:not(:disabled)]:not-has-[[data-slot=input-group-addon]:hover]:bg-surface-overlay future:hover:has-[button[data-slot=input-group-control]:not(:disabled)]:not-has-[[data-slot=input-group-addon]:hover]:not-has-[[data-slot=input-group-control]_[data-slot=badge]:hover]:bg-surface-hover'
149
153
  }
150
154
  ],
151
155
  defaultVariants: {
@@ -156,7 +160,11 @@ const inputGroupVariants = (0, external_class_variance_authority_namespaceObject
156
160
  disabled: false
157
161
  }
158
162
  });
159
- const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, error, errorId, variant = 'default', size = 'default', layout = 'row', invalid, disabled, ...props }, ref)=>{
163
+ function enabledControl(box) {
164
+ const control = box.querySelector('[data-slot=input-group-control]');
165
+ return control && !control.matches(':disabled, [aria-disabled=true]') ? control : null;
166
+ }
167
+ const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, error, errorId, variant = 'default', size = 'default', layout = 'row', invalid, disabled, onPointerDown, onMouseDown, onClick, ...props }, ref)=>{
160
168
  const generatedId = external_react_namespaceObject.useId();
161
169
  const validationId = errorId ?? `input-group-${generatedId.replace(/:/g, '')}-error`;
162
170
  const flagged = Boolean(invalid || error);
@@ -185,6 +193,42 @@ const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ cl
185
193
  invalid,
186
194
  disabled
187
195
  ]);
196
+ const press = external_react_namespaceObject.useRef(null);
197
+ const boxControl = external_react_namespaceObject.useCallback((e)=>e.target !== e.currentTarget || disabled ? null : enabledControl(e.currentTarget), [
198
+ disabled
199
+ ]);
200
+ const handlePointerDown = external_react_namespaceObject.useCallback((e)=>{
201
+ onPointerDown?.(e);
202
+ const control = boxControl(e);
203
+ const pressed = control && {
204
+ control,
205
+ expanded: 'true' === control.getAttribute('aria-expanded')
206
+ };
207
+ if (control instanceof HTMLButtonElement) control.dispatchEvent(new PointerEvent('pointerdown', e.nativeEvent));
208
+ press.current = pressed;
209
+ }, [
210
+ onPointerDown,
211
+ boxControl
212
+ ]);
213
+ const handleMouseDown = external_react_namespaceObject.useCallback((e)=>{
214
+ onMouseDown?.(e);
215
+ if (press.current && e.target === e.currentTarget) e.preventDefault();
216
+ }, [
217
+ onMouseDown
218
+ ]);
219
+ const handleClick = external_react_namespaceObject.useCallback((e)=>{
220
+ onClick?.(e);
221
+ const pressed = press.current;
222
+ press.current = null;
223
+ if (!pressed || e.defaultPrevented || boxControl(e) !== pressed.control) return;
224
+ const { control } = pressed;
225
+ if (control instanceof HTMLButtonElement) {
226
+ if (!pressed.expanded || 'true' === control.getAttribute('aria-expanded')) control.click();
227
+ } else control.focus();
228
+ }, [
229
+ onClick,
230
+ boxControl
231
+ ]);
188
232
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
189
233
  value: group,
190
234
  children: [
@@ -203,6 +247,9 @@ const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ cl
203
247
  invalid: flagged,
204
248
  disabled
205
249
  }), className),
250
+ onPointerDown: handlePointerDown,
251
+ onMouseDown: handleMouseDown,
252
+ onClick: handleClick,
206
253
  ...props
207
254
  }),
208
255
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
@@ -327,7 +374,7 @@ InputGroupTrigger.displayName = 'InputGroupTrigger';
327
374
  function isEmpty(children) {
328
375
  return null == children || false === children || '' === children;
329
376
  }
330
- const InputGroupPopoverTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ children, placeholder, caret = true, ...props }, ref)=>{
377
+ const InputGroupPopoverTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ children, placeholder, caret = true, loading = false, ...props }, ref)=>{
331
378
  const { anchor } = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
332
379
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
333
380
  children: [
@@ -335,6 +382,7 @@ const InputGroupPopoverTrigger = /*#__PURE__*/ external_react_namespaceObject.fo
335
382
  asChild: true,
336
383
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(InputGroupTrigger, {
337
384
  ref: ref,
385
+ "aria-busy": loading || void 0,
338
386
  ...props,
339
387
  children: [
340
388
  isEmpty(children) ? void 0 !== placeholder && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
@@ -342,9 +390,13 @@ const InputGroupPopoverTrigger = /*#__PURE__*/ external_react_namespaceObject.fo
342
390
  className: "truncate text-muted-foreground",
343
391
  children: placeholder
344
392
  }) : children,
345
- caret && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
393
+ caret && (loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Loader2, {
394
+ "data-slot": "input-group-caret",
395
+ className: "ml-auto shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none"
396
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
397
+ "data-slot": "input-group-caret",
346
398
  className: "ml-auto shrink-0 text-muted-foreground"
347
- })
399
+ }))
348
400
  ]
349
401
  })
350
402
  }),
@@ -82,6 +82,8 @@ export interface InputGroupPopoverTriggerProps extends InputGroupTriggerProps {
82
82
  placeholder?: React.ReactNode;
83
83
  /** Draws the trailing caret. Pass `false` for a trigger that brings its own. */
84
84
  caret?: boolean;
85
+ /** Spins the caret, and marks the trigger busy, while its options or value are on their way. */
86
+ loading?: boolean;
85
87
  }
86
88
  /**
87
89
  * A popover's trigger as the group's control. Must be rendered inside a `Popover`. The panel
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
- import { ChevronDown } from "lucide-react";
3
+ import { ChevronDown, Loader2 } from "lucide-react";
4
4
  import { forwardRef, useCallback, useId, useMemo, useRef, useState } from "react";
5
5
  import { Button } from "./button.js";
6
6
  import { Input } from "./input.js";
@@ -103,10 +103,14 @@ const inputGroupVariants = cva([
103
103
  invalid: true,
104
104
  class: 'ring-error/20 future:ring-1 future:ring-error/40'
105
105
  },
106
+ {
107
+ layout: ROW_LAYOUTS,
108
+ class: 'has-[button[data-slot=input-group-control]:not(:disabled)]:cursor-pointer'
109
+ },
106
110
  {
107
111
  variant: FILLED,
108
112
  layout: ROW_LAYOUTS,
109
- class: 'has-[button[data-slot=input-group-control]:not(:disabled):hover]:bg-accent future:has-[button[data-slot=input-group-control]:not(:disabled):hover]:bg-surface-overlay future:has-[button[data-slot=input-group-control]:not(:disabled):hover]:not-has-[[data-slot=input-group-control]_[data-slot=badge]:hover]:bg-surface-hover'
113
+ class: 'hover:has-[button[data-slot=input-group-control]:not(:disabled)]:not-has-[[data-slot=input-group-addon]:hover]:bg-accent future:hover:has-[button[data-slot=input-group-control]:not(:disabled)]:not-has-[[data-slot=input-group-addon]:hover]:bg-surface-overlay future:hover:has-[button[data-slot=input-group-control]:not(:disabled)]:not-has-[[data-slot=input-group-addon]:hover]:not-has-[[data-slot=input-group-control]_[data-slot=badge]:hover]:bg-surface-hover'
110
114
  }
111
115
  ],
112
116
  defaultVariants: {
@@ -117,7 +121,11 @@ const inputGroupVariants = cva([
117
121
  disabled: false
118
122
  }
119
123
  });
120
- const InputGroup = /*#__PURE__*/ forwardRef(({ className, error, errorId, variant = 'default', size = 'default', layout = 'row', invalid, disabled, ...props }, ref)=>{
124
+ function enabledControl(box) {
125
+ const control = box.querySelector('[data-slot=input-group-control]');
126
+ return control && !control.matches(':disabled, [aria-disabled=true]') ? control : null;
127
+ }
128
+ const InputGroup = /*#__PURE__*/ forwardRef(({ className, error, errorId, variant = 'default', size = 'default', layout = 'row', invalid, disabled, onPointerDown, onMouseDown, onClick, ...props }, ref)=>{
121
129
  const generatedId = useId();
122
130
  const validationId = errorId ?? `input-group-${generatedId.replace(/:/g, '')}-error`;
123
131
  const flagged = Boolean(invalid || error);
@@ -146,6 +154,42 @@ const InputGroup = /*#__PURE__*/ forwardRef(({ className, error, errorId, varian
146
154
  invalid,
147
155
  disabled
148
156
  ]);
157
+ const press = useRef(null);
158
+ const boxControl = useCallback((e)=>e.target !== e.currentTarget || disabled ? null : enabledControl(e.currentTarget), [
159
+ disabled
160
+ ]);
161
+ const handlePointerDown = useCallback((e)=>{
162
+ onPointerDown?.(e);
163
+ const control = boxControl(e);
164
+ const pressed = control && {
165
+ control,
166
+ expanded: 'true' === control.getAttribute('aria-expanded')
167
+ };
168
+ if (control instanceof HTMLButtonElement) control.dispatchEvent(new PointerEvent('pointerdown', e.nativeEvent));
169
+ press.current = pressed;
170
+ }, [
171
+ onPointerDown,
172
+ boxControl
173
+ ]);
174
+ const handleMouseDown = useCallback((e)=>{
175
+ onMouseDown?.(e);
176
+ if (press.current && e.target === e.currentTarget) e.preventDefault();
177
+ }, [
178
+ onMouseDown
179
+ ]);
180
+ const handleClick = useCallback((e)=>{
181
+ onClick?.(e);
182
+ const pressed = press.current;
183
+ press.current = null;
184
+ if (!pressed || e.defaultPrevented || boxControl(e) !== pressed.control) return;
185
+ const { control } = pressed;
186
+ if (control instanceof HTMLButtonElement) {
187
+ if (!pressed.expanded || 'true' === control.getAttribute('aria-expanded')) control.click();
188
+ } else control.focus();
189
+ }, [
190
+ onClick,
191
+ boxControl
192
+ ]);
149
193
  return /*#__PURE__*/ jsxs(InputGroupContext.Provider, {
150
194
  value: group,
151
195
  children: [
@@ -164,6 +208,9 @@ const InputGroup = /*#__PURE__*/ forwardRef(({ className, error, errorId, varian
164
208
  invalid: flagged,
165
209
  disabled
166
210
  }), className),
211
+ onPointerDown: handlePointerDown,
212
+ onMouseDown: handleMouseDown,
213
+ onClick: handleClick,
167
214
  ...props
168
215
  }),
169
216
  /*#__PURE__*/ jsx(FormFieldError, {
@@ -288,7 +335,7 @@ InputGroupTrigger.displayName = 'InputGroupTrigger';
288
335
  function isEmpty(children) {
289
336
  return null == children || false === children || '' === children;
290
337
  }
291
- const InputGroupPopoverTrigger = /*#__PURE__*/ forwardRef(({ children, placeholder, caret = true, ...props }, ref)=>{
338
+ const InputGroupPopoverTrigger = /*#__PURE__*/ forwardRef(({ children, placeholder, caret = true, loading = false, ...props }, ref)=>{
292
339
  const { anchor } = useInputGroup();
293
340
  return /*#__PURE__*/ jsxs(Fragment, {
294
341
  children: [
@@ -296,6 +343,7 @@ const InputGroupPopoverTrigger = /*#__PURE__*/ forwardRef(({ children, placehold
296
343
  asChild: true,
297
344
  children: /*#__PURE__*/ jsxs(InputGroupTrigger, {
298
345
  ref: ref,
346
+ "aria-busy": loading || void 0,
299
347
  ...props,
300
348
  children: [
301
349
  isEmpty(children) ? void 0 !== placeholder && /*#__PURE__*/ jsx("span", {
@@ -303,9 +351,13 @@ const InputGroupPopoverTrigger = /*#__PURE__*/ forwardRef(({ children, placehold
303
351
  className: "truncate text-muted-foreground",
304
352
  children: placeholder
305
353
  }) : children,
306
- caret && /*#__PURE__*/ jsx(ChevronDown, {
354
+ caret && (loading ? /*#__PURE__*/ jsx(Loader2, {
355
+ "data-slot": "input-group-caret",
356
+ className: "ml-auto shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none"
357
+ }) : /*#__PURE__*/ jsx(ChevronDown, {
358
+ "data-slot": "input-group-caret",
307
359
  className: "ml-auto shrink-0 text-muted-foreground"
308
- })
360
+ }))
309
361
  ]
310
362
  })
311
363
  }),
@@ -0,0 +1,95 @@
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
+ PasswordInput: ()=>PasswordInput
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
+ const external_input_cjs_namespaceObject = require("./input.cjs");
33
+ const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
34
+ const external_tooltip_cjs_namespaceObject = require("./tooltip.cjs");
35
+ const PasswordInput = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, variant, size, disabled, errorId, visible: visibleProp, defaultVisible = false, onVisibleChange, showLabel = 'Show password', hideLabel = 'Hide password', ...props }, ref)=>{
36
+ const [visibleState, setVisibleState] = external_react_namespaceObject.useState(defaultVisible);
37
+ const visible = visibleProp ?? visibleState;
38
+ const label = visible ? hideLabel : showLabel;
39
+ const toggle = ()=>{
40
+ setVisibleState(!visible);
41
+ onVisibleChange?.(!visible);
42
+ };
43
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
44
+ className: className,
45
+ variant: variant,
46
+ size: size,
47
+ disabled: disabled,
48
+ errorId: errorId,
49
+ children: [
50
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
51
+ ref: ref,
52
+ type: visible ? 'text' : 'password',
53
+ autoCapitalize: "off",
54
+ autoCorrect: "off",
55
+ spellCheck: false,
56
+ ...props
57
+ }),
58
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
59
+ align: "inline-end",
60
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipProvider, {
61
+ delayDuration: 300,
62
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
63
+ children: [
64
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
65
+ asChild: true,
66
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
67
+ icon: true,
68
+ size: 'xs' === size ? '4xs' : '3xs',
69
+ "aria-label": label,
70
+ "aria-pressed": visible,
71
+ "aria-controls": props.id,
72
+ onClick: toggle,
73
+ children: visible ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.EyeOff, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Eye, {})
74
+ })
75
+ }),
76
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipPortal, {
77
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
78
+ children: label
79
+ })
80
+ })
81
+ ]
82
+ })
83
+ })
84
+ })
85
+ ]
86
+ });
87
+ });
88
+ PasswordInput.displayName = 'PasswordInput';
89
+ exports.PasswordInput = __webpack_exports__.PasswordInput;
90
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
91
+ "PasswordInput"
92
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
93
+ Object.defineProperty(exports, '__esModule', {
94
+ value: true
95
+ });
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { type InputProps } from './input';
3
+ /** `className` styles the field box, not the inner `<input>`. */
4
+ export interface PasswordInputProps extends Omit<InputProps, 'type'> {
5
+ visible?: boolean;
6
+ defaultVisible?: boolean;
7
+ onVisibleChange?: (visible: boolean) => void;
8
+ /** Translated toggle label and tooltip while hidden. Use a different label for each field on the page. */
9
+ showLabel?: string;
10
+ /** Translated toggle label and tooltip while shown. */
11
+ hideLabel?: string;
12
+ }
13
+ declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
14
+ export { PasswordInput };
@@ -0,0 +1,61 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Eye, EyeOff } from "lucide-react";
3
+ import { forwardRef, useState } from "react";
4
+ import { Input } from "./input.js";
5
+ import { InputGroup, InputGroupAddon, InputGroupButton } from "./input-group.js";
6
+ import { Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger } from "./tooltip.js";
7
+ const PasswordInput = /*#__PURE__*/ forwardRef(({ className, variant, size, disabled, errorId, visible: visibleProp, defaultVisible = false, onVisibleChange, showLabel = 'Show password', hideLabel = 'Hide password', ...props }, ref)=>{
8
+ const [visibleState, setVisibleState] = useState(defaultVisible);
9
+ const visible = visibleProp ?? visibleState;
10
+ const label = visible ? hideLabel : showLabel;
11
+ const toggle = ()=>{
12
+ setVisibleState(!visible);
13
+ onVisibleChange?.(!visible);
14
+ };
15
+ return /*#__PURE__*/ jsxs(InputGroup, {
16
+ className: className,
17
+ variant: variant,
18
+ size: size,
19
+ disabled: disabled,
20
+ errorId: errorId,
21
+ children: [
22
+ /*#__PURE__*/ jsx(Input, {
23
+ ref: ref,
24
+ type: visible ? 'text' : 'password',
25
+ autoCapitalize: "off",
26
+ autoCorrect: "off",
27
+ spellCheck: false,
28
+ ...props
29
+ }),
30
+ /*#__PURE__*/ jsx(InputGroupAddon, {
31
+ align: "inline-end",
32
+ children: /*#__PURE__*/ jsx(TooltipProvider, {
33
+ delayDuration: 300,
34
+ children: /*#__PURE__*/ jsxs(Tooltip, {
35
+ children: [
36
+ /*#__PURE__*/ jsx(TooltipTrigger, {
37
+ asChild: true,
38
+ children: /*#__PURE__*/ jsx(InputGroupButton, {
39
+ icon: true,
40
+ size: 'xs' === size ? '4xs' : '3xs',
41
+ "aria-label": label,
42
+ "aria-pressed": visible,
43
+ "aria-controls": props.id,
44
+ onClick: toggle,
45
+ children: visible ? /*#__PURE__*/ jsx(EyeOff, {}) : /*#__PURE__*/ jsx(Eye, {})
46
+ })
47
+ }),
48
+ /*#__PURE__*/ jsx(TooltipPortal, {
49
+ children: /*#__PURE__*/ jsx(TooltipContent, {
50
+ children: label
51
+ })
52
+ })
53
+ ]
54
+ })
55
+ })
56
+ })
57
+ ]
58
+ });
59
+ });
60
+ PasswordInput.displayName = 'PasswordInput';
61
+ export { PasswordInput };
@@ -47,7 +47,7 @@ const TokenPillBase = ({ value, tokenType, onRemove, diffType, readonly, isInval
47
47
  onRemove: onRemove,
48
48
  removeLabel: strings.removeToken,
49
49
  readOnly: readonly,
50
- invalid: isInvalid && !diffType,
50
+ variant: isInvalid && !diffType ? 'invalid' : 'default',
51
51
  selected: isSelected,
52
52
  onMouseDown: onMouseDown,
53
53
  className: `${readonly ? 'cursor-default' : 'cursor-pointer'} ${'removed' === diffType ? 'line-through opacity-60' : ''}`,
@@ -19,7 +19,7 @@ const TokenPillBase = ({ value, tokenType, onRemove, diffType, readonly, isInval
19
19
  onRemove: onRemove,
20
20
  removeLabel: strings.removeToken,
21
21
  readOnly: readonly,
22
- invalid: isInvalid && !diffType,
22
+ variant: isInvalid && !diffType ? 'invalid' : 'default',
23
23
  selected: isSelected,
24
24
  onMouseDown: onMouseDown,
25
25
  className: `${readonly ? 'cursor-default' : 'cursor-pointer'} ${'removed' === diffType ? 'line-through opacity-60' : ''}`,
@@ -70,6 +70,12 @@ export declare const getPromptEditorTokenColors: () => {
70
70
  text: string;
71
71
  icon: string;
72
72
  };
73
+ warning: {
74
+ background: string;
75
+ border: string;
76
+ text: string;
77
+ icon: string;
78
+ };
73
79
  invalid: {
74
80
  background: string;
75
81
  border: string;
@@ -33,6 +33,12 @@ const getReferenceChipColors = ()=>({
33
33
  text: 'var(--color-info-text)',
34
34
  icon: 'var(--color-info-icon)'
35
35
  },
36
+ warning: {
37
+ background: 'var(--color-warning-background)',
38
+ border: 'var(--color-warning-icon)',
39
+ text: 'var(--color-warning-text)',
40
+ icon: 'var(--color-warning-icon)'
41
+ },
36
42
  invalid: {
37
43
  background: 'var(--color-error-background)',
38
44
  border: 'var(--color-error-icon)',
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Semantic look of a reference.
3
+ * - `default`: a valid reference. Uses the `valid` palette.
4
+ * - `warning`: valid but needs attention, such as a file variable no tool can read.
5
+ * - `invalid`: the reference doesn't resolve, such as a deleted or unknown variable.
6
+ */
7
+ export type ReferenceChipVariant = 'default' | 'warning' | 'invalid';
1
8
  /** Paired reference colors. Keep labels, icons and backgrounds on the same semantic palette. */
2
9
  export declare const getReferenceChipColors: () => {
3
10
  valid: {
@@ -6,6 +13,13 @@ export declare const getReferenceChipColors: () => {
6
13
  text: string;
7
14
  icon: string;
8
15
  };
16
+ /** A valid reference the host can't act on, such as a file variable no tool can read. */
17
+ warning: {
18
+ background: string;
19
+ border: string;
20
+ text: string;
21
+ icon: string;
22
+ };
9
23
  invalid: {
10
24
  background: string;
11
25
  border: string;
@@ -5,6 +5,12 @@ const getReferenceChipColors = ()=>({
5
5
  text: 'var(--color-info-text)',
6
6
  icon: 'var(--color-info-icon)'
7
7
  },
8
+ warning: {
9
+ background: 'var(--color-warning-background)',
10
+ border: 'var(--color-warning-icon)',
11
+ text: 'var(--color-warning-text)',
12
+ icon: 'var(--color-warning-icon)'
13
+ },
8
14
  invalid: {
9
15
  background: 'var(--color-error-background)',
10
16
  border: 'var(--color-error-icon)',
@@ -30,13 +30,15 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const external_react_namespaceObject = require("react");
31
31
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
32
32
  const external_reference_chip_colors_cjs_namespaceObject = require("./reference-chip-colors.cjs");
33
- const ReferenceChip = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ label, icon, onRemove, removeLabel, readOnly = false, disabled = false, invalid = false, selected = false, className, style, ...props }, ref)=>{
34
- const colors = (0, external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors)()[invalid ? 'invalid' : 'valid'];
33
+ const ReferenceChip = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ label, icon, onRemove, removeLabel, readOnly = false, disabled = false, variant: variantProp = 'default', invalid = false, selected = false, className, style, ...props }, ref)=>{
34
+ const variant = invalid ? 'invalid' : variantProp;
35
+ const colors = (0, external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors)()['default' === variant ? 'valid' : variant];
35
36
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
36
37
  ...props,
37
38
  ref: ref,
38
39
  "data-slot": "reference-chip",
39
- "data-invalid": invalid || void 0,
40
+ "data-variant": variant,
41
+ "data-invalid": 'invalid' === variant || void 0,
40
42
  "data-selected": selected || void 0,
41
43
  "aria-disabled": disabled || void 0,
42
44
  className: (0, index_cjs_namespaceObject.cn)('relative inline-flex max-w-full min-w-0 items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1', selected && 'z-10', disabled && 'opacity-50', className),
@@ -57,16 +59,13 @@ const ReferenceChip = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRe
57
59
  }),
58
60
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
59
61
  className: "min-w-0 truncate font-normal",
60
- style: {
61
- fontFamily: "'Noto Sans', sans-serif"
62
- },
63
62
  children: label
64
63
  }),
65
64
  onRemove && !readOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
66
65
  type: "button",
67
66
  disabled: disabled,
68
67
  "aria-label": removeLabel ?? ('string' == typeof label ? `Remove ${label}` : 'Remove'),
69
- className: "inline-flex shrink-0 items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4 text-inherit focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current disabled:cursor-default",
68
+ className: "inline-flex shrink-0 items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4 text-inherit enabled:hover:bg-current/10 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current disabled:cursor-default",
70
69
  onMouseDown: (event)=>{
71
70
  event.preventDefault();
72
71
  event.stopPropagation();
@@ -1,4 +1,5 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import { type ReferenceChipVariant } from './reference-chip-colors';
2
3
  export interface ReferenceChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
3
4
  /** Display name of the referenced variable, resource or connection. */
4
5
  label: ReactNode;
@@ -9,6 +10,8 @@ export interface ReferenceChipProps extends Omit<HTMLAttributes<HTMLSpanElement>
9
10
  removeLabel?: string;
10
11
  readOnly?: boolean;
11
12
  disabled?: boolean;
13
+ variant?: ReferenceChipVariant;
14
+ /** @deprecated Use `variant="invalid"`. Wins over `variant` when true. */
12
15
  invalid?: boolean;
13
16
  /** Visual selection only. The containing editor or picker owns selection semantics. */
14
17
  selected?: boolean;
@@ -2,13 +2,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { cn } from "../../lib/index.js";
4
4
  import { getReferenceChipColors } from "./reference-chip-colors.js";
5
- const ReferenceChip = /*#__PURE__*/ forwardRef(({ label, icon, onRemove, removeLabel, readOnly = false, disabled = false, invalid = false, selected = false, className, style, ...props }, ref)=>{
6
- const colors = getReferenceChipColors()[invalid ? 'invalid' : 'valid'];
5
+ const ReferenceChip = /*#__PURE__*/ forwardRef(({ label, icon, onRemove, removeLabel, readOnly = false, disabled = false, variant: variantProp = 'default', invalid = false, selected = false, className, style, ...props }, ref)=>{
6
+ const variant = invalid ? 'invalid' : variantProp;
7
+ const colors = getReferenceChipColors()['default' === variant ? 'valid' : variant];
7
8
  return /*#__PURE__*/ jsxs("span", {
8
9
  ...props,
9
10
  ref: ref,
10
11
  "data-slot": "reference-chip",
11
- "data-invalid": invalid || void 0,
12
+ "data-variant": variant,
13
+ "data-invalid": 'invalid' === variant || void 0,
12
14
  "data-selected": selected || void 0,
13
15
  "aria-disabled": disabled || void 0,
14
16
  className: cn('relative inline-flex max-w-full min-w-0 items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1', selected && 'z-10', disabled && 'opacity-50', className),
@@ -29,16 +31,13 @@ const ReferenceChip = /*#__PURE__*/ forwardRef(({ label, icon, onRemove, removeL
29
31
  }),
30
32
  /*#__PURE__*/ jsx("span", {
31
33
  className: "min-w-0 truncate font-normal",
32
- style: {
33
- fontFamily: "'Noto Sans', sans-serif"
34
- },
35
34
  children: label
36
35
  }),
37
36
  onRemove && !readOnly && /*#__PURE__*/ jsx("button", {
38
37
  type: "button",
39
38
  disabled: disabled,
40
39
  "aria-label": removeLabel ?? ('string' == typeof label ? `Remove ${label}` : 'Remove'),
41
- className: "inline-flex shrink-0 items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4 text-inherit focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current disabled:cursor-default",
40
+ className: "inline-flex shrink-0 items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4 text-inherit enabled:hover:bg-current/10 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current disabled:cursor-default",
42
41
  onMouseDown: (event)=>{
43
42
  event.preventDefault();
44
43
  event.stopPropagation();
@@ -230,7 +230,7 @@ function VariablePicker({ children, align = 'end', disabled = false, open: contr
230
230
  }),
231
231
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverContent, {
232
232
  align: align,
233
- className: (0, index_cjs_namespaceObject.cn)('w-[280px] max-w-[calc(100vw-1rem)] overflow-hidden p-0', className),
233
+ className: (0, index_cjs_namespaceObject.cn)('max-w-[calc(100vw-1rem)] overflow-hidden p-0', renderPicker ? 'w-auto' : 'w-[280px]', className),
234
234
  children: renderPicker ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VariablePickerSlot, {
235
235
  render: renderPicker,
236
236
  onSelect: (value)=>selectItem({
@@ -37,7 +37,8 @@ export interface VariablePickerProps extends VariablePickerContentProps {
37
37
  triggerAriaLabel?: string;
38
38
  /**
39
39
  * The host's own picker, rendered in the popover in place of the search and tree, whose `items`
40
- * it then does not use. A pick reaches `onSelect` as an entry made from the picked value.
40
+ * it then does not use. A pick reaches `onSelect` as an entry made from the picked value. The
41
+ * popover then sizes to the host picker, which sets its own width.
41
42
  */
42
43
  renderPicker?: RenderVariablePicker;
43
44
  }