@tradalab/lyra 3.19.0 → 3.21.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 +3 -3
- package/dist/{account-menu-q2VMEk3b.d.ts → account-menu-CGAOXP_j.d.ts} +6 -1
- package/dist/blocks/index.d.ts +101 -2
- package/dist/blocks/index.js +123 -9
- package/dist/blocks/index.js.map +1 -1
- package/dist/{chunk-D7DMRCDY.js → chunk-24BDCHMS.js} +60 -3
- package/dist/chunk-24BDCHMS.js.map +1 -0
- package/dist/{chunk-W3J2KTYP.js → chunk-RK4ODMGO.js} +37 -5
- package/dist/chunk-RK4ODMGO.js.map +1 -0
- package/dist/{chunk-ASSRDIKG.js → chunk-RLCWEDMW.js} +5 -5
- package/dist/chunk-RLCWEDMW.js.map +1 -0
- package/dist/{chunk-UNRT3B6P.js → chunk-ZJRNRX6T.js} +113 -13
- package/dist/chunk-ZJRNRX6T.js.map +1 -0
- package/dist/hooks/index.d.ts +27 -1
- package/dist/hooks/index.js +2 -2
- package/dist/shell/index.d.ts +16 -2
- package/dist/shell/index.js +25 -6
- package/dist/shell/index.js.map +1 -1
- package/dist/sidebar-width-BK0gbgLG.d.ts +22 -0
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-ASSRDIKG.js.map +0 -1
- package/dist/chunk-D7DMRCDY.js.map +0 -1
- package/dist/chunk-UNRT3B6P.js.map +0 -1
- package/dist/chunk-W3J2KTYP.js.map +0 -1
package/README.md
CHANGED
|
@@ -25,11 +25,11 @@ The stylesheet pulls in Tailwind v4, so your app needs `@tailwindcss/postcss`.
|
|
|
25
25
|
| Subpath | Exports | Boundary |
|
|
26
26
|
|---|---|---|
|
|
27
27
|
| `@tradalab/lyra/utils` | `cn`, `foldText`, `formatBytes`/`formatCount`, `addTag`/`matchesKeyword`, `pickDelimiter`/`groupByPrefix`, `CONNECTION_COLORS`/`resolveColor`/`ENV_FRAME` | server-safe |
|
|
28
|
-
| `@tradalab/lyra/hooks` | `useMobile`, `useDirtyFields`, `useBackClose`/`pushBackLayer` | client |
|
|
28
|
+
| `@tradalab/lyra/hooks` | `useMobile`, `useDirtyFields`, `useBackClose`/`pushBackLayer`, `useSidebarWidth` + `clampSidebarWidth`/`SIDEBAR_WIDTH_KEY` | client |
|
|
29
29
|
| `@tradalab/lyra/ui` | 61 shadcn primitives + `AccountMenu`, `ActionButton`, `Container`, `EmptyState`, `StatusBadge` | client |
|
|
30
|
-
| `@tradalab/lyra/blocks` | `Form`/`FormField` + RHF glue, `Panel`, `Confirm`/`useConfirm`, `Tree`, `TzPicker`, `OptionPicker`, `MobileSheet`, `ChoiceDrawer`, `McpSettings`, `LlmSettings`, `PlatePicker`, `usePlate`, `useCompact`, `PreferenceScript`, `StatTile`, `BarList`, `ColorSwatches`, `TagInput`, `loadExpanded`/`saveExpanded`, `DateField`, `LockedReason`, `UnsavedBadge`, `useConfirmReason`, `useBlocked`, `ConnectionTree`/`buildConnectionTree`, `ConfigListDialog`, `SshFields`/`TlsFields`/`ProxyFields` + `sshDefaults`/`tlsDefaults`/`proxyDefaults`, `ReleaseNotes`, `useHostKeyTrust` + `hostKeyAsk`/`retryAfterTrust` | client |
|
|
30
|
+
| `@tradalab/lyra/blocks` | `Form`/`FormField` + RHF glue, `Panel`, `Confirm`/`useConfirm`, `Tree`, `TzPicker`, `OptionPicker`, `MobileSheet`, `ChoiceDrawer`, `McpSettings`, `LlmSettings`, `PlatePicker`, `usePlate`, `useCompact`, `PreferenceScript`, `StatTile`, `BarList`, `ColorSwatches`, `TagInput`, `loadExpanded`/`saveExpanded`, `DateField`, `LockedReason`, `UnsavedBadge`, `useConfirmReason`, `useBlocked`, `ConnectionTree`/`buildConnectionTree`, `ConfigListDialog`, `SshFields`/`TlsFields`/`ProxyFields` + `sshDefaults`/`tlsDefaults`/`proxyDefaults`, `ReleaseNotes`, `useHostKeyTrust` + `hostKeyAsk`/`retryAfterTrust`, `ListSection`/`ListSectionTitle`/`ListItem`/`ListRow` | client |
|
|
31
31
|
| `@tradalab/lyra/data-table` | `DataTable` + `usePager`, `TableFilterBar`, `TableFilterChips`, `TableSearch`, `TableReload`, `filterRows`, `pageWindow` | client |
|
|
32
|
-
| `@tradalab/lyra/shell` | `AppShell`, `PageShell`, `PageHeader`, `NavItem`, `NavGroup`, `Breadcrumbs`, `BottomNav`, `useActiveRoute`, `useSearchParam`, `useTabParam`, `usePageParam`, `UrlTabs` | client |
|
|
32
|
+
| `@tradalab/lyra/shell` | `AppShell`, `PageShell`, `PageHeader`, `TopBar`, `NavItem`, `NavGroup`, `Breadcrumbs`, `BottomNav`, `useActiveRoute`, `useSearchParam`, `useTabParam`, `usePageParam`, `UrlTabs` | client |
|
|
33
33
|
| `@tradalab/lyra/styles.css` | Tailwind v4 base + `radix-lyra` tokens (light/dark) | CSS |
|
|
34
34
|
|
|
35
35
|
Client subpaths carry a build-injected `"use client"`; import them inside a
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { S as SidebarResize } from './sidebar-width-BK0gbgLG.js';
|
|
4
5
|
import { Separator as Separator$1, Tooltip as Tooltip$1, Tabs as Tabs$1 } from 'radix-ui';
|
|
5
6
|
|
|
6
7
|
declare const buttonVariants: (props?: ({
|
|
@@ -38,12 +39,16 @@ type SidebarContextProps = {
|
|
|
38
39
|
setOpenMobile: (open: boolean) => void;
|
|
39
40
|
isMobile: boolean;
|
|
40
41
|
toggleSidebar: () => void;
|
|
42
|
+
resize: SidebarResize | undefined;
|
|
43
|
+
width: number | null;
|
|
44
|
+
setWidth: (px: number | null) => void;
|
|
41
45
|
};
|
|
42
46
|
declare function useSidebar(): SidebarContextProps;
|
|
43
|
-
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
47
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, resizable, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
44
48
|
defaultOpen?: boolean;
|
|
45
49
|
open?: boolean;
|
|
46
50
|
onOpenChange?: (open: boolean) => void;
|
|
51
|
+
resizable?: boolean | SidebarResize;
|
|
47
52
|
}): React.JSX.Element;
|
|
48
53
|
declare function Sidebar({ side, variant, collapsible, className, children, dir, ...props }: React.ComponentProps<"div"> & {
|
|
49
54
|
side?: "left" | "right";
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_hook_form from 'react-hook-form';
|
|
2
2
|
import { FieldValues, FieldPath, ControllerProps, UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import { ReactNode, DragEvent, HTMLAttributes, ComponentProps, ReactElement } from 'react';
|
|
4
|
+
import { ReactNode, DragEvent, HTMLAttributes, ComponentProps, ReactElement, ComponentType } from 'react';
|
|
5
5
|
import { Slot, Label } from 'radix-ui';
|
|
6
6
|
import { LucideIcon } from 'lucide-react';
|
|
7
7
|
import { d as ConnectionColor } from '../connection-color-DxEs04ll.js';
|
|
@@ -1001,4 +1001,103 @@ interface ReleaseNotesProps {
|
|
|
1001
1001
|
*/
|
|
1002
1002
|
declare function ReleaseNotes({ notes, onOpenLink, className }: ReleaseNotesProps): React$1.JSX.Element;
|
|
1003
1003
|
|
|
1004
|
-
|
|
1004
|
+
interface SegmentedOption<T extends string = string> {
|
|
1005
|
+
value: T;
|
|
1006
|
+
label: ReactNode;
|
|
1007
|
+
}
|
|
1008
|
+
interface SegmentedProps<T extends string = string> {
|
|
1009
|
+
options: readonly SegmentedOption<T>[];
|
|
1010
|
+
value: T | undefined;
|
|
1011
|
+
onValueChange: (value: T) => void;
|
|
1012
|
+
label?: string;
|
|
1013
|
+
className?: string;
|
|
1014
|
+
}
|
|
1015
|
+
/** One of a few options as a row of buttons; the chosen one is filled with the primary colour. */
|
|
1016
|
+
declare function Segmented<T extends string = string>({ options, value, onValueChange, label, className }: SegmentedProps<T>): React$1.JSX.Element;
|
|
1017
|
+
interface ConsentCheckProps {
|
|
1018
|
+
checked: boolean;
|
|
1019
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1020
|
+
label: ReactNode;
|
|
1021
|
+
title?: ReactNode;
|
|
1022
|
+
icon?: ReactNode;
|
|
1023
|
+
summary?: ReactNode;
|
|
1024
|
+
policyLabel?: ReactNode;
|
|
1025
|
+
onOpenPolicy?: () => void;
|
|
1026
|
+
className?: string;
|
|
1027
|
+
}
|
|
1028
|
+
/** A policy summary with a link to the full text, and the box the user ticks to agree. */
|
|
1029
|
+
declare function ConsentCheck({ checked, onCheckedChange, label, title, icon, summary, policyLabel, onOpenPolicy, className }: ConsentCheckProps): React$1.JSX.Element;
|
|
1030
|
+
interface OnboardingStep {
|
|
1031
|
+
id: string;
|
|
1032
|
+
title: ReactNode;
|
|
1033
|
+
icon?: ReactNode;
|
|
1034
|
+
description?: ReactNode;
|
|
1035
|
+
content?: ReactNode;
|
|
1036
|
+
canContinue?: boolean;
|
|
1037
|
+
}
|
|
1038
|
+
interface OnboardingLabels {
|
|
1039
|
+
next: ReactNode;
|
|
1040
|
+
back: ReactNode;
|
|
1041
|
+
done: ReactNode;
|
|
1042
|
+
}
|
|
1043
|
+
interface OnboardingProps {
|
|
1044
|
+
steps: readonly OnboardingStep[];
|
|
1045
|
+
labels: OnboardingLabels;
|
|
1046
|
+
onDone: () => void;
|
|
1047
|
+
className?: string;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Full-screen first-run steps with progress dots, Back and Next; the last step's button calls `onDone`.
|
|
1051
|
+
* A step with `canContinue: false` disables its forward button, which is how a consent step waits for its box.
|
|
1052
|
+
*/
|
|
1053
|
+
declare function Onboarding({ steps, labels, onDone, className }: OnboardingProps): React$1.JSX.Element | null;
|
|
1054
|
+
|
|
1055
|
+
interface HintProps {
|
|
1056
|
+
storageKey: string;
|
|
1057
|
+
children: ReactNode;
|
|
1058
|
+
icon?: ReactNode;
|
|
1059
|
+
when?: boolean;
|
|
1060
|
+
dismissLabel?: string;
|
|
1061
|
+
className?: string;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* A tip shown until the user closes it once; the close is remembered on the device under `storageKey`.
|
|
1065
|
+
* `when: false` keeps it hidden without using it up, so a tip can wait for the moment it is about.
|
|
1066
|
+
*/
|
|
1067
|
+
declare function Hint({ storageKey, children, icon, when, dismissLabel, className }: HintProps): React$1.JSX.Element | null;
|
|
1068
|
+
|
|
1069
|
+
type ListIcon = ComponentType<{
|
|
1070
|
+
className?: string;
|
|
1071
|
+
}>;
|
|
1072
|
+
interface ListSectionProps {
|
|
1073
|
+
title?: ReactNode;
|
|
1074
|
+
footer?: ReactNode;
|
|
1075
|
+
className?: string;
|
|
1076
|
+
children: ReactNode;
|
|
1077
|
+
}
|
|
1078
|
+
/** The small heading above a `ListSection` card, for content that is not a list of rows. */
|
|
1079
|
+
declare function ListSectionTitle({ className, ...props }: ComponentProps<"h2">): React$1.JSX.Element;
|
|
1080
|
+
/** A titled group of settings rows on one card; fill it with `ListItem` and `ListRow`. */
|
|
1081
|
+
declare function ListSection({ title, footer, className, children }: ListSectionProps): React$1.JSX.Element;
|
|
1082
|
+
interface ListLabelProps {
|
|
1083
|
+
icon?: ListIcon;
|
|
1084
|
+
inset?: boolean;
|
|
1085
|
+
label: ReactNode;
|
|
1086
|
+
hint?: ReactNode;
|
|
1087
|
+
}
|
|
1088
|
+
type ListItemProps = ListLabelProps & {
|
|
1089
|
+
value?: ReactNode;
|
|
1090
|
+
} & Omit<ComponentProps<"button">, "value">;
|
|
1091
|
+
/**
|
|
1092
|
+
* A tappable row with a chevron; a real `button`, so it works as a `SheetTrigger asChild` child.
|
|
1093
|
+
* `inset` lines a row without an icon up under the label of an icon row above it.
|
|
1094
|
+
*/
|
|
1095
|
+
declare function ListItem({ icon, inset, label, hint, value, className, ...props }: ListItemProps): React$1.JSX.Element;
|
|
1096
|
+
type ListRowProps = ListLabelProps & {
|
|
1097
|
+
className?: string;
|
|
1098
|
+
children?: ReactNode;
|
|
1099
|
+
};
|
|
1100
|
+
/** A row that holds its own control (switch, button) on the right, so no button wraps another. */
|
|
1101
|
+
declare function ListRow({ icon, inset, label, hint, className, children }: ListRowProps): React$1.JSX.Element;
|
|
1102
|
+
|
|
1103
|
+
export { AuthCard, type AuthCardProps, AvatarTile, type AvatarTileProps, BarList, type BarListItem, BlockedContext, BlockedDialog, type BlockedFn, type BlockedOptions, ChoiceDrawer, type ChoiceDrawerProps, type ChoiceOption, ColorSwatches, type ColorSwatchesProps, ConfigListDialog, type ConfigListDialogLabels, type ConfigListDialogProps, ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, ConfirmReasonContext, type ConfirmReasonFn, type ConfirmReasonOptions, ConnectionTree, type ConnectionTreeConnection, type ConnectionTreeGroup, type ConnectionTreeItem, type ConnectionTreeProps, ConsentCheck, type ConsentCheckProps, DateField, type DateFieldProps, type DatePattern, type DropPlan, type DropPosition, type FieldsLabels, type FlatTreeNode, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HOST_KEY_CHANGED, HOST_KEY_UNKNOWN, Hint, type HintProps, type HostKeyAsk, type HostKeyLabels, type ListIcon, ListItem, type ListItemProps, type ListLabelProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, ListSectionTitle, type LlmCapability, type LlmDriver, type LlmField, type LlmFound, type LlmModel, type LlmProvider, type LlmProviderInput, type LlmPullProgress, LlmSettings, type LlmSettingsApi, type LlmSettingsFormat, type LlmSettingsLabels, type LlmSettingsProps, type LlmSlot, type LlmState, LockedReason, type McpCall, type McpClient, McpSettings, type McpSettingsApi, type McpSettingsLabels, type McpStatus, type McpTool, MobileSheet, type MobileSheetProps, Onboarding, type OnboardingLabels, type OnboardingProps, type OnboardingStep, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, ProxyFields, type ProxyFieldsLabels, type ProxyValues, type ReasonField, ReleaseNotes, type ReleaseNotesProps, Segmented, type SegmentedOption, type SegmentedProps, SshFields, type SshFieldsLabels, type SshKind, type SshValues, StatTile, type StatTileProps, TagInput, type TagInputProps, TlsFields, type TlsFieldsLabels, type TlsValues, type TreeData, TreeDndProvider, type TreeDndProviderProps, TreeExpander, type TreeExpanderProps, TreeIcon, type TreeIconProps, TreeLabel, type TreeLabelProps, TreeLines, TreeNode, TreeNodeContent, type TreeNodeContentProps, type TreeNodeProps, TreeNodeTrigger, type TreeNodeTriggerProps, TreeProvider, type TreeProviderProps, TreeView, type TreeViewProps, type TrustOutcome, TzPicker, type TzPickerLabels, type TzPickerProps, UnsavedBadge, buildConnectionTree, connectionNameMatches, datePattern, filterTree, flattenTree, formatDate, hostKeyAsk, loadExpanded, moveId, parseDate, planDrop, proxyDefaults, retryAfterTrust, sameOrder, saveExpanded, sharedWhilePending, sortTree, sshDefaults, tlsDefaults, useBlocked, useConfirm, useConfirmReason, useFormField, useHostKeyTrust, useTreeDndNode, useTreeDndRoot };
|
package/dist/blocks/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Label, Badge, Spinner, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Combobox, ComboboxInput, ComboboxContent, ComboboxEmpty, ComboboxList, ComboboxItem, Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, Calendar, Alert, AlertDescription, FieldGroup, FieldSet, FieldLegend, FieldDescription, Field, FieldContent, FieldLabel, FieldSeparator, Progress } from '../chunk-
|
|
3
|
-
export { PreferenceScript } from '../chunk-
|
|
4
|
-
import { NativeSelect, NativeSelectOption } from '../chunk-KSF233MC.js';
|
|
5
|
-
import { useBackClose } from '../chunk-
|
|
6
|
-
export { useCompact, usePlate } from '../chunk-
|
|
7
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, SidebarGroupContent, SidebarMenu, SidebarContent, SidebarGroup, Switch, RadioGroup, RadioGroupItem } from '../chunk-
|
|
8
|
-
export { PlatePicker } from '../chunk-
|
|
9
|
-
export { BEARING_PLATES, PLATES, derivePlate, isPlate } from '../chunk-
|
|
2
|
+
import { Label, Badge, Spinner, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Combobox, ComboboxInput, ComboboxContent, ComboboxEmpty, ComboboxList, ComboboxItem, Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, Calendar, Alert, AlertDescription, FieldGroup, FieldSet, FieldLegend, FieldDescription, Field, FieldContent, FieldLabel, FieldSeparator, Progress } from '../chunk-RLCWEDMW.js';
|
|
3
|
+
export { PreferenceScript } from '../chunk-RLCWEDMW.js';
|
|
4
|
+
import { NativeSelect, NativeSelectOption, Checkbox } from '../chunk-KSF233MC.js';
|
|
5
|
+
import { useBackClose, useSeen } from '../chunk-RK4ODMGO.js';
|
|
6
|
+
export { useCompact, usePlate } from '../chunk-RK4ODMGO.js';
|
|
7
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, SidebarGroupContent, SidebarMenu, SidebarContent, SidebarGroup, Switch, RadioGroup, RadioGroupItem } from '../chunk-ZJRNRX6T.js';
|
|
8
|
+
export { PlatePicker } from '../chunk-ZJRNRX6T.js';
|
|
9
|
+
export { BEARING_PLATES, PLATES, derivePlate, isPlate } from '../chunk-24BDCHMS.js';
|
|
10
10
|
import '../chunk-OH3OMK7A.js';
|
|
11
11
|
import { isConnectionColor, CONNECTION_COLOR_NAMES, CONNECTION_COLORS, addTag, matchesKeyword } from '../chunk-A3T2BEQH.js';
|
|
12
12
|
import { Dialog, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogHeader, DialogFooter, Popover, PopoverTrigger, PopoverContent } from '../chunk-L4LQCVOF.js';
|
|
@@ -2928,7 +2928,121 @@ function Inline({ nodes, onOpenLink }) {
|
|
|
2928
2928
|
}
|
|
2929
2929
|
}) });
|
|
2930
2930
|
}
|
|
2931
|
+
function Segmented({ options, value, onValueChange, label, className }) {
|
|
2932
|
+
return /* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": label, className: cn("flex w-full gap-1.5", className), children: options.map((o) => /* @__PURE__ */ jsx(
|
|
2933
|
+
Button,
|
|
2934
|
+
{
|
|
2935
|
+
type: "button",
|
|
2936
|
+
role: "radio",
|
|
2937
|
+
"aria-checked": o.value === value,
|
|
2938
|
+
variant: o.value === value ? "default" : "outline",
|
|
2939
|
+
className: "min-w-0 flex-1",
|
|
2940
|
+
onClick: () => onValueChange(o.value),
|
|
2941
|
+
children: o.label
|
|
2942
|
+
},
|
|
2943
|
+
o.value
|
|
2944
|
+
)) });
|
|
2945
|
+
}
|
|
2946
|
+
function ConsentCheck({ checked, onCheckedChange, label, title, icon, summary, policyLabel, onOpenPolicy, className }) {
|
|
2947
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
|
|
2948
|
+
(title || summary || onOpenPolicy) && /* @__PURE__ */ jsxs("div", { className: "space-y-2 border p-3", children: [
|
|
2949
|
+
title && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium [&_svg]:size-4", children: [
|
|
2950
|
+
icon,
|
|
2951
|
+
title
|
|
2952
|
+
] }),
|
|
2953
|
+
summary && /* @__PURE__ */ jsx("p", { className: "text-xs leading-relaxed text-muted-foreground", children: summary }),
|
|
2954
|
+
onOpenPolicy && policyLabel && /* @__PURE__ */ jsx("button", { type: "button", className: "text-xs font-medium text-primary underline underline-offset-4", onClick: onOpenPolicy, children: policyLabel })
|
|
2955
|
+
] }),
|
|
2956
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2957
|
+
/* @__PURE__ */ jsx(Checkbox, { id: "lyra-consent", checked, onCheckedChange: (v) => onCheckedChange(v === true), className: "mt-0.5" }),
|
|
2958
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "lyra-consent", className: "text-sm leading-relaxed font-normal", children: label })
|
|
2959
|
+
] })
|
|
2960
|
+
] });
|
|
2961
|
+
}
|
|
2962
|
+
function Onboarding({ steps, labels, onDone, className }) {
|
|
2963
|
+
const [index, setIndex] = useState(0);
|
|
2964
|
+
const at = Math.min(index, steps.length - 1);
|
|
2965
|
+
const step = steps[at];
|
|
2966
|
+
if (!step) return null;
|
|
2967
|
+
const last = at === steps.length - 1;
|
|
2968
|
+
const blocked = step.canContinue === false;
|
|
2969
|
+
return /* @__PURE__ */ jsxs(
|
|
2970
|
+
"div",
|
|
2971
|
+
{
|
|
2972
|
+
className: cn(
|
|
2973
|
+
"flex h-full flex-col overflow-y-auto px-6 pt-[calc(env(safe-area-inset-top)+2rem)] pb-[calc(env(safe-area-inset-bottom)+1.5rem)]",
|
|
2974
|
+
className
|
|
2975
|
+
),
|
|
2976
|
+
children: [
|
|
2977
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 animate-in flex-col gap-4 duration-300 fade-in slide-in-from-right-4", children: [
|
|
2978
|
+
step.icon && /* @__PURE__ */ jsx("div", { className: "text-primary [&_svg]:size-10", children: step.icon }),
|
|
2979
|
+
/* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold", children: step.title }),
|
|
2980
|
+
step.description && /* @__PURE__ */ jsx("p", { className: "text-sm leading-relaxed text-muted-foreground", children: step.description }),
|
|
2981
|
+
step.content
|
|
2982
|
+
] }, step.id),
|
|
2983
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 flex items-center gap-3", children: [
|
|
2984
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 gap-1.5", "aria-hidden": true, children: steps.map((s, i) => /* @__PURE__ */ jsx("span", { className: cn("h-1.5 transition-all", i === at ? "w-6 bg-primary" : "w-1.5 bg-muted-foreground/40") }, s.id)) }),
|
|
2985
|
+
at > 0 && /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", onClick: () => setIndex(at - 1), children: labels.back }),
|
|
2986
|
+
/* @__PURE__ */ jsx(Button, { type: "button", size: "lg", disabled: blocked, onClick: () => last ? onDone() : setIndex(at + 1), children: last ? labels.done : labels.next })
|
|
2987
|
+
] })
|
|
2988
|
+
]
|
|
2989
|
+
}
|
|
2990
|
+
);
|
|
2991
|
+
}
|
|
2992
|
+
function Hint({ storageKey, children, icon, when = true, dismissLabel = "Dismiss", className }) {
|
|
2993
|
+
const [seen, markSeen, ready] = useSeen(storageKey);
|
|
2994
|
+
if (!ready || seen || !when) return null;
|
|
2995
|
+
return /* @__PURE__ */ jsxs("div", { role: "note", className: cn("flex animate-in items-start gap-2 border bg-popover p-3 text-sm text-popover-foreground shadow-md fade-in", className), children: [
|
|
2996
|
+
icon && /* @__PURE__ */ jsx("span", { className: "mt-0.5 shrink-0 text-primary [&_svg]:size-4", children: icon }),
|
|
2997
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 leading-relaxed", children }),
|
|
2998
|
+
/* @__PURE__ */ jsx("button", { type: "button", "aria-label": dismissLabel, onClick: markSeen, className: "-m-1 shrink-0 p-1 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" }) })
|
|
2999
|
+
] });
|
|
3000
|
+
}
|
|
3001
|
+
function ListSectionTitle({ className, ...props }) {
|
|
3002
|
+
return /* @__PURE__ */ jsx("h2", { "data-slot": "list-section-title", className: cn("py-2 text-xs text-muted-foreground", className), ...props });
|
|
3003
|
+
}
|
|
3004
|
+
function ListSection({ title, footer, className, children }) {
|
|
3005
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "list-section", className, children: [
|
|
3006
|
+
title && /* @__PURE__ */ jsx(ListSectionTitle, { children: title }),
|
|
3007
|
+
/* @__PURE__ */ jsx(Card, { className: "gap-0 divide-y divide-border p-0 shadow-none", children }),
|
|
3008
|
+
footer && /* @__PURE__ */ jsx("p", { className: "pt-2 text-xs text-muted-foreground", children: footer })
|
|
3009
|
+
] });
|
|
3010
|
+
}
|
|
3011
|
+
function ListLabel({ icon: Icon, inset, label, hint }) {
|
|
3012
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 items-center gap-3", inset && !Icon && "pl-8"), children: [
|
|
3013
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: "size-5 shrink-0 text-muted-foreground" }),
|
|
3014
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
3015
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm", children: label }),
|
|
3016
|
+
hint && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: hint })
|
|
3017
|
+
] })
|
|
3018
|
+
] });
|
|
3019
|
+
}
|
|
3020
|
+
var row = "flex w-full items-center justify-between gap-4 px-3 py-3 text-left";
|
|
3021
|
+
function ListItem({ icon, inset, label, hint, value, className, ...props }) {
|
|
3022
|
+
return /* @__PURE__ */ jsxs(
|
|
3023
|
+
"button",
|
|
3024
|
+
{
|
|
3025
|
+
type: "button",
|
|
3026
|
+
"data-slot": "list-item",
|
|
3027
|
+
className: cn(row, "active:bg-muted disabled:opacity-50", className),
|
|
3028
|
+
...props,
|
|
3029
|
+
children: [
|
|
3030
|
+
/* @__PURE__ */ jsx(ListLabel, { icon, inset, label, hint }),
|
|
3031
|
+
/* @__PURE__ */ jsxs("span", { className: "flex shrink-0 items-center gap-1 text-sm text-muted-foreground", children: [
|
|
3032
|
+
value,
|
|
3033
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
|
|
3034
|
+
] })
|
|
3035
|
+
]
|
|
3036
|
+
}
|
|
3037
|
+
);
|
|
3038
|
+
}
|
|
3039
|
+
function ListRow({ icon, inset, label, hint, className, children }) {
|
|
3040
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "list-row", className: cn(row, className), children: [
|
|
3041
|
+
/* @__PURE__ */ jsx(ListLabel, { icon, inset, label, hint }),
|
|
3042
|
+
children && /* @__PURE__ */ jsx("div", { className: "shrink-0", children })
|
|
3043
|
+
] });
|
|
3044
|
+
}
|
|
2931
3045
|
|
|
2932
|
-
export { AuthCard, AvatarTile, BarList, BlockedContext, BlockedDialog, ChoiceDrawer, ColorSwatches, ConfigListDialog, ConfirmContext, ConfirmDialog, ConfirmProvider, ConfirmReasonContext, ConnectionTree, DateField, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HOST_KEY_CHANGED, HOST_KEY_UNKNOWN, LlmSettings, LockedReason, McpSettings, MobileSheet, OptionPicker, Panel, PanelCard, ProxyFields, ReleaseNotes, SshFields, StatTile, TagInput, TlsFields, TreeDndProvider, TreeExpander, TreeIcon, TreeLabel, TreeLines, TreeNode, TreeNodeContent, TreeNodeTrigger, TreeProvider, TreeView, TzPicker, UnsavedBadge, buildConnectionTree, connectionNameMatches, datePattern, filterTree, flattenTree, formatDate, hostKeyAsk, loadExpanded, moveId, parseDate, planDrop, proxyDefaults, retryAfterTrust, sameOrder, saveExpanded, sharedWhilePending, sortTree, sshDefaults, tlsDefaults, useBlocked, useConfirm, useConfirmReason, useFormField, useHostKeyTrust, useTreeDndNode, useTreeDndRoot };
|
|
3046
|
+
export { AuthCard, AvatarTile, BarList, BlockedContext, BlockedDialog, ChoiceDrawer, ColorSwatches, ConfigListDialog, ConfirmContext, ConfirmDialog, ConfirmProvider, ConfirmReasonContext, ConnectionTree, ConsentCheck, DateField, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HOST_KEY_CHANGED, HOST_KEY_UNKNOWN, Hint, ListItem, ListRow, ListSection, ListSectionTitle, LlmSettings, LockedReason, McpSettings, MobileSheet, Onboarding, OptionPicker, Panel, PanelCard, ProxyFields, ReleaseNotes, Segmented, SshFields, StatTile, TagInput, TlsFields, TreeDndProvider, TreeExpander, TreeIcon, TreeLabel, TreeLines, TreeNode, TreeNodeContent, TreeNodeTrigger, TreeProvider, TreeView, TzPicker, UnsavedBadge, buildConnectionTree, connectionNameMatches, datePattern, filterTree, flattenTree, formatDate, hostKeyAsk, loadExpanded, moveId, parseDate, planDrop, proxyDefaults, retryAfterTrust, sameOrder, saveExpanded, sharedWhilePending, sortTree, sshDefaults, tlsDefaults, useBlocked, useConfirm, useConfirmReason, useFormField, useHostKeyTrust, useTreeDndNode, useTreeDndRoot };
|
|
2933
3047
|
//# sourceMappingURL=index.js.map
|
|
2934
3048
|
//# sourceMappingURL=index.js.map
|