@react-spot/ui-components 0.0.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.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # @react-spot/ui-components
2
+
3
+ Shared UI primitives for the React Trace package ecosystem.
4
+
5
+ Use this package when building a plugin. These components match the widget's existing look and feel, especially toolbar controls, action-panel controls, overlays, and small layout helpers.
6
+
7
+ ## Stable exports across current entrypoints
8
+
9
+ These are the symbols currently present in both `src/index.tsx` and the production stub surface (`src/index.prod.ts` / `dist/index.prod.d.ts`).
10
+
11
+ ### Action and input primitives
12
+
13
+ - `Button`
14
+ - `IconButton`
15
+ - `ToolbarButton`
16
+ - `Textarea`
17
+
18
+ ### Layout and small helpers
19
+
20
+ - `PanelHeader`
21
+ - `Separator`
22
+ - `Kbd`, `KbdGroup`
23
+
24
+ ### Overlay and selection primitives
25
+
26
+ - `Tooltip`
27
+ - `Popover`
28
+ - `DropdownMenu`
29
+ - `Select`
30
+ - `Combobox`
31
+ - `panelPopupStyle`
32
+
33
+ ### Icons
34
+
35
+ - `ChatBubbleIcon`
36
+ - `ChevronRightIcon`
37
+ - `ClipboardIcon`
38
+ - `CollapseIcon`
39
+ - `ExpandIcon`
40
+ - `FolderIcon`
41
+ - `OpencodeIcon`
42
+ - `OpenInEditorIcon`
43
+ - `SaveIcon`
44
+ - `SettingsIcon`
45
+ - `TrashIcon`
46
+ - `XIcon`
47
+
48
+ ### Logo
49
+
50
+ - `Logo`
51
+
52
+ ## Intended usage for package authors
53
+
54
+ - Prefer these primitives over package-local replacements when you need standard buttons, headers, menus, selects, or text inputs.
55
+ - Keep styling inline. These components are designed to be extended with `style` props and the shared inline-style approach used throughout this repo.
56
+ - For portal-based UI inside the Trace widget, render into the widget portal container instead of `document.body`. In practice, package authors typically pair this package with `useWidgetPortalContainer()` from `@react-spot/core`.
57
+ - Keep examples and public imports limited to the shared surface available across the package's current conditional entrypoints.
58
+
59
+ ## Example
60
+
61
+ ```tsx
62
+ import { useWidgetPortalContainer } from '@react-spot/core'
63
+ import {
64
+ Button,
65
+ IconButton,
66
+ OpenInEditorIcon,
67
+ PanelHeader,
68
+ Tooltip,
69
+ } from '@react-spot/ui-components'
70
+
71
+ export function ExamplePanel() {
72
+ const portalContainer = useWidgetPortalContainer()
73
+
74
+ return (
75
+ <div>
76
+ <PanelHeader
77
+ title="Preview"
78
+ actionsRender={
79
+ <Tooltip label="Open in editor" container={portalContainer}>
80
+ <IconButton aria-label="Open in editor">
81
+ <OpenInEditorIcon size={14} />
82
+ </IconButton>
83
+ </Tooltip>
84
+ }
85
+ />
86
+
87
+ <Button variant="secondary">Refresh</Button>
88
+ </div>
89
+ )
90
+ }
91
+ ```