@uipath/apollo-wind 2.70.0 → 2.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +25 -0
  2. package/dist/components/forms/field-control.cjs +3 -2
  3. package/dist/components/forms/field-control.js +3 -2
  4. package/dist/components/forms/validation-converter.cjs +14 -5
  5. package/dist/components/forms/validation-converter.js +14 -5
  6. package/dist/components/ui/chat-hero.cjs +244 -0
  7. package/dist/components/ui/chat-hero.d.ts +51 -0
  8. package/dist/components/ui/chat-hero.js +189 -0
  9. package/dist/components/ui/date-picker.cjs +6 -5
  10. package/dist/components/ui/date-picker.js +7 -6
  11. package/dist/components/ui/datetime-picker.cjs +7 -10
  12. package/dist/components/ui/datetime-picker.js +8 -11
  13. package/dist/components/ui/index.cjs +629 -413
  14. package/dist/components/ui/index.d.ts +6 -2
  15. package/dist/components/ui/index.js +7 -3
  16. package/dist/components/ui/prompt-editor/components/MarkdownPreview.cjs +4 -2
  17. package/dist/components/ui/prompt-editor/components/MarkdownPreview.js +4 -2
  18. package/dist/components/ui/prompt-editor/components/TokenPill.cjs +13 -68
  19. package/dist/components/ui/prompt-editor/components/TokenPill.js +14 -69
  20. package/dist/components/ui/prompt-editor/types.cjs +2 -14
  21. package/dist/components/ui/prompt-editor/types.d.ts +14 -1
  22. package/dist/components/ui/prompt-editor/types.js +2 -14
  23. package/dist/components/ui/prompt-suggestions.cjs +133 -0
  24. package/dist/components/ui/prompt-suggestions.d.ts +52 -0
  25. package/dist/components/ui/prompt-suggestions.js +90 -0
  26. package/dist/components/ui/quick-form-field/components/field-header.cjs +9 -4
  27. package/dist/components/ui/quick-form-field/components/field-header.d.ts +4 -1
  28. package/dist/components/ui/quick-form-field/components/field-header.js +9 -4
  29. package/dist/components/ui/quick-form-field/components/lock-toggle-button.cjs +2 -2
  30. package/dist/components/ui/quick-form-field/components/lock-toggle-button.d.ts +5 -4
  31. package/dist/components/ui/quick-form-field/components/lock-toggle-button.js +2 -2
  32. package/dist/components/ui/quick-form-field/index.d.ts +1 -1
  33. package/dist/components/ui/quick-form-field/quick-form-field.cjs +158 -222
  34. package/dist/components/ui/quick-form-field/quick-form-field.d.ts +6 -4
  35. package/dist/components/ui/quick-form-field/quick-form-field.js +159 -223
  36. package/dist/components/ui/quick-form-field/types.cjs +2 -2
  37. package/dist/components/ui/quick-form-field/types.d.ts +39 -32
  38. package/dist/components/ui/quick-form-field/types.js +2 -2
  39. package/dist/components/ui/quick-form-field/utils.cjs +5 -59
  40. package/dist/components/ui/quick-form-field/utils.d.ts +2 -24
  41. package/dist/components/ui/quick-form-field/utils.js +3 -48
  42. package/dist/components/ui/reference-chip-colors.cjs +49 -0
  43. package/dist/components/ui/reference-chip-colors.d.ts +15 -0
  44. package/dist/components/ui/reference-chip-colors.js +15 -0
  45. package/dist/components/ui/reference-chip.cjs +104 -0
  46. package/dist/components/ui/reference-chip.d.ts +17 -0
  47. package/dist/components/ui/reference-chip.js +70 -0
  48. package/dist/components/ui/variable-value-control.cjs +5 -3
  49. package/dist/components/ui/variable-value-control.js +5 -3
  50. package/dist/index.cjs +50 -4
  51. package/dist/index.d.ts +12 -6
  52. package/dist/index.js +7 -3
  53. package/dist/lib/date-value.cjs +46 -0
  54. package/dist/lib/date-value.d.ts +8 -0
  55. package/dist/lib/date-value.js +12 -0
  56. package/dist/styles.css +110 -43
  57. package/dist/tailwind.utilities.css +15 -0
  58. package/package.json +1 -1
  59. package/dist/components/custom/chat-first-experience.cjs +0 -87
  60. package/dist/components/custom/chat-first-experience.d.ts +0 -24
  61. package/dist/components/custom/chat-first-experience.js +0 -53
  62. package/dist/components/custom/chat-prompt-suggestions.cjs +0 -49
  63. package/dist/components/custom/chat-prompt-suggestions.d.ts +0 -18
  64. package/dist/components/custom/chat-prompt-suggestions.js +0 -15
@@ -14,6 +14,7 @@ export * from './calendar';
14
14
  export * from './card';
15
15
  export * from './chart';
16
16
  export * from './chat-composer';
17
+ export * from './chat-hero';
17
18
  export * from './checkbox';
18
19
  export * from './citation';
19
20
  export * from './code-block';
@@ -53,20 +54,24 @@ export * from './message-scroller';
53
54
  export * from './model-picker';
54
55
  export * from './multi-select';
55
56
  export * from './pagination';
57
+ export * from './panel-tabs';
56
58
  export * from './popover';
57
59
  export * from './portal-container';
58
60
  export * from './progress';
59
61
  export * from './prompt-editor';
62
+ export * from './prompt-suggestions';
60
63
  export * from './prompt-value-control';
61
64
  export * from './quick-form-field';
62
65
  export * from './radio-group';
66
+ export { ReferenceChip, type ReferenceChipProps } from './reference-chip';
67
+ export { getReferenceChipColors } from './reference-chip-colors';
63
68
  export * from './resizable';
64
69
  export * from './scroll-area';
65
70
  export * from './search';
66
71
  export * from './select';
67
72
  export * from './separator';
68
- export * from './sidebar';
69
73
  export * from './sheet';
74
+ export * from './sidebar';
70
75
  export * from './skeleton';
71
76
  export * from './slider';
72
77
  export * from './sonner';
@@ -76,7 +81,6 @@ export * from './stats-card';
76
81
  export * from './stepper';
77
82
  export * from './switch';
78
83
  export * from './table';
79
- export * from './panel-tabs';
80
84
  export * from './tabs';
81
85
  export * from './textarea';
82
86
  export * from './thinking-indicator';
@@ -1,3 +1,5 @@
1
+ import { ReferenceChip } from "./reference-chip.js";
2
+ import { getReferenceChipColors } from "./reference-chip-colors.js";
1
3
  import tree_view, { TreeView } from "./tree-view.js";
2
4
  export * from "./accordion.js";
3
5
  export * from "./alert.js";
@@ -15,6 +17,7 @@ export * from "./calendar.js";
15
17
  export * from "./card.js";
16
18
  export * from "./chart.js";
17
19
  export * from "./chat-composer.js";
20
+ export * from "./chat-hero.js";
18
21
  export * from "./checkbox.js";
19
22
  export * from "./citation.js";
20
23
  export * from "./code-block.js";
@@ -54,10 +57,12 @@ export * from "./message-scroller/index.js";
54
57
  export * from "./model-picker/index.js";
55
58
  export * from "./multi-select.js";
56
59
  export * from "./pagination.js";
60
+ export * from "./panel-tabs.js";
57
61
  export * from "./popover.js";
58
62
  export * from "./portal-container.js";
59
63
  export * from "./progress.js";
60
64
  export * from "./prompt-editor/index.js";
65
+ export * from "./prompt-suggestions.js";
61
66
  export * from "./prompt-value-control.js";
62
67
  export * from "./quick-form-field/index.js";
63
68
  export * from "./radio-group.js";
@@ -66,8 +71,8 @@ export * from "./scroll-area.js";
66
71
  export * from "./search.js";
67
72
  export * from "./select.js";
68
73
  export * from "./separator.js";
69
- export * from "./sidebar/index.js";
70
74
  export * from "./sheet.js";
75
+ export * from "./sidebar/index.js";
71
76
  export * from "./skeleton.js";
72
77
  export * from "./slider.js";
73
78
  export * from "./sonner.js";
@@ -77,7 +82,6 @@ export * from "./stats-card.js";
77
82
  export * from "./stepper.js";
78
83
  export * from "./switch.js";
79
84
  export * from "./table.js";
80
- export * from "./panel-tabs.js";
81
85
  export * from "./tabs.js";
82
86
  export * from "./textarea.js";
83
87
  export * from "./thinking-indicator.js";
@@ -87,4 +91,4 @@ export * from "./tool-call.js";
87
91
  export * from "./tooltip.js";
88
92
  export * from "./variable-picker/index.js";
89
93
  export * from "./variable-value-control.js";
90
- export { tree_view as FileTreeView, TreeView };
94
+ export { tree_view as FileTreeView, ReferenceChip, TreeView, getReferenceChipColors };
@@ -40,6 +40,7 @@ const external_dompurify_namespaceObject = require("dompurify");
40
40
  var external_dompurify_default = /*#__PURE__*/ __webpack_require__.n(external_dompurify_namespaceObject);
41
41
  const external_marked_namespaceObject = require("marked");
42
42
  const external_react_namespaceObject = require("react");
43
+ const external_reference_chip_colors_cjs_namespaceObject = require("../../reference-chip-colors.cjs");
43
44
  const external_prompt_editor_config_cjs_namespaceObject = require("../prompt-editor-config.cjs");
44
45
  const external_token_icon_markup_cjs_namespaceObject = require("./token-icon-markup.cjs");
45
46
  const marked = new external_marked_namespaceObject.Marked({
@@ -47,6 +48,7 @@ const marked = new external_marked_namespaceObject.Marked({
47
48
  gfm: true,
48
49
  breaks: true
49
50
  });
51
+ const referenceColors = (0, external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors)().valid;
50
52
  const MARKDOWN_PREVIEW_STYLES = `
51
53
  .prompt-editor-preview { color: var(--color-foreground); }
52
54
  .prompt-editor-preview-empty { color: var(--color-muted-foreground); }
@@ -73,8 +75,8 @@ const MARKDOWN_PREVIEW_STYLES = `
73
75
  .prompt-editor-preview th { font-weight: 600; background-color: var(--color-muted); }
74
76
  .prompt-editor-preview strong { font-weight: 700; }
75
77
  .prompt-editor-preview em { font-style: italic; }
76
- .prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background: var(--color-info-background); color: var(--color-info-text); }
77
- .prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color: var(--color-info-icon); width: 14px; height: 14px; }
78
+ .prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background: ${referenceColors.background}; color: ${referenceColors.text}; }
79
+ .prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color: ${referenceColors.icon}; width: 14px; height: 14px; }
78
80
  `;
79
81
  const PURIFY_CONFIG = {
80
82
  ALLOWED_TAGS: [
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import dompurify from "dompurify";
3
3
  import { Marked } from "marked";
4
4
  import { useMemo } from "react";
5
+ import { getReferenceChipColors } from "../../reference-chip-colors.js";
5
6
  import { usePromptEditorConfig } from "../prompt-editor-config.js";
6
7
  import { buildTokenIconSvgMarkup } from "./token-icon-markup.js";
7
8
  const marked = new Marked({
@@ -9,6 +10,7 @@ const marked = new Marked({
9
10
  gfm: true,
10
11
  breaks: true
11
12
  });
13
+ const referenceColors = getReferenceChipColors().valid;
12
14
  const MARKDOWN_PREVIEW_STYLES = `
13
15
  .prompt-editor-preview { color: var(--color-foreground); }
14
16
  .prompt-editor-preview-empty { color: var(--color-muted-foreground); }
@@ -35,8 +37,8 @@ const MARKDOWN_PREVIEW_STYLES = `
35
37
  .prompt-editor-preview th { font-weight: 600; background-color: var(--color-muted); }
36
38
  .prompt-editor-preview strong { font-weight: 700; }
37
39
  .prompt-editor-preview em { font-style: italic; }
38
- .prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background: var(--color-info-background); color: var(--color-info-text); }
39
- .prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color: var(--color-info-icon); width: 14px; height: 14px; }
40
+ .prompt-editor-preview .token-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 13px; line-height: 20px; vertical-align: middle; background: ${referenceColors.background}; color: ${referenceColors.text}; }
41
+ .prompt-editor-preview .token-pill svg { display: block; flex-shrink: 0; color: ${referenceColors.icon}; width: 14px; height: 14px; }
40
42
  `;
41
43
  const PURIFY_CONFIG = {
42
44
  ALLOWED_TAGS: [
@@ -29,8 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const external_lucide_react_namespaceObject = require("lucide-react");
31
31
  const external_react_namespaceObject = require("react");
32
+ const external_reference_chip_cjs_namespaceObject = require("../../reference-chip.cjs");
32
33
  const external_prompt_editor_config_cjs_namespaceObject = require("../prompt-editor-config.cjs");
33
- const external_types_cjs_namespaceObject = require("../types.cjs");
34
34
  const TOKEN_TYPE_ICON = {
35
35
  input: external_lucide_react_namespaceObject.Variable,
36
36
  output: external_lucide_react_namespaceObject.SquareFunction,
@@ -40,75 +40,20 @@ const TOKEN_TYPE_ICON = {
40
40
  };
41
41
  const TokenPillBase = ({ value, tokenType, onRemove, diffType, readonly, isInvalid, isSelected, onMouseDown })=>{
42
42
  const { strings } = (0, external_prompt_editor_config_cjs_namespaceObject.usePromptEditorConfig)();
43
- const PROMPT_EDITOR_TOKEN_COLORS = (0, external_types_cjs_namespaceObject.getPromptEditorTokenColors)();
44
- const colors = isInvalid && !diffType ? PROMPT_EDITOR_TOKEN_COLORS.invalid : PROMPT_EDITOR_TOKEN_COLORS.valid;
45
43
  const Icon = TOKEN_TYPE_ICON[tokenType];
46
- const handleRemoveMouseDown = (e)=>{
47
- e.preventDefault();
48
- e.stopPropagation();
49
- };
50
- const handleRemoveClick = (e)=>{
51
- e.preventDefault();
52
- e.stopPropagation();
53
- onRemove?.();
54
- };
55
- const bgColor = diffType ? 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)' : colors.background;
56
- const outerClassName = [
57
- 'relative inline-flex items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1',
58
- readonly ? 'cursor-default' : 'cursor-pointer',
59
- 'removed' === diffType ? 'line-through opacity-60' : '',
60
- isSelected ? 'z-10' : ''
61
- ].filter(Boolean).join(' ');
62
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
44
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_reference_chip_cjs_namespaceObject.ReferenceChip, {
45
+ label: value,
46
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {}),
47
+ onRemove: onRemove,
48
+ removeLabel: strings.removeToken,
49
+ readOnly: readonly,
50
+ invalid: isInvalid && !diffType,
51
+ selected: isSelected,
63
52
  onMouseDown: onMouseDown,
64
- className: outerClassName,
65
- style: {
66
- backgroundColor: bgColor,
67
- outline: isSelected ? `2px solid ${colors.border}` : 'none'
68
- },
69
- children: [
70
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
71
- className: "inline-flex shrink-0",
72
- style: {
73
- color: colors.icon
74
- },
75
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
76
- className: "h-3.5 w-3.5"
77
- })
78
- }),
79
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
80
- className: "font-normal whitespace-nowrap",
81
- style: {
82
- color: colors.text,
83
- fontFamily: "'Noto Sans', sans-serif"
84
- },
85
- children: value
86
- }),
87
- !readonly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
88
- type: "button",
89
- "aria-label": strings.removeToken,
90
- className: "inline-flex items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4",
91
- style: {
92
- color: colors.text
93
- },
94
- onMouseDown: handleRemoveMouseDown,
95
- onClick: handleRemoveClick,
96
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
97
- width: "12",
98
- height: "12",
99
- viewBox: "0 0 24 24",
100
- fill: "none",
101
- xmlns: "http://www.w3.org/2000/svg",
102
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
103
- d: "M18 6L6 18M6 6L18 18",
104
- stroke: "currentColor",
105
- strokeWidth: "2",
106
- strokeLinecap: "round",
107
- strokeLinejoin: "round"
108
- })
109
- })
110
- })
111
- ]
53
+ className: `${readonly ? 'cursor-default' : 'cursor-pointer'} ${'removed' === diffType ? 'line-through opacity-60' : ''}`,
54
+ style: diffType ? {
55
+ backgroundColor: 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)'
56
+ } : void 0
112
57
  });
113
58
  };
114
59
  const TokenPill = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(TokenPillBase);
@@ -1,8 +1,8 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { Database, Paperclip, SquareFunction, Variable } from "lucide-react";
3
3
  import { memo } from "react";
4
+ import { ReferenceChip } from "../../reference-chip.js";
4
5
  import { usePromptEditorConfig } from "../prompt-editor-config.js";
5
- import { getPromptEditorTokenColors } from "../types.js";
6
6
  const TOKEN_TYPE_ICON = {
7
7
  input: Variable,
8
8
  output: SquareFunction,
@@ -12,75 +12,20 @@ const TOKEN_TYPE_ICON = {
12
12
  };
13
13
  const TokenPillBase = ({ value, tokenType, onRemove, diffType, readonly, isInvalid, isSelected, onMouseDown })=>{
14
14
  const { strings } = usePromptEditorConfig();
15
- const PROMPT_EDITOR_TOKEN_COLORS = getPromptEditorTokenColors();
16
- const colors = isInvalid && !diffType ? PROMPT_EDITOR_TOKEN_COLORS.invalid : PROMPT_EDITOR_TOKEN_COLORS.valid;
17
15
  const Icon = TOKEN_TYPE_ICON[tokenType];
18
- const handleRemoveMouseDown = (e)=>{
19
- e.preventDefault();
20
- e.stopPropagation();
21
- };
22
- const handleRemoveClick = (e)=>{
23
- e.preventDefault();
24
- e.stopPropagation();
25
- onRemove?.();
26
- };
27
- const bgColor = diffType ? 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)' : colors.background;
28
- const outerClassName = [
29
- 'relative inline-flex items-center align-middle gap-[3px] h-5 rounded px-1 text-[13px] leading-5 outline-offset-1',
30
- readonly ? 'cursor-default' : 'cursor-pointer',
31
- 'removed' === diffType ? 'line-through opacity-60' : '',
32
- isSelected ? 'z-10' : ''
33
- ].filter(Boolean).join(' ');
34
- return /*#__PURE__*/ jsxs("span", {
16
+ return /*#__PURE__*/ jsx(ReferenceChip, {
17
+ label: value,
18
+ icon: /*#__PURE__*/ jsx(Icon, {}),
19
+ onRemove: onRemove,
20
+ removeLabel: strings.removeToken,
21
+ readOnly: readonly,
22
+ invalid: isInvalid && !diffType,
23
+ selected: isSelected,
35
24
  onMouseDown: onMouseDown,
36
- className: outerClassName,
37
- style: {
38
- backgroundColor: bgColor,
39
- outline: isSelected ? `2px solid ${colors.border}` : 'none'
40
- },
41
- children: [
42
- /*#__PURE__*/ jsx("span", {
43
- className: "inline-flex shrink-0",
44
- style: {
45
- color: colors.icon
46
- },
47
- children: /*#__PURE__*/ jsx(Icon, {
48
- className: "h-3.5 w-3.5"
49
- })
50
- }),
51
- /*#__PURE__*/ jsx("span", {
52
- className: "font-normal whitespace-nowrap",
53
- style: {
54
- color: colors.text,
55
- fontFamily: "'Noto Sans', sans-serif"
56
- },
57
- children: value
58
- }),
59
- !readonly && /*#__PURE__*/ jsx("button", {
60
- type: "button",
61
- "aria-label": strings.removeToken,
62
- className: "inline-flex items-center justify-center p-px border-0 bg-transparent cursor-pointer rounded-[2px] w-4 h-4",
63
- style: {
64
- color: colors.text
65
- },
66
- onMouseDown: handleRemoveMouseDown,
67
- onClick: handleRemoveClick,
68
- children: /*#__PURE__*/ jsx("svg", {
69
- width: "12",
70
- height: "12",
71
- viewBox: "0 0 24 24",
72
- fill: "none",
73
- xmlns: "http://www.w3.org/2000/svg",
74
- children: /*#__PURE__*/ jsx("path", {
75
- d: "M18 6L6 18M6 6L18 18",
76
- stroke: "currentColor",
77
- strokeWidth: "2",
78
- strokeLinecap: "round",
79
- strokeLinejoin: "round"
80
- })
81
- })
82
- })
83
- ]
25
+ className: `${readonly ? 'cursor-default' : 'cursor-pointer'} ${'removed' === diffType ? 'line-through opacity-60' : ''}`,
26
+ style: diffType ? {
27
+ backgroundColor: 'added' === diffType ? 'rgba(76, 175, 80, 0.15)' : 'rgba(244, 67, 54, 0.15)'
28
+ } : void 0
84
29
  });
85
30
  };
86
31
  const TokenPill = /*#__PURE__*/ memo(TokenPillBase);
@@ -29,20 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  isPromptEditorNonTextToken: ()=>isPromptEditorNonTextToken,
30
30
  isPromptEditorTextToken: ()=>isPromptEditorTextToken
31
31
  });
32
- const getPromptEditorTokenColors = ()=>({
33
- valid: {
34
- background: 'var(--color-info-background)',
35
- border: 'var(--color-info-icon)',
36
- text: 'var(--color-info-text)',
37
- icon: 'var(--color-info-icon)'
38
- },
39
- invalid: {
40
- background: 'var(--color-error-background)',
41
- border: 'var(--color-error-icon)',
42
- text: 'var(--color-error-text)',
43
- icon: 'var(--color-error-icon)'
44
- }
45
- });
32
+ const external_reference_chip_colors_cjs_namespaceObject = require("../reference-chip-colors.cjs");
33
+ const getPromptEditorTokenColors = external_reference_chip_colors_cjs_namespaceObject.getReferenceChipColors;
46
34
  const getPromptEditorTokenTypeLabel = (type, labels)=>{
47
35
  switch(type){
48
36
  case 'input':
@@ -63,7 +63,20 @@ export interface PromptEditorTokenColorConfig {
63
63
  * Two-state palette: invalid = red, valid = blue. Backed by apollo-wind's semantic design tokens,
64
64
  * which already resolve per light/dark theme via CSS — no JS theme detection needed.
65
65
  */
66
- export declare const getPromptEditorTokenColors: () => Record<"valid" | "invalid", PromptEditorTokenColorConfig>;
66
+ export declare const getPromptEditorTokenColors: () => {
67
+ valid: {
68
+ background: string;
69
+ border: string;
70
+ text: string;
71
+ icon: string;
72
+ };
73
+ invalid: {
74
+ background: string;
75
+ border: string;
76
+ text: string;
77
+ icon: string;
78
+ };
79
+ };
67
80
  /** The token-type label subset of `PromptEditorStrings` (structural, to avoid a config↔types cycle). */
68
81
  export interface PromptEditorTokenTypeLabels {
69
82
  tokenTypeInput: string;
@@ -1,17 +1,5 @@
1
- const getPromptEditorTokenColors = ()=>({
2
- valid: {
3
- background: 'var(--color-info-background)',
4
- border: 'var(--color-info-icon)',
5
- text: 'var(--color-info-text)',
6
- icon: 'var(--color-info-icon)'
7
- },
8
- invalid: {
9
- background: 'var(--color-error-background)',
10
- border: 'var(--color-error-icon)',
11
- text: 'var(--color-error-text)',
12
- icon: 'var(--color-error-icon)'
13
- }
14
- });
1
+ import { getReferenceChipColors } from "../reference-chip-colors.js";
2
+ const getPromptEditorTokenColors = getReferenceChipColors;
15
3
  const getPromptEditorTokenTypeLabel = (type, labels)=>{
16
4
  switch(type){
17
5
  case 'input':
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ "use client";
3
+ var __webpack_require__ = {};
4
+ (()=>{
5
+ __webpack_require__.d = (exports1, definition)=>{
6
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ get: definition[key]
9
+ });
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.r = (exports1)=>{
17
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
18
+ value: 'Module'
19
+ });
20
+ Object.defineProperty(exports1, '__esModule', {
21
+ value: true
22
+ });
23
+ };
24
+ })();
25
+ var __webpack_exports__ = {};
26
+ __webpack_require__.r(__webpack_exports__);
27
+ __webpack_require__.d(__webpack_exports__, {
28
+ DEFAULT_PROMPT_SUGGESTIONS_STRINGS: ()=>DEFAULT_PROMPT_SUGGESTIONS_STRINGS,
29
+ PromptSuggestions: ()=>PromptSuggestions,
30
+ promptSuggestionsListVariants: ()=>promptSuggestionsListVariants,
31
+ promptSuggestionVariants: ()=>promptSuggestionVariants
32
+ });
33
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
34
+ const external_class_variance_authority_namespaceObject = require("class-variance-authority");
35
+ const external_react_namespaceObject = require("react");
36
+ const index_cjs_namespaceObject = require("../../lib/index.cjs");
37
+ const DEFAULT_PROMPT_SUGGESTIONS_STRINGS = {
38
+ label: 'Suggestions'
39
+ };
40
+ const promptSuggestionsListVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex min-w-0 gap-2', {
41
+ variants: {
42
+ orientation: {
43
+ vertical: 'flex-col items-start',
44
+ horizontal: '-mx-1 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none overflow-x-auto overscroll-x-contain px-1 py-1'
45
+ }
46
+ },
47
+ defaultVariants: {
48
+ orientation: 'vertical'
49
+ }
50
+ });
51
+ const promptSuggestionVariants = (0, external_class_variance_authority_namespaceObject.cva)('inline-flex max-w-full cursor-pointer items-center border border-border-subtle bg-surface-raised text-left font-normal text-foreground transition-colors hover:border-border hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0', {
52
+ variants: {
53
+ density: {
54
+ comfortable: 'gap-2 px-4 py-2 text-sm leading-5 [&_svg]:size-4 rounded-xl',
55
+ compact: 'gap-1.5 px-2 py-1 text-xs leading-4 [&_svg]:size-3.5 rounded-lg'
56
+ },
57
+ orientation: {
58
+ vertical: 'whitespace-normal',
59
+ horizontal: 'flex-none snap-start whitespace-nowrap'
60
+ }
61
+ },
62
+ defaultVariants: {
63
+ density: 'comfortable',
64
+ orientation: 'vertical'
65
+ }
66
+ });
67
+ const PromptSuggestions = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, suggestions, onSelect, orientation, density, showLabel = false, animated = false, disabled = false, strings, ...props }, ref)=>{
68
+ const labelId = external_react_namespaceObject.useId();
69
+ const resolvedOrientation = orientation ?? 'vertical';
70
+ const resolvedDensity = density ?? 'comfortable';
71
+ const text = {
72
+ ...DEFAULT_PROMPT_SUGGESTIONS_STRINGS,
73
+ ...strings
74
+ };
75
+ if (0 === suggestions.length) return null;
76
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
77
+ ref: ref,
78
+ role: "group",
79
+ "aria-label": showLabel ? void 0 : text.label,
80
+ "aria-labelledby": showLabel ? labelId : void 0,
81
+ "data-slot": "prompt-suggestions",
82
+ "data-orientation": resolvedOrientation,
83
+ "data-density": resolvedDensity,
84
+ className: (0, index_cjs_namespaceObject.cn)('flex w-full min-w-0 flex-col gap-1', animated && 'animate-slide-in-from-bottom', className),
85
+ ...props,
86
+ children: [
87
+ showLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
88
+ id: labelId,
89
+ "data-slot": "prompt-suggestions-label",
90
+ className: (0, index_cjs_namespaceObject.cn)('text-start font-semibold text-foreground', 'compact' === resolvedDensity ? 'text-xs leading-4' : 'text-sm leading-5'),
91
+ children: text.label
92
+ }),
93
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
94
+ "data-slot": "prompt-suggestions-list",
95
+ className: promptSuggestionsListVariants({
96
+ orientation: resolvedOrientation
97
+ }),
98
+ children: suggestions.map((suggestion, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
99
+ type: "button",
100
+ "data-slot": "prompt-suggestion",
101
+ "data-index": index,
102
+ disabled: disabled,
103
+ className: promptSuggestionVariants({
104
+ density: resolvedDensity,
105
+ orientation: resolvedOrientation
106
+ }),
107
+ onClick: ()=>onSelect?.(suggestion),
108
+ children: [
109
+ suggestion.icon,
110
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
111
+ className: "min-w-0",
112
+ children: suggestion.label
113
+ })
114
+ ]
115
+ }, suggestion.id ?? suggestion.label))
116
+ })
117
+ ]
118
+ });
119
+ });
120
+ PromptSuggestions.displayName = 'PromptSuggestions';
121
+ exports.DEFAULT_PROMPT_SUGGESTIONS_STRINGS = __webpack_exports__.DEFAULT_PROMPT_SUGGESTIONS_STRINGS;
122
+ exports.PromptSuggestions = __webpack_exports__.PromptSuggestions;
123
+ exports.promptSuggestionVariants = __webpack_exports__.promptSuggestionVariants;
124
+ exports.promptSuggestionsListVariants = __webpack_exports__.promptSuggestionsListVariants;
125
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
126
+ "DEFAULT_PROMPT_SUGGESTIONS_STRINGS",
127
+ "PromptSuggestions",
128
+ "promptSuggestionVariants",
129
+ "promptSuggestionsListVariants"
130
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
131
+ Object.defineProperty(exports, '__esModule', {
132
+ value: true
133
+ });
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Prompts the user can pick instead of typing, as a group of chips. `onSelect` receives the
4
+ * suggestion; whether that sends it or puts it in the composer is the caller's call:
5
+ *
6
+ * ```tsx
7
+ * <PromptSuggestions
8
+ * suggestions={[{ label: 'Summarize', prompt: 'Summarize this conversation' }]}
9
+ * onSelect={({ label, prompt }) => send(prompt ?? label)}
10
+ * />
11
+ * ```
12
+ */
13
+ export interface PromptSuggestionsStrings {
14
+ /** Accessible name of the group, and its visible title with `showLabel`. */
15
+ label: string;
16
+ }
17
+ export declare const DEFAULT_PROMPT_SUGGESTIONS_STRINGS: PromptSuggestionsStrings;
18
+ /** One chip. Shaped so a chat service's `{ label, prompt }` suggestions pass straight in. */
19
+ export interface PromptSuggestionItem {
20
+ label: string;
21
+ /** The text to send or prefill, when it differs from the label. */
22
+ prompt?: string;
23
+ /** Keys the chip. Defaults to `label`. */
24
+ id?: string;
25
+ /** Leading icon. */
26
+ icon?: React.ReactNode;
27
+ }
28
+ export type PromptSuggestionsDensity = 'comfortable' | 'compact';
29
+ declare const promptSuggestionsListVariants: (props?: ({
30
+ orientation?: "horizontal" | "vertical" | null | undefined;
31
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
32
+ declare const promptSuggestionVariants: (props?: ({
33
+ density?: "compact" | "comfortable" | null | undefined;
34
+ orientation?: "horizontal" | "vertical" | null | undefined;
35
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
36
+ export type PromptSuggestionsOrientation = 'vertical' | 'horizontal';
37
+ export interface PromptSuggestionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
38
+ suggestions: PromptSuggestionItem[];
39
+ onSelect?: (suggestion: PromptSuggestionItem) => void;
40
+ orientation?: PromptSuggestionsOrientation;
41
+ density?: PromptSuggestionsDensity;
42
+ /** Shows `strings.label` as a title above the chips, as a chat does after a reply. */
43
+ showLabel?: boolean;
44
+ /** Slides the group in from below when it mounts. Only fades under reduced motion. */
45
+ animated?: boolean;
46
+ disabled?: boolean;
47
+ /** Overrides for any subset of the English strings. */
48
+ strings?: Partial<PromptSuggestionsStrings>;
49
+ }
50
+ /** Stacks vertically by default; `horizontal` keeps one row that scrolls when it overflows. */
51
+ declare const PromptSuggestions: React.ForwardRefExoticComponent<PromptSuggestionsProps & React.RefAttributes<HTMLDivElement>>;
52
+ export { PromptSuggestions, promptSuggestionsListVariants, promptSuggestionVariants };