@tradalab/lyra 3.17.0 → 3.18.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 +2 -2
- package/dist/blocks/index.d.ts +89 -6
- package/dist/blocks/index.js +337 -72
- package/dist/blocks/index.js.map +1 -1
- package/dist/{chunk-AIULLZYM.js → chunk-D2O4GTCC.js} +12 -3
- package/dist/chunk-D2O4GTCC.js.map +1 -0
- package/dist/hooks/index.d.ts +10 -3
- package/dist/hooks/index.js +1 -1
- package/dist/{plate-BJ19iaVV.d.ts → plate-iXwbupLU.d.ts} +1 -1
- package/dist/{plate-picker-dhKLjz_6.d.ts → plate-picker-DdC2HFo6.d.ts} +1 -1
- package/dist/shell/index.d.ts +2 -2
- package/dist/shell/index.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/{use-compact-BvI4sJf9.d.ts → use-compact-ahmJWpSH.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-AIULLZYM.js.map +0 -1
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ 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` | client |
|
|
28
|
+
| `@tradalab/lyra/hooks` | `useMobile`, `useDirtyFields` | 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` | 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` | client |
|
|
31
31
|
| `@tradalab/lyra/data-table` | `DataTable` + `usePager`, `TableFilterBar`, `TableFilterChips`, `TableSearch`, `TableReload`, `filterRows`, `pageWindow` | client |
|
|
32
32
|
| `@tradalab/lyra/shell` | `AppShell`, `PageShell`, `PageHeader`, `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 |
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { ReactNode, DragEvent, HTMLAttributes, ComponentProps, ReactElement } fr
|
|
|
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';
|
|
8
|
-
export { B as BEARING_PLATES, a as BearingPlate,
|
|
9
|
-
export { u as useCompact, a as usePlate } from '../use-compact-
|
|
10
|
-
export { a as PlatePicker, P as PlatePickerProps } from '../plate-picker-
|
|
8
|
+
export { B as BEARING_PLATES, a as BearingPlate, b as PLATES, P as Plate, d as derivePlate, i as isPlate } from '../plate-iXwbupLU.js';
|
|
9
|
+
export { u as useCompact, a as usePlate } from '../use-compact-ahmJWpSH.js';
|
|
10
|
+
export { a as PlatePicker, P as PlatePickerProps } from '../plate-picker-DdC2HFo6.js';
|
|
11
11
|
export { P as PreferenceScript } from '../preference-script-Dm-LEoYX.js';
|
|
12
12
|
|
|
13
13
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe, }: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
@@ -73,22 +73,62 @@ type ConfirmOptions = {
|
|
|
73
73
|
confirmText?: string;
|
|
74
74
|
cancelText?: string;
|
|
75
75
|
danger?: boolean;
|
|
76
|
+
/** What the action does to other records or people, one line each. */
|
|
77
|
+
consequences?: ReactNode[];
|
|
78
|
+
/** Set to say whether the action can be undone; the line is shown only when it is set. */
|
|
79
|
+
reversible?: boolean;
|
|
80
|
+
reversibleText?: string;
|
|
81
|
+
irreversibleText?: string;
|
|
82
|
+
};
|
|
83
|
+
type ReasonField = {
|
|
84
|
+
label: string;
|
|
85
|
+
placeholder?: string;
|
|
86
|
+
required?: boolean;
|
|
87
|
+
};
|
|
88
|
+
type ConfirmReasonOptions = ConfirmOptions & {
|
|
89
|
+
reason: ReasonField;
|
|
90
|
+
};
|
|
91
|
+
type BlockedOptions = {
|
|
92
|
+
title: string;
|
|
93
|
+
description?: ReactNode;
|
|
94
|
+
/** What stands in the way, one line each. */
|
|
95
|
+
blockers: ReactNode[];
|
|
96
|
+
closeText?: string;
|
|
97
|
+
/** A way to the place where the blocker is resolved; there is never a confirm button. */
|
|
98
|
+
action?: {
|
|
99
|
+
label: string;
|
|
100
|
+
onClick: () => void;
|
|
101
|
+
};
|
|
76
102
|
};
|
|
77
103
|
|
|
78
104
|
type Props = {
|
|
79
|
-
options: ConfirmOptions
|
|
80
|
-
|
|
105
|
+
options: ConfirmOptions & {
|
|
106
|
+
reason?: ReasonField;
|
|
107
|
+
};
|
|
108
|
+
onConfirm: (reason: string) => void;
|
|
81
109
|
onCancel: () => void;
|
|
82
110
|
};
|
|
83
111
|
declare function ConfirmDialog({ options, onConfirm, onCancel }: Props): React$1.JSX.Element;
|
|
112
|
+
declare function BlockedDialog({ options, onClose }: {
|
|
113
|
+
options: BlockedOptions;
|
|
114
|
+
onClose: () => void;
|
|
115
|
+
}): React$1.JSX.Element;
|
|
84
116
|
|
|
85
117
|
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
118
|
+
type ConfirmReasonFn = (options: ConfirmReasonOptions) => Promise<string | null>;
|
|
119
|
+
type BlockedFn = (options: BlockedOptions) => Promise<void>;
|
|
86
120
|
declare const ConfirmContext: React$1.Context<ConfirmFn | null>;
|
|
121
|
+
declare const ConfirmReasonContext: React$1.Context<ConfirmReasonFn | null>;
|
|
122
|
+
declare const BlockedContext: React$1.Context<BlockedFn | null>;
|
|
87
123
|
declare function ConfirmProvider({ children }: {
|
|
88
124
|
children: ReactNode;
|
|
89
125
|
}): React$1.JSX.Element;
|
|
90
126
|
|
|
91
127
|
declare const useConfirm: () => ConfirmFn;
|
|
128
|
+
/** Like `useConfirm`, with a reason box; resolves to the trimmed reason, or `null` when cancelled. */
|
|
129
|
+
declare const useConfirmReason: () => ConfirmReasonFn;
|
|
130
|
+
/** Explains why an action cannot run, listing what blocks it; offers no confirm button. */
|
|
131
|
+
declare const useBlocked: () => BlockedFn;
|
|
92
132
|
|
|
93
133
|
type TreeData<T> = {
|
|
94
134
|
id: string;
|
|
@@ -291,6 +331,49 @@ interface TzPickerProps {
|
|
|
291
331
|
}
|
|
292
332
|
declare function TzPicker({ value, onChange, allowInherit, labels, disabled, id, className, }: TzPickerProps): React$1.JSX.Element;
|
|
293
333
|
|
|
334
|
+
type Part = "d" | "m" | "y";
|
|
335
|
+
interface DatePattern {
|
|
336
|
+
order: Part[];
|
|
337
|
+
sep: string;
|
|
338
|
+
}
|
|
339
|
+
/** Day, month and year order and separator the locale writes dates with, read from `Intl`. */
|
|
340
|
+
declare function datePattern(locale: string): DatePattern;
|
|
341
|
+
/** `YYYY-MM-DD` written the locale's way, `""` for an empty or malformed value. */
|
|
342
|
+
declare function formatDate(iso: string, pattern: DatePattern): string;
|
|
343
|
+
/** Typed text to `YYYY-MM-DD`: the locale's order, any separator, or ISO. A two-digit year lands within ten years ahead or the century before. `null` when it is not a real date. */
|
|
344
|
+
declare function parseDate(text: string, pattern: DatePattern): string | null;
|
|
345
|
+
interface DateFieldProps {
|
|
346
|
+
/** `YYYY-MM-DD`, or `""` for no date. */
|
|
347
|
+
value: string;
|
|
348
|
+
onChange: (value: string) => void;
|
|
349
|
+
/** BCP 47 tag of the APP's language, not the browser's: it decides how the date is written. */
|
|
350
|
+
locale: string;
|
|
351
|
+
id?: string;
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
required?: boolean;
|
|
354
|
+
min?: string;
|
|
355
|
+
max?: string;
|
|
356
|
+
todayLabel?: string;
|
|
357
|
+
clearLabel?: string;
|
|
358
|
+
pickLabel?: string;
|
|
359
|
+
className?: string;
|
|
360
|
+
"aria-label"?: string;
|
|
361
|
+
"aria-invalid"?: boolean;
|
|
362
|
+
}
|
|
363
|
+
/** A date typed in the app's own format, with a calendar beside it: a popover under a mouse, a bottom sheet under a finger. */
|
|
364
|
+
declare function DateField({ value, onChange, locale, id, disabled, required, min, max, todayLabel, clearLabel, pickLabel, className, ...aria }: DateFieldProps): React$1.JSX.Element;
|
|
365
|
+
|
|
366
|
+
/** Why a disabled field cannot be edited and where it is changed instead; text, not a tooltip, so it reads on a phone. */
|
|
367
|
+
declare function LockedReason({ children, className }: {
|
|
368
|
+
children: ReactNode;
|
|
369
|
+
className?: string;
|
|
370
|
+
}): React$1.JSX.Element;
|
|
371
|
+
/** Marks a form that holds edits not yet saved; render it next to the save button. */
|
|
372
|
+
declare function UnsavedBadge({ children, className }: {
|
|
373
|
+
children: ReactNode;
|
|
374
|
+
className?: string;
|
|
375
|
+
}): React$1.JSX.Element;
|
|
376
|
+
|
|
294
377
|
/**
|
|
295
378
|
* Pick one id from a known set.
|
|
296
379
|
*
|
|
@@ -684,4 +767,4 @@ interface LlmSettingsProps {
|
|
|
684
767
|
}
|
|
685
768
|
declare function LlmSettings({ api, labels, className, header, footer }: LlmSettingsProps): React$1.JSX.Element;
|
|
686
769
|
|
|
687
|
-
export { AuthCard, type AuthCardProps, AvatarTile, type AvatarTileProps, BarList, type BarListItem, ChoiceDrawer, type ChoiceDrawerProps, type ChoiceOption, ColorSwatches, type ColorSwatchesProps, ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, type DropPlan, type DropPosition, type FlatTreeNode, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, 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, type McpCall, type McpClient, McpSettings, type McpSettingsApi, type McpSettingsLabels, type McpStatus, type McpTool, MobileSheet, type MobileSheetProps, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, StatTile, type StatTileProps, TagInput, type TagInputProps, 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, TzPicker, type TzPickerLabels, type TzPickerProps, filterTree, flattenTree, loadExpanded, moveId, planDrop, sameOrder, saveExpanded, sortTree, useConfirm, useFormField, useTreeDndNode, useTreeDndRoot };
|
|
770
|
+
export { AuthCard, type AuthCardProps, AvatarTile, type AvatarTileProps, BarList, type BarListItem, BlockedContext, BlockedDialog, type BlockedFn, type BlockedOptions, ChoiceDrawer, type ChoiceDrawerProps, type ChoiceOption, ColorSwatches, type ColorSwatchesProps, ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, ConfirmReasonContext, type ConfirmReasonFn, type ConfirmReasonOptions, DateField, type DateFieldProps, type DatePattern, type DropPlan, type DropPosition, type FlatTreeNode, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, 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, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, type ReasonField, StatTile, type StatTileProps, TagInput, type TagInputProps, 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, TzPicker, type TzPickerLabels, type TzPickerProps, UnsavedBadge, datePattern, filterTree, flattenTree, formatDate, loadExpanded, moveId, parseDate, planDrop, sameOrder, saveExpanded, sortTree, useBlocked, useConfirm, useConfirmReason, useFormField, useTreeDndNode, useTreeDndRoot };
|