@uipath/apollo-wind 2.56.0 → 2.57.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 (77) hide show
  1. package/dist/components/ui/alert-dialog.cjs +7 -6
  2. package/dist/components/ui/alert-dialog.js +7 -6
  3. package/dist/components/ui/code-editors.shared.cjs +323 -0
  4. package/dist/components/ui/code-editors.shared.d.ts +936 -0
  5. package/dist/components/ui/code-editors.shared.js +264 -0
  6. package/dist/components/ui/combobox.cjs +33 -15
  7. package/dist/components/ui/combobox.js +33 -15
  8. package/dist/components/ui/date-picker.cjs +62 -26
  9. package/dist/components/ui/date-picker.js +62 -26
  10. package/dist/components/ui/datetime-picker.cjs +29 -12
  11. package/dist/components/ui/datetime-picker.js +29 -12
  12. package/dist/components/ui/dialog.cjs +2 -1
  13. package/dist/components/ui/dialog.js +2 -1
  14. package/dist/components/ui/dropdown-menu.cjs +12 -8
  15. package/dist/components/ui/dropdown-menu.js +12 -8
  16. package/dist/components/ui/field-actions/ai-assist-action.cjs +121 -0
  17. package/dist/components/ui/field-actions/ai-assist-action.d.ts +21 -0
  18. package/dist/components/ui/field-actions/ai-assist-action.js +84 -0
  19. package/dist/components/ui/field-actions/collapse.cjs +44 -0
  20. package/dist/components/ui/field-actions/collapse.d.ts +6 -0
  21. package/dist/components/ui/field-actions/collapse.js +4 -0
  22. package/dist/components/ui/field-actions/index.cjs +46 -0
  23. package/dist/components/ui/field-actions/index.d.ts +2 -0
  24. package/dist/components/ui/field-actions/index.js +3 -0
  25. package/dist/components/ui/field-actions/insert-variable-action.cjs +94 -0
  26. package/dist/components/ui/field-actions/insert-variable-action.d.ts +22 -0
  27. package/dist/components/ui/field-actions/insert-variable-action.js +57 -0
  28. package/dist/components/ui/field-addons/index.cjs +50 -0
  29. package/dist/components/ui/field-addons/index.d.ts +3 -0
  30. package/dist/components/ui/field-addons/index.js +4 -0
  31. package/dist/components/ui/field-addons/value-mode-indicator.cjs +57 -0
  32. package/dist/components/ui/field-addons/value-mode-indicator.d.ts +13 -0
  33. package/dist/components/ui/field-addons/value-mode-indicator.js +23 -0
  34. package/dist/components/ui/field-addons/value-mode-menu.cjs +149 -0
  35. package/dist/components/ui/field-addons/value-mode-menu.d.ts +69 -0
  36. package/dist/components/ui/field-addons/value-mode-menu.js +112 -0
  37. package/dist/components/ui/field-addons/value-mode-strings.cjs +69 -0
  38. package/dist/components/ui/field-addons/value-mode-strings.d.ts +32 -0
  39. package/dist/components/ui/field-addons/value-mode-strings.js +29 -0
  40. package/dist/components/ui/form-field.cjs +42 -5
  41. package/dist/components/ui/form-field.d.ts +21 -1
  42. package/dist/components/ui/form-field.js +36 -2
  43. package/dist/components/ui/index.cjs +150 -130
  44. package/dist/components/ui/index.d.ts +2 -0
  45. package/dist/components/ui/index.js +2 -0
  46. package/dist/components/ui/input-group-context.cjs +91 -0
  47. package/dist/components/ui/input-group-context.d.ts +69 -0
  48. package/dist/components/ui/input-group-context.js +42 -0
  49. package/dist/components/ui/input-group.cjs +303 -56
  50. package/dist/components/ui/input-group.d.ts +70 -3
  51. package/dist/components/ui/input-group.js +285 -56
  52. package/dist/components/ui/input.cjs +28 -17
  53. package/dist/components/ui/input.js +28 -17
  54. package/dist/components/ui/lockable-value-field/components/field-header.cjs +16 -114
  55. package/dist/components/ui/lockable-value-field/components/field-header.js +14 -112
  56. package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +4 -12
  57. package/dist/components/ui/lockable-value-field/lockable-value-field.js +4 -12
  58. package/dist/components/ui/multi-select.cjs +82 -58
  59. package/dist/components/ui/multi-select.js +84 -60
  60. package/dist/components/ui/popover.cjs +13 -9
  61. package/dist/components/ui/popover.js +13 -9
  62. package/dist/components/ui/select.cjs +89 -27
  63. package/dist/components/ui/select.d.ts +4 -0
  64. package/dist/components/ui/select.js +90 -28
  65. package/dist/components/ui/textarea.cjs +16 -11
  66. package/dist/components/ui/textarea.js +16 -11
  67. package/dist/index.cjs +61 -11
  68. package/dist/index.d.ts +8 -4
  69. package/dist/index.js +5 -3
  70. package/dist/lib/dialog-surface.cjs +36 -0
  71. package/dist/lib/dialog-surface.d.ts +1 -0
  72. package/dist/lib/dialog-surface.js +2 -0
  73. package/dist/styles.css +249 -14
  74. package/package.json +1 -1
  75. package/dist/components/ui/lockable-value-field/components/mode-menu-item.cjs +0 -63
  76. package/dist/components/ui/lockable-value-field/components/mode-menu-item.d.ts +0 -9
  77. package/dist/components/ui/lockable-value-field/components/mode-menu-item.js +0 -29
@@ -5,34 +5,51 @@ import { CalendarIcon } from "lucide-react";
5
5
  import { forwardRef, useId } from "react";
6
6
  import { Button } from "./button.js";
7
7
  import { Calendar } from "./calendar.js";
8
+ import { InputGroupPopoverTrigger } from "./input-group.js";
8
9
  import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
9
10
  import { cn } from "../../lib/index.js";
10
11
  import { FormFieldError } from "./form-field.js";
12
+ import { useControlValidation, useInputGroup } from "./input-group-context.js";
11
13
  const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function({ id, value, onValueChange, disabled, placeholder = 'Pick a date', className, calendarProps, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
12
14
  const generatedId = useId();
13
15
  const validationId = errorId ?? `${id ?? `date-picker-${generatedId.replace(/:/g, '')}`}-error`;
14
- const describedBy = [
15
- ariaDescribedBy,
16
- error ? validationId : void 0
17
- ].filter(Boolean).join(' ');
16
+ const group = useInputGroup();
17
+ const grouped = group.inGroup;
18
+ const validation = useControlValidation(group, {
19
+ error,
20
+ errorId: validationId,
21
+ 'aria-invalid': ariaInvalid,
22
+ 'aria-describedby': ariaDescribedBy,
23
+ 'aria-errormessage': ariaErrorMessage
24
+ });
25
+ const triggerProps = {
26
+ id,
27
+ 'aria-label': id || ariaLabelledBy ? void 0 : value ? `Selected date: ${format(value, 'PPP')}` : placeholder,
28
+ 'aria-labelledby': ariaLabelledBy,
29
+ ...validation.aria,
30
+ disabled: disabled || group.disabled
31
+ };
18
32
  return /*#__PURE__*/ jsxs(Fragment, {
19
33
  children: [
20
34
  /*#__PURE__*/ jsxs(Popover, {
21
35
  "data-slot": "date-picker",
22
36
  children: [
23
- /*#__PURE__*/ jsx(PopoverTrigger, {
37
+ grouped ? /*#__PURE__*/ jsx(InputGroupPopoverTrigger, {
38
+ ref: ref,
39
+ ...triggerProps,
40
+ className: className,
41
+ placeholder: placeholder,
42
+ children: value && /*#__PURE__*/ jsx("span", {
43
+ className: "truncate",
44
+ children: format(value, 'PPP')
45
+ })
46
+ }) : /*#__PURE__*/ jsx(PopoverTrigger, {
24
47
  asChild: true,
25
48
  children: /*#__PURE__*/ jsxs(Button, {
49
+ ...triggerProps,
26
50
  ref: ref,
27
- id: id,
28
51
  variant: "outline",
29
- "aria-label": id || ariaLabelledBy ? void 0 : value ? `Selected date: ${format(value, 'PPP')}` : placeholder,
30
- "aria-labelledby": ariaLabelledBy,
31
- "aria-describedby": describedBy || void 0,
32
- "aria-errormessage": error ? validationId : ariaErrorMessage,
33
- "aria-invalid": error ? true : ariaInvalid,
34
52
  className: cn('w-full justify-start text-left font-normal [&>svg]:text-foreground-muted hover:[&>svg]:text-accent-foreground', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
35
- disabled: disabled,
36
53
  children: [
37
54
  /*#__PURE__*/ jsx(CalendarIcon, {}),
38
55
  value ? format(value, 'PPP') : /*#__PURE__*/ jsx("span", {
@@ -44,6 +61,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function({ id, value, on
44
61
  }),
45
62
  /*#__PURE__*/ jsx(PopoverContent, {
46
63
  className: "w-auto p-0",
64
+ align: grouped ? 'start' : void 0,
47
65
  children: /*#__PURE__*/ jsx(Calendar, {
48
66
  mode: "single",
49
67
  selected: value,
@@ -54,7 +72,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function({ id, value, on
54
72
  })
55
73
  ]
56
74
  }),
57
- /*#__PURE__*/ jsx(FormFieldError, {
75
+ validation.ownMessage && /*#__PURE__*/ jsx(FormFieldError, {
58
76
  id: validationId,
59
77
  children: error
60
78
  })
@@ -64,29 +82,47 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function({ id, value, on
64
82
  const date_picker_DateRangePicker = /*#__PURE__*/ forwardRef(function({ id, value, onValueChange, disabled, placeholder = 'Pick a date range', className, calendarProps, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
65
83
  const generatedId = useId();
66
84
  const validationId = errorId ?? `${id ?? `date-range-picker-${generatedId.replace(/:/g, '')}`}-error`;
67
- const describedBy = [
68
- ariaDescribedBy,
69
- error ? validationId : void 0
70
- ].filter(Boolean).join(' ');
71
85
  const computedLabel = value?.from ? value.to ? `Selected range: ${format(value.from, 'LLL dd, y')} to ${format(value.to, 'LLL dd, y')}` : `Selected date: ${format(value.from, 'LLL dd, y')}` : placeholder;
86
+ const group = useInputGroup();
87
+ const grouped = group.inGroup;
88
+ const validation = useControlValidation(group, {
89
+ error,
90
+ errorId: validationId,
91
+ 'aria-invalid': ariaInvalid,
92
+ 'aria-describedby': ariaDescribedBy,
93
+ 'aria-errormessage': ariaErrorMessage
94
+ });
95
+ const triggerProps = {
96
+ id,
97
+ 'aria-label': id || ariaLabelledBy ? void 0 : computedLabel,
98
+ 'aria-labelledby': ariaLabelledBy,
99
+ ...validation.aria,
100
+ disabled: disabled || group.disabled
101
+ };
72
102
  return /*#__PURE__*/ jsxs(Fragment, {
73
103
  children: [
74
104
  /*#__PURE__*/ jsxs(Popover, {
75
105
  "data-slot": "date-range-picker",
76
106
  children: [
77
- /*#__PURE__*/ jsx(PopoverTrigger, {
107
+ grouped ? /*#__PURE__*/ jsx(InputGroupPopoverTrigger, {
108
+ ref: ref,
109
+ ...triggerProps,
110
+ className: className,
111
+ placeholder: placeholder,
112
+ children: value?.from && /*#__PURE__*/ jsxs("span", {
113
+ className: "truncate",
114
+ children: [
115
+ format(value.from, 'LLL dd, y'),
116
+ value.to && ` - ${format(value.to, 'LLL dd, y')}`
117
+ ]
118
+ })
119
+ }) : /*#__PURE__*/ jsx(PopoverTrigger, {
78
120
  asChild: true,
79
121
  children: /*#__PURE__*/ jsxs(Button, {
122
+ ...triggerProps,
80
123
  ref: ref,
81
- id: id,
82
124
  variant: "outline",
83
- "aria-label": id || ariaLabelledBy ? void 0 : computedLabel,
84
- "aria-labelledby": ariaLabelledBy,
85
- "aria-describedby": describedBy || void 0,
86
- "aria-errormessage": error ? validationId : ariaErrorMessage,
87
- "aria-invalid": error ? true : ariaInvalid,
88
125
  className: cn('w-[300px] justify-start text-left font-normal [&>svg]:text-foreground-muted hover:[&>svg]:text-accent-foreground', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
89
- disabled: disabled,
90
126
  children: [
91
127
  /*#__PURE__*/ jsx(CalendarIcon, {}),
92
128
  value?.from ? value.to ? /*#__PURE__*/ jsxs(Fragment, {
@@ -118,7 +154,7 @@ const date_picker_DateRangePicker = /*#__PURE__*/ forwardRef(function({ id, valu
118
154
  })
119
155
  ]
120
156
  }),
121
- /*#__PURE__*/ jsx(FormFieldError, {
157
+ validation.ownMessage && /*#__PURE__*/ jsx(FormFieldError, {
122
158
  id: validationId,
123
159
  children: error
124
160
  })
@@ -33,18 +33,16 @@ const external_react_namespaceObject = require("react");
33
33
  const external_button_cjs_namespaceObject = require("./button.cjs");
34
34
  const external_calendar_cjs_namespaceObject = require("./calendar.cjs");
35
35
  const external_input_cjs_namespaceObject = require("./input.cjs");
36
+ const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
36
37
  const external_label_cjs_namespaceObject = require("./label.cjs");
37
38
  const external_popover_cjs_namespaceObject = require("./popover.cjs");
38
39
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
39
40
  const external_form_field_cjs_namespaceObject = require("./form-field.cjs");
41
+ const external_input_group_context_cjs_namespaceObject = require("./input-group-context.cjs");
40
42
  const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ value, onValueChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false, id, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
41
43
  const [open, setOpen] = external_react_namespaceObject.useState(false);
42
44
  const generatedId = external_react_namespaceObject.useId();
43
45
  const validationId = errorId ?? `${id ?? `datetime-picker-${generatedId.replace(/:/g, '')}`}-error`;
44
- const describedBy = [
45
- ariaDescribedBy,
46
- error ? validationId : void 0
47
- ].filter(Boolean).join(' ');
48
46
  const [selectedDate, setSelectedDate] = external_react_namespaceObject.useState(value);
49
47
  const [timeValue, setTimeValue] = external_react_namespaceObject.useState(value ? (0, external_date_fns_namespaceObject.format)(value, use12Hour ? 'hh:mm a' : 'HH:mm') : '');
50
48
  const handleDateSelect = (date)=>{
@@ -74,6 +72,21 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObj
74
72
  const timePart = (0, external_date_fns_namespaceObject.format)(selectedDate, use12Hour ? 'hh:mm a' : 'HH:mm');
75
73
  return `${datePart} at ${timePart}`;
76
74
  };
75
+ const group = (0, external_input_group_context_cjs_namespaceObject.useInputGroup)();
76
+ const grouped = group.inGroup;
77
+ const validation = (0, external_input_group_context_cjs_namespaceObject.useControlValidation)(group, {
78
+ error,
79
+ errorId: validationId,
80
+ 'aria-invalid': ariaInvalid,
81
+ 'aria-describedby': ariaDescribedBy,
82
+ 'aria-errormessage': ariaErrorMessage
83
+ });
84
+ const triggerProps = {
85
+ id,
86
+ 'aria-labelledby': ariaLabelledBy,
87
+ ...validation.aria,
88
+ disabled: disabled || group.disabled
89
+ };
77
90
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
78
91
  children: [
79
92
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
@@ -81,18 +94,22 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObj
81
94
  open: open,
82
95
  onOpenChange: setOpen,
83
96
  children: [
84
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
97
+ grouped ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupPopoverTrigger, {
98
+ ref: ref,
99
+ ...triggerProps,
100
+ className: className,
101
+ placeholder: placeholder,
102
+ children: selectedDate && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
103
+ className: "truncate",
104
+ children: formatDisplayValue()
105
+ })
106
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
85
107
  asChild: true,
86
108
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
109
+ ...triggerProps,
87
110
  ref: ref,
88
- id: id,
89
- "aria-labelledby": ariaLabelledBy,
90
- "aria-describedby": describedBy || void 0,
91
- "aria-errormessage": error ? validationId : ariaErrorMessage,
92
- "aria-invalid": error ? true : ariaInvalid,
93
111
  variant: "outline",
94
112
  className: (0, index_cjs_namespaceObject.cn)('w-full justify-start text-left font-normal [&>svg]:text-foreground-muted hover:[&>svg]:text-accent-foreground', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
95
- disabled: disabled,
96
113
  children: [
97
114
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CalendarIcon, {
98
115
  className: "mr-2 h-4 w-4"
@@ -163,7 +180,7 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObj
163
180
  })
164
181
  ]
165
182
  }),
166
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
183
+ validation.ownMessage && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
167
184
  id: validationId,
168
185
  children: error
169
186
  })
@@ -5,18 +5,16 @@ import { forwardRef, useId, useState } from "react";
5
5
  import { Button } from "./button.js";
6
6
  import { Calendar } from "./calendar.js";
7
7
  import { Input } from "./input.js";
8
+ import { InputGroupPopoverTrigger } from "./input-group.js";
8
9
  import { Label } from "./label.js";
9
10
  import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
10
11
  import { cn } from "../../lib/index.js";
11
12
  import { FormFieldError } from "./form-field.js";
13
+ import { useControlValidation, useInputGroup } from "./input-group-context.js";
12
14
  const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value, onValueChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false, id, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
13
15
  const [open, setOpen] = useState(false);
14
16
  const generatedId = useId();
15
17
  const validationId = errorId ?? `${id ?? `datetime-picker-${generatedId.replace(/:/g, '')}`}-error`;
16
- const describedBy = [
17
- ariaDescribedBy,
18
- error ? validationId : void 0
19
- ].filter(Boolean).join(' ');
20
18
  const [selectedDate, setSelectedDate] = useState(value);
21
19
  const [timeValue, setTimeValue] = useState(value ? format(value, use12Hour ? 'hh:mm a' : 'HH:mm') : '');
22
20
  const handleDateSelect = (date)=>{
@@ -46,6 +44,21 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value
46
44
  const timePart = format(selectedDate, use12Hour ? 'hh:mm a' : 'HH:mm');
47
45
  return `${datePart} at ${timePart}`;
48
46
  };
47
+ const group = useInputGroup();
48
+ const grouped = group.inGroup;
49
+ const validation = useControlValidation(group, {
50
+ error,
51
+ errorId: validationId,
52
+ 'aria-invalid': ariaInvalid,
53
+ 'aria-describedby': ariaDescribedBy,
54
+ 'aria-errormessage': ariaErrorMessage
55
+ });
56
+ const triggerProps = {
57
+ id,
58
+ 'aria-labelledby': ariaLabelledBy,
59
+ ...validation.aria,
60
+ disabled: disabled || group.disabled
61
+ };
49
62
  return /*#__PURE__*/ jsxs(Fragment, {
50
63
  children: [
51
64
  /*#__PURE__*/ jsxs(Popover, {
@@ -53,18 +66,22 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value
53
66
  open: open,
54
67
  onOpenChange: setOpen,
55
68
  children: [
56
- /*#__PURE__*/ jsx(PopoverTrigger, {
69
+ grouped ? /*#__PURE__*/ jsx(InputGroupPopoverTrigger, {
70
+ ref: ref,
71
+ ...triggerProps,
72
+ className: className,
73
+ placeholder: placeholder,
74
+ children: selectedDate && /*#__PURE__*/ jsx("span", {
75
+ className: "truncate",
76
+ children: formatDisplayValue()
77
+ })
78
+ }) : /*#__PURE__*/ jsx(PopoverTrigger, {
57
79
  asChild: true,
58
80
  children: /*#__PURE__*/ jsxs(Button, {
81
+ ...triggerProps,
59
82
  ref: ref,
60
- id: id,
61
- "aria-labelledby": ariaLabelledBy,
62
- "aria-describedby": describedBy || void 0,
63
- "aria-errormessage": error ? validationId : ariaErrorMessage,
64
- "aria-invalid": error ? true : ariaInvalid,
65
83
  variant: "outline",
66
84
  className: cn('w-full justify-start text-left font-normal [&>svg]:text-foreground-muted hover:[&>svg]:text-accent-foreground', 'future:h-10 future:rounded-xl future:border-0 future:bg-surface-overlay future:px-4 future:gap-4 future:text-foreground future:hover:bg-surface-hover future:focus-visible:ring-offset-2 future:focus-visible:ring-offset-background', className),
67
- disabled: disabled,
68
85
  children: [
69
86
  /*#__PURE__*/ jsx(CalendarIcon, {
70
87
  className: "mr-2 h-4 w-4"
@@ -135,7 +152,7 @@ const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value
135
152
  })
136
153
  ]
137
154
  }),
138
- /*#__PURE__*/ jsx(FormFieldError, {
155
+ validation.ownMessage && /*#__PURE__*/ jsx(FormFieldError, {
139
156
  id: validationId,
140
157
  children: error
141
158
  })
@@ -53,6 +53,7 @@ const external_lucide_react_namespaceObject = require("lucide-react");
53
53
  const external_react_namespaceObject = require("react");
54
54
  const external_button_cjs_namespaceObject = require("./button.cjs");
55
55
  const external_portal_container_cjs_namespaceObject = require("./portal-container.cjs");
56
+ const dialog_surface_cjs_namespaceObject = require("../../lib/dialog-surface.cjs");
56
57
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
57
58
  function Dialog({ ...props }) {
58
59
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Root, {
@@ -73,7 +74,7 @@ function DialogPortal({ ...props }) {
73
74
  ...props
74
75
  });
75
76
  }
76
- const dialogContentVariants = (0, external_class_variance_authority_namespaceObject.cva)('bg-surface-raised text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 relative z-50 border border-border-subtle shadow-xl duration-200', {
77
+ const dialogContentVariants = (0, external_class_variance_authority_namespaceObject.cva)(`${dialog_surface_cjs_namespaceObject.dialogSurfaceClassName} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 relative z-50 duration-200`, {
77
78
  variants: {
78
79
  variant: {
79
80
  default: 'grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-2xl p-6 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-lg',
@@ -6,6 +6,7 @@ import { Maximize2, Minimize2, XIcon } from "lucide-react";
6
6
  import { forwardRef, useState } from "react";
7
7
  import { Button } from "./button.js";
8
8
  import { useResolvedPortalContainer } from "./portal-container.js";
9
+ import { dialogSurfaceClassName } from "../../lib/dialog-surface.js";
9
10
  import { cn } from "../../lib/index.js";
10
11
  function Dialog({ ...props }) {
11
12
  return /*#__PURE__*/ jsx(Root, {
@@ -26,7 +27,7 @@ function DialogPortal({ ...props }) {
26
27
  ...props
27
28
  });
28
29
  }
29
- const dialogContentVariants = cva('bg-surface-raised text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 relative z-50 border border-border-subtle shadow-xl duration-200', {
30
+ const dialogContentVariants = cva(`${dialogSurfaceClassName} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 relative z-50 duration-200`, {
30
31
  variants: {
31
32
  variant: {
32
33
  default: 'grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-2xl p-6 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-lg',
@@ -47,6 +47,7 @@ const external_lucide_react_namespaceObject = require("lucide-react");
47
47
  const external_react_namespaceObject = require("react");
48
48
  const external_portal_container_cjs_namespaceObject = require("./portal-container.cjs");
49
49
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
50
+ const external_input_group_context_cjs_namespaceObject = require("./input-group-context.cjs");
50
51
  const DropdownMenu = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Root, {
51
52
  "data-slot": "dropdown-menu",
52
53
  ...props
@@ -112,14 +113,17 @@ const DropdownMenuSubContent = /*#__PURE__*/ external_react_namespaceObject.forw
112
113
  DropdownMenuSubContent.displayName = react_dropdown_menu_namespaceObject.SubContent.displayName;
113
114
  const DropdownMenuContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, sideOffset = 4, container, ...props }, ref)=>{
114
115
  const resolvedContainer = (0, external_portal_container_cjs_namespaceObject.useResolvedPortalContainer)(container);
115
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Portal, {
116
- container: resolvedContainer,
117
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Content, {
118
- ref: ref,
119
- "data-slot": "dropdown-menu-content",
120
- sideOffset: sideOffset,
121
- className: (0, index_cjs_namespaceObject.cn)('z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]', className),
122
- ...props
116
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_context_cjs_namespaceObject.InputGroupContext.Provider, {
117
+ value: external_input_group_context_cjs_namespaceObject.NO_GROUP,
118
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Portal, {
119
+ container: resolvedContainer,
120
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dropdown_menu_namespaceObject.Content, {
121
+ ref: ref,
122
+ "data-slot": "dropdown-menu-content",
123
+ sideOffset: sideOffset,
124
+ className: (0, index_cjs_namespaceObject.cn)('z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]', className),
125
+ ...props
126
+ })
123
127
  })
124
128
  });
125
129
  });
@@ -5,6 +5,7 @@ import { Check, ChevronRight, Circle } from "lucide-react";
5
5
  import { forwardRef } from "react";
6
6
  import { useResolvedPortalContainer } from "./portal-container.js";
7
7
  import { cn } from "../../lib/index.js";
8
+ import { InputGroupContext, NO_GROUP } from "./input-group-context.js";
8
9
  const DropdownMenu = (props)=>/*#__PURE__*/ jsx(Root, {
9
10
  "data-slot": "dropdown-menu",
10
11
  ...props
@@ -70,14 +71,17 @@ const DropdownMenuSubContent = /*#__PURE__*/ forwardRef(({ className, ...props }
70
71
  DropdownMenuSubContent.displayName = SubContent.displayName;
71
72
  const DropdownMenuContent = /*#__PURE__*/ forwardRef(({ className, sideOffset = 4, container, ...props }, ref)=>{
72
73
  const resolvedContainer = useResolvedPortalContainer(container);
73
- return /*#__PURE__*/ jsx(Portal, {
74
- container: resolvedContainer,
75
- children: /*#__PURE__*/ jsx(Content, {
76
- ref: ref,
77
- "data-slot": "dropdown-menu-content",
78
- sideOffset: sideOffset,
79
- className: cn('z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]', className),
80
- ...props
74
+ return /*#__PURE__*/ jsx(InputGroupContext.Provider, {
75
+ value: NO_GROUP,
76
+ children: /*#__PURE__*/ jsx(Portal, {
77
+ container: resolvedContainer,
78
+ children: /*#__PURE__*/ jsx(Content, {
79
+ ref: ref,
80
+ "data-slot": "dropdown-menu-content",
81
+ sideOffset: sideOffset,
82
+ className: cn('z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md future:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]', className),
83
+ ...props
84
+ })
81
85
  })
82
86
  });
83
87
  });
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ AiAssistAction: ()=>AiAssistAction,
28
+ DEFAULT_AI_ASSIST_ACTION_STRINGS: ()=>DEFAULT_AI_ASSIST_ACTION_STRINGS
29
+ });
30
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_lucide_react_namespaceObject = require("lucide-react");
32
+ const external_react_namespaceObject = require("react");
33
+ const external_button_cjs_namespaceObject = require("../button.cjs");
34
+ const external_label_cjs_namespaceObject = require("../label.cjs");
35
+ const external_popover_cjs_namespaceObject = require("../popover.cjs");
36
+ const external_textarea_cjs_namespaceObject = require("../textarea.cjs");
37
+ const external_tooltip_cjs_namespaceObject = require("../tooltip.cjs");
38
+ const DEFAULT_AI_ASSIST_ACTION_STRINGS = {
39
+ trigger: 'AI assist',
40
+ tooltip: 'Generate with AI',
41
+ prompt: 'Describe what you want',
42
+ promptPlaceholder: 'Display a value from the previous step',
43
+ generate: 'Generate'
44
+ };
45
+ function AiAssistAction({ onGenerate, hint, strings }) {
46
+ const promptId = (0, external_react_namespaceObject.useId)();
47
+ const [prompt, setPrompt] = (0, external_react_namespaceObject.useState)('');
48
+ const text = {
49
+ ...DEFAULT_AI_ASSIST_ACTION_STRINGS,
50
+ ...strings
51
+ };
52
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
53
+ children: [
54
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
55
+ children: [
56
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
57
+ asChild: true,
58
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
59
+ asChild: true,
60
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
61
+ type: "button",
62
+ "aria-label": text.trigger,
63
+ className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
64
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Sparkles, {
65
+ size: 12
66
+ })
67
+ })
68
+ })
69
+ }),
70
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
71
+ children: text.tooltip
72
+ })
73
+ ]
74
+ }),
75
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.PopoverContent, {
76
+ align: "end",
77
+ className: "space-y-3",
78
+ children: [
79
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
80
+ className: "space-y-1.5",
81
+ children: [
82
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.Label, {
83
+ htmlFor: promptId,
84
+ className: "text-xs font-medium text-foreground-muted",
85
+ children: text.prompt
86
+ }),
87
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_textarea_cjs_namespaceObject.Textarea, {
88
+ id: promptId,
89
+ rows: 3,
90
+ value: prompt,
91
+ onChange: (e)=>setPrompt(e.target.value),
92
+ placeholder: text.promptPlaceholder,
93
+ className: "resize-none text-sm"
94
+ })
95
+ ]
96
+ }),
97
+ hint && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
98
+ className: "block text-[11px] text-foreground-subtle",
99
+ children: hint
100
+ }),
101
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
102
+ size: "sm",
103
+ className: "w-full",
104
+ disabled: !onGenerate,
105
+ onClick: ()=>onGenerate?.(prompt),
106
+ children: text.generate
107
+ })
108
+ ]
109
+ })
110
+ ]
111
+ });
112
+ }
113
+ exports.AiAssistAction = __webpack_exports__.AiAssistAction;
114
+ exports.DEFAULT_AI_ASSIST_ACTION_STRINGS = __webpack_exports__.DEFAULT_AI_ASSIST_ACTION_STRINGS;
115
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
116
+ "AiAssistAction",
117
+ "DEFAULT_AI_ASSIST_ACTION_STRINGS"
118
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
119
+ Object.defineProperty(exports, '__esModule', {
120
+ value: true
121
+ });
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface AiAssistActionStrings {
3
+ trigger: string;
4
+ tooltip: string;
5
+ prompt: string;
6
+ promptPlaceholder: string;
7
+ generate: string;
8
+ }
9
+ export declare const DEFAULT_AI_ASSIST_ACTION_STRINGS: AiAssistActionStrings;
10
+ export interface AiAssistActionProps {
11
+ /** Called with the entered prompt. Omitted, Generate is disabled. */
12
+ onGenerate?: (prompt: string) => void;
13
+ /** A line under the prompt describing what will be generated, such as the value's type. */
14
+ hint?: ReactNode;
15
+ /** Overrides for any subset of the English strings. */
16
+ strings?: Partial<AiAssistActionStrings>;
17
+ }
18
+ /**
19
+ * The AI-assist header action: a prompt in a popover. Requires an ancestor `TooltipProvider`.
20
+ */
21
+ export declare function AiAssistAction({ onGenerate, hint, strings }: AiAssistActionProps): import("react/jsx-runtime").JSX.Element;