@adecore/agents-react 0.49.7 → 0.50.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.
@@ -1,4 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- export declare function UsageLimitsCard({ children }: {
2
+ export declare function UsageLimitsCard({ side, children }: {
3
+ side?: 'top' | 'left';
3
4
  children: ReactElement<Record<string, unknown>>;
4
5
  }): import("react").JSX.Element;
@@ -65,73 +65,76 @@ function CardBody(t0) {
65
65
  * the bars take a moment to read, and it stays open while the pointer travels to it.
66
66
  */
67
67
  export function UsageLimitsCard(t0) {
68
- const $ = _c(12);
68
+ const $ = _c(13);
69
69
  const {
70
+ side: t1,
70
71
  children
71
72
  } = t0;
73
+ const side = t1 === undefined ? "top" : t1;
72
74
  const [opened, setOpened] = useState(false);
73
- let t1;
75
+ let t2;
74
76
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
75
- t1 = new Set();
76
- $[0] = t1;
77
+ t2 = new Set();
78
+ $[0] = t2;
77
79
  } else {
78
- t1 = $[0];
80
+ t2 = $[0];
79
81
  }
80
- const [folded, setFolded] = useState(t1);
81
- let t2;
82
+ const [folded, setFolded] = useState(t2);
83
+ let t3;
82
84
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
83
- t2 = open => open && setOpened(true);
84
- $[1] = t2;
85
+ t3 = open => open && setOpened(true);
86
+ $[1] = t3;
85
87
  } else {
86
- t2 = $[1];
88
+ t3 = $[1];
87
89
  }
88
- let t3;
90
+ let t4;
89
91
  if ($[2] !== children) {
90
- t3 = /*#__PURE__*/_jsx(PreviewCard.Trigger, {
92
+ t4 = /*#__PURE__*/_jsx(PreviewCard.Trigger, {
91
93
  render: children,
92
94
  delay: 500
93
95
  });
94
96
  $[2] = children;
95
- $[3] = t3;
97
+ $[3] = t4;
96
98
  } else {
97
- t3 = $[3];
99
+ t4 = $[3];
98
100
  }
99
- let t4;
101
+ let t5;
100
102
  if ($[4] !== folded || $[5] !== opened) {
101
- t4 = opened && /*#__PURE__*/_jsx(CardBody, {
103
+ t5 = opened && /*#__PURE__*/_jsx(CardBody, {
102
104
  folded: folded,
103
105
  onFoldedChange: setFolded
104
106
  });
105
107
  $[4] = folded;
106
108
  $[5] = opened;
107
- $[6] = t4;
109
+ $[6] = t5;
108
110
  } else {
109
- t4 = $[6];
111
+ t5 = $[6];
110
112
  }
111
- let t5;
112
- if ($[7] !== t4) {
113
- t5 = /*#__PURE__*/_jsx(PreviewCard.Popup, {
114
- side: "top",
113
+ let t6;
114
+ if ($[7] !== side || $[8] !== t5) {
115
+ t6 = /*#__PURE__*/_jsx(PreviewCard.Popup, {
116
+ side: side,
115
117
  align: "end",
116
118
  className: "w-85 p-2",
117
- children: t4
119
+ children: t5
118
120
  });
119
- $[7] = t4;
121
+ $[7] = side;
120
122
  $[8] = t5;
123
+ $[9] = t6;
121
124
  } else {
122
- t5 = $[8];
125
+ t6 = $[9];
123
126
  }
124
- let t6;
125
- if ($[9] !== t3 || $[10] !== t5) {
126
- t6 = /*#__PURE__*/_jsxs(PreviewCard.Root, {
127
- onOpenChange: t2,
128
- children: [t3, t5]
127
+ let t7;
128
+ if ($[10] !== t4 || $[11] !== t6) {
129
+ t7 = /*#__PURE__*/_jsxs(PreviewCard.Root, {
130
+ onOpenChange: t3,
131
+ children: [t4, t6]
129
132
  });
130
- $[9] = t3;
131
- $[10] = t5;
133
+ $[10] = t4;
132
134
  $[11] = t6;
135
+ $[12] = t7;
133
136
  } else {
134
- t6 = $[11];
137
+ t7 = $[12];
135
138
  }
136
- return t6;
139
+ return t7;
137
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agents-react",
3
- "version": "0.49.7",
3
+ "version": "0.50.0",
4
4
  "description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -72,11 +72,11 @@
72
72
  "test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
73
73
  },
74
74
  "dependencies": {
75
- "@adecore/agent-contracts": "0.49.7",
76
- "@adecore/editor": "0.49.7",
77
- "@adecore/editor-react": "0.49.7",
78
- "@adecore/intelligent-ui": "0.49.7",
79
- "@adecore/merge": "0.49.7",
75
+ "@adecore/agent-contracts": "0.50.0",
76
+ "@adecore/editor": "0.50.0",
77
+ "@adecore/editor-react": "0.50.0",
78
+ "@adecore/intelligent-ui": "0.50.0",
79
+ "@adecore/merge": "0.50.0",
80
80
  "@codemirror/commands": "^6.11.1",
81
81
  "@codemirror/language": "^6.13.1",
82
82
  "@codemirror/state": "^6.7.6",
@@ -100,14 +100,14 @@
100
100
  "zustand": "^5.0.16"
101
101
  },
102
102
  "peerDependencies": {
103
- "@adecore/ui": "^0.49.7",
103
+ "@adecore/ui": "^0.50.0",
104
104
  "i18next": "^26.4.2",
105
105
  "react": "^19.3.0",
106
106
  "react-dom": "^19.3.0",
107
107
  "react-i18next": "^17.0.15"
108
108
  },
109
109
  "devDependencies": {
110
- "@adecore/ui": "0.49.7",
110
+ "@adecore/ui": "0.50.0",
111
111
  "@types/bun": "^1.4.4",
112
112
  "@types/react": "^19.3.0",
113
113
  "@types/react-dom": "^19.3.0",
@@ -27,14 +27,21 @@ function CardBody({ folded, onFoldedChange }: { folded: ReadonlySet<string>; onF
27
27
  * What is left of each plan, without opening the usage dialog. A hover card rather than a tooltip:
28
28
  * the bars take a moment to read, and it stays open while the pointer travels to it.
29
29
  */
30
- export function UsageLimitsCard({ children }: { children: ReactElement<Record<string, unknown>> }) {
30
+ export function UsageLimitsCard({
31
+ side = 'top',
32
+ children
33
+ }: {
34
+ /* Where the card opens: above a button in a footer, or `left` beside one in a column at the window's right edge. */
35
+ side?: 'top' | 'left';
36
+ children: ReactElement<Record<string, unknown>>;
37
+ }) {
31
38
  const [opened, setOpened] = useState(false);
32
39
  const [folded, setFolded] = useState<ReadonlySet<string>>(new Set());
33
40
 
34
41
  return (
35
42
  <PreviewCard.Root onOpenChange={(open) => open && setOpened(true)}>
36
43
  <PreviewCard.Trigger render={children} delay={500} />
37
- <PreviewCard.Popup side="top" align="end" className="w-85 p-2">
44
+ <PreviewCard.Popup side={side} align="end" className="w-85 p-2">
38
45
  {opened && <CardBody folded={folded} onFoldedChange={setFolded} />}
39
46
  </PreviewCard.Popup>
40
47
  </PreviewCard.Root>