@skyvexsoftware/stratos-sdk 0.10.5 → 0.11.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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/ui/combobox.d.ts +31 -0
- package/dist/ui/combobox.js +24 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/popover.d.ts +8 -0
- package/dist/ui/popover.js +10 -0
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ export { useShellToast } from "./hooks/useShellToast";
|
|
|
30
30
|
export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSystemMetrics, } from "./hooks/useSimulatorData";
|
|
31
31
|
export { SOCKET_EVENTS } from "./shared-types/socket-events";
|
|
32
32
|
export type { AutoStartConfirmPayload, ConnectionState, LogEntryPayload, NotificationPayload, ProtocolUrlPayload, SimulatorDataPayload, SimulatorStatusPayload, SocketEventName, SystemMetricsPayload, } from "./shared-types/socket-events";
|
|
33
|
-
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
|
|
34
|
-
export type { BadgeProps, ButtonProps } from "./ui";
|
|
33
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
|
|
34
|
+
export type { BadgeProps, ButtonProps, ComboboxOption, ComboboxProps, } from "./ui";
|
|
35
35
|
export { STRATOS_ICONS, STRATOS_ICON_NAMES } from "./icons";
|
|
36
36
|
export { cn } from "./utils/cn";
|
|
37
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export { useSocket, useSimulatorData, useProtocolUrl, useNotifications, useSyste
|
|
|
25
25
|
// ── Socket.io Event Catalog ──────────────────────────────────────────────
|
|
26
26
|
export { SOCKET_EVENTS } from "./shared-types/socket-events";
|
|
27
27
|
// ── UI Primitives ──────────────────────────────────────────────────────
|
|
28
|
-
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
|
|
28
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, Badge, badgeVariants, Button, buttonVariants, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui";
|
|
29
29
|
// ── Icons (deprecated) ────────────────────────────────────────────────
|
|
30
30
|
// Kept as a thin re-export of lucide-react's icons registry so plugin
|
|
31
31
|
// bundles built against earlier SDK versions keep working when core
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type ComboboxOption = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export type ComboboxProps = {
|
|
6
|
+
options: ComboboxOption[];
|
|
7
|
+
value?: string;
|
|
8
|
+
onValueChange?: (value: string) => void;
|
|
9
|
+
/** Trigger text shown when nothing is selected. */
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
/** Placeholder inside the search field. */
|
|
12
|
+
searchPlaceholder?: string;
|
|
13
|
+
/** Shown when the search filter matches nothing. */
|
|
14
|
+
emptyText?: string;
|
|
15
|
+
/** Render a loading row instead of the list (e.g. while options are fetched). */
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
loadingText?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
triggerClassName?: string;
|
|
20
|
+
contentClassName?: string;
|
|
21
|
+
align?: "start" | "center" | "end";
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Searchable single-select built on Popover + cmdk. The list scrolls
|
|
26
|
+
* natively (no hover auto-scroll arrows), filters as you type, and marks the
|
|
27
|
+
* selected option with a check. Pass `loading` while options are being
|
|
28
|
+
* fetched to keep the trigger usable without a flickering empty state.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, loading, loadingText, disabled, triggerClassName, contentClassName, align, onOpenChange, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Command } from "cmdk";
|
|
4
|
+
import { Check, ChevronsUpDown, Search } from "lucide-react";
|
|
5
|
+
import { cn } from "../utils/cn";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
7
|
+
/**
|
|
8
|
+
* Searchable single-select built on Popover + cmdk. The list scrolls
|
|
9
|
+
* natively (no hover auto-scroll arrows), filters as you type, and marks the
|
|
10
|
+
* selected option with a check. Pass `loading` while options are being
|
|
11
|
+
* fetched to keep the trigger usable without a flickering empty state.
|
|
12
|
+
*/
|
|
13
|
+
export function Combobox({ options, value, onValueChange, placeholder = "Select…", searchPlaceholder = "Search…", emptyText = "No results.", loading = false, loadingText = "Loading…", disabled = false, triggerClassName, contentClassName, align = "start", onOpenChange, }) {
|
|
14
|
+
const [open, setOpen] = React.useState(false);
|
|
15
|
+
const selected = options.find((option) => option.value === value);
|
|
16
|
+
const handleOpenChange = (next) => {
|
|
17
|
+
setOpen(next);
|
|
18
|
+
onOpenChange?.(next);
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs(Popover, { open: open, onOpenChange: handleOpenChange, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", role: "combobox", "aria-expanded": open, disabled: disabled, className: cn("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", triggerClassName), children: [_jsx("span", { className: cn("truncate", !selected && "text-muted-foreground"), children: selected ? selected.label : placeholder }), _jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { align: align, className: cn("w-[var(--radix-popover-trigger-width)] p-0", contentClassName), children: _jsxs(Command, { className: "text-popover-foreground flex w-full flex-col overflow-hidden", children: [_jsxs("div", { className: "border-border flex items-center border-b px-2.5", children: [_jsx(Search, { className: "text-muted-foreground mr-2 h-4 w-4 shrink-0" }), _jsx(Command.Input, { placeholder: searchPlaceholder, className: "placeholder:text-muted-foreground h-9 w-full bg-transparent py-2 text-sm outline-none" })] }), _jsx(Command.List, { className: "max-h-60 overflow-y-auto p-1", children: loading ? (_jsx("div", { className: "text-muted-foreground py-3 text-center text-sm", children: loadingText })) : (_jsxs(_Fragment, { children: [_jsx(Command.Empty, { className: "text-muted-foreground py-3 text-center text-sm", children: emptyText }), options.map((option) => (_jsxs(Command.Item, { value: `${option.label} ${option.value}`, onSelect: () => {
|
|
21
|
+
onValueChange?.(option.value);
|
|
22
|
+
handleOpenChange(false);
|
|
23
|
+
}, className: "aria-selected:bg-accent aria-selected:text-accent-foreground flex cursor-pointer items-center rounded-sm px-2 py-1.5 text-sm outline-none", children: [_jsx(Check, { className: cn("mr-2 h-4 w-4 shrink-0", value === option.value ? "opacity-100" : "opacity-0") }), _jsx("span", { className: "truncate", children: option.label })] }, option.value)))] })) })] }) })] }));
|
|
24
|
+
}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -4,9 +4,12 @@ export type { BadgeProps } from "./badge";
|
|
|
4
4
|
export { Button, buttonVariants } from "./button";
|
|
5
5
|
export type { ButtonProps } from "./button";
|
|
6
6
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "./card";
|
|
7
|
+
export { Combobox } from "./combobox";
|
|
8
|
+
export type { ComboboxOption, ComboboxProps } from "./combobox";
|
|
7
9
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./dialog";
|
|
8
10
|
export { Input } from "./input";
|
|
9
11
|
export { Label } from "./label";
|
|
12
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, } from "./popover";
|
|
10
13
|
export { RadioGroup, RadioGroupItem } from "./radio-group";
|
|
11
14
|
export { Slider } from "./slider";
|
|
12
15
|
export { Switch } from "./switch";
|
package/dist/ui/index.js
CHANGED
|
@@ -2,9 +2,11 @@ export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger,
|
|
|
2
2
|
export { Badge, badgeVariants } from "./badge";
|
|
3
3
|
export { Button, buttonVariants } from "./button";
|
|
4
4
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "./card";
|
|
5
|
+
export { Combobox } from "./combobox";
|
|
5
6
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./dialog";
|
|
6
7
|
export { Input } from "./input";
|
|
7
8
|
export { Label } from "./label";
|
|
9
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, } from "./popover";
|
|
8
10
|
export { RadioGroup, RadioGroupItem } from "./radio-group";
|
|
9
11
|
export { Slider } from "./slider";
|
|
10
12
|
export { Switch } from "./switch";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent };
|
|
8
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
import { cn } from "../utils/cn";
|
|
5
|
+
const Popover = PopoverPrimitive.Root;
|
|
6
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
7
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
8
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 w-72 rounded-md border p-4 shadow-md outline-none", className), ...props }) })));
|
|
9
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
10
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyvexsoftware/stratos-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Plugin SDK for Stratos — types, hooks, and UI components",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Skyvex Software Pty Ltd",
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"@radix-ui/react-alert-dialog": "^1.1.0",
|
|
87
87
|
"@radix-ui/react-dialog": "^1.1.0",
|
|
88
88
|
"@radix-ui/react-label": "^2.1.0",
|
|
89
|
+
"@radix-ui/react-popover": "^1.1.0",
|
|
89
90
|
"@radix-ui/react-radio-group": "^1.3.0",
|
|
90
91
|
"@radix-ui/react-select": "^2.1.0",
|
|
91
92
|
"@radix-ui/react-separator": "^1.1.0",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"@tanstack/react-query": "^5.99.0",
|
|
98
99
|
"@vitejs/plugin-react": "^5.0.0",
|
|
99
100
|
"class-variance-authority": "^0.7.0",
|
|
101
|
+
"cmdk": "^1.0.0",
|
|
100
102
|
"lucide-react": ">=0.300.0",
|
|
101
103
|
"react": "^19.0.0",
|
|
102
104
|
"socket.io-client": "^4.0.0",
|
|
@@ -112,6 +114,7 @@
|
|
|
112
114
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
113
115
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
114
116
|
"@radix-ui/react-label": "^2.1.8",
|
|
117
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
115
118
|
"@radix-ui/react-radio-group": "^1.3.8",
|
|
116
119
|
"@radix-ui/react-select": "^2.1.8",
|
|
117
120
|
"@radix-ui/react-separator": "^1.1.4",
|
|
@@ -125,6 +128,7 @@
|
|
|
125
128
|
"@vitejs/plugin-react": "^5.1.4",
|
|
126
129
|
"react-dom": "^19.0.0",
|
|
127
130
|
"class-variance-authority": "^0.7.1",
|
|
131
|
+
"cmdk": "^1.1.1",
|
|
128
132
|
"lucide-react": "^0.577.0",
|
|
129
133
|
"socket.io-client": "^4.8.3",
|
|
130
134
|
"typescript": "^5.8.3",
|