@railtownai/railtracks-visualizer 0.0.30 → 0.0.31
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/cjs/index.js +32 -2
- package/dist/esm/index.js +32 -2
- package/dist/types/components/ui/select.d.ts +5 -1
- package/package.json +8 -8
package/dist/cjs/index.js
CHANGED
|
@@ -24478,6 +24478,7 @@ const SelectContent = styled(Content2)`
|
|
|
24478
24478
|
z-index: 50;
|
|
24479
24479
|
min-width: 8rem;
|
|
24480
24480
|
overflow: hidden;
|
|
24481
|
+
max-height: ${(props)=>props.$maxHeight || "none"};
|
|
24481
24482
|
border-radius: ${(props)=>props.$theme.borderRadius.lg};
|
|
24482
24483
|
border: 1px solid ${(props)=>props.$theme.colors.border};
|
|
24483
24484
|
background-color: ${(props)=>props.$theme.colors.background};
|
|
@@ -24584,16 +24585,45 @@ const SelectScrollDownButtonWithRef = /*#__PURE__*/ React__namespace.forwardRef(
|
|
|
24584
24585
|
}));
|
|
24585
24586
|
});
|
|
24586
24587
|
SelectScrollDownButtonWithRef.displayName = ScrollDownButton.displayName;
|
|
24587
|
-
const SelectContentWithRef = /*#__PURE__*/ React__namespace.forwardRef(({ children, position = "popper", ...props }, ref)=>{
|
|
24588
|
+
const SelectContentWithRef = /*#__PURE__*/ React__namespace.forwardRef(({ children, position = "popper", maxItems = 6, itemHeight = "2.5rem", ...props }, ref)=>{
|
|
24588
24589
|
const { theme } = useTheme();
|
|
24590
|
+
const viewportRef = React__namespace.useRef(null);
|
|
24591
|
+
// Calculate max height based on maxItems and itemHeight
|
|
24592
|
+
const maxHeight = maxItems ? `calc(${itemHeight} * ${maxItems} + 8px)` : "none";
|
|
24593
|
+
// Handle scroll wheel events for smooth scrolling
|
|
24594
|
+
const handleWheel = React__namespace.useCallback((e)=>{
|
|
24595
|
+
if (viewportRef.current) {
|
|
24596
|
+
e.preventDefault();
|
|
24597
|
+
const scrollAmount = e.deltaY;
|
|
24598
|
+
viewportRef.current.scrollTop += scrollAmount;
|
|
24599
|
+
}
|
|
24600
|
+
}, []);
|
|
24601
|
+
React__namespace.useEffect(()=>{
|
|
24602
|
+
const viewport = viewportRef.current;
|
|
24603
|
+
if (viewport) {
|
|
24604
|
+
viewport.addEventListener("wheel", handleWheel, {
|
|
24605
|
+
passive: false
|
|
24606
|
+
});
|
|
24607
|
+
return ()=>{
|
|
24608
|
+
viewport.removeEventListener("wheel", handleWheel);
|
|
24609
|
+
};
|
|
24610
|
+
}
|
|
24611
|
+
}, [
|
|
24612
|
+
handleWheel
|
|
24613
|
+
]);
|
|
24589
24614
|
return /*#__PURE__*/ React__namespace.createElement(Portal$1, null, /*#__PURE__*/ React__namespace.createElement(SelectContent, {
|
|
24590
24615
|
ref: ref,
|
|
24591
24616
|
position: position,
|
|
24592
24617
|
$theme: theme,
|
|
24618
|
+
$maxHeight: maxHeight,
|
|
24593
24619
|
...props
|
|
24594
24620
|
}, /*#__PURE__*/ React__namespace.createElement(SelectScrollUpButtonWithRef, null), /*#__PURE__*/ React__namespace.createElement(Viewport, {
|
|
24621
|
+
ref: viewportRef,
|
|
24595
24622
|
style: {
|
|
24596
|
-
padding: "4px"
|
|
24623
|
+
padding: "4px",
|
|
24624
|
+
maxHeight: maxHeight !== "none" ? `calc(${maxHeight} - 8px)` : "none",
|
|
24625
|
+
overflowY: "auto",
|
|
24626
|
+
scrollBehavior: "smooth"
|
|
24597
24627
|
}
|
|
24598
24628
|
}, children), /*#__PURE__*/ React__namespace.createElement(SelectScrollDownButtonWithRef, null)));
|
|
24599
24629
|
});
|
package/dist/esm/index.js
CHANGED
|
@@ -24458,6 +24458,7 @@ const SelectContent = styled(Content2)`
|
|
|
24458
24458
|
z-index: 50;
|
|
24459
24459
|
min-width: 8rem;
|
|
24460
24460
|
overflow: hidden;
|
|
24461
|
+
max-height: ${(props)=>props.$maxHeight || "none"};
|
|
24461
24462
|
border-radius: ${(props)=>props.$theme.borderRadius.lg};
|
|
24462
24463
|
border: 1px solid ${(props)=>props.$theme.colors.border};
|
|
24463
24464
|
background-color: ${(props)=>props.$theme.colors.background};
|
|
@@ -24564,16 +24565,45 @@ const SelectScrollDownButtonWithRef = /*#__PURE__*/ React.forwardRef(({ ...props
|
|
|
24564
24565
|
}));
|
|
24565
24566
|
});
|
|
24566
24567
|
SelectScrollDownButtonWithRef.displayName = ScrollDownButton.displayName;
|
|
24567
|
-
const SelectContentWithRef = /*#__PURE__*/ React.forwardRef(({ children, position = "popper", ...props }, ref)=>{
|
|
24568
|
+
const SelectContentWithRef = /*#__PURE__*/ React.forwardRef(({ children, position = "popper", maxItems = 6, itemHeight = "2.5rem", ...props }, ref)=>{
|
|
24568
24569
|
const { theme } = useTheme();
|
|
24570
|
+
const viewportRef = React.useRef(null);
|
|
24571
|
+
// Calculate max height based on maxItems and itemHeight
|
|
24572
|
+
const maxHeight = maxItems ? `calc(${itemHeight} * ${maxItems} + 8px)` : "none";
|
|
24573
|
+
// Handle scroll wheel events for smooth scrolling
|
|
24574
|
+
const handleWheel = React.useCallback((e)=>{
|
|
24575
|
+
if (viewportRef.current) {
|
|
24576
|
+
e.preventDefault();
|
|
24577
|
+
const scrollAmount = e.deltaY;
|
|
24578
|
+
viewportRef.current.scrollTop += scrollAmount;
|
|
24579
|
+
}
|
|
24580
|
+
}, []);
|
|
24581
|
+
React.useEffect(()=>{
|
|
24582
|
+
const viewport = viewportRef.current;
|
|
24583
|
+
if (viewport) {
|
|
24584
|
+
viewport.addEventListener("wheel", handleWheel, {
|
|
24585
|
+
passive: false
|
|
24586
|
+
});
|
|
24587
|
+
return ()=>{
|
|
24588
|
+
viewport.removeEventListener("wheel", handleWheel);
|
|
24589
|
+
};
|
|
24590
|
+
}
|
|
24591
|
+
}, [
|
|
24592
|
+
handleWheel
|
|
24593
|
+
]);
|
|
24569
24594
|
return /*#__PURE__*/ React.createElement(Portal$1, null, /*#__PURE__*/ React.createElement(SelectContent, {
|
|
24570
24595
|
ref: ref,
|
|
24571
24596
|
position: position,
|
|
24572
24597
|
$theme: theme,
|
|
24598
|
+
$maxHeight: maxHeight,
|
|
24573
24599
|
...props
|
|
24574
24600
|
}, /*#__PURE__*/ React.createElement(SelectScrollUpButtonWithRef, null), /*#__PURE__*/ React.createElement(Viewport, {
|
|
24601
|
+
ref: viewportRef,
|
|
24575
24602
|
style: {
|
|
24576
|
-
padding: "4px"
|
|
24603
|
+
padding: "4px",
|
|
24604
|
+
maxHeight: maxHeight !== "none" ? `calc(${maxHeight} - 8px)` : "none",
|
|
24605
|
+
overflowY: "auto",
|
|
24606
|
+
scrollBehavior: "smooth"
|
|
24577
24607
|
}
|
|
24578
24608
|
}, children), /*#__PURE__*/ React.createElement(SelectScrollDownButtonWithRef, null)));
|
|
24579
24609
|
});
|
|
@@ -6,7 +6,11 @@ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.Selec
|
|
|
6
6
|
declare const SelectTriggerWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const SelectScrollUpButtonWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const SelectScrollDownButtonWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
|
|
9
|
+
interface SelectContentProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {
|
|
10
|
+
maxItems?: number;
|
|
11
|
+
itemHeight?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const SelectContentWithRef: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
14
|
declare const SelectLabelWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
15
|
declare const SelectItemWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
16
|
declare const SelectSeparatorWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@railtownai/railtracks-visualizer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Railtown AI",
|
|
6
6
|
"description": "A visualizer for RailTracks agentic flows",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@radix-ui/react-checkbox": "1.3.3",
|
|
44
44
|
"@radix-ui/react-dialog": "1.1.15",
|
|
45
45
|
"@radix-ui/react-select": "2.2.6",
|
|
46
|
-
"@railtownai/railtracks-timeline": "0.0.
|
|
46
|
+
"@railtownai/railtracks-timeline": "0.0.10",
|
|
47
47
|
"@xyflow/react": "12.8.4",
|
|
48
48
|
"lucide-react": "0.542.0",
|
|
49
49
|
"moment": "2.30.1",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
78
78
|
"@rollup/plugin-swc": "0.4.0",
|
|
79
79
|
"@rollup/plugin-terser": "0.4.4",
|
|
80
|
-
"@storybook/addon-a11y": "9.1.
|
|
81
|
-
"@storybook/addon-docs": "9.1.
|
|
82
|
-
"@storybook/addon-onboarding": "9.1.
|
|
83
|
-
"@storybook/addon-vitest": "9.1.
|
|
84
|
-
"@storybook/react-vite": "9.1.
|
|
80
|
+
"@storybook/addon-a11y": "9.1.10",
|
|
81
|
+
"@storybook/addon-docs": "9.1.10",
|
|
82
|
+
"@storybook/addon-onboarding": "9.1.10",
|
|
83
|
+
"@storybook/addon-vitest": "9.1.10",
|
|
84
|
+
"@storybook/react-vite": "9.1.10",
|
|
85
85
|
"@testing-library/jest-dom": "6.8.0",
|
|
86
86
|
"@testing-library/react": "16.3.0",
|
|
87
87
|
"@testing-library/user-event": "14.6.1",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"prettier": "3.6.2",
|
|
103
103
|
"rollup": "4.50.1",
|
|
104
104
|
"rollup-plugin-postcss": "4.0.2",
|
|
105
|
-
"storybook": "9.1.
|
|
105
|
+
"storybook": "9.1.10",
|
|
106
106
|
"tslib": "2.8.1",
|
|
107
107
|
"typescript": "5.9.2",
|
|
108
108
|
"vite": "7.1.5",
|