@kelet-ai/feedback-ui 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/components/vote-feedback.d.ts +1 -1
- package/dist/feedback-ui.es.js +826 -795
- package/dist/feedback-ui.umd.js +16 -16
- package/dist/index.d.ts +1 -0
- package/dist/lib/otel-trace.d.ts +22 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +9 -2
- package/dist/lib/utils.d.ts +0 -2
package/README.md
CHANGED
|
@@ -313,6 +313,23 @@ const [data, setData] = useFeedbackState(initial, 'tracker', {
|
|
|
313
313
|
|
|
314
314
|
---
|
|
315
315
|
|
|
316
|
+
## 🔗 OpenTelemetry Integration
|
|
317
|
+
|
|
318
|
+
Automatically extract trace IDs to correlate feedback with distributed traces:
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
import { VoteFeedback, getOtelTraceId } from '@kelet-ai/feedback-ui';
|
|
322
|
+
|
|
323
|
+
<VoteFeedback.Root tx_id={getOtelTraceId} onFeedback={handleFeedback}>
|
|
324
|
+
<VoteFeedback.UpvoteButton>👍</VoteFeedback.UpvoteButton>
|
|
325
|
+
<VoteFeedback.DownvoteButton>👎</VoteFeedback.DownvoteButton>
|
|
326
|
+
</VoteFeedback.Root>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Requires `@opentelemetry/api` and active Span to collect the trace_id from.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
316
333
|
## 🔧 Core Components
|
|
317
334
|
|
|
318
335
|
### **VoteFeedback.Root**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DownvoteButtonProps, PopoverProps, SubmitButtonProps, TextareaProps, UpvoteButtonProps, VoteFeedbackRootProps } from '../types';
|
|
2
2
|
export declare const VoteFeedback: {
|
|
3
|
-
Root: ({ children, onFeedback, defaultText, tx_id, extra_metadata, trigger_name, }: VoteFeedbackRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
Root: ({ children, onFeedback, defaultText, tx_id: txIdProp, extra_metadata, trigger_name, }: VoteFeedbackRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
UpvoteButton: ({ asChild, children, onClick, ...props }: UpvoteButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
DownvoteButton: ({ asChild, children, onClick, ...props }: DownvoteButtonProps) => string | number | bigint | true | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Popover: ({ asChild, children, ...props }: PopoverProps) => import("react/jsx-runtime").JSX.Element | null;
|