@uipath/apollo-wind 2.52.3 → 2.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/forms/field-renderer.cjs +42 -3
- package/dist/components/forms/field-renderer.js +42 -3
- package/dist/components/forms/string-list-field.cjs +3 -0
- package/dist/components/forms/string-list-field.js +3 -0
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.cjs +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.cjs +70 -51
- package/dist/components/ui/combobox.d.ts +12 -0
- package/dist/components/ui/combobox.js +72 -53
- package/dist/components/ui/date-picker.cjs +102 -62
- package/dist/components/ui/date-picker.d.ts +28 -0
- package/dist/components/ui/date-picker.js +103 -63
- package/dist/components/ui/datetime-picker.cjs +90 -72
- package/dist/components/ui/datetime-picker.d.ts +12 -2
- package/dist/components/ui/datetime-picker.js +92 -74
- package/dist/components/ui/file-upload.cjs +21 -8
- package/dist/components/ui/file-upload.d.ts +7 -0
- package/dist/components/ui/file-upload.js +22 -9
- package/dist/components/ui/form-field.cjs +3 -3
- package/dist/components/ui/form-field.d.ts +11 -0
- package/dist/components/ui/form-field.js +3 -3
- package/dist/components/ui/index.cjs +26 -26
- package/dist/components/ui/input-group.cjs +0 -2
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +0 -2
- package/dist/components/ui/input.cjs +0 -2
- package/dist/components/ui/input.js +0 -2
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +1 -1
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +1 -1
- package/dist/components/ui/multi-select.cjs +125 -112
- package/dist/components/ui/multi-select.d.ts +7 -0
- package/dist/components/ui/multi-select.js +126 -113
- package/dist/components/ui/prompt-editor/prompt-editor.cjs +0 -2
- package/dist/components/ui/prompt-editor/prompt-editor.js +0 -2
- package/dist/components/ui/radio-group.cjs +2 -2
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/search.cjs +3 -1
- package/dist/components/ui/search.d.ts +4 -0
- package/dist/components/ui/search.js +3 -1
- package/dist/components/ui/select.cjs +33 -12
- package/dist/components/ui/select.d.ts +10 -1
- package/dist/components/ui/select.js +35 -14
- package/dist/components/ui/slider.cjs +7 -2
- package/dist/components/ui/slider.js +7 -2
- package/dist/components/ui/switch.cjs +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/textarea.cjs +30 -11
- package/dist/components/ui/textarea.d.ts +7 -0
- package/dist/components/ui/textarea.js +32 -13
- package/dist/index.cjs +4 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2 -2
- package/dist/styles.css +74 -0
- 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
|
-
|
|
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__*/
|
|
35
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
29
36
|
ref: ref,
|
|
30
37
|
"data-slot": "multi-select",
|
|
31
38
|
className: cn('relative', className),
|
|
32
|
-
children:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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__*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
}
|
|
88
|
-
|
|
142
|
+
})
|
|
143
|
+
]
|
|
89
144
|
}),
|
|
90
|
-
/*#__PURE__*/ jsx(
|
|
91
|
-
className: "
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
]
|
|
@@ -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)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
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)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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',
|