@conductor-by-89soone/react 0.3.1 → 0.4.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/dist/index.js CHANGED
@@ -1,18 +1,73 @@
1
- export { Badge, SeverityTag, StatusBadge } from './chunk-535YGQAR.js';
2
- export { Card, CardGrid, Panel } from './chunk-TUHWL5JC.js';
3
- export { Button, IconButton } from './chunk-G7TRTZRR.js';
4
- export { CodeBlock, Kbd, Table, Timeline } from './chunk-RBD5Z2LR.js';
5
- export { Banner, EmptyState, Meter, ProgressRing, Spinner } from './chunk-NF3ZHADJ.js';
6
- export { Checkbox, Field, Select, Switch, TextArea, TextField } from './chunk-3YDK2JBK.js';
7
- export { Dialog, Drawer, DropdownMenu, Tooltip } from './chunk-MR7FIZKV.js';
8
- export { AppShell, NavList, TopBar } from './chunk-R5BLKHR2.js';
9
- export { cx } from './chunk-WEIMKRZV.js';
10
- import { PACKAGE_NAME as PACKAGE_NAME$1, CDT_PREFIX } from '@conductor-by-89soone/tokens';
11
-
12
- var PACKAGE_NAME = "@conductor-by-89soone/react";
13
- var CONSUMED_PACKAGES = [PACKAGE_NAME$1, "@conductor-by-89soone/css"];
1
+ import { CDT_PREFIX, PACKAGE_NAME as TOKENS_PACKAGE_NAME } from "@conductor-by-89soone/tokens";
2
+ import { cx } from "./cx.js";
3
+ import { Button, IconButton } from "./action.js";
4
+ import { Card, CardGrid, Panel } from "./surface.js";
5
+ import { Badge, SeverityTag, StatusBadge } from "./status.js";
6
+ import { CodeBlock, Kbd, Table, Timeline } from "./data.js";
7
+ import { Dialog, Drawer, DropdownMenu, Tooltip } from "./overlay.js";
8
+ import { Checkbox, Field, Select, Switch, TextArea, TextField } from "./form.js";
9
+ import { Banner, EmptyState, Meter, ProgressRing, Spinner } from "./feedback.js";
10
+ import { AppShell, NavList, TopBar } from "./shell.js";
11
+ const PACKAGE_NAME = "@conductor-by-89soone/react";
12
+ const CONSUMED_PACKAGES = [TOKENS_PACKAGE_NAME, "@conductor-by-89soone/css"];
14
13
  function blockClassName(block) {
15
14
  return `${CDT_PREFIX}${block}`;
16
15
  }
17
-
18
- export { CONSUMED_PACKAGES, PACKAGE_NAME, blockClassName };
16
+ import { Combobox, MultiSelect, FilterChip, FilterToolbar, DataTable, WorkbenchLayout, DetailInspector, PathList, Breadcrumb, Skeleton, CopyButton, ProcessingStatus } from "./workbench.js";
17
+ import { Tabs, Popover, Collapsible } from "./interaction.js";
18
+ import { AppShellNavTrigger } from "./shell.js";
19
+ import { RelationGraph, layoutRelationNodes } from "./relation.js";
20
+ export {
21
+ AppShell,
22
+ AppShellNavTrigger,
23
+ Badge,
24
+ Banner,
25
+ Breadcrumb,
26
+ Button,
27
+ CONSUMED_PACKAGES,
28
+ Card,
29
+ CardGrid,
30
+ Checkbox,
31
+ CodeBlock,
32
+ Collapsible,
33
+ Combobox,
34
+ CopyButton,
35
+ DataTable,
36
+ DetailInspector,
37
+ Dialog,
38
+ Drawer,
39
+ DropdownMenu,
40
+ EmptyState,
41
+ Field,
42
+ FilterChip,
43
+ FilterToolbar,
44
+ IconButton,
45
+ Kbd,
46
+ Meter,
47
+ MultiSelect,
48
+ NavList,
49
+ PACKAGE_NAME,
50
+ Panel,
51
+ PathList,
52
+ Popover,
53
+ ProcessingStatus,
54
+ ProgressRing,
55
+ RelationGraph,
56
+ Select,
57
+ SeverityTag,
58
+ Skeleton,
59
+ Spinner,
60
+ StatusBadge,
61
+ Switch,
62
+ Table,
63
+ Tabs,
64
+ TextArea,
65
+ TextField,
66
+ Timeline,
67
+ Tooltip,
68
+ TopBar,
69
+ WorkbenchLayout,
70
+ blockClassName,
71
+ cx,
72
+ layoutRelationNodes
73
+ };
@@ -0,0 +1,37 @@
1
+ import * as react from 'react';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ import * as RadixTabs from '@radix-ui/react-tabs';
4
+ import * as RadixPopover from '@radix-ui/react-popover';
5
+ import * as RadixCollapsible from '@radix-ui/react-collapsible';
6
+
7
+ type TabsRootProps = ComponentPropsWithoutRef<typeof RadixTabs.Root>;
8
+ /** Inactive children unmount by default. forceMount preserves their state, but keeps them hidden. */
9
+ type TabsContentProps = ComponentPropsWithoutRef<typeof RadixTabs.Content>;
10
+ declare const Tabs: {
11
+ readonly Root: react.ForwardRefExoticComponent<Omit<RadixTabs.TabsProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
12
+ readonly List: react.ForwardRefExoticComponent<Omit<RadixTabs.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
13
+ readonly Trigger: react.ForwardRefExoticComponent<Omit<RadixTabs.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
14
+ readonly Content: react.ForwardRefExoticComponent<Omit<RadixTabs.TabsContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
15
+ };
16
+ type PopoverContentProps = ComponentPropsWithoutRef<typeof RadixPopover.Content> & {
17
+ /** Keep a locally scoped theme by portalling into its container. Defaults to document.body. */
18
+ readonly container?: ComponentPropsWithoutRef<typeof RadixPopover.Portal>["container"];
19
+ };
20
+ declare const Popover: {
21
+ readonly Root: react.FC<RadixPopover.PopoverProps>;
22
+ readonly Trigger: react.ForwardRefExoticComponent<RadixPopover.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
23
+ readonly Anchor: react.ForwardRefExoticComponent<RadixPopover.PopoverAnchorProps & react.RefAttributes<HTMLDivElement>>;
24
+ readonly Content: react.ForwardRefExoticComponent<Omit<RadixPopover.PopoverContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
25
+ /** Keep a locally scoped theme by portalling into its container. Defaults to document.body. */
26
+ readonly container?: ComponentPropsWithoutRef<typeof RadixPopover.Portal>["container"];
27
+ } & react.RefAttributes<HTMLDivElement>>;
28
+ readonly Close: react.ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
29
+ readonly Arrow: react.ForwardRefExoticComponent<RadixPopover.PopoverArrowProps & react.RefAttributes<SVGSVGElement>>;
30
+ };
31
+ declare const Collapsible: {
32
+ readonly Root: react.ForwardRefExoticComponent<Omit<RadixCollapsible.CollapsibleProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
33
+ readonly Trigger: react.ForwardRefExoticComponent<Omit<RadixCollapsible.CollapsibleTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
34
+ readonly Content: react.ForwardRefExoticComponent<Omit<RadixCollapsible.CollapsibleContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
35
+ };
36
+
37
+ export { Collapsible, Popover, type PopoverContentProps, Tabs, type TabsContentProps, type TabsRootProps };
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ "use client";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import * as RadixTabs from "@radix-ui/react-tabs";
5
+ import * as RadixPopover from "@radix-ui/react-popover";
6
+ import * as RadixCollapsible from "@radix-ui/react-collapsible";
7
+ import { createContext, useContext, useState, forwardRef } from "react";
8
+ import { cx } from "./cx.js";
9
+ const TabValue = createContext(void 0);
10
+ const TabsRoot = forwardRef(function TabsRoot2({ className, activationMode = "manual", value, defaultValue, onValueChange, ...props }, ref) {
11
+ const [localValue, setLocalValue] = useState(defaultValue);
12
+ const selected = value ?? localValue;
13
+ return /* @__PURE__ */ jsx(TabValue.Provider, { value: selected, children: /* @__PURE__ */ jsx(RadixTabs.Root, { ...props, ref, className: cx("cdt-tabs", className), activationMode, value: selected, onValueChange: (next) => {
14
+ setLocalValue(next);
15
+ onValueChange?.(next);
16
+ } }) });
17
+ });
18
+ const TabsList = forwardRef(function TabsList2({ className, ...props }, ref) {
19
+ return /* @__PURE__ */ jsx(RadixTabs.List, { ...props, ref, className: cx("cdt-tabs__list", className) });
20
+ });
21
+ const TabsTrigger = forwardRef(function TabsTrigger2({ className, ...props }, ref) {
22
+ return /* @__PURE__ */ jsx(RadixTabs.Trigger, { ...props, ref, className: cx("cdt-tabs__trigger", className) });
23
+ });
24
+ const TabsContent = forwardRef(function TabsContent2({ className, value, ...props }, ref) {
25
+ const selected = useContext(TabValue);
26
+ return /* @__PURE__ */ jsx(RadixTabs.Content, { ...props, value, ref, hidden: selected !== value, className: cx("cdt-tabs__content", className) });
27
+ });
28
+ const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent };
29
+ const PopoverContent = forwardRef(function PopoverContent2({ className, container, ...props }, ref) {
30
+ return /* @__PURE__ */ jsx(RadixPopover.Portal, { container, children: /* @__PURE__ */ jsx(RadixPopover.Content, { ...props, ref, className: cx("cdt-popover", className) }) });
31
+ });
32
+ const Popover = { Root: RadixPopover.Root, Trigger: RadixPopover.Trigger, Anchor: RadixPopover.Anchor, Content: PopoverContent, Close: RadixPopover.Close, Arrow: RadixPopover.Arrow };
33
+ const CollapsibleRoot = forwardRef(function CollapsibleRoot2({ className, ...props }, ref) {
34
+ return /* @__PURE__ */ jsx(RadixCollapsible.Root, { ...props, ref, className: cx("cdt-collapsible", className) });
35
+ });
36
+ const CollapsibleTrigger = forwardRef(function CollapsibleTrigger2({ className, ...props }, ref) {
37
+ return /* @__PURE__ */ jsx(RadixCollapsible.Trigger, { ...props, ref, className: cx("cdt-collapsible__trigger", className) });
38
+ });
39
+ const CollapsibleContent = forwardRef(function CollapsibleContent2({ className, ...props }, ref) {
40
+ return /* @__PURE__ */ jsx(RadixCollapsible.Content, { ...props, ref, className: cx("cdt-collapsible__content", className) });
41
+ });
42
+ const Collapsible = { Root: CollapsibleRoot, Trigger: CollapsibleTrigger, Content: CollapsibleContent };
43
+ export {
44
+ Collapsible,
45
+ Popover,
46
+ Tabs
47
+ };
package/dist/overlay.js CHANGED
@@ -1,2 +1,227 @@
1
- export { Dialog, Drawer, DropdownMenu, Tooltip } from './chunk-MR7FIZKV.js';
2
- import './chunk-WEIMKRZV.js';
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as RadixDialog from "@radix-ui/react-dialog";
4
+ import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu";
5
+ import * as RadixTooltip from "@radix-ui/react-tooltip";
6
+ import {
7
+ forwardRef
8
+ } from "react";
9
+ import { cx } from "./cx.js";
10
+ const DialogContent = forwardRef(
11
+ function DialogContent2({ children, className, size = "md", ...props }, ref) {
12
+ return /* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
13
+ /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "cdt-overlay" }),
14
+ /* @__PURE__ */ jsx(
15
+ RadixDialog.Content,
16
+ {
17
+ ...props,
18
+ ref,
19
+ className: cx(
20
+ "cdt-dialog",
21
+ size === "sm" && "cdt-dialog--sm",
22
+ className
23
+ ),
24
+ children
25
+ }
26
+ )
27
+ ] });
28
+ }
29
+ );
30
+ DialogContent.displayName = "Dialog.Content";
31
+ const DialogTitle = forwardRef(function DialogTitle2({ className, ...props }, ref) {
32
+ return /* @__PURE__ */ jsx(
33
+ RadixDialog.Title,
34
+ {
35
+ ...props,
36
+ ref,
37
+ className: cx("cdt-dialog__title", className)
38
+ }
39
+ );
40
+ });
41
+ DialogTitle.displayName = "Dialog.Title";
42
+ const DialogDescription = forwardRef(function DialogDescription2({ className, ...props }, ref) {
43
+ return /* @__PURE__ */ jsx(
44
+ RadixDialog.Description,
45
+ {
46
+ ...props,
47
+ ref,
48
+ className: cx("cdt-dialog__description", className)
49
+ }
50
+ );
51
+ });
52
+ DialogDescription.displayName = "Dialog.Description";
53
+ const DialogClose = forwardRef(
54
+ function DialogClose2({ asChild = false, className, ...props }, ref) {
55
+ return /* @__PURE__ */ jsx(
56
+ RadixDialog.Close,
57
+ {
58
+ ...props,
59
+ ref,
60
+ asChild,
61
+ className: cx(
62
+ "cdt-dialog__close",
63
+ !asChild && "cdt-btn",
64
+ !asChild && "cdt-btn--secondary",
65
+ !asChild && "cdt-btn--sm",
66
+ className
67
+ )
68
+ }
69
+ );
70
+ }
71
+ );
72
+ DialogClose.displayName = "Dialog.Close";
73
+ const Dialog = {
74
+ Root: RadixDialog.Root,
75
+ Trigger: RadixDialog.Trigger,
76
+ Content: DialogContent,
77
+ Title: DialogTitle,
78
+ Description: DialogDescription,
79
+ Close: DialogClose
80
+ };
81
+ const DrawerContent = forwardRef(
82
+ function DrawerContent2({ children, className, side = "right", ...props }, ref) {
83
+ return /* @__PURE__ */ jsxs(RadixDialog.Portal, { children: [
84
+ /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "cdt-overlay" }),
85
+ /* @__PURE__ */ jsx(
86
+ RadixDialog.Content,
87
+ {
88
+ ...props,
89
+ ref,
90
+ className: cx("cdt-drawer", `cdt-drawer--${side}`, className),
91
+ children
92
+ }
93
+ )
94
+ ] });
95
+ }
96
+ );
97
+ DrawerContent.displayName = "Drawer.Content";
98
+ const DrawerTitle = forwardRef(function DrawerTitle2({ className, ...props }, ref) {
99
+ return /* @__PURE__ */ jsx(
100
+ RadixDialog.Title,
101
+ {
102
+ ...props,
103
+ ref,
104
+ className: cx("cdt-drawer__title", className)
105
+ }
106
+ );
107
+ });
108
+ DrawerTitle.displayName = "Drawer.Title";
109
+ const DrawerClose = forwardRef(
110
+ function DrawerClose2({ asChild = false, className, ...props }, ref) {
111
+ return /* @__PURE__ */ jsx(
112
+ RadixDialog.Close,
113
+ {
114
+ ...props,
115
+ ref,
116
+ asChild,
117
+ className: cx(
118
+ "cdt-drawer__close",
119
+ !asChild && "cdt-btn",
120
+ !asChild && "cdt-btn--secondary",
121
+ !asChild && "cdt-btn--sm",
122
+ className
123
+ )
124
+ }
125
+ );
126
+ }
127
+ );
128
+ DrawerClose.displayName = "Drawer.Close";
129
+ const Drawer = {
130
+ Root: RadixDialog.Root,
131
+ Trigger: RadixDialog.Trigger,
132
+ Content: DrawerContent,
133
+ Title: DrawerTitle,
134
+ Description: RadixDialog.Description,
135
+ Close: DrawerClose
136
+ };
137
+ const TooltipContent = forwardRef(
138
+ function TooltipContent2({ children, className, showArrow = true, ...props }, ref) {
139
+ return /* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs(
140
+ RadixTooltip.Content,
141
+ {
142
+ ...props,
143
+ ref,
144
+ className: cx("cdt-tooltip", className),
145
+ children: [
146
+ children,
147
+ showArrow ? /* @__PURE__ */ jsx(RadixTooltip.Arrow, { className: "cdt-tooltip__arrow" }) : null
148
+ ]
149
+ }
150
+ ) });
151
+ }
152
+ );
153
+ TooltipContent.displayName = "Tooltip.Content";
154
+ const Tooltip = {
155
+ Provider: RadixTooltip.Provider,
156
+ Root: RadixTooltip.Root,
157
+ Trigger: RadixTooltip.Trigger,
158
+ Content: TooltipContent
159
+ };
160
+ const DropdownMenuContent = forwardRef(function DropdownMenuContent2({ className, ...props }, ref) {
161
+ return /* @__PURE__ */ jsx(RadixDropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
162
+ RadixDropdownMenu.Content,
163
+ {
164
+ ...props,
165
+ ref,
166
+ className: cx("cdt-menu", className)
167
+ }
168
+ ) });
169
+ });
170
+ DropdownMenuContent.displayName = "DropdownMenu.Content";
171
+ const DropdownMenuItem = forwardRef(
172
+ function DropdownMenuItem2({ children, className, icon, tone = "neutral", ...props }, ref) {
173
+ return /* @__PURE__ */ jsxs(
174
+ RadixDropdownMenu.Item,
175
+ {
176
+ ...props,
177
+ ref,
178
+ className: cx(
179
+ "cdt-menu__item",
180
+ tone === "danger" && "cdt-menu__item--danger",
181
+ className
182
+ ),
183
+ children: [
184
+ icon === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "cdt-menu__item-icon", "aria-hidden": "true", children: icon }),
185
+ children
186
+ ]
187
+ }
188
+ );
189
+ }
190
+ );
191
+ DropdownMenuItem.displayName = "DropdownMenu.Item";
192
+ const DropdownMenuLabel = forwardRef(function DropdownMenuLabel2({ className, ...props }, ref) {
193
+ return /* @__PURE__ */ jsx(
194
+ RadixDropdownMenu.Label,
195
+ {
196
+ ...props,
197
+ ref,
198
+ className: cx("cdt-menu__label", className)
199
+ }
200
+ );
201
+ });
202
+ DropdownMenuLabel.displayName = "DropdownMenu.Label";
203
+ const DropdownMenuSeparator = forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
204
+ return /* @__PURE__ */ jsx(
205
+ RadixDropdownMenu.Separator,
206
+ {
207
+ ...props,
208
+ ref,
209
+ className: cx("cdt-menu__separator", className)
210
+ }
211
+ );
212
+ });
213
+ DropdownMenuSeparator.displayName = "DropdownMenu.Separator";
214
+ const DropdownMenu = {
215
+ Root: RadixDropdownMenu.Root,
216
+ Trigger: RadixDropdownMenu.Trigger,
217
+ Content: DropdownMenuContent,
218
+ Item: DropdownMenuItem,
219
+ Label: DropdownMenuLabel,
220
+ Separator: DropdownMenuSeparator
221
+ };
222
+ export {
223
+ Dialog,
224
+ Drawer,
225
+ DropdownMenu,
226
+ Tooltip
227
+ };
@@ -0,0 +1,56 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ interface RelationNode {
5
+ readonly id: string;
6
+ readonly label: string;
7
+ readonly description?: string;
8
+ /** Consumer-sanitized state; never infer or reveal why content is unavailable. */
9
+ readonly unavailable?: boolean;
10
+ }
11
+ interface RelationEdge {
12
+ readonly id: string;
13
+ readonly source: string;
14
+ readonly target: string;
15
+ readonly type: string;
16
+ /** A verb phrase read as “source → label → target”. */
17
+ readonly label: string;
18
+ readonly evidence: string;
19
+ readonly confidence?: string;
20
+ readonly unresolved?: boolean;
21
+ readonly ambiguous?: boolean;
22
+ readonly retracted?: boolean;
23
+ }
24
+ type RelationSelection = {
25
+ readonly kind: "node" | "edge";
26
+ readonly id: string;
27
+ } | null;
28
+ interface RelationViewport {
29
+ readonly x: number;
30
+ readonly y: number;
31
+ readonly zoom: number;
32
+ }
33
+ interface RelationGraphProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> {
34
+ readonly nodes: readonly RelationNode[];
35
+ readonly edges: readonly RelationEdge[];
36
+ readonly label: string;
37
+ readonly selection?: RelationSelection;
38
+ readonly onSelectionChange?: (selection: RelationSelection) => void;
39
+ readonly viewport?: RelationViewport;
40
+ readonly onViewportChange?: (viewport: RelationViewport) => void;
41
+ readonly state?: "ready" | "loading" | "empty" | "error" | "partial";
42
+ readonly stateMessage?: string;
43
+ readonly onRetry?: () => void;
44
+ }
45
+ /** Stable ID order, bounded O(n log n), and no assumption of a directed acyclic graph. */
46
+ declare function layoutRelationNodes(nodes: readonly RelationNode[]): {
47
+ x: number;
48
+ y: number;
49
+ id: string;
50
+ label: string;
51
+ description?: string;
52
+ unavailable?: boolean;
53
+ }[];
54
+ declare const RelationGraph: react.ForwardRefExoticComponent<RelationGraphProps & react.RefAttributes<HTMLDivElement>>;
55
+
56
+ export { type RelationEdge, RelationGraph, type RelationGraphProps, type RelationNode, type RelationSelection, type RelationViewport, layoutRelationNodes };