@uipath/apollo-wind 2.52.3 → 2.53.1

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 (58) hide show
  1. package/dist/components/forms/field-renderer.cjs +42 -3
  2. package/dist/components/forms/field-renderer.js +42 -3
  3. package/dist/components/forms/string-list-field.cjs +3 -0
  4. package/dist/components/forms/string-list-field.js +3 -0
  5. package/dist/components/ui/button.cjs +1 -1
  6. package/dist/components/ui/button.js +1 -1
  7. package/dist/components/ui/checkbox.cjs +1 -1
  8. package/dist/components/ui/checkbox.js +1 -1
  9. package/dist/components/ui/combobox.cjs +70 -51
  10. package/dist/components/ui/combobox.d.ts +12 -0
  11. package/dist/components/ui/combobox.js +72 -53
  12. package/dist/components/ui/date-picker.cjs +102 -62
  13. package/dist/components/ui/date-picker.d.ts +28 -0
  14. package/dist/components/ui/date-picker.js +103 -63
  15. package/dist/components/ui/datetime-picker.cjs +90 -72
  16. package/dist/components/ui/datetime-picker.d.ts +12 -2
  17. package/dist/components/ui/datetime-picker.js +92 -74
  18. package/dist/components/ui/file-upload.cjs +21 -8
  19. package/dist/components/ui/file-upload.d.ts +7 -0
  20. package/dist/components/ui/file-upload.js +22 -9
  21. package/dist/components/ui/form-field.cjs +3 -3
  22. package/dist/components/ui/form-field.d.ts +11 -0
  23. package/dist/components/ui/form-field.js +3 -3
  24. package/dist/components/ui/index.cjs +16 -16
  25. package/dist/components/ui/input-group.cjs +0 -2
  26. package/dist/components/ui/input-group.d.ts +1 -1
  27. package/dist/components/ui/input-group.js +0 -2
  28. package/dist/components/ui/input.cjs +0 -2
  29. package/dist/components/ui/input.js +0 -2
  30. package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +1 -1
  31. package/dist/components/ui/lockable-value-field/lockable-value-field.js +1 -1
  32. package/dist/components/ui/multi-select.cjs +125 -112
  33. package/dist/components/ui/multi-select.d.ts +7 -0
  34. package/dist/components/ui/multi-select.js +126 -113
  35. package/dist/components/ui/prompt-editor/prompt-editor.cjs +0 -2
  36. package/dist/components/ui/prompt-editor/prompt-editor.js +0 -2
  37. package/dist/components/ui/radio-group.cjs +2 -2
  38. package/dist/components/ui/radio-group.js +2 -2
  39. package/dist/components/ui/search.cjs +3 -1
  40. package/dist/components/ui/search.d.ts +4 -0
  41. package/dist/components/ui/search.js +3 -1
  42. package/dist/components/ui/select.cjs +33 -12
  43. package/dist/components/ui/select.d.ts +10 -1
  44. package/dist/components/ui/select.js +35 -14
  45. package/dist/components/ui/slider.cjs +7 -2
  46. package/dist/components/ui/slider.js +7 -2
  47. package/dist/components/ui/switch.cjs +1 -1
  48. package/dist/components/ui/switch.js +1 -1
  49. package/dist/components/ui/textarea.cjs +30 -11
  50. package/dist/components/ui/textarea.d.ts +7 -0
  51. package/dist/components/ui/textarea.js +32 -13
  52. package/dist/components/ui/tooltip.cjs +1 -1
  53. package/dist/components/ui/tooltip.js +1 -1
  54. package/dist/index.cjs +4 -1
  55. package/dist/index.d.ts +5 -1
  56. package/dist/index.js +2 -2
  57. package/dist/styles.css +112 -24
  58. package/package.json +1 -1
@@ -1,14 +1,21 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { ChevronsUpDown, X } from "lucide-react";
3
- import { forwardRef, useState } from "react";
3
+ import { forwardRef, useId, useState } from "react";
4
4
  import { Badge } from "./badge.js";
5
5
  import { Button } from "./button.js";
6
6
  import { Checkbox } from "./checkbox.js";
7
7
  import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command.js";
8
8
  import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
9
9
  import { cn } from "../../lib/index.js";
10
- const MultiSelect = /*#__PURE__*/ forwardRef(({ id, options, selected, onChange, placeholder = 'Select items...', emptyMessage = 'No items found.', className, maxSelected, disabled = false, searchPlaceholder = 'Search...', clearAllText, onBlur, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref)=>{
10
+ import { FormFieldError } from "./form-field.js";
11
+ const MultiSelect = /*#__PURE__*/ forwardRef(({ id, options, selected, onChange, placeholder = 'Select items...', emptyMessage = 'No items found.', className, maxSelected, disabled = false, searchPlaceholder = 'Search...', clearAllText, onBlur, error, errorId, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref)=>{
11
12
  const [open, setOpen] = useState(false);
13
+ const generatedId = useId();
14
+ const validationId = errorId ?? `${id ?? `multi-select-${generatedId.replace(/:/g, '')}`}-error`;
15
+ const describedBy = [
16
+ ariaDescribedBy,
17
+ error ? validationId : void 0
18
+ ].filter(Boolean).join(' ');
12
19
  const handleUnselect = (value)=>{
13
20
  onChange(selected.filter((s)=>s !== value));
14
21
  };
@@ -25,129 +32,135 @@ const MultiSelect = /*#__PURE__*/ forwardRef(({ id, options, selected, onChange,
25
32
  const handleClearAll = ()=>{
26
33
  onChange([]);
27
34
  };
28
- return /*#__PURE__*/ jsx("div", {
35
+ return /*#__PURE__*/ jsxs("div", {
29
36
  ref: ref,
30
37
  "data-slot": "multi-select",
31
38
  className: cn('relative', className),
32
- children: /*#__PURE__*/ jsxs(Popover, {
33
- open: open,
34
- onOpenChange: (nextOpen)=>{
35
- setOpen(nextOpen);
36
- if (!nextOpen && open) onBlur?.();
37
- },
38
- children: [
39
- /*#__PURE__*/ jsx(PopoverTrigger, {
40
- asChild: true,
41
- children: /*#__PURE__*/ jsxs(Button, {
42
- id: id,
43
- variant: "outline",
44
- role: "combobox",
45
- "aria-expanded": open,
46
- "aria-invalid": ariaInvalid,
47
- "aria-describedby": ariaDescribedBy,
48
- "aria-errormessage": ariaErrorMessage,
49
- "aria-label": id ? void 0 : selected.length > 0 ? `${selected.length} ${1 === selected.length ? 'item' : 'items'} selected` : placeholder,
50
- className: cn('w-full justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:hover:bg-surface-hover future:font-normal future:text-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
51
- disabled: disabled,
39
+ children: [
40
+ /*#__PURE__*/ jsxs(Popover, {
41
+ open: open,
42
+ onOpenChange: (nextOpen)=>{
43
+ setOpen(nextOpen);
44
+ if (!nextOpen && open) onBlur?.();
45
+ },
46
+ children: [
47
+ /*#__PURE__*/ jsx(PopoverTrigger, {
48
+ asChild: true,
49
+ children: /*#__PURE__*/ jsxs(Button, {
50
+ id: id,
51
+ variant: "outline",
52
+ role: "combobox",
53
+ "aria-expanded": open,
54
+ "aria-invalid": error ? true : ariaInvalid,
55
+ "aria-describedby": describedBy || void 0,
56
+ "aria-errormessage": error ? validationId : ariaErrorMessage,
57
+ "aria-label": id ? void 0 : selected.length > 0 ? `${selected.length} ${1 === selected.length ? 'item' : 'items'} selected` : placeholder,
58
+ className: cn('w-full justify-between future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:hover:bg-surface-hover future:font-normal future:text-foreground future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', selected.length > 0 ? 'h-auto min-h-10' : 'h-10'),
59
+ disabled: disabled,
60
+ children: [
61
+ /*#__PURE__*/ jsx("div", {
62
+ className: "flex flex-wrap gap-1 flex-1",
63
+ children: 0 === selected.length ? /*#__PURE__*/ jsx("span", {
64
+ className: "text-foreground-muted",
65
+ children: placeholder
66
+ }) : selected.map((value)=>{
67
+ const option = options.find((opt)=>opt.value === value);
68
+ return /*#__PURE__*/ jsxs(Badge, {
69
+ variant: "secondary",
70
+ className: "mr-1 future:bg-surface-raised future:hover:bg-surface-raised",
71
+ onClick: (e)=>{
72
+ e.stopPropagation();
73
+ handleUnselect(value);
74
+ },
75
+ children: [
76
+ option?.label,
77
+ /*#__PURE__*/ jsx("button", {
78
+ type: "button",
79
+ "aria-label": `Remove ${option?.label}`,
80
+ className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer bg-transparent border-0 p-0 inline-flex items-center",
81
+ onMouseDown: (e)=>{
82
+ e.preventDefault();
83
+ e.stopPropagation();
84
+ },
85
+ onClick: (e)=>{
86
+ e.preventDefault();
87
+ e.stopPropagation();
88
+ handleUnselect(value);
89
+ },
90
+ children: /*#__PURE__*/ jsx(X, {
91
+ className: "h-3 w-3 text-muted-foreground hover:text-foreground"
92
+ })
93
+ })
94
+ ]
95
+ }, value);
96
+ })
97
+ }),
98
+ /*#__PURE__*/ jsx(ChevronsUpDown, {
99
+ className: "h-4 w-4 shrink-0 opacity-50"
100
+ })
101
+ ]
102
+ })
103
+ }),
104
+ /*#__PURE__*/ jsxs(PopoverContent, {
105
+ className: "w-[--radix-popover-trigger-width] p-0",
106
+ align: "start",
52
107
  children: [
53
- /*#__PURE__*/ jsx("div", {
54
- className: "flex flex-wrap gap-1 flex-1",
55
- children: 0 === selected.length ? /*#__PURE__*/ jsx("span", {
56
- className: "text-foreground-muted",
57
- children: placeholder
58
- }) : selected.map((value)=>{
59
- const option = options.find((opt)=>opt.value === value);
60
- return /*#__PURE__*/ jsxs(Badge, {
61
- variant: "secondary",
62
- className: "mr-1 future:bg-surface-raised future:hover:bg-surface-raised",
63
- onClick: (e)=>{
64
- e.stopPropagation();
65
- handleUnselect(value);
66
- },
108
+ /*#__PURE__*/ jsxs(Command, {
109
+ children: [
110
+ /*#__PURE__*/ jsx(CommandInput, {
111
+ placeholder: searchPlaceholder
112
+ }),
113
+ /*#__PURE__*/ jsxs(CommandList, {
67
114
  children: [
68
- option?.label,
69
- /*#__PURE__*/ jsx("button", {
70
- type: "button",
71
- "aria-label": `Remove ${option?.label}`,
72
- className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer bg-transparent border-0 p-0 inline-flex items-center",
73
- onMouseDown: (e)=>{
74
- e.preventDefault();
75
- e.stopPropagation();
76
- },
77
- onClick: (e)=>{
78
- e.preventDefault();
79
- e.stopPropagation();
80
- handleUnselect(value);
81
- },
82
- children: /*#__PURE__*/ jsx(X, {
83
- className: "h-3 w-3 text-muted-foreground hover:text-foreground"
115
+ /*#__PURE__*/ jsx(CommandEmpty, {
116
+ children: emptyMessage
117
+ }),
118
+ /*#__PURE__*/ jsx(CommandGroup, {
119
+ children: options.map((option)=>{
120
+ const isSelected = selected.includes(option.value);
121
+ const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
122
+ return /*#__PURE__*/ jsxs(CommandItem, {
123
+ onSelect: ()=>{
124
+ if (!isDisabled) handleSelect(option.value);
125
+ },
126
+ disabled: isDisabled,
127
+ className: cn('group', isDisabled && 'opacity-50 cursor-not-allowed'),
128
+ children: [
129
+ /*#__PURE__*/ jsx(Checkbox, {
130
+ checked: isSelected,
131
+ className: "mr-2 pointer-events-none group-hover:border-muted-foreground",
132
+ tabIndex: -1
133
+ }),
134
+ /*#__PURE__*/ jsx("span", {
135
+ children: option.label
136
+ })
137
+ ]
138
+ }, option.value);
84
139
  })
85
140
  })
86
141
  ]
87
- }, value);
88
- })
142
+ })
143
+ ]
89
144
  }),
90
- /*#__PURE__*/ jsx(ChevronsUpDown, {
91
- className: "h-4 w-4 shrink-0 opacity-50"
145
+ selected.length > 0 && /*#__PURE__*/ jsx("div", {
146
+ className: "border-t p-2",
147
+ children: /*#__PURE__*/ jsx(Button, {
148
+ variant: "ghost",
149
+ size: "sm",
150
+ className: "w-full",
151
+ onClick: handleClearAll,
152
+ children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
153
+ })
92
154
  })
93
155
  ]
94
156
  })
95
- }),
96
- /*#__PURE__*/ jsxs(PopoverContent, {
97
- className: "w-[--radix-popover-trigger-width] p-0",
98
- align: "start",
99
- children: [
100
- /*#__PURE__*/ jsxs(Command, {
101
- children: [
102
- /*#__PURE__*/ jsx(CommandInput, {
103
- placeholder: searchPlaceholder
104
- }),
105
- /*#__PURE__*/ jsxs(CommandList, {
106
- children: [
107
- /*#__PURE__*/ jsx(CommandEmpty, {
108
- children: emptyMessage
109
- }),
110
- /*#__PURE__*/ jsx(CommandGroup, {
111
- children: options.map((option)=>{
112
- const isSelected = selected.includes(option.value);
113
- const isDisabled = void 0 !== maxSelected && selected.length >= maxSelected && !isSelected;
114
- return /*#__PURE__*/ jsxs(CommandItem, {
115
- onSelect: ()=>{
116
- if (!isDisabled) handleSelect(option.value);
117
- },
118
- disabled: isDisabled,
119
- className: cn('group', isDisabled && 'opacity-50 cursor-not-allowed'),
120
- children: [
121
- /*#__PURE__*/ jsx(Checkbox, {
122
- checked: isSelected,
123
- className: "mr-2 pointer-events-none group-hover:border-muted-foreground",
124
- tabIndex: -1
125
- }),
126
- /*#__PURE__*/ jsx("span", {
127
- children: option.label
128
- })
129
- ]
130
- }, option.value);
131
- })
132
- })
133
- ]
134
- })
135
- ]
136
- }),
137
- selected.length > 0 && /*#__PURE__*/ jsx("div", {
138
- className: "border-t p-2",
139
- children: /*#__PURE__*/ jsx(Button, {
140
- variant: "ghost",
141
- size: "sm",
142
- className: "w-full",
143
- onClick: handleClearAll,
144
- children: 'function' == typeof clearAllText ? clearAllText(selected.length) : clearAllText || `Clear all (${selected.length})`
145
- })
146
- })
147
- ]
148
- })
149
- ]
150
- })
157
+ ]
158
+ }),
159
+ /*#__PURE__*/ jsx(FormFieldError, {
160
+ id: validationId,
161
+ children: error
162
+ })
163
+ ]
151
164
  });
152
165
  });
153
166
  MultiSelect.displayName = 'MultiSelect';
@@ -529,8 +529,6 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
529
529
  }),
530
530
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
531
531
  id: errorId,
532
- "data-slot": "prompt-editor-error",
533
- className: "mt-1",
534
532
  children: error
535
533
  })
536
534
  ]
@@ -501,8 +501,6 @@ const PromptEditor = ({ value: rawValue, initialValue: rawInitialValue, onChange
501
501
  }),
502
502
  /*#__PURE__*/ jsx(FormFieldError, {
503
503
  id: errorId,
504
- "data-slot": "prompt-editor-error",
505
- className: "mt-1",
506
504
  children: error
507
505
  })
508
506
  ]
@@ -34,7 +34,7 @@ const external_react_namespaceObject = require("react");
34
34
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
35
35
  const RadioGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Root, {
36
36
  "data-slot": "radio-group",
37
- className: (0, index_cjs_namespaceObject.cn)('grid gap-2', className),
37
+ className: (0, index_cjs_namespaceObject.cn)('group/radio-group grid gap-2', className),
38
38
  ...props,
39
39
  ref: ref
40
40
  }));
@@ -42,7 +42,7 @@ RadioGroup.displayName = react_radio_group_namespaceObject.Root.displayName;
42
42
  const RadioGroupItem = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Item, {
43
43
  ref: ref,
44
44
  "data-slot": "radio-group-item",
45
- className: (0, index_cjs_namespaceObject.cn)('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted', className),
45
+ className: (0, index_cjs_namespaceObject.cn)('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 group-aria-invalid/radio-group:border-error group-aria-invalid/radio-group:focus-visible:ring-error', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted future:group-aria-invalid/radio-group:border-error', 'future:group-aria-invalid/radio-group:hover:border-error future:group-aria-invalid/radio-group:data-[state=checked]:border-error', className),
46
46
  ...props,
47
47
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Indicator, {
48
48
  className: "flex items-center justify-center",
@@ -5,7 +5,7 @@ import { forwardRef } from "react";
5
5
  import { cn } from "../../lib/index.js";
6
6
  const RadioGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Root, {
7
7
  "data-slot": "radio-group",
8
- className: cn('grid gap-2', className),
8
+ className: cn('group/radio-group grid gap-2', className),
9
9
  ...props,
10
10
  ref: ref
11
11
  }));
@@ -13,7 +13,7 @@ RadioGroup.displayName = Root.displayName;
13
13
  const RadioGroupItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Item, {
14
14
  ref: ref,
15
15
  "data-slot": "radio-group-item",
16
- className: cn('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted', className),
16
+ className: cn('aspect-square h-4 w-4 cursor-pointer rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 group-aria-invalid/radio-group:border-error group-aria-invalid/radio-group:focus-visible:ring-error', 'future:border-border future:text-foreground future:hover:border-border-hover future:data-[state=checked]:border-foreground-muted future:group-aria-invalid/radio-group:border-error', 'future:group-aria-invalid/radio-group:hover:border-error future:group-aria-invalid/radio-group:data-[state=checked]:border-error', className),
17
17
  ...props,
18
18
  children: /*#__PURE__*/ jsx(Indicator, {
19
19
  className: "flex items-center justify-center",
@@ -34,7 +34,7 @@ const external_command_cjs_namespaceObject = require("./command.cjs");
34
34
  const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
35
35
  const external_popover_cjs_namespaceObject = require("./popover.cjs");
36
36
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
37
- const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, ...props }, ref)=>{
37
+ const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, error, errorId, ...props }, ref)=>{
38
38
  const handleClear = ()=>{
39
39
  onChange?.('');
40
40
  onClear?.();
@@ -43,6 +43,8 @@ const Search = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classN
43
43
  "data-slot": "search",
44
44
  variant: variant,
45
45
  size: size,
46
+ error: error,
47
+ errorId: errorId,
46
48
  children: [
47
49
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
48
50
  align: "inline-start",
@@ -7,6 +7,10 @@ export interface SearchProps extends Omit<InputGroupInputProps, 'onChange'> {
7
7
  showClearButton?: boolean;
8
8
  variant?: InputGroupProps['variant'];
9
9
  size?: InputGroupProps['size'];
10
+ /** Field-specific feedback rendered immediately below the search field. */
11
+ error?: React.ReactNode;
12
+ /** Optional id for the inline validation message. */
13
+ errorId?: string;
10
14
  }
11
15
  declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLInputElement>>;
12
16
  export interface SearchWithSuggestionsProps {
@@ -5,7 +5,7 @@ import { Command, CommandEmpty, CommandGroup, CommandItem, CommandList } from ".
5
5
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
6
6
  import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
7
7
  import { cn } from "../../lib/index.js";
8
- const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, ...props }, ref)=>{
8
+ const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, onClear, showClearButton = true, variant, size, error, errorId, ...props }, ref)=>{
9
9
  const handleClear = ()=>{
10
10
  onChange?.('');
11
11
  onClear?.();
@@ -14,6 +14,8 @@ const search_Search = /*#__PURE__*/ forwardRef(({ className, value, onChange, on
14
14
  "data-slot": "search",
15
15
  variant: variant,
16
16
  size: size,
17
+ error: error,
18
+ errorId: errorId,
17
19
  children: [
18
20
  /*#__PURE__*/ jsx(InputGroupAddon, {
19
21
  align: "inline-start",
@@ -42,6 +42,7 @@ const external_lucide_react_namespaceObject = require("lucide-react");
42
42
  const external_react_namespaceObject = require("react");
43
43
  const external_portal_container_cjs_namespaceObject = require("./portal-container.cjs");
44
44
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
45
+ const external_form_field_cjs_namespaceObject = require("./form-field.cjs");
45
46
  const Select = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.Root, {
46
47
  "data-slot": "select",
47
48
  ...props
@@ -59,21 +60,41 @@ const SelectValue = /*#__PURE__*/ external_react_namespaceObject.forwardRef((pro
59
60
  ...props
60
61
  }));
61
62
  SelectValue.displayName = react_select_namespaceObject.Value.displayName;
62
- const SelectTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_select_namespaceObject.Trigger, {
63
- ref: ref,
64
- "data-slot": "select-trigger",
65
- className: (0, index_cjs_namespaceObject.cn)('flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-1 text-base transition-colors data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&>span]:line-clamp-1 future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:px-4 future:gap-4 future:font-normal aria-invalid:border-error aria-invalid:focus-visible:ring-error future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
66
- ...props,
63
+ const SelectTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, children, error, errorId, id, ...props }, ref)=>{
64
+ const generatedId = external_react_namespaceObject.useId();
65
+ const validationId = errorId ?? `${id ?? `select-${generatedId.replace(/:/g, '')}`}-error`;
66
+ const describedBy = [
67
+ ariaDescribedBy,
68
+ error ? validationId : void 0
69
+ ].filter(Boolean).join(' ');
70
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
67
71
  children: [
68
- children,
69
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.Icon, {
70
- asChild: true,
71
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
72
- className: "h-4 w-4 opacity-50"
73
- })
72
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_select_namespaceObject.Trigger, {
73
+ ref: ref,
74
+ id: id,
75
+ "data-slot": "select-trigger",
76
+ "aria-describedby": describedBy || void 0,
77
+ "aria-errormessage": error ? validationId : ariaErrorMessage,
78
+ "aria-invalid": error ? true : ariaInvalid,
79
+ className: (0, index_cjs_namespaceObject.cn)('flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-1 text-base transition-colors data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&>span]:line-clamp-1 future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:px-4 future:gap-4 future:font-normal aria-invalid:border-error aria-invalid:focus-visible:ring-error future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
80
+ ...props,
81
+ children: [
82
+ children,
83
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.Icon, {
84
+ asChild: true,
85
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
86
+ className: "h-4 w-4 opacity-50"
87
+ })
88
+ })
89
+ ]
90
+ }),
91
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
92
+ id: validationId,
93
+ children: error
74
94
  })
75
95
  ]
76
- }));
96
+ });
97
+ });
77
98
  SelectTrigger.displayName = react_select_namespaceObject.Trigger.displayName;
78
99
  const SelectScrollUpButton = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_select_namespaceObject.ScrollUpButton, {
79
100
  ref: ref,
@@ -7,7 +7,16 @@ declare const Select: {
7
7
  };
8
8
  declare const SelectGroup: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
9
  declare const SelectValue: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
10
- declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
+ export interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
11
+ /**
12
+ * Field-specific feedback rendered immediately below the trigger.
13
+ * Keep the message focused on what went wrong and how to resolve it.
14
+ */
15
+ error?: React.ReactNode;
16
+ /** Optional id for the inline validation message. */
17
+ errorId?: string;
18
+ }
19
+ declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
11
20
  declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
21
  declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
22
  declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
@@ -1,10 +1,11 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Content, Group, Icon, Item, ItemIndicator, ItemText, Label, Portal, Root, ScrollDownButton, ScrollUpButton, Separator, Trigger, Value, Viewport } from "@radix-ui/react-select";
4
4
  import { Check, ChevronDown, ChevronUp } from "lucide-react";
5
- import { forwardRef } from "react";
5
+ import { forwardRef, useId } from "react";
6
6
  import { useResolvedPortalContainer } from "./portal-container.js";
7
7
  import { cn } from "../../lib/index.js";
8
+ import { FormFieldError } from "./form-field.js";
8
9
  const Select = (props)=>/*#__PURE__*/ jsx(Root, {
9
10
  "data-slot": "select",
10
11
  ...props
@@ -22,21 +23,41 @@ const SelectValue = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Val
22
23
  ...props
23
24
  }));
24
25
  SelectValue.displayName = Value.displayName;
25
- const SelectTrigger = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsxs(Trigger, {
26
- ref: ref,
27
- "data-slot": "select-trigger",
28
- className: cn('flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-1 text-base transition-colors data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&>span]:line-clamp-1 future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:px-4 future:gap-4 future:font-normal aria-invalid:border-error aria-invalid:focus-visible:ring-error future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
29
- ...props,
26
+ const SelectTrigger = /*#__PURE__*/ forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, children, error, errorId, id, ...props }, ref)=>{
27
+ const generatedId = useId();
28
+ const validationId = errorId ?? `${id ?? `select-${generatedId.replace(/:/g, '')}`}-error`;
29
+ const describedBy = [
30
+ ariaDescribedBy,
31
+ error ? validationId : void 0
32
+ ].filter(Boolean).join(' ');
33
+ return /*#__PURE__*/ jsxs(Fragment, {
30
34
  children: [
31
- children,
32
- /*#__PURE__*/ jsx(Icon, {
33
- asChild: true,
34
- children: /*#__PURE__*/ jsx(ChevronDown, {
35
- className: "h-4 w-4 opacity-50"
36
- })
35
+ /*#__PURE__*/ jsxs(Trigger, {
36
+ ref: ref,
37
+ id: id,
38
+ "data-slot": "select-trigger",
39
+ "aria-describedby": describedBy || void 0,
40
+ "aria-errormessage": error ? validationId : ariaErrorMessage,
41
+ "aria-invalid": error ? true : ariaInvalid,
42
+ className: cn('flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-transparent px-3 py-1 text-base transition-colors data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&>span]:line-clamp-1 future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:hover:bg-surface-hover future:px-4 future:gap-4 future:font-normal aria-invalid:border-error aria-invalid:focus-visible:ring-error future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
43
+ ...props,
44
+ children: [
45
+ children,
46
+ /*#__PURE__*/ jsx(Icon, {
47
+ asChild: true,
48
+ children: /*#__PURE__*/ jsx(ChevronDown, {
49
+ className: "h-4 w-4 opacity-50"
50
+ })
51
+ })
52
+ ]
53
+ }),
54
+ /*#__PURE__*/ jsx(FormFieldError, {
55
+ id: validationId,
56
+ children: error
37
57
  })
38
58
  ]
39
- }));
59
+ });
60
+ });
40
61
  SelectTrigger.displayName = Trigger.displayName;
41
62
  const SelectScrollUpButton = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollUpButton, {
42
63
  ref: ref,
@@ -30,7 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const react_slider_namespaceObject = require("@radix-ui/react-slider");
31
31
  const external_react_namespaceObject = require("react");
32
32
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
33
- const Slider = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, defaultValue, value, ...props }, ref)=>{
33
+ const Slider = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, defaultValue, value, 'aria-label': ariaLabel, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-labelledby': ariaLabelledBy, ...props }, ref)=>{
34
34
  const thumbCount = value?.length ?? defaultValue?.length ?? 1;
35
35
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_slider_namespaceObject.Root, {
36
36
  ref: ref,
@@ -49,7 +49,12 @@ const Slider = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classN
49
49
  Array.from({
50
50
  length: thumbCount
51
51
  }).map((_, i)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_slider_namespaceObject.Thumb, {
52
- className: "block h-5 w-5 cursor-pointer rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
52
+ "aria-label": ariaLabel,
53
+ "aria-invalid": ariaInvalid,
54
+ "aria-describedby": ariaDescribedBy,
55
+ "aria-errormessage": ariaErrorMessage,
56
+ "aria-labelledby": ariaLabelledBy,
57
+ className: "block h-5 w-5 cursor-pointer rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error"
53
58
  }, i))
54
59
  ]
55
60
  });
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Range, Root, Thumb, Track } from "@radix-ui/react-slider";
3
3
  import { forwardRef } from "react";
4
4
  import { cn } from "../../lib/index.js";
5
- const Slider = /*#__PURE__*/ forwardRef(({ className, defaultValue, value, ...props }, ref)=>{
5
+ const Slider = /*#__PURE__*/ forwardRef(({ className, defaultValue, value, 'aria-label': ariaLabel, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-labelledby': ariaLabelledBy, ...props }, ref)=>{
6
6
  const thumbCount = value?.length ?? defaultValue?.length ?? 1;
7
7
  return /*#__PURE__*/ jsxs(Root, {
8
8
  ref: ref,
@@ -21,7 +21,12 @@ const Slider = /*#__PURE__*/ forwardRef(({ className, defaultValue, value, ...pr
21
21
  Array.from({
22
22
  length: thumbCount
23
23
  }).map((_, i)=>/*#__PURE__*/ jsx(Thumb, {
24
- className: "block h-5 w-5 cursor-pointer rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
24
+ "aria-label": ariaLabel,
25
+ "aria-invalid": ariaInvalid,
26
+ "aria-describedby": ariaDescribedBy,
27
+ "aria-errormessage": ariaErrorMessage,
28
+ "aria-labelledby": ariaLabelledBy,
29
+ className: "block h-5 w-5 cursor-pointer rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error"
25
30
  }, i))
26
31
  ]
27
32
  });
@@ -32,7 +32,7 @@ const react_switch_namespaceObject = require("@radix-ui/react-switch");
32
32
  const external_class_variance_authority_namespaceObject = require("class-variance-authority");
33
33
  const external_react_namespaceObject = require("react");
34
34
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
35
- const switchVariants = (0, external_class_variance_authority_namespaceObject.cva)('peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border', {
35
+ const switchVariants = (0, external_class_variance_authority_namespaceObject.cva)('peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border aria-invalid:border-error aria-invalid:focus-visible:ring-error', {
36
36
  variants: {
37
37
  size: {
38
38
  default: 'h-6 w-11',
@@ -3,7 +3,7 @@ import { Root, Thumb } from "@radix-ui/react-switch";
3
3
  import { cva } from "class-variance-authority";
4
4
  import { forwardRef } from "react";
5
5
  import { cn } from "../../lib/index.js";
6
- const switchVariants = cva('peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border', {
6
+ const switchVariants = cva('peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-border aria-invalid:border-error aria-invalid:focus-visible:ring-error', {
7
7
  variants: {
8
8
  size: {
9
9
  default: 'h-6 w-11',