@uipath/apollo-wind 2.36.2 → 2.37.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 (35) hide show
  1. package/dist/components/forms/field-renderer.cjs +2 -3
  2. package/dist/components/forms/field-renderer.js +3 -4
  3. package/dist/components/forms/form-designer.cjs +2 -3
  4. package/dist/components/forms/form-designer.js +3 -4
  5. package/dist/components/ui/file-upload.cjs +8 -2
  6. package/dist/components/ui/file-upload.d.ts +3 -0
  7. package/dist/components/ui/file-upload.js +8 -2
  8. package/dist/components/ui/index.cjs +12 -12
  9. package/dist/components/ui/input-group.cjs +59 -15
  10. package/dist/components/ui/input-group.d.ts +5 -1
  11. package/dist/components/ui/input-group.js +61 -17
  12. package/dist/components/ui/input.cjs +31 -7
  13. package/dist/components/ui/input.d.ts +7 -0
  14. package/dist/components/ui/input.js +33 -9
  15. package/dist/components/ui/label.cjs +20 -1
  16. package/dist/components/ui/label.d.ts +15 -1
  17. package/dist/components/ui/label.js +18 -2
  18. package/dist/components/ui/lockable-value-field/components/field-header.cjs +1 -4
  19. package/dist/components/ui/lockable-value-field/components/field-header.js +2 -5
  20. package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +38 -5
  21. package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +1 -1
  22. package/dist/components/ui/lockable-value-field/lockable-value-field.js +38 -5
  23. package/dist/components/ui/lockable-value-field/types.d.ts +9 -1
  24. package/dist/components/ui/multi-select.cjs +4 -1
  25. package/dist/components/ui/multi-select.d.ts +3 -0
  26. package/dist/components/ui/multi-select.js +4 -1
  27. package/dist/components/ui/prompt-editor/components/MarkdownPreview.cjs +2 -2
  28. package/dist/components/ui/prompt-editor/components/MarkdownPreview.js +2 -2
  29. package/dist/components/ui/prompt-editor/types.cjs +5 -5
  30. package/dist/components/ui/prompt-editor/types.js +5 -5
  31. package/dist/index.cjs +3 -0
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.js +2 -2
  34. package/dist/styles.css +87 -6
  35. package/package.json +1 -1
@@ -544,9 +544,8 @@ function FormLabel({ children, required, htmlFor, className = '' }) {
544
544
  className: className,
545
545
  children: [
546
546
  children,
547
- required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
548
- className: "text-destructive ml-1",
549
- children: "*"
547
+ required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(label_cjs_namespaceObject.RequiredIndicator, {
548
+ className: "ml-1"
550
549
  })
551
550
  ]
552
551
  });
@@ -12,7 +12,7 @@ import { Checkbox } from "../ui/checkbox.js";
12
12
  import { Switch } from "../ui/switch.js";
13
13
  import { RadioGroup, RadioGroupItem } from "../ui/radio-group.js";
14
14
  import { Slider } from "../ui/slider.js";
15
- import { Label } from "../ui/label.js";
15
+ import { Label, RequiredIndicator } from "../ui/label.js";
16
16
  import { DatePicker } from "../ui/date-picker.js";
17
17
  import { DateTimePicker } from "../ui/datetime-picker.js";
18
18
  import { FileUpload } from "../ui/file-upload.js";
@@ -516,9 +516,8 @@ function FormLabel({ children, required, htmlFor, className = '' }) {
516
516
  className: className,
517
517
  children: [
518
518
  children,
519
- required && /*#__PURE__*/ jsx("span", {
520
- className: "text-destructive ml-1",
521
- children: "*"
519
+ required && /*#__PURE__*/ jsx(RequiredIndicator, {
520
+ className: "ml-1"
522
521
  })
523
522
  ]
524
523
  });
@@ -1172,9 +1172,8 @@ function FormDesigner() {
1172
1172
  className: "text-xs font-medium truncate",
1173
1173
  children: field.label
1174
1174
  }),
1175
- field.rules?.some((r)=>r.effects.required) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
1176
- className: "text-[10px] text-destructive",
1177
- children: "*"
1175
+ field.rules?.some((r)=>r.effects.required) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(label_cjs_namespaceObject.RequiredIndicator, {
1176
+ className: "ml-0 text-[10px]"
1178
1177
  })
1179
1178
  ]
1180
1179
  }),
@@ -4,7 +4,7 @@ import { schemaToJson } from "./schema-serializer.js";
4
4
  import { MetadataForm } from "./metadata-form.js";
5
5
  import { Button } from "../ui/button.js";
6
6
  import { Input } from "../ui/input.js";
7
- import { Label } from "../ui/label.js";
7
+ import { Label, RequiredIndicator } from "../ui/label.js";
8
8
  import { Textarea } from "../ui/textarea.js";
9
9
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select.js";
10
10
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../ui/card.js";
@@ -1144,9 +1144,8 @@ function FormDesigner() {
1144
1144
  className: "text-xs font-medium truncate",
1145
1145
  children: field.label
1146
1146
  }),
1147
- field.rules?.some((r)=>r.effects.required) && /*#__PURE__*/ jsx("span", {
1148
- className: "text-[10px] text-destructive",
1149
- children: "*"
1147
+ field.rules?.some((r)=>r.effects.required) && /*#__PURE__*/ jsx(RequiredIndicator, {
1148
+ className: "ml-0 text-[10px]"
1150
1149
  })
1151
1150
  ]
1152
1151
  }),
@@ -32,7 +32,7 @@ const external_lucide_react_namespaceObject = require("lucide-react");
32
32
  const external_react_namespaceObject = require("react");
33
33
  const external_button_cjs_namespaceObject = require("./button.cjs");
34
34
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
35
- const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ id, ariaLabel, onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors, onBlur }, ref) {
35
+ const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ id, ariaLabel, onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors, onBlur, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
36
36
  const [files, setFiles] = external_react_namespaceObject.useState([]);
37
37
  const [isDragging, setIsDragging] = external_react_namespaceObject.useState(false);
38
38
  const [fileErrors, setFileErrors] = external_react_namespaceObject.useState(new Map());
@@ -177,12 +177,18 @@ const file_upload_FileUpload = /*#__PURE__*/ external_react_namespaceObject.forw
177
177
  multiple: multiple,
178
178
  disabled: disabled,
179
179
  onChange: handleInputChange,
180
- "aria-label": id ? void 0 : ariaLabel ?? 'File upload'
180
+ "aria-label": id ? void 0 : ariaLabel ?? 'File upload',
181
+ "aria-invalid": ariaInvalid,
182
+ "aria-describedby": ariaDescribedBy,
183
+ "aria-errormessage": ariaErrorMessage
181
184
  }),
182
185
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
183
186
  role: "button",
184
187
  "aria-label": ariaLabel ?? 'File upload area',
185
188
  "aria-disabled": disabled,
189
+ "aria-invalid": ariaInvalid,
190
+ "aria-describedby": ariaDescribedBy,
191
+ "aria-errormessage": ariaErrorMessage,
186
192
  tabIndex: disabled ? -1 : 0,
187
193
  className: (0, index_cjs_namespaceObject.cn)('relative flex flex-col items-center justify-center w-full h-32 px-4 py-6 border-2 border-dashed rounded-lg cursor-pointer transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background', 'future:rounded-xl', isDragging ? 'border-primary bg-primary/5' : 'border-input bg-background hover:bg-accent/50 future:border-border future:bg-surface-raised future:hover:bg-surface-overlay', disabled && 'opacity-50 cursor-not-allowed hover:bg-background future:hover:bg-surface-raised'),
188
194
  onDragEnter: handleDragEnter,
@@ -26,5 +26,8 @@ export interface FileUploadProps {
26
26
  /** External errors keyed by filename. Use this to set errors from outside (e.g., upload failures). */
27
27
  errors?: Record<string, string>;
28
28
  onBlur?: React.FocusEventHandler<HTMLFieldSetElement>;
29
+ 'aria-invalid'?: React.AriaAttributes['aria-invalid'];
30
+ 'aria-describedby'?: string;
31
+ 'aria-errormessage'?: string;
29
32
  }
30
33
  export declare const FileUpload: React.ForwardRefExoticComponent<FileUploadProps & React.RefAttributes<HTMLFieldSetElement>>;
@@ -4,7 +4,7 @@ import { Upload, X } from "lucide-react";
4
4
  import { forwardRef, useRef, useState } from "react";
5
5
  import { Button } from "./button.js";
6
6
  import { cn } from "../../lib/index.js";
7
- const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel, onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors, onBlur }, ref) {
7
+ const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel, onFilesChange, accept, multiple = false, disabled = false, maxSize, className, showPreview = false, errors, onBlur, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
8
8
  const [files, setFiles] = useState([]);
9
9
  const [isDragging, setIsDragging] = useState(false);
10
10
  const [fileErrors, setFileErrors] = useState(new Map());
@@ -149,12 +149,18 @@ const file_upload_FileUpload = /*#__PURE__*/ forwardRef(function({ id, ariaLabel
149
149
  multiple: multiple,
150
150
  disabled: disabled,
151
151
  onChange: handleInputChange,
152
- "aria-label": id ? void 0 : ariaLabel ?? 'File upload'
152
+ "aria-label": id ? void 0 : ariaLabel ?? 'File upload',
153
+ "aria-invalid": ariaInvalid,
154
+ "aria-describedby": ariaDescribedBy,
155
+ "aria-errormessage": ariaErrorMessage
153
156
  }),
154
157
  /*#__PURE__*/ jsxs("div", {
155
158
  role: "button",
156
159
  "aria-label": ariaLabel ?? 'File upload area',
157
160
  "aria-disabled": disabled,
161
+ "aria-invalid": ariaInvalid,
162
+ "aria-describedby": ariaDescribedBy,
163
+ "aria-errormessage": ariaErrorMessage,
158
164
  tabIndex: disabled ? -1 : 0,
159
165
  className: cn('relative flex flex-col items-center justify-center w-full h-32 px-4 py-6 border-2 border-dashed rounded-lg cursor-pointer transition-colors', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background', 'future:rounded-xl', isDragging ? 'border-primary bg-primary/5' : 'border-input bg-background hover:bg-accent/50 future:border-border future:bg-surface-raised future:hover:bg-surface-overlay', disabled && 'opacity-50 cursor-not-allowed hover:bg-background future:hover:bg-surface-raised'),
160
166
  onDragEnter: handleDragEnter,
@@ -60,7 +60,7 @@ var __webpack_modules__ = {
60
60
  "./datetime-picker" (module) {
61
61
  module.exports = require("./datetime-picker.cjs");
62
62
  },
63
- "./dialog" (module) {
63
+ "@/components/ui/dialog" (module) {
64
64
  module.exports = require("./dialog.cjs");
65
65
  },
66
66
  "./drawer" (module) {
@@ -69,7 +69,7 @@ var __webpack_modules__ = {
69
69
  "@/components/ui/dropdown-menu" (module) {
70
70
  module.exports = require("./dropdown-menu.cjs");
71
71
  },
72
- "@/components/ui/editable-cell" (module) {
72
+ "./editable-cell" (module) {
73
73
  module.exports = require("./editable-cell.cjs");
74
74
  },
75
75
  "./empty-state" (module) {
@@ -87,7 +87,7 @@ var __webpack_modules__ = {
87
87
  "@/components/ui/input" (module) {
88
88
  module.exports = require("./input.cjs");
89
89
  },
90
- "@/components/ui/label" (module) {
90
+ "./label" (module) {
91
91
  module.exports = require("./label.cjs");
92
92
  },
93
93
  "./layout" (module) {
@@ -156,19 +156,19 @@ var __webpack_modules__ = {
156
156
  "./switch" (module) {
157
157
  module.exports = require("./switch.cjs");
158
158
  },
159
- "@/components/ui/table" (module) {
159
+ "./table" (module) {
160
160
  module.exports = require("./table.cjs");
161
161
  },
162
162
  "./tabs" (module) {
163
163
  module.exports = require("./tabs.cjs");
164
164
  },
165
- "./textarea" (module) {
165
+ "@/components/ui/textarea" (module) {
166
166
  module.exports = require("./textarea.cjs");
167
167
  },
168
168
  "./toggle-group" (module) {
169
169
  module.exports = require("./toggle-group.cjs");
170
170
  },
171
- "./toggle" (module) {
171
+ "@/components/ui/toggle" (module) {
172
172
  module.exports = require("./toggle.cjs");
173
173
  },
174
174
  "./tooltip" (module) {
@@ -367,7 +367,7 @@ var __webpack_exports__ = {};
367
367
  "default"
368
368
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_19[__rspack_import_key];
369
369
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
370
- var _dialog__rspack_import_20 = __webpack_require__("./dialog");
370
+ var _dialog__rspack_import_20 = __webpack_require__("@/components/ui/dialog");
371
371
  var __rspack_reexport = {};
372
372
  for(const __rspack_import_key in _dialog__rspack_import_20)if ([
373
373
  "TreeView",
@@ -388,7 +388,7 @@ var __webpack_exports__ = {};
388
388
  "default"
389
389
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropdown_menu__rspack_import_22[__rspack_import_key];
390
390
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
391
- var _editable_cell__rspack_import_23 = __webpack_require__("@/components/ui/editable-cell");
391
+ var _editable_cell__rspack_import_23 = __webpack_require__("./editable-cell");
392
392
  var __rspack_reexport = {};
393
393
  for(const __rspack_import_key in _editable_cell__rspack_import_23)if ([
394
394
  "TreeView",
@@ -430,7 +430,7 @@ var __webpack_exports__ = {};
430
430
  "default"
431
431
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_input_group__rspack_import_28[__rspack_import_key];
432
432
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
433
- var _label__rspack_import_29 = __webpack_require__("@/components/ui/label");
433
+ var _label__rspack_import_29 = __webpack_require__("./label");
434
434
  var __rspack_reexport = {};
435
435
  for(const __rspack_import_key in _label__rspack_import_29)if ([
436
436
  "TreeView",
@@ -591,7 +591,7 @@ var __webpack_exports__ = {};
591
591
  "default"
592
592
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_51[__rspack_import_key];
593
593
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
594
- var _table__rspack_import_52 = __webpack_require__("@/components/ui/table");
594
+ var _table__rspack_import_52 = __webpack_require__("./table");
595
595
  var __rspack_reexport = {};
596
596
  for(const __rspack_import_key in _table__rspack_import_52)if ([
597
597
  "TreeView",
@@ -605,14 +605,14 @@ var __webpack_exports__ = {};
605
605
  "default"
606
606
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_53[__rspack_import_key];
607
607
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
608
- var _textarea__rspack_import_54 = __webpack_require__("./textarea");
608
+ var _textarea__rspack_import_54 = __webpack_require__("@/components/ui/textarea");
609
609
  var __rspack_reexport = {};
610
610
  for(const __rspack_import_key in _textarea__rspack_import_54)if ([
611
611
  "TreeView",
612
612
  "default"
613
613
  ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_textarea__rspack_import_54[__rspack_import_key];
614
614
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
615
- var _toggle__rspack_import_55 = __webpack_require__("./toggle");
615
+ var _toggle__rspack_import_55 = __webpack_require__("@/components/ui/toggle");
616
616
  var __rspack_reexport = {};
617
617
  for(const __rspack_import_key in _toggle__rspack_import_55)if ([
618
618
  "TreeView",
@@ -38,12 +38,33 @@ const external_button_cjs_namespaceObject = require("./button.cjs");
38
38
  const external_input_cjs_namespaceObject = require("./input.cjs");
39
39
  const external_textarea_cjs_namespaceObject = require("./textarea.cjs");
40
40
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
41
- const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, variant = 'default', size = 'default', ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
42
- ref: ref,
43
- role: "group",
44
- className: (0, index_cjs_namespaceObject.cn)('group/input-group relative flex w-full items-center gap-2 transition-colors has-[>textarea]:h-auto has-[>textarea]:items-start', 'default' === size && 'h-9 rounded-md px-3 py-1 future:h-10 future:rounded-xl future:py-2', 'xs' === size && 'h-6 gap-1 rounded px-2', 'default' === variant && 'border border-input bg-transparent future:border-0 future:bg-surface-overlay', 'ghost' === variant && 'border-0 bg-surface-overlay', 'has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background', 'has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20', 'has-[[data-slot=input-group-control]:disabled]:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:opacity-50', className),
45
- ...props
46
- }));
41
+ const InputGroupValidationContext = /*#__PURE__*/ external_react_namespaceObject.createContext({});
42
+ const InputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, error, errorId, variant = 'default', size = 'default', ...props }, ref)=>{
43
+ const generatedId = external_react_namespaceObject.useId();
44
+ const validationId = errorId ?? `input-group-${generatedId.replace(/:/g, '')}-error`;
45
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(InputGroupValidationContext.Provider, {
46
+ value: {
47
+ error,
48
+ errorId: validationId
49
+ },
50
+ children: [
51
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
52
+ ref: ref,
53
+ role: "group",
54
+ className: (0, index_cjs_namespaceObject.cn)('group/input-group relative flex w-full items-center gap-2 transition-colors has-[>textarea]:h-auto has-[>textarea]:items-start', 'default' === size && 'h-9 rounded-md px-3 py-1 future:h-10 future:rounded-xl future:py-2', 'xs' === size && 'h-6 gap-1 rounded px-2', 'default' === variant && 'border border-input bg-transparent future:border-0 future:bg-surface-overlay', 'ghost' === variant && 'border-0 bg-surface-overlay', 'has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background', 'has-[[data-slot][aria-invalid=true]]:border-error has-[[data-slot][aria-invalid=true]]:ring-error/20 future:has-[[data-slot][aria-invalid=true]]:ring-1 future:has-[[data-slot][aria-invalid=true]]:ring-error/40', error && 'border-error ring-error/20 future:ring-1 future:ring-error/40', 'has-[[data-slot=input-group-control]:disabled]:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:opacity-50', className),
55
+ ...props
56
+ }),
57
+ error && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
58
+ id: validationId,
59
+ "data-slot": "input-group-error",
60
+ "aria-live": "polite",
61
+ "aria-atomic": "true",
62
+ className: "mt-1 text-xs leading-4 text-error",
63
+ children: error
64
+ })
65
+ ]
66
+ });
67
+ });
47
68
  InputGroup.displayName = 'InputGroup';
48
69
  const inputGroupAddonVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex h-auto cursor-text items-center justify-center gap-1 text-sm text-muted-foreground select-none group-has-[[data-slot=input-group-control]:disabled]/input-group:opacity-50 [&>svg:not([class*="size-"])]:size-4', {
49
70
  variants: {
@@ -86,19 +107,42 @@ const InputGroupText = /*#__PURE__*/ external_react_namespaceObject.forwardRef((
86
107
  ...props
87
108
  }));
88
109
  InputGroupText.displayName = 'InputGroupText';
89
- const InputGroupInput = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
90
- ref: ref,
91
- "data-slot": "input-group-control",
92
- className: (0, index_cjs_namespaceObject.cn)('h-full flex-1 rounded-none border-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:h-full future:rounded-none future:border-0 future:bg-transparent future:p-0 future:focus-visible:ring-offset-0', className),
93
- ...props
94
- }));
110
+ const InputGroupInput = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, ...props }, ref)=>{
111
+ const validation = external_react_namespaceObject.useContext(InputGroupValidationContext);
112
+ const describedBy = [
113
+ ariaDescribedBy,
114
+ validation.error ? validation.errorId : void 0
115
+ ].filter(Boolean).join(' ');
116
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
117
+ className: "min-w-0 flex-1",
118
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
119
+ ref: ref,
120
+ "data-slot": "input-group-control",
121
+ "aria-describedby": describedBy || void 0,
122
+ "aria-errormessage": validation.error ? validation.errorId : ariaErrorMessage,
123
+ "aria-invalid": validation.error ? true : ariaInvalid,
124
+ className: (0, index_cjs_namespaceObject.cn)('h-full w-full rounded-none !border-0 !ring-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:h-full future:rounded-none future:border-0 future:bg-transparent future:p-0 future:focus-visible:ring-offset-0', className),
125
+ ...props
126
+ })
127
+ });
128
+ });
95
129
  InputGroupInput.displayName = 'InputGroupInput';
96
- const InputGroupTextarea = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_textarea_cjs_namespaceObject.Textarea, {
130
+ const InputGroupTextarea = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, ...props }, ref)=>{
131
+ const validation = external_react_namespaceObject.useContext(InputGroupValidationContext);
132
+ const describedBy = [
133
+ ariaDescribedBy,
134
+ validation.error ? validation.errorId : void 0
135
+ ].filter(Boolean).join(' ');
136
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_textarea_cjs_namespaceObject.Textarea, {
97
137
  ref: ref,
98
138
  "data-slot": "input-group-control",
99
- className: (0, index_cjs_namespaceObject.cn)('min-h-0 flex-1 resize-none rounded-none border-0 bg-transparent p-0 py-2 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:rounded-none future:border-0 future:bg-transparent future:focus-visible:ring-offset-0', className),
139
+ "aria-describedby": describedBy || void 0,
140
+ "aria-errormessage": validation.error ? validation.errorId : ariaErrorMessage,
141
+ "aria-invalid": validation.error ? true : ariaInvalid,
142
+ className: (0, index_cjs_namespaceObject.cn)('min-h-0 flex-1 resize-none rounded-none !border-0 !ring-0 bg-transparent p-0 py-2 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:rounded-none future:border-0 future:bg-transparent future:focus-visible:ring-offset-0', className),
100
143
  ...props
101
- }));
144
+ });
145
+ });
102
146
  InputGroupTextarea.displayName = 'InputGroupTextarea';
103
147
  exports.InputGroup = __webpack_exports__.InputGroup;
104
148
  exports.InputGroupAddon = __webpack_exports__.InputGroupAddon;
@@ -6,6 +6,10 @@ import { type TextareaProps } from './textarea';
6
6
  export interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
7
7
  variant?: 'default' | 'ghost';
8
8
  size?: 'default' | 'xs';
9
+ /** Field-specific validation feedback rendered below the grouped control. */
10
+ error?: React.ReactNode;
11
+ /** Optional id for the inline validation message. */
12
+ errorId?: string;
9
13
  }
10
14
  declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLDivElement>>;
11
15
  declare const inputGroupAddonVariants: (props?: ({
@@ -20,7 +24,7 @@ declare const InputGroupButton: React.ForwardRefExoticComponent<InputGroupButton
20
24
  export interface InputGroupTextProps extends React.HTMLAttributes<HTMLSpanElement> {
21
25
  }
22
26
  declare const InputGroupText: React.ForwardRefExoticComponent<InputGroupTextProps & React.RefAttributes<HTMLSpanElement>>;
23
- export interface InputGroupInputProps extends Omit<InputProps, 'variant' | 'size'> {
27
+ export interface InputGroupInputProps extends Omit<InputProps, 'variant' | 'size' | 'error' | 'errorId'> {
24
28
  }
25
29
  declare const InputGroupInput: React.ForwardRefExoticComponent<InputGroupInputProps & React.RefAttributes<HTMLInputElement>>;
26
30
  export interface InputGroupTextareaProps extends Omit<TextareaProps, 'variant'> {
@@ -1,16 +1,37 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
- import { forwardRef } from "react";
3
+ import { createContext, forwardRef, useContext, useId } from "react";
4
4
  import { Button } from "./button.js";
5
5
  import { Input } from "./input.js";
6
6
  import { Textarea } from "./textarea.js";
7
7
  import { cn } from "../../lib/index.js";
8
- const InputGroup = /*#__PURE__*/ forwardRef(({ className, variant = 'default', size = 'default', ...props }, ref)=>/*#__PURE__*/ jsx("div", {
9
- ref: ref,
10
- role: "group",
11
- className: cn('group/input-group relative flex w-full items-center gap-2 transition-colors has-[>textarea]:h-auto has-[>textarea]:items-start', 'default' === size && 'h-9 rounded-md px-3 py-1 future:h-10 future:rounded-xl future:py-2', 'xs' === size && 'h-6 gap-1 rounded px-2', 'default' === variant && 'border border-input bg-transparent future:border-0 future:bg-surface-overlay', 'ghost' === variant && 'border-0 bg-surface-overlay', 'has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background', 'has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20', 'has-[[data-slot=input-group-control]:disabled]:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:opacity-50', className),
12
- ...props
13
- }));
8
+ const InputGroupValidationContext = /*#__PURE__*/ createContext({});
9
+ const InputGroup = /*#__PURE__*/ forwardRef(({ className, error, errorId, variant = 'default', size = 'default', ...props }, ref)=>{
10
+ const generatedId = useId();
11
+ const validationId = errorId ?? `input-group-${generatedId.replace(/:/g, '')}-error`;
12
+ return /*#__PURE__*/ jsxs(InputGroupValidationContext.Provider, {
13
+ value: {
14
+ error,
15
+ errorId: validationId
16
+ },
17
+ children: [
18
+ /*#__PURE__*/ jsx("div", {
19
+ ref: ref,
20
+ role: "group",
21
+ className: cn('group/input-group relative flex w-full items-center gap-2 transition-colors has-[>textarea]:h-auto has-[>textarea]:items-start', 'default' === size && 'h-9 rounded-md px-3 py-1 future:h-10 future:rounded-xl future:py-2', 'xs' === size && 'h-6 gap-1 rounded px-2', 'default' === variant && 'border border-input bg-transparent future:border-0 future:bg-surface-overlay', 'ghost' === variant && 'border-0 bg-surface-overlay', 'has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background', 'has-[[data-slot][aria-invalid=true]]:border-error has-[[data-slot][aria-invalid=true]]:ring-error/20 future:has-[[data-slot][aria-invalid=true]]:ring-1 future:has-[[data-slot][aria-invalid=true]]:ring-error/40', error && 'border-error ring-error/20 future:ring-1 future:ring-error/40', 'has-[[data-slot=input-group-control]:disabled]:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:opacity-50', className),
22
+ ...props
23
+ }),
24
+ error && /*#__PURE__*/ jsx("p", {
25
+ id: validationId,
26
+ "data-slot": "input-group-error",
27
+ "aria-live": "polite",
28
+ "aria-atomic": "true",
29
+ className: "mt-1 text-xs leading-4 text-error",
30
+ children: error
31
+ })
32
+ ]
33
+ });
34
+ });
14
35
  InputGroup.displayName = 'InputGroup';
15
36
  const inputGroupAddonVariants = cva('flex h-auto cursor-text items-center justify-center gap-1 text-sm text-muted-foreground select-none group-has-[[data-slot=input-group-control]:disabled]/input-group:opacity-50 [&>svg:not([class*="size-"])]:size-4', {
16
37
  variants: {
@@ -53,18 +74,41 @@ const InputGroupText = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>
53
74
  ...props
54
75
  }));
55
76
  InputGroupText.displayName = 'InputGroupText';
56
- const InputGroupInput = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Input, {
57
- ref: ref,
58
- "data-slot": "input-group-control",
59
- className: cn('h-full flex-1 rounded-none border-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:h-full future:rounded-none future:border-0 future:bg-transparent future:p-0 future:focus-visible:ring-offset-0', className),
60
- ...props
61
- }));
77
+ const InputGroupInput = /*#__PURE__*/ forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, ...props }, ref)=>{
78
+ const validation = useContext(InputGroupValidationContext);
79
+ const describedBy = [
80
+ ariaDescribedBy,
81
+ validation.error ? validation.errorId : void 0
82
+ ].filter(Boolean).join(' ');
83
+ return /*#__PURE__*/ jsx("div", {
84
+ className: "min-w-0 flex-1",
85
+ children: /*#__PURE__*/ jsx(Input, {
86
+ ref: ref,
87
+ "data-slot": "input-group-control",
88
+ "aria-describedby": describedBy || void 0,
89
+ "aria-errormessage": validation.error ? validation.errorId : ariaErrorMessage,
90
+ "aria-invalid": validation.error ? true : ariaInvalid,
91
+ className: cn('h-full w-full rounded-none !border-0 !ring-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:h-full future:rounded-none future:border-0 future:bg-transparent future:p-0 future:focus-visible:ring-offset-0', className),
92
+ ...props
93
+ })
94
+ });
95
+ });
62
96
  InputGroupInput.displayName = 'InputGroupInput';
63
- const InputGroupTextarea = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Textarea, {
97
+ const InputGroupTextarea = /*#__PURE__*/ forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, ...props }, ref)=>{
98
+ const validation = useContext(InputGroupValidationContext);
99
+ const describedBy = [
100
+ ariaDescribedBy,
101
+ validation.error ? validation.errorId : void 0
102
+ ].filter(Boolean).join(' ');
103
+ return /*#__PURE__*/ jsx(Textarea, {
64
104
  ref: ref,
65
105
  "data-slot": "input-group-control",
66
- className: cn('min-h-0 flex-1 resize-none rounded-none border-0 bg-transparent p-0 py-2 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:rounded-none future:border-0 future:bg-transparent future:focus-visible:ring-offset-0', className),
106
+ "aria-describedby": describedBy || void 0,
107
+ "aria-errormessage": validation.error ? validation.errorId : ariaErrorMessage,
108
+ "aria-invalid": validation.error ? true : ariaInvalid,
109
+ className: cn('min-h-0 flex-1 resize-none rounded-none !border-0 !ring-0 bg-transparent p-0 py-2 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 future:rounded-none future:border-0 future:bg-transparent future:focus-visible:ring-offset-0', className),
67
110
  ...props
68
- }));
111
+ });
112
+ });
69
113
  InputGroupTextarea.displayName = 'InputGroupTextarea';
70
114
  export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -29,13 +29,37 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const external_react_namespaceObject = require("react");
31
31
  const utils_cjs_namespaceObject = require("../../lib/utils.cjs");
32
- const Input = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, type, variant = 'default', size = 'default', ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
33
- type: type,
34
- "data-slot": "input",
35
- className: (0, utils_cjs_namespaceObject.cn)('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
36
- ref: ref,
37
- ...props
38
- }));
32
+ const Input = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, error, errorId, id, type, variant = 'default', size = 'default', ...props }, ref)=>{
33
+ const generatedId = external_react_namespaceObject.useId();
34
+ const validationId = errorId ?? `${id ?? `input-${generatedId.replace(/:/g, '')}`}-error`;
35
+ const describedBy = [
36
+ ariaDescribedBy,
37
+ error ? validationId : void 0
38
+ ].filter(Boolean).join(' ');
39
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
40
+ children: [
41
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
42
+ type: type,
43
+ "data-slot": "input",
44
+ id: id,
45
+ ...props,
46
+ "aria-describedby": describedBy || void 0,
47
+ "aria-errormessage": error ? validationId : ariaErrorMessage,
48
+ "aria-invalid": error ? true : ariaInvalid,
49
+ className: (0, utils_cjs_namespaceObject.cn)('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
50
+ ref: ref
51
+ }),
52
+ error && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
53
+ id: validationId,
54
+ "data-slot": "input-error",
55
+ "aria-live": "polite",
56
+ "aria-atomic": "true",
57
+ className: "mt-1 text-xs leading-4 text-error",
58
+ children: error
59
+ })
60
+ ]
61
+ });
62
+ });
39
63
  Input.displayName = 'Input';
40
64
  exports.Input = __webpack_exports__.Input;
41
65
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -2,6 +2,13 @@ import * as React from 'react';
2
2
  export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
3
  variant?: 'default' | 'ghost';
4
4
  size?: 'default' | 'xs';
5
+ /**
6
+ * Field-specific feedback rendered immediately below the input.
7
+ * Keep the message focused on what went wrong and how to resolve it.
8
+ */
9
+ error?: React.ReactNode;
10
+ /** Optional id for the inline validation message. */
11
+ errorId?: string;
5
12
  }
6
13
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
7
14
  export { Input };
@@ -1,12 +1,36 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useId } from "react";
3
3
  import { cn } from "../../lib/utils.js";
4
- const Input = /*#__PURE__*/ forwardRef(({ className, type, variant = 'default', size = 'default', ...props }, ref)=>/*#__PURE__*/ jsx("input", {
5
- type: type,
6
- "data-slot": "input",
7
- className: cn('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
8
- ref: ref,
9
- ...props
10
- }));
4
+ const Input = /*#__PURE__*/ forwardRef(({ 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage, 'aria-invalid': ariaInvalid, className, error, errorId, id, type, variant = 'default', size = 'default', ...props }, ref)=>{
5
+ const generatedId = useId();
6
+ const validationId = errorId ?? `${id ?? `input-${generatedId.replace(/:/g, '')}`}-error`;
7
+ const describedBy = [
8
+ ariaDescribedBy,
9
+ error ? validationId : void 0
10
+ ].filter(Boolean).join(' ');
11
+ return /*#__PURE__*/ jsxs(Fragment, {
12
+ children: [
13
+ /*#__PURE__*/ jsx("input", {
14
+ type: type,
15
+ "data-slot": "input",
16
+ id: id,
17
+ ...props,
18
+ "aria-describedby": describedBy || void 0,
19
+ "aria-errormessage": error ? validationId : ariaErrorMessage,
20
+ "aria-invalid": error ? true : ariaInvalid,
21
+ className: cn('flex w-full transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-error aria-invalid:focus-visible:ring-error', 'default' === size && 'h-9 rounded-md px-3 py-1 text-base placeholder:text-muted-foreground md:text-sm', 'xs' === size && 'h-6 rounded px-2 text-xs placeholder:text-muted-foreground', 'default' === variant && 'border border-input bg-transparent', 'ghost' === variant && 'border-0 bg-surface-overlay', 'default' === variant && 'default' === size && 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:py-2 future:text-sm future:placeholder:text-foreground-muted future:placeholder:font-normal future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background future:aria-invalid:ring-1 future:aria-invalid:ring-error/40', className),
22
+ ref: ref
23
+ }),
24
+ error && /*#__PURE__*/ jsx("p", {
25
+ id: validationId,
26
+ "data-slot": "input-error",
27
+ "aria-live": "polite",
28
+ "aria-atomic": "true",
29
+ className: "mt-1 text-xs leading-4 text-error",
30
+ children: error
31
+ })
32
+ ]
33
+ });
34
+ });
11
35
  Input.displayName = 'Input';
12
36
  export { Input };
@@ -24,6 +24,7 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
+ RequiredIndicator: ()=>RequiredIndicator,
27
28
  Label: ()=>Label
28
29
  });
29
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
@@ -39,9 +40,27 @@ const Label = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ classNa
39
40
  ...props
40
41
  }));
41
42
  Label.displayName = react_label_namespaceObject.Root.displayName;
43
+ const RequiredIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
44
+ ref: ref,
45
+ ...props,
46
+ className: (0, index_cjs_namespaceObject.cn)('ml-0.5 text-current', className),
47
+ children: [
48
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
49
+ "aria-hidden": "true",
50
+ children: "*"
51
+ }),
52
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
53
+ className: "sr-only",
54
+ children: " (required)"
55
+ })
56
+ ]
57
+ }));
58
+ RequiredIndicator.displayName = 'RequiredIndicator';
42
59
  exports.Label = __webpack_exports__.Label;
60
+ exports.RequiredIndicator = __webpack_exports__.RequiredIndicator;
43
61
  for(var __rspack_i in __webpack_exports__)if (-1 === [
44
- "Label"
62
+ "Label",
63
+ "RequiredIndicator"
45
64
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
46
65
  Object.defineProperty(exports, '__esModule', {
47
66
  value: true