@petrarca/sonnet-ui 0.7.0 → 0.9.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 CHANGED
@@ -3,8 +3,8 @@ import * as React$1 from 'react';
3
3
  import React__default from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
6
- import * as react_jsx_runtime from 'react/jsx-runtime';
7
6
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
+ import { RadioGroup as RadioGroup$1 } from 'radix-ui';
8
8
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
9
9
  import * as DialogPrimitive from '@radix-ui/react-dialog';
10
10
  import { DialogProps } from '@radix-ui/react-dialog';
@@ -15,11 +15,11 @@ import * as LabelPrimitive from '@radix-ui/react-label';
15
15
  import * as PopoverPrimitive from '@radix-ui/react-popover';
16
16
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
17
17
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
18
+ import { CodeableConcept, UISchema, JsonSchemaProperty, JsonSchema } from '@petrarca/sonnet-core/schema';
18
19
  import * as TabsPrimitive from '@radix-ui/react-tabs';
19
20
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
20
- import { RowData, PaginationState, OnChangeFn } from '@tanstack/react-table';
21
- export { PaginationState } from '@tanstack/react-table';
22
- import { UISchema, JsonSchemaProperty, JsonSchema } from '@petrarca/sonnet-core/schema';
21
+ import { RowData, PaginationState, OnChangeFn, SortingState } from '@tanstack/react-table';
22
+ export { PaginationState, SortingState } from '@tanstack/react-table';
23
23
  import { EntitySelectMode } from '@petrarca/sonnet-core/hooks';
24
24
  import { EntityOptionFetcher, EntityOption } from '@petrarca/sonnet-core/entityOptions';
25
25
  import { FilterExpr } from '@petrarca/sonnet-core/search';
@@ -35,15 +35,15 @@ declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitiv
35
35
  declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
36
36
 
37
37
  declare const badgeVariants: (props?: ({
38
- variant?: "default" | "destructive" | "secondary" | "outline" | null | undefined;
38
+ variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
39
39
  badgeColor?: "grape" | "blue" | "green" | "red" | "orange" | "yellow" | "teal" | "cyan" | "pink" | "indigo" | "violet" | null | undefined;
40
40
  } & class_variance_authority_types.ClassProp) | undefined) => string;
41
41
  interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
42
42
  }
43
- declare function Badge({ className, variant, badgeColor, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
43
+ declare function Badge({ className, variant, badgeColor, ...props }: BadgeProps): React$1.JSX.Element;
44
44
 
45
45
  declare const buttonVariants: (props?: ({
46
- variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
46
+ variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
47
47
  size?: "default" | "sm" | "lg" | "icon" | "compact" | null | undefined;
48
48
  } & class_variance_authority_types.ClassProp) | undefined) => string;
49
49
  interface ButtonProps$1 extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -94,6 +94,131 @@ interface IconButtonProps extends Omit<ButtonProps$1, "size" | "children" | "ari
94
94
  }
95
95
  declare const IconButton: React$1.ForwardRefExoticComponent<IconButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
96
96
 
97
+ /**
98
+ * CopyButton -- copies a value to the clipboard and confirms it for a moment
99
+ * (a check mark, "Copied"). Icon-only by default, as an IconButton whose label
100
+ * is the tooltip and the accessible name; `withText` shows the label beside
101
+ * the icon instead, for a standalone toolbar button.
102
+ *
103
+ * Usage:
104
+ * <CopyButton value={path} label="Copy path" />
105
+ * <CopyButton value={json} withText />
106
+ */
107
+ interface CopyButtonProps {
108
+ /** The text to copy. */
109
+ value: string;
110
+ /** What the button does. Default "Copy". */
111
+ label?: string;
112
+ /** Show the label as text beside the icon. Default false. */
113
+ withText?: boolean;
114
+ className?: string;
115
+ }
116
+ declare function CopyButton({ value, label, withText, className, }: CopyButtonProps): React$1.ReactElement;
117
+
118
+ /**
119
+ * SplitButton -- a primary action with an attached dropdown of secondary
120
+ * actions (the "split button" / menu-button pattern). The main face runs the
121
+ * primary action on click; the caret opens a menu of related alternatives.
122
+ *
123
+ * Use it to keep a cluster of related verbs as one control (e.g. a primary
124
+ * "Collect" with a secondary "Run a single operation") instead of a row of
125
+ * sibling buttons. For a single action use Button; for a pure menu use
126
+ * DropdownMenu with its own trigger.
127
+ *
128
+ * - `variant`/`size` apply to both faces, so it reads as one control. The two
129
+ * faces share a seam (the primary loses its right radius, the caret its
130
+ * left) and a hairline divider.
131
+ * - `disabled` disables the primary action only; the menu caret stays usable
132
+ * (so secondary actions remain reachable while the primary is unavailable,
133
+ * e.g. mid-run). Pass `menuDisabled` to disable the caret too.
134
+ * - Each item carries its own `disabled`; a `destructive` item tints red.
135
+ *
136
+ * Usage:
137
+ * <SplitButton
138
+ * label="Collect"
139
+ * icon={<Play />}
140
+ * onClick={startCollect}
141
+ * disabled={collecting}
142
+ * items={[
143
+ * { label: "Run a single operation...", icon: <Zap />, onSelect: openRun },
144
+ * ]}
145
+ * />
146
+ */
147
+ interface SplitButtonItem {
148
+ /** The item's visible text. */
149
+ label: string;
150
+ /** Optional leading icon (bare `<Icon />`, no size class). */
151
+ icon?: React$1.ReactNode;
152
+ /** Chosen handler. */
153
+ onSelect: () => void;
154
+ /** Disable just this item. */
155
+ disabled?: boolean;
156
+ /** Tint the item red (a destructive secondary action). */
157
+ destructive?: boolean;
158
+ }
159
+ interface SplitButtonProps extends Omit<ButtonProps$1, "children" | "onClick"> {
160
+ /** The primary action's label. */
161
+ label: string;
162
+ /** Optional leading icon for the primary face. */
163
+ icon?: React$1.ReactNode;
164
+ /** The primary action, run when the main face is clicked. */
165
+ onClick?: () => void;
166
+ /** The secondary actions, shown in the dropdown. */
167
+ items: SplitButtonItem[];
168
+ /** Disable the menu caret too (default: only the primary is disabled). */
169
+ menuDisabled?: boolean;
170
+ /** Accessible label for the caret trigger. Default "More actions". */
171
+ menuLabel?: string;
172
+ /** Which side the menu opens. Default "bottom". */
173
+ menuAlign?: "start" | "center" | "end";
174
+ }
175
+ declare const SplitButton: React$1.ForwardRefExoticComponent<SplitButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
176
+
177
+ /**
178
+ * ViewSwitch -- a quiet row of icon + text buttons that switches between the
179
+ * views (or modes) of one surface: Graph | Model | Description, Semantic |
180
+ * Text. The current one is filled (secondary), the others are ghost buttons,
181
+ * so the switch sits calmly in a header or next to a query bar.
182
+ *
183
+ * Exactly one option is current; choosing another calls `onChange`. Use it for
184
+ * a handful of short options that change what the surface shows. For content
185
+ * panels that belong to the switch use Tabs; for actions use Button.
186
+ *
187
+ * - Pass bare icons (`<Network />`): the Button sizes child SVGs.
188
+ * - Each option is a toggle button (`aria-pressed`) in a labelled group.
189
+ *
190
+ * Usage:
191
+ * <ViewSwitch
192
+ * label="Views"
193
+ * value={view}
194
+ * onChange={setView}
195
+ * options={[
196
+ * { value: "graph", label: "Graph", icon: <Network /> },
197
+ * { value: "model", label: "Model", icon: <Shapes /> },
198
+ * ]}
199
+ * />
200
+ */
201
+ interface ViewSwitchOption<T extends string> {
202
+ /** The option's value. */
203
+ value: T;
204
+ /** Its visible text. */
205
+ label: string;
206
+ /** Optional leading icon (bare `<Icon />`, no size class). */
207
+ icon?: React$1.ReactNode;
208
+ }
209
+ interface ViewSwitchProps<T extends string> {
210
+ /** The options, in order. */
211
+ options: ViewSwitchOption<T>[];
212
+ /** The current option's value. */
213
+ value: T;
214
+ /** Called with the chosen option's value. */
215
+ onChange: (value: T) => void;
216
+ /** Accessible name of the group (e.g. "Views", "Search mode"). */
217
+ label: string;
218
+ className?: string;
219
+ }
220
+ declare function ViewSwitch<T extends string>({ options, value, onChange, label, className, }: ViewSwitchProps<T>): React$1.ReactElement;
221
+
97
222
  declare const Card: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
98
223
  declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
99
224
  declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
@@ -103,17 +228,22 @@ declare const CardFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttribut
103
228
 
104
229
  declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
105
230
 
231
+ /** A set of options of which one is chosen -- arrow keys move between them. */
232
+ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroup$1.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
233
+ /** One option of a RadioGroup, styled as the Checkbox is. */
234
+ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroup$1.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
235
+
106
236
  declare const Collapsible: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React$1.RefAttributes<HTMLDivElement>>;
107
237
  declare const CollapsibleTrigger: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
108
238
  declare const CollapsibleContent: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React$1.RefAttributes<HTMLDivElement>>;
109
239
 
110
240
  declare const Command: React$1.ForwardRefExoticComponent<Omit<{
111
241
  children?: React$1.ReactNode;
112
- } & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
242
+ } & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
113
243
  ref?: React$1.Ref<HTMLDivElement>;
114
244
  } & {
115
245
  asChild?: boolean;
116
- }, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
246
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
117
247
  label?: string;
118
248
  shouldFilter?: boolean;
119
249
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -124,7 +254,7 @@ declare const Command: React$1.ForwardRefExoticComponent<Omit<{
124
254
  disablePointerSelection?: boolean;
125
255
  vimBindings?: boolean;
126
256
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
127
- declare const CommandDialog: ({ children, ...props }: DialogProps) => react_jsx_runtime.JSX.Element;
257
+ declare const CommandDialog: ({ children, ...props }: DialogProps) => React$1.JSX.Element;
128
258
  declare const CommandInput: React$1.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React$1.InputHTMLAttributes<HTMLInputElement>> & {
129
259
  ref?: React$1.Ref<HTMLInputElement>;
130
260
  } & {
@@ -135,45 +265,45 @@ declare const CommandInput: React$1.ForwardRefExoticComponent<Omit<Omit<Pick<Pic
135
265
  } & React$1.RefAttributes<HTMLInputElement>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
136
266
  declare const CommandList: React$1.ForwardRefExoticComponent<Omit<{
137
267
  children?: React$1.ReactNode;
138
- } & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
268
+ } & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
139
269
  ref?: React$1.Ref<HTMLDivElement>;
140
270
  } & {
141
271
  asChild?: boolean;
142
- }, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
272
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
143
273
  label?: string;
144
274
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
145
275
  declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
146
276
  children?: React$1.ReactNode;
147
- } & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
277
+ } & Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
148
278
  ref?: React$1.Ref<HTMLDivElement>;
149
279
  } & {
150
280
  asChild?: boolean;
151
- }, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
281
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
152
282
  declare const CommandGroup: React$1.ForwardRefExoticComponent<Omit<{
153
283
  children?: React$1.ReactNode;
154
- } & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
284
+ } & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
155
285
  ref?: React$1.Ref<HTMLDivElement>;
156
286
  } & {
157
287
  asChild?: boolean;
158
- }, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "heading" | "value"> & {
288
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
159
289
  heading?: React$1.ReactNode;
160
290
  value?: string;
161
291
  forceMount?: boolean;
162
292
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
163
- declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
293
+ declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
164
294
  ref?: React$1.Ref<HTMLDivElement>;
165
295
  } & {
166
296
  asChild?: boolean;
167
- }, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild"> & {
297
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
168
298
  alwaysRender?: boolean;
169
299
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
170
300
  declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
171
301
  children?: React$1.ReactNode;
172
- } & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React$1.HTMLAttributes<HTMLDivElement> | "key"> & {
302
+ } & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
173
303
  ref?: React$1.Ref<HTMLDivElement>;
174
304
  } & {
175
305
  asChild?: boolean;
176
- }, keyof React$1.HTMLAttributes<HTMLDivElement> | "key" | "asChild">, "onSelect" | "disabled" | "value"> & {
306
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
177
307
  disabled?: boolean;
178
308
  onSelect?: (value: string) => void;
179
309
  value?: string;
@@ -181,7 +311,7 @@ declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
181
311
  forceMount?: boolean;
182
312
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
183
313
  declare const CommandShortcut: {
184
- ({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
314
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
185
315
  displayName: string;
186
316
  };
187
317
 
@@ -192,11 +322,11 @@ declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dia
192
322
  declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
193
323
  declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
194
324
  declare const DialogHeader: {
195
- ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
325
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
196
326
  displayName: string;
197
327
  };
198
328
  declare const DialogFooter: {
199
- ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
329
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
200
330
  displayName: string;
201
331
  };
202
332
  declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
@@ -223,7 +353,7 @@ declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<Omit<Dropdown
223
353
  } & React$1.RefAttributes<HTMLDivElement>>;
224
354
  declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
225
355
  declare const DropdownMenuShortcut: {
226
- ({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
356
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
227
357
  displayName: string;
228
358
  };
229
359
 
@@ -260,8 +390,12 @@ interface DateInputProps {
260
390
  error?: string;
261
391
  className?: string;
262
392
  onBlur?: () => void;
393
+ /** The earliest date that can be picked (`YYYY-MM-DD`); the calendar disables those before. */
394
+ min?: string;
395
+ /** The latest date that can be picked (`YYYY-MM-DD`); the calendar disables those after. */
396
+ max?: string;
263
397
  }
264
- declare function DateInput({ value, onChange, precision, locale, id, name, placeholder, required, disabled, error, className, onBlur, }: DateInputProps): React$1.ReactElement;
398
+ declare function DateInput({ value, onChange, precision, locale, id, name, placeholder, required, disabled, error, className, onBlur, min, max, }: DateInputProps): React$1.ReactElement;
265
399
 
266
400
  /**
267
401
  * Calendar -- month/year/decade grid for selecting a single day.
@@ -285,8 +419,12 @@ interface CalendarProps {
285
419
  precision?: DatePrecision;
286
420
  /** BCP-47 locale for month/weekday labels and week-start. */
287
421
  locale?: string;
422
+ /** The earliest day that can be picked; days, months and years before it are disabled. */
423
+ min?: Date;
424
+ /** The latest day that can be picked; days, months and years after it are disabled. */
425
+ max?: Date;
288
426
  }
289
- declare function Calendar({ value, onSelect, defaultViewDate, precision, locale, }: CalendarProps): React$1.ReactElement;
427
+ declare function Calendar({ value, onSelect, defaultViewDate, precision, locale, min, max, }: CalendarProps): React$1.ReactElement;
290
428
 
291
429
  /**
292
430
  * TimeInput -- text input for a zone-free time of day.
@@ -353,8 +491,12 @@ interface DateTimeInputProps {
353
491
  error?: string;
354
492
  className?: string;
355
493
  onBlur?: () => void;
494
+ /** The earliest datetime (`YYYY-MM-DDTHH:mm...`): its date bounds the calendar. */
495
+ min?: string;
496
+ /** The latest datetime: its date bounds the calendar. */
497
+ max?: string;
356
498
  }
357
- declare function DateTimeInput({ value, onChange, granularity, timeZone, locale, idPrefix, required, disabled, error, className, onBlur, }: DateTimeInputProps): React$1.ReactElement;
499
+ declare function DateTimeInput({ value, onChange, granularity, timeZone, locale, idPrefix, required, disabled, error, className, onBlur, min, max, }: DateTimeInputProps): React$1.ReactElement;
358
500
 
359
501
  declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
360
502
  declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
@@ -367,23 +509,24 @@ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitiv
367
509
  declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
368
510
  declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
369
511
 
370
- declare function InputGroup({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
512
+ declare function InputGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
371
513
  declare const inputGroupAddonVariants: (props?: ({
372
514
  align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
373
515
  } & class_variance_authority_types.ClassProp) | undefined) => string;
374
- declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
516
+ declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React$1.JSX.Element;
375
517
  declare const inputGroupButtonVariants: (props?: ({
376
518
  size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
377
519
  } & class_variance_authority_types.ClassProp) | undefined) => string;
378
- declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
379
- declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
380
- declare function InputGroupInput({ className, ...props }: React$1.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
381
- declare function InputGroupTextarea({ className, ...props }: React$1.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
520
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React$1.JSX.Element;
521
+ declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
522
+ declare function InputGroupInput({ className, ...props }: React$1.ComponentProps<"input">): React$1.JSX.Element;
523
+ declare function InputGroupTextarea({ className, ...props }: React$1.ComponentProps<"textarea">): React$1.JSX.Element;
382
524
 
383
525
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
384
526
 
385
527
  declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
386
528
  declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
529
+ declare const PopoverAnchor: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React$1.RefAttributes<HTMLDivElement>>;
387
530
  declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
388
531
 
389
532
  declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -426,6 +569,15 @@ interface ResizeHandleProps extends React$1.HTMLAttributes<HTMLDivElement> {
426
569
  */
427
570
  declare const ResizeHandle: React$1.ForwardRefExoticComponent<ResizeHandleProps & React$1.RefAttributes<HTMLDivElement>>;
428
571
 
572
+ /**
573
+ * Sheet — a slide-over panel (drawer) built on Radix Dialog.
574
+ * Slides in from the right edge. Used for create/edit/detail operations.
575
+ *
576
+ * SheetContent accepts an optional `offsetTop` (CSS length, e.g. "3rem")
577
+ * to push the panel below a fixed header. The overlay is unaffected so the
578
+ * backdrop still covers the full screen.
579
+ */
580
+
429
581
  declare const Sheet: React$1.FC<DialogPrimitive.DialogProps>;
430
582
  declare const SheetTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
431
583
  declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
@@ -435,11 +587,11 @@ declare const SheetContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimiti
435
587
  /** CSS length (e.g. "3rem" or "0px") controlling where the panel starts vertically. Internal use — prefer PanelOptions.coverage at the shell API level. */
436
588
  offsetTop?: string;
437
589
  } & React$1.RefAttributes<HTMLDivElement>>;
438
- declare const SheetHeader: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
590
+ declare const SheetHeader: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element;
439
591
  declare const SheetTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
440
592
  declare const SheetDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
441
- declare const SheetBody: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
442
- declare const SheetFooter: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
593
+ declare const SheetBody: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element;
594
+ declare const SheetFooter: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element;
443
595
 
444
596
  declare const gapMap$1: {
445
597
  readonly 0: "gap-0";
@@ -504,6 +656,68 @@ interface SimpleGroupProps {
504
656
  */
505
657
  declare function SimpleGroup({ children, gap, align, justify, wrap, grow, className, style, mt, onClick, }: SimpleGroupProps): React$1.ReactElement;
506
658
 
659
+ interface ListRowProps {
660
+ /** The item's name. */
661
+ title: React$1.ReactNode;
662
+ /** Shown next to the title: badges, a key, a status. */
663
+ adornment?: React$1.ReactNode;
664
+ /** One muted line below the title: a description or a summary of values. */
665
+ detail?: React$1.ReactNode;
666
+ /** Right-aligned controls, typically icon buttons (edit, delete, test). */
667
+ actions?: React$1.ReactNode;
668
+ /** Makes the title area a button (e.g. open the item); the actions stay separate. */
669
+ onClick?: () => void;
670
+ className?: string;
671
+ }
672
+ /**
673
+ * ListRow -- one item of a short, bordered list: a title with an optional
674
+ * adornment and detail line, and actions on the right. For lists of
675
+ * configurable things (connections, kinds, settings entries); a large or
676
+ * sortable collection belongs in an EntityTable.
677
+ */
678
+ declare function ListRow({ title, adornment, detail, actions, onClick, className, }: ListRowProps): React$1.ReactElement;
679
+
680
+ /** One action of a Danger zone: what it is, what it destroys, its button. */
681
+ interface DangerZoneAction {
682
+ /** What it does, as a heading: "Delete this source". */
683
+ title: React$1.ReactNode;
684
+ /** One sentence saying what it destroys. */
685
+ description: React$1.ReactNode;
686
+ /** The button's text: "Delete source". */
687
+ label: React$1.ReactNode;
688
+ icon?: React$1.ComponentType<{
689
+ className?: string;
690
+ }>;
691
+ /** Run it -- the caller confirms first (dialog.confirm), naming what is lost. */
692
+ onClick: () => void;
693
+ /**
694
+ * "destructive" (the default) for what removes the item itself; "outline" for
695
+ * what destroys part of it and leaves the item (drop its data, reset it).
696
+ */
697
+ variant?: "destructive" | "outline";
698
+ /** Not allowed yet: the button is disabled and this says why, on hover. */
699
+ disabledReason?: React$1.ReactNode;
700
+ /** Running: the button is disabled until it ends. */
701
+ pending?: boolean;
702
+ }
703
+ interface DangerZoneProps {
704
+ actions: DangerZoneAction[];
705
+ /** The section's heading; "Danger zone" by default. */
706
+ title?: React$1.ReactNode;
707
+ className?: string;
708
+ }
709
+ /**
710
+ * DangerZone -- the last section of a heavyweight item's Settings tab: what
711
+ * cannot be undone or reaches beyond the item (delete it, drop its data), set
712
+ * apart under a destructive heading and border, one row per action.
713
+ *
714
+ * Each action says what it destroys; one not allowed yet is shown disabled with
715
+ * its reason -- unlike a row action, which is omitted. Confirming is the
716
+ * caller's (sonnet-shell's dialog.confirm), naming what is lost. See
717
+ * docs/design/interaction-patterns.md, "The Danger zone".
718
+ */
719
+ declare function DangerZone({ actions, title, className, }: DangerZoneProps): React$1.ReactElement | null;
720
+
507
721
  declare const gapMap: {
508
722
  readonly 0: "gap-0";
509
723
  readonly xs: "gap-1";
@@ -565,9 +779,30 @@ interface SimpleTooltipProps {
565
779
  * Simplified Tooltip wrapper that matches Mantine's simple API.
566
780
  * Usage: <SimpleTooltip label="Click me"><Button>Click</Button></SimpleTooltip>
567
781
  */
568
- declare function SimpleTooltip({ label, children, side, align, delayDuration, sideOffset, }: SimpleTooltipProps): react_jsx_runtime.JSX.Element;
782
+ declare function SimpleTooltip({ label, children, side, align, delayDuration, sideOffset, }: SimpleTooltipProps): React$1.JSX.Element;
569
783
 
570
- declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
784
+ /**
785
+ * CodedValueDisplay -- a coded value as text: its label, and its code beside
786
+ * it, muted; the code alone when there is no label. The code system, when
787
+ * given, shows on hover. Used by the coded-value widget, the `coding` cell
788
+ * renderer, and wherever a stored code is shown without an input.
789
+ */
790
+ interface CodedValueDisplayProps {
791
+ code: string;
792
+ display?: string | null;
793
+ /** The code system, shown on hover. */
794
+ system?: string | null;
795
+ className?: string;
796
+ }
797
+ declare function CodedValueDisplay({ code, display, system, className, }: CodedValueDisplayProps): React$1.JSX.Element;
798
+
799
+ interface CodeableConceptDisplayProps {
800
+ value: CodeableConcept;
801
+ className?: string;
802
+ }
803
+ declare function CodeableConceptDisplay({ value, className, }: CodeableConceptDisplayProps): React$1.JSX.Element;
804
+
805
+ declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
571
806
 
572
807
  interface SpinnerProps {
573
808
  className?: string;
@@ -585,7 +820,7 @@ interface SpinnerProps {
585
820
  * <Spinner className="text-blue-500" />
586
821
  * ```
587
822
  */
588
- declare function Spinner({ className, size }: SpinnerProps): react_jsx_runtime.JSX.Element;
823
+ declare function Spinner({ className, size }: SpinnerProps): React$1.JSX.Element;
589
824
 
590
825
  declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
591
826
  interface TabsListProps extends React$1.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
@@ -645,38 +880,38 @@ interface StepperProps extends DivProps {
645
880
  loop?: boolean;
646
881
  nonInteractive?: boolean;
647
882
  }
648
- declare function Stepper(props: StepperProps): react_jsx_runtime.JSX.Element;
649
- declare function StepperList(props: DivProps): react_jsx_runtime.JSX.Element;
883
+ declare function Stepper(props: StepperProps): React$1.JSX.Element;
884
+ declare function StepperList(props: DivProps): React$1.JSX.Element;
650
885
  interface StepperItemProps extends DivProps {
651
886
  value: string;
652
887
  completed?: boolean;
653
888
  disabled?: boolean;
654
889
  }
655
- declare function StepperItem(props: StepperItemProps): react_jsx_runtime.JSX.Element;
656
- declare function StepperTrigger(props: ButtonProps): react_jsx_runtime.JSX.Element;
890
+ declare function StepperItem(props: StepperItemProps): React$1.JSX.Element;
891
+ declare function StepperTrigger(props: ButtonProps): React$1.JSX.Element;
657
892
  interface StepperIndicatorProps extends Omit<DivProps, "children"> {
658
893
  children?: React$1.ReactNode | ((dataState: DataState) => React$1.ReactNode);
659
894
  }
660
- declare function StepperIndicator(props: StepperIndicatorProps): react_jsx_runtime.JSX.Element;
895
+ declare function StepperIndicator(props: StepperIndicatorProps): React$1.JSX.Element;
661
896
  interface StepperSeparatorProps extends DivProps {
662
897
  forceMount?: boolean;
663
898
  }
664
- declare function StepperSeparator(props: StepperSeparatorProps): react_jsx_runtime.JSX.Element | null;
899
+ declare function StepperSeparator(props: StepperSeparatorProps): React$1.JSX.Element | null;
665
900
  interface StepperTitleProps extends React$1.ComponentProps<"span"> {
666
901
  asChild?: boolean;
667
902
  }
668
- declare function StepperTitle(props: StepperTitleProps): react_jsx_runtime.JSX.Element;
903
+ declare function StepperTitle(props: StepperTitleProps): React$1.JSX.Element;
669
904
  interface StepperDescriptionProps extends React$1.ComponentProps<"span"> {
670
905
  asChild?: boolean;
671
906
  }
672
- declare function StepperDescription(props: StepperDescriptionProps): react_jsx_runtime.JSX.Element;
907
+ declare function StepperDescription(props: StepperDescriptionProps): React$1.JSX.Element;
673
908
  interface StepperContentProps extends DivProps {
674
909
  value: string;
675
910
  forceMount?: boolean;
676
911
  }
677
- declare function StepperContent(props: StepperContentProps): react_jsx_runtime.JSX.Element | null;
678
- declare function StepperPrev(props: ButtonProps): react_jsx_runtime.JSX.Element;
679
- declare function StepperNext(props: ButtonProps): react_jsx_runtime.JSX.Element;
912
+ declare function StepperContent(props: StepperContentProps): React$1.JSX.Element | null;
913
+ declare function StepperPrev(props: ButtonProps): React$1.JSX.Element;
914
+ declare function StepperNext(props: ButtonProps): React$1.JSX.Element;
680
915
 
681
916
  /**
682
917
  * Type definitions for the schema-driven EntityTable system.
@@ -700,6 +935,8 @@ interface ResolvedColumn {
700
935
  width?: number;
701
936
  /** Minimum column width in pixels, if specified. */
702
937
  minWidth?: number;
938
+ /** Whether the data source can order by this column (x-ui-column.sortable). */
939
+ sortable: boolean;
703
940
  }
704
941
  /** Per-field UI schema entry for table columns. */
705
942
  type TableUiSchema = Record<string, UISchema & {
@@ -708,17 +945,16 @@ type TableUiSchema = Record<string, UISchema & {
708
945
  };
709
946
  }> & {
710
947
  /**
711
- * Table-level options. Reserved for sorting and a sticky header; **neither is
712
- * implemented yet**, so setting these has no effect today. Kept declared
713
- * because both are intended features -- see the design doc.
948
+ * Table-level options. Reserved for a sticky header, which is **not
949
+ * implemented yet**, so setting it has no effect today. Kept declared because
950
+ * it is an intended feature -- see the design doc. (Sorting is per column:
951
+ * `x-ui-column.sortable`.)
714
952
  *
715
953
  * Note this key is unrelated to the `x-ui-globalOptions` of a form UISchema,
716
954
  * which carries `UISchemaOptions` and does work. The two share a name and
717
955
  * nothing else.
718
956
  */
719
957
  "x-ui-globalOptions"?: {
720
- /** Planned. Sorting is not wired up in EntityTable yet; this has no effect. */
721
- sortable?: boolean;
722
958
  /** Planned. No sticky positioning is applied yet; this has no effect. */
723
959
  stickyHeader?: boolean;
724
960
  };
@@ -786,7 +1022,7 @@ declare const CELL_RENDERERS: Record<string, CellRenderer>;
786
1022
  * const RENDERERS = {
787
1023
  * "x-audit-actors": createRenderer<AuditLogEntry>((row, options) => {
788
1024
  * // row is fully typed, options from x-ui-cell-options in the schema.
789
- * return <span>{row.actors[0]?.name ?? "--"}</span>;
1025
+ * return <span>{row.actors[0]?.name ?? EMPTY_VALUE}</span>;
790
1026
  * }),
791
1027
  * };
792
1028
  *
@@ -808,6 +1044,9 @@ declare function createRenderer<TRow = Record<string, unknown>>(render: (row: TR
808
1044
  *
809
1045
  * Pagination is opt-in. When pagination + onPaginationChange are provided the
810
1046
  * table runs in manualPagination mode and renders prev/next controls.
1047
+ * Sorting is opt-in the same way: with sorting + onSortingChange, the headers of
1048
+ * columns marked x-ui-column.sortable become sort controls (manualSorting --
1049
+ * the consumer's query does the ordering).
811
1050
  *
812
1051
  * Row interaction has two modes controlled by selectionMode:
813
1052
  *
@@ -824,6 +1063,32 @@ declare function createRenderer<TRow = Record<string, unknown>>(render: (row: TR
824
1063
 
825
1064
  /** How a row's detail (onRowClick) is opened. */
826
1065
  type RowActivation = "click" | "double-click";
1066
+ /**
1067
+ * How tightly rows are spaced: "default", or "compact" for dense lists (a file
1068
+ * list, a picker in a side panel) -- tighter cells, the same columns and
1069
+ * behaviour.
1070
+ */
1071
+ type TableDensity = "default" | "compact";
1072
+ /**
1073
+ * Progressive loading -- the alternative to page controls for a list one scans:
1074
+ * the rows grow as more are loaded. The consumer accumulates the pages (e.g.
1075
+ * React Query's useInfiniteQuery) and passes every row loaded so far as
1076
+ * `data.data`, the server's total as `data.meta.total`.
1077
+ */
1078
+ interface TableLoadMore {
1079
+ /** More rows on the server. */
1080
+ hasMore: boolean;
1081
+ /** A further page is on its way. */
1082
+ isLoading: boolean;
1083
+ /** Fetch the next page (the consumer appends it to `data`). */
1084
+ onLoadMore: () => void;
1085
+ /**
1086
+ * Load when the end of the rows scrolls into view (default false) -- in the
1087
+ * table's own scroll box with `fill`, else in the page -- instead of on the
1088
+ * footer's "Load more" button, which then is not shown.
1089
+ */
1090
+ auto?: boolean;
1091
+ }
827
1092
  /**
828
1093
  * Props of EntityTable that can be defaulted app-wide via SonnetConfigProvider.
829
1094
  * Behavioral, non-data props only.
@@ -886,6 +1151,25 @@ interface EntityTableProps<TRow extends RowData> {
886
1151
  * "double-click" mode the chevron is an interactive button that opens detail.
887
1152
  */
888
1153
  showChevron?: boolean;
1154
+ /** Row spacing (default "default"); "compact" for dense lists. */
1155
+ density?: TableDensity;
1156
+ /**
1157
+ * Fill the parent's height (default false): the rows scroll inside the
1158
+ * table, the header row stays on top and the footer below. The parent gives
1159
+ * the height -- e.g. a flex child with `min-h-0`.
1160
+ */
1161
+ fill?: boolean;
1162
+ /**
1163
+ * Progressive loading instead of pages (opt-in): a "Load more" footer, or
1164
+ * with `auto` loading when the end is scrolled to. Not with `pagination`.
1165
+ */
1166
+ loadMore?: TableLoadMore;
1167
+ /**
1168
+ * Render only the rows in view (default false): for long lists -- many
1169
+ * pages loaded with `loadMore`, or a large data set at once. Needs `fill`
1170
+ * (the table's own scroll box); rows are measured, so wrapping cells work.
1171
+ */
1172
+ virtualize?: boolean;
889
1173
  selectionMode?: boolean;
890
1174
  onSelectionChange?: (selectedRows: TRow[]) => void;
891
1175
  /**
@@ -900,10 +1184,39 @@ interface EntityTableProps<TRow extends RowData> {
900
1184
  getRowId?: (row: TRow) => string;
901
1185
  pagination?: PaginationState;
902
1186
  onPaginationChange?: OnChangeFn<PaginationState>;
1187
+ /**
1188
+ * Server-side sorting (opt-in). With both, the header of each sortable column
1189
+ * (`x-ui-column.sortable`) is a sort control cycling ascending, descending,
1190
+ * unsorted. The table reports the order and never reorders rows itself:
1191
+ * forward it to the query (and start again at the first page).
1192
+ */
1193
+ sorting?: SortingState;
1194
+ onSortingChange?: OnChangeFn<SortingState>;
903
1195
  rowActions?: RowAction<TRow>[];
904
1196
  }
905
1197
  declare function EntityTable<TRow extends RowData>(props: EntityTableProps<TRow>): React__default.ReactElement;
906
1198
 
1199
+ /**
1200
+ * JsonTree -- collapsible JSON tree themed by the semantic design tokens
1201
+ * (dark-mode aware via CSS vars). Thin wrapper over react-json-tree so every
1202
+ * package renders JSON trees the same way.
1203
+ */
1204
+
1205
+ interface JsonTreeProps {
1206
+ data: unknown;
1207
+ /** Expand every node initially. Default true. Ignored when `expandLevel` is set. */
1208
+ expanded?: boolean;
1209
+ /**
1210
+ * Expand only the nodes above this depth initially (the root is level 0):
1211
+ * 1 opens the root, 2 also its children. For large documents, where
1212
+ * expanding everything is slow and unreadable.
1213
+ */
1214
+ expandLevel?: number;
1215
+ /** Hide the root node label. Default false. */
1216
+ hideRoot?: boolean;
1217
+ }
1218
+ declare function JsonTree({ data, expanded, expandLevel, hideRoot, }: JsonTreeProps): React__default.ReactElement;
1219
+
907
1220
  /**
908
1221
  * PropertyList — read-only display of a record's properties.
909
1222
  *
@@ -911,22 +1224,41 @@ declare function EntityTable<TRow extends RowData>(props: EntityTableProps<TRow>
911
1224
  * - `"inline"` (default) — horizontal two-column grid, key left / value right.
912
1225
  * - `"stacked"` — key label above each value.
913
1226
  *
914
- * Values rendered by {@link PropertyValue}. Optional per-property schema
915
- * refines value rendering (schema is NOT required).
1227
+ * Two densities:
1228
+ * - `"compact"` (default) — small keys, tight rows: an inspector, a card.
1229
+ * - `"comfortable"` — a detail page: a fixed label column, body-size text,
1230
+ * rows apart by space alone (no rules between them).
916
1231
  *
917
- * Shared by the graph view's node/edge cards and the table inspector so all
918
- * property displays look identical.
1232
+ * Without a schema, every property shows, keyed by its name, rendered by
1233
+ * {@link PropertyValue} from its value; `propertySchemas` refines that per
1234
+ * property. With a `schema` (an object JSON Schema), the schema decides, as it
1235
+ * does for EntityTable's columns: which fields and in which order
1236
+ * (`x-ui-column`), their labels (`x-ui-title`, `title`), and how each value
1237
+ * renders (`x-ui-cell`, or a local renderer from `renderers`).
1238
+ *
1239
+ * Shared by the graph view's node/edge cards, the table inspector and detail
1240
+ * pages, so all property displays look alike.
919
1241
  */
920
1242
 
921
1243
  /** Layout mode for the property list. */
922
1244
  type PropertyListLayout = "inline" | "stacked";
1245
+ /** Density: an inspector's (compact) or a detail page's (comfortable). */
1246
+ type PropertyListDensity = "compact" | "comfortable";
923
1247
  interface PropertyListProps {
924
1248
  /** Property name -> value. */
925
1249
  properties: Record<string, unknown>;
926
- /** Optional property name -> schema, to refine value rendering. */
1250
+ /** Optional property name -> schema, to refine value rendering. Ignored with `schema`. */
927
1251
  propertySchemas?: Record<string, JsonSchemaProperty>;
1252
+ /** An object JSON Schema deciding the fields, their order, labels and rendering. */
1253
+ schema?: JsonSchema;
1254
+ /** Per-field overrides of `schema`, as EntityTable's uiSchema. */
1255
+ uiSchema?: TableUiSchema;
1256
+ /** Local cell renderers (`x-` names) the schema's x-ui-cell may name; given the whole record as the row. */
1257
+ renderers?: Record<string, CellRenderer>;
928
1258
  /** Layout mode. Default "inline" (horizontal key-value grid). */
929
1259
  layout?: PropertyListLayout;
1260
+ /** Density. Default "compact". */
1261
+ density?: PropertyListDensity;
930
1262
  /** Show a "Properties" section header. Default false. */
931
1263
  showHeader?: boolean;
932
1264
  /** Click value to copy it to the clipboard. Default true. */
@@ -935,7 +1267,7 @@ interface PropertyListProps {
935
1267
  emptyLabel?: string;
936
1268
  className?: string;
937
1269
  }
938
- declare function PropertyList({ properties, propertySchemas, layout, showHeader, copyable, emptyLabel, className, }: PropertyListProps): React__default.ReactElement;
1270
+ declare function PropertyList(props: PropertyListProps): React__default.ReactElement;
939
1271
 
940
1272
  /**
941
1273
  * PropertyValue — read-only, type-aware rendering of a single property value.
@@ -951,6 +1283,7 @@ declare function PropertyList({ properties, propertySchemas, layout, showHeader,
951
1283
  * Schema is OPTIONAL and only REFINES rendering when present:
952
1284
  * - x-ui-cell / inferred type/format (date, datetime, boolean, number)
953
1285
  * - x-ui-cell: "json" forces a JSON tree even for a string value
1286
+ * - a local renderer (`renderers`, `x-` names) as EntityTable's, given the row
954
1287
  * A plain string is treated as text by default — it is NOT auto-parsed as
955
1288
  * JSON (avoids fragile, surprising behaviour). Schema is the only signal that
956
1289
  * turns a JSON-looking string into a tree.
@@ -963,8 +1296,30 @@ interface PropertyValueProps {
963
1296
  className?: string;
964
1297
  /** Strings longer than this clamp with a "Show more" toggle. */
965
1298
  clampChars?: number;
1299
+ /** Local cell renderers (`x-` names) the schema's x-ui-cell may name, as EntityTable's. */
1300
+ renderers?: Record<string, CellRenderer>;
1301
+ /** The record the value belongs to: a renderer reads sibling fields from it. */
1302
+ row?: Record<string, unknown>;
1303
+ }
1304
+ declare function PropertyValue({ value, schema, className, clampChars, renderers, row, }: PropertyValueProps): React__default.ReactElement;
1305
+
1306
+ /**
1307
+ * Resolve the fields a PropertyList shows from a JSON Schema -- as EntityTable
1308
+ * resolves its columns (order, hidden, label, cell), so a record reads the same
1309
+ * in a table and on its detail page.
1310
+ *
1311
+ * Pure: no React, no DOM.
1312
+ */
1313
+
1314
+ /** One field of a PropertyList: its key, its label, and the schema its value renders by. */
1315
+ interface PropertyField {
1316
+ key: string;
1317
+ label: string;
1318
+ /** The property, with its resolved x-ui-cell and x-ui-cell-options. */
1319
+ schema: JsonSchemaProperty;
966
1320
  }
967
- declare function PropertyValue({ value, schema, className, clampChars, }: PropertyValueProps): React__default.ReactElement;
1321
+ /** The schema's fields in order, hidden ones dropped, each labelled and with its cell. */
1322
+ declare function resolvePropertyFields(schema: JsonSchema, uiSchema?: TableUiSchema): PropertyField[];
968
1323
 
969
1324
  /**
970
1325
  * EntitySelect -- async searchable single-select for entity references.
@@ -1053,6 +1408,20 @@ declare function EntitySelect(props: EntitySelectProps): React$1.ReactElement;
1053
1408
  * Loading and error states per node are communicated via the node data
1054
1409
  * itself (isLoading, isError flags). The caller controls data fetching.
1055
1410
  *
1411
+ * Large trees: with virtualize, only the rows in view are rendered -- the tree
1412
+ * scrolls itself, in a box of bounded height the caller gives it -- and each
1413
+ * row states its level and place among its siblings (aria-level, -setsize,
1414
+ * -posinset), since the others are not in the DOM. Focus and the active node
1415
+ * follow a row out of view: it is scrolled to, then focused. Off by default.
1416
+ *
1417
+ * Sticky parents (with virtualize): the ancestors of the topmost row in view
1418
+ * stay pinned at the top -- deep in a level of thousands, its parent is one
1419
+ * click away. Home/End focus the first and the last visible node.
1420
+ *
1421
+ * Type-to-find: given getTypeAheadLabel, typing moves focus to the next
1422
+ * visible row whose label starts with what was typed (WAI-ARIA tree view).
1423
+ * Off without it.
1424
+ *
1056
1425
  * Extractable to @petrarca/sonnet-ui. Contains no app-specific imports.
1057
1426
  */
1058
1427
 
@@ -1097,8 +1466,35 @@ interface TreeViewProps<TData = Record<string, unknown>> {
1097
1466
  * (nodes sharing the same parent). Clearing all selections resets the
1098
1467
  * constraint so a different sibling group can be selected next. */
1099
1468
  constrainSelectionToSiblings?: boolean;
1469
+ /** The node that is open (e.g. the file shown next to the tree): marked,
1470
+ * announced as selected and scrolled into view once shown. Independent of
1471
+ * the checkbox selection. */
1472
+ activeId?: string;
1473
+ /** Accessible name of the tree. Default "Tree". */
1474
+ label?: string;
1100
1475
  /** Pixels of indentation per depth level. Default 20. */
1101
1476
  indentPx?: number;
1477
+ /**
1478
+ * Render only the rows in view. The tree then scrolls itself and needs a
1479
+ * bounded height (h-full in a box of known height, or a fixed height).
1480
+ * Default false: every visible row is rendered, as before.
1481
+ */
1482
+ virtualize?: boolean;
1483
+ /** A row's height before it is measured, in pixels (virtualize). Default 32. */
1484
+ rowHeight?: number;
1485
+ /**
1486
+ * Type-to-find: a node's label, as typed to find it. Given, typing moves
1487
+ * focus to the next visible row whose label starts with what was typed
1488
+ * (case-insensitive; one character again moves on to the next match).
1489
+ */
1490
+ getTypeAheadLabel?: (node: TreeNode<TData>) => string;
1491
+ /**
1492
+ * With virtualize: pin the ancestors of the topmost row in view at the top,
1493
+ * so a long level's parent stays visible and one click away (it is scrolled
1494
+ * to, focused and reported as a click). A visual aid, hidden from assistive
1495
+ * technology -- ArrowLeft moves to the parent. Default false.
1496
+ */
1497
+ stickyParents?: boolean;
1102
1498
  className?: string;
1103
1499
  }
1104
1500
  /** Imperative handle exposed via ref for programmatic focus. */
@@ -1193,6 +1589,8 @@ declare const EntityTree: <TData extends Record<string, unknown>>(props: EntityT
1193
1589
  * Faceted mode -- on submit only (Enter on empty input after
1194
1590
  * chips are composed). Chip accumulation is
1195
1591
  * internal state; the caller never sees it.
1592
+ * Free text, debounce -- the chips and the text, after the user stops
1593
+ * typing (faceted with textKey)
1196
1594
  * Remove chip / Clear -- immediately (destructive ops need instant feedback)
1197
1595
  *
1198
1596
  * Faceted field selection:
@@ -1204,6 +1602,12 @@ declare const EntityTree: <TData extends Record<string, unknown>>(props: EntityT
1204
1602
  * If the input ends with a space, facet matching is suppressed --
1205
1603
  * the value is committed against facets[0] (implicit default).
1206
1604
  *
1605
+ * Free text (faceted, with textKey):
1606
+ * The typed text is the search itself, not a facet value: it stays in the
1607
+ * input and is submitted with the chips as a term keyed textKey. Facets
1608
+ * come from the picker only (typing does not narrow or select them); while
1609
+ * a facet's value is entered, the text is held and comes back after.
1610
+ *
1207
1611
  * Extractable to @petrarca/sonnet-ui: no app-specific imports.
1208
1612
  */
1209
1613
 
@@ -1260,6 +1664,8 @@ declare const DEFAULT_SEARCH_WIDGETS: SearchWidgetRegistry;
1260
1664
  * Simple -- no schema prop; produces a single search term
1261
1665
  * Faceted -- schema prop provided; facets derived from schema properties,
1262
1666
  * value entry delegates to search widgets
1667
+ * Free text -- faceted plus textKey: the typed text is the query, submitted
1668
+ * with the chips; facets come from the picker
1263
1669
  *
1264
1670
  * Faceted field picker:
1265
1671
  * - Opens on ArrowDown or chevron button click
@@ -1300,10 +1706,24 @@ interface SearchInputProps {
1300
1706
  * code OR display). Ignored in faceted mode.
1301
1707
  */
1302
1708
  searchFields?: string[];
1709
+ /**
1710
+ * Faceted mode only. The key of the free-text term: typed text is the
1711
+ * search itself -- it stays in the input and is submitted with the chips as
1712
+ * a term with this key -- and facets come from the picker (the chevron or
1713
+ * ArrowDown). One field for a query and its filters. Without it, typed text
1714
+ * narrows the picker or becomes a value of the first facet.
1715
+ */
1716
+ textKey?: string;
1303
1717
  placeholder?: string;
1304
1718
  className?: string;
1305
1719
  /** Disable all interaction (e.g. when a prerequisite is not met). */
1306
1720
  disabled?: boolean;
1721
+ /**
1722
+ * Faceted mode only: the filter the chips (and the free text) make, each
1723
+ * time they change -- before Enter commits them through onChange. For a
1724
+ * page with a control of its own that runs the search (a Run button).
1725
+ */
1726
+ onDraftChange?: (draft: FilterExpr) => void;
1307
1727
  }
1308
1728
  declare function SearchInput(props: SearchInputProps): React__default.ReactElement;
1309
1729
 
@@ -1316,7 +1736,7 @@ type Props$2 = {
1316
1736
  *
1317
1737
  * Displayed in CytoscapeControls toolbar with enabled/disabled state.
1318
1738
  */
1319
- declare function ClipboardButton({ hasItems, onClick }: Props$2): react_jsx_runtime.JSX.Element;
1739
+ declare function ClipboardButton({ hasItems, onClick }: Props$2): React$1.JSX.Element;
1320
1740
 
1321
1741
  /**
1322
1742
  * ClipboardItem - Lightweight representation of an item in the clipboard.
@@ -1341,7 +1761,7 @@ type Props$1 = {
1341
1761
  * Shows item info with color indicator and action buttons.
1342
1762
  * Compact design for dropdown menu.
1343
1763
  */
1344
- declare function ClipboardItemComponent({ item, onAddItem, onRemove }: Props$1): react_jsx_runtime.JSX.Element;
1764
+ declare function ClipboardItemComponent({ item, onAddItem, onRemove }: Props$1): React$1.JSX.Element;
1345
1765
 
1346
1766
  type Props = {
1347
1767
  onAddItem: (item: ClipboardItem, keepInClipboard: boolean) => void;
@@ -1351,6 +1771,7 @@ type Props = {
1351
1771
  *
1352
1772
  * Displays clipboard items with add and clear all functionality.
1353
1773
  */
1354
- declare function ClipboardMenu({ onAddItem }: Props): react_jsx_runtime.JSX.Element;
1774
+ declare function ClipboardMenu({ onAddItem }: Props): React$1.JSX.Element;
1355
1775
 
1356
- export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, CELL_RENDERERS, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CellRenderer, type CellRendererProps, Checkbox, ClipboardButton, ClipboardItemComponent as ClipboardItem, ClipboardMenu, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DEFAULT_SEARCH_WIDGETS, DateInput, type DateInputProps, DateTimeInput, type DateTimeInputProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EntitySelect, type EntitySelectProps, EntityTable, type EntityTableProps, EntityTree, type EntityTreeHandle, type EntityTreeProps, IconButton, type IconButtonProps, Input, InputError, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, Popover, PopoverContent, PopoverTrigger, PropertyList, type PropertyListLayout, type PropertyListProps, PropertyValue, type PropertyValueProps, ResizeHandle, type ResizeHandleProps, type ResolvedColumn, type RowAction, ScrollArea, ScrollBar, SearchInput, type SearchInputProps, type SearchMode, type SearchWidget, type SearchWidgetProps, type SearchWidgetRegistry, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetTitle, SheetTrigger, SimpleGroup, SimpleStack, SimpleTooltip, Skeleton, Spinner, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, StepperNext, StepperPrev, type StepperProps, StepperSeparator, StepperTitle, StepperTrigger, type TableUiSchema, Tabs, TabsContent, TabsList, TabsSeparator, TabsTrigger, Textarea, TimeInput, type TimeInputProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TreeNode, TreeView, type TreeViewHandle, type TreeViewProps, badgeVariants, buttonVariants, createRenderer, useStore as useStepper };
1776
+ export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, CELL_RENDERERS, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ClipboardButton, ClipboardItemComponent as ClipboardItem, ClipboardMenu, CodeableConceptDisplay, CodedValueDisplay, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CopyButton, DEFAULT_SEARCH_WIDGETS, DangerZone, DateInput, DateTimeInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EntitySelect, EntityTable, EntityTree, IconButton, Input, InputError, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, JsonTree, Label, ListRow, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PropertyList, PropertyValue, RadioGroup, RadioGroupItem, ResizeHandle, ScrollArea, ScrollBar, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetTitle, SheetTrigger, SimpleGroup, SimpleStack, SimpleTooltip, Skeleton, Spinner, SplitButton, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperList, StepperNext, StepperPrev, StepperSeparator, StepperTitle, StepperTrigger, Tabs, TabsContent, TabsList, TabsSeparator, TabsTrigger, Textarea, TimeInput, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TreeView, ViewSwitch, badgeVariants, buttonVariants, createRenderer, resolvePropertyFields, useStore as useStepper };
1777
+ export type { BadgeProps, CalendarProps, CellRenderer, CellRendererProps, CodeableConceptDisplayProps, CodedValueDisplayProps, CopyButtonProps, DangerZoneAction, DangerZoneProps, DateInputProps, DateTimeInputProps, EntitySelectProps, EntityTableProps, EntityTreeHandle, EntityTreeProps, IconButtonProps, JsonTreeProps, ListRowProps, PropertyField, PropertyListDensity, PropertyListLayout, PropertyListProps, PropertyValueProps, ResizeHandleProps, ResolvedColumn, RowAction, SearchInputProps, SearchMode, SearchWidget, SearchWidgetProps, SearchWidgetRegistry, SplitButtonItem, SplitButtonProps, StepperProps, TableDensity, TableLoadMore, TableUiSchema, TimeInputProps, TreeNode, TreeViewHandle, TreeViewProps, ViewSwitchOption, ViewSwitchProps };