@tradalab/lyra 3.5.0 → 3.6.1

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.
Files changed (51) hide show
  1. package/dist/blocks/index.d.ts +5 -68
  2. package/dist/blocks/index.js +13 -156
  3. package/dist/blocks/index.js.map +1 -1
  4. package/dist/chunk-7MZ73OVI.js +3776 -0
  5. package/dist/chunk-7MZ73OVI.js.map +1 -0
  6. package/dist/chunk-AIULLZYM.js +21 -0
  7. package/dist/chunk-AIULLZYM.js.map +1 -0
  8. package/dist/{chunk-FHM6VOPQ.js → chunk-AM6UJ666.js} +105 -3
  9. package/dist/chunk-AM6UJ666.js.map +1 -0
  10. package/dist/chunk-D7DMRCDY.js +115 -0
  11. package/dist/chunk-D7DMRCDY.js.map +1 -0
  12. package/dist/{chunk-VDO6PQ5L.js → chunk-L4LQCVOF.js} +144 -8
  13. package/dist/chunk-L4LQCVOF.js.map +1 -0
  14. package/dist/{chunk-BTZYRWFX.js → chunk-RNKXFELK.js} +223 -17
  15. package/dist/chunk-RNKXFELK.js.map +1 -0
  16. package/dist/{chunk-2HDU26FC.js → chunk-VXW3K5O5.js} +99 -3
  17. package/dist/chunk-VXW3K5O5.js.map +1 -0
  18. package/dist/data-table/index.js +1 -2
  19. package/dist/data-table/index.js.map +1 -1
  20. package/dist/hooks/index.d.ts +3 -0
  21. package/dist/hooks/index.js +2 -1
  22. package/dist/people/index.js +2 -4
  23. package/dist/people/index.js.map +1 -1
  24. package/dist/plate-BJ19iaVV.d.ts +38 -0
  25. package/dist/plate-picker-CXxUGyNz.d.ts +20 -0
  26. package/dist/preference-script-Dm-LEoYX.d.ts +5 -0
  27. package/dist/shell/index.d.ts +22 -6
  28. package/dist/shell/index.js +42 -14
  29. package/dist/shell/index.js.map +1 -1
  30. package/dist/ui/index.d.ts +5 -2
  31. package/dist/ui/index.js +7 -3176
  32. package/dist/ui/index.js.map +1 -1
  33. package/dist/use-compact-BvI4sJf9.d.ts +15 -0
  34. package/package.json +1 -1
  35. package/dist/chunk-2HDU26FC.js.map +0 -1
  36. package/dist/chunk-BTZYRWFX.js.map +0 -1
  37. package/dist/chunk-CV3UXQBT.js +0 -110
  38. package/dist/chunk-CV3UXQBT.js.map +0 -1
  39. package/dist/chunk-EJP7F42V.js +0 -679
  40. package/dist/chunk-EJP7F42V.js.map +0 -1
  41. package/dist/chunk-F2ET7EL2.js +0 -104
  42. package/dist/chunk-F2ET7EL2.js.map +0 -1
  43. package/dist/chunk-FHM6VOPQ.js.map +0 -1
  44. package/dist/chunk-QYA2HGKW.js +0 -20
  45. package/dist/chunk-QYA2HGKW.js.map +0 -1
  46. package/dist/chunk-VDO6PQ5L.js.map +0 -1
  47. package/dist/chunk-XJJQAQWJ.js +0 -119
  48. package/dist/chunk-XJJQAQWJ.js.map +0 -1
  49. package/dist/chunk-XWGYXLIA.js +0 -147
  50. package/dist/chunk-XWGYXLIA.js.map +0 -1
  51. package/dist/{breadcrumb-CgEcSonR.d.ts → account-menu-D9M_kEzN.d.ts} +12 -12
@@ -4,6 +4,10 @@ import * as React from 'react';
4
4
  import { ReactNode, HTMLAttributes } from 'react';
5
5
  import { Slot, Label } from 'radix-ui';
6
6
  import { LucideIcon } from 'lucide-react';
7
+ export { B as BEARING_PLATES, a as BearingPlate, P as PLATES, b as Plate, d as derivePlate, i as isPlate } from '../plate-BJ19iaVV.js';
8
+ export { u as useCompact, a as usePlate } from '../use-compact-BvI4sJf9.js';
9
+ export { P as PlatePicker, a as PlatePickerProps } from '../plate-picker-CXxUGyNz.js';
10
+ export { P as PreferenceScript } from '../preference-script-Dm-LEoYX.js';
7
11
 
8
12
  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.JSX.Element;
9
13
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
@@ -428,71 +432,4 @@ declare function LlmSettings({ api, labels, className, }: {
428
432
  className?: string;
429
433
  }): React.JSX.Element;
430
434
 
431
- /**
432
- * Plates: the palette a reader picks, applied by putting `data-plate` on any element.
433
- *
434
- * This module holds NAMES and nothing else. The colours live once, in `styles/globals.css`, and a
435
- * swatch reads them the same way the rest of the UI does - by sitting inside a `data-plate` scope
436
- * and using `bg-primary`. Copying the values here would be the second table that drifts.
437
- *
438
- * Absent `data-plate`, `--primary` is lyra's neutral. That is the default every app ships with, so
439
- * adopting plates costs an app nothing until a reader chooses.
440
- */
441
- declare const PLATES: readonly ["pink", "rose", "crimson", "rust", "orange", "ochre", "amber", "honey", "gold", "olive", "lime", "green", "teal", "cyan", "azure", "blue", "indigo", "violet", "magenta"];
442
- type Plate = (typeof PLATES)[number];
443
- /**
444
- * The plates certified to be told apart from each other, not merely from the status tokens.
445
- *
446
- * Only these may carry MEANING. The distinction is not decorative: a plate a reader picks for
447
- * pleasure needs no relation to anyone else's, but a plate that says "which space you are typing
448
- * into" stops working the moment two of them look alike - so that use gets the subset measured at
449
- * dE76 >= 29.7 pairwise, in both themes.
450
- */
451
- declare const BEARING_PLATES: readonly ["pink", "rust", "amber", "olive", "green", "teal", "azure", "blue", "violet"];
452
- type BearingPlate = (typeof BEARING_PLATES)[number];
453
- declare function isPlate(s: string): s is Plate;
454
- /**
455
- * The plate for an id, from the certified subset.
456
- *
457
- * Derived, never chosen, and that is the point when the colour is a fence rather than a preference:
458
- * if two organisations could both pick blue the signal stops working for both of them. Deriving on
459
- * the CLIENT is deliberate too - the alternative is every server that shows a coloured surface
460
- * keeping its own copy of the name list, which is the shape chat ended up in (a Go slice, a CSS
461
- * block and a TS union, with nothing holding them together).
462
- *
463
- * FNV-1a rather than a cryptographic hash: this picks a colour, so spreading matters and secrecy
464
- * does not, and it stays synchronous - SubtleCrypto would make every call site async for nothing.
465
- */
466
- declare function derivePlate(id: string): BearingPlate;
467
-
468
- interface PlatePickerProps {
469
- value: Plate | null;
470
- onChange: (plate: Plate | null) => void;
471
- /** Accessible name for the group, e.g. "Accent colour". */
472
- label: string;
473
- /** Accessible name for the neutral option, e.g. "Default". */
474
- resetLabel: string;
475
- /**
476
- * Translated name per plate. Falls back to the plate's own key, which is English - fine for a
477
- * developer tool, wrong for a product, and the reason this is a prop rather than a table in here.
478
- */
479
- plateLabels?: Partial<Record<Plate, string>>;
480
- className?: string;
481
- }
482
- declare function PlatePicker({ value, onChange, label, resetLabel, plateLabels, className }: PlatePickerProps): React.JSX.Element;
483
-
484
- /**
485
- * The plate this device is set to, and a way to change it.
486
- *
487
- * A stored name that is no longer a plate - a rename, a downgrade to an older lyra - reads as no
488
- * plate. The alternative is an attribute no rule matches, which looks identical to the neutral
489
- * default on screen while the picker shows nothing selected at all, so the reader cannot tell that
490
- * their choice was dropped or get back to a known state.
491
- */
492
- declare function usePlate(): [Plate | null, (plate: Plate | null) => void];
493
-
494
- declare function useCompact(): [boolean, (compact: boolean) => void];
495
-
496
- declare function PreferenceScript(): React.JSX.Element;
497
-
498
- export { BEARING_PLATES, type BearingPlate, ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, 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 LlmSettingsLabels, type LlmSlot, type LlmState, type McpCall, type McpClient, McpSettings, type McpSettingsApi, type McpSettingsLabels, type McpStatus, type McpTool, OptionPicker, type OptionPickerLabels, PLATES, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, type Plate, PlatePicker, type PlatePickerProps, PreferenceScript, 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, derivePlate, isPlate, useCompact, useConfirm, useFormField, usePlate };
435
+ export { ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, 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 LlmSettingsLabels, type LlmSlot, type LlmState, type McpCall, type McpClient, McpSettings, type McpSettingsApi, type McpSettingsLabels, type McpStatus, type McpTool, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, 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, useConfirm, useFormField };
@@ -1,14 +1,19 @@
1
1
  "use client";
2
- import { Label, Combobox, ComboboxInput, ComboboxContent, ComboboxEmpty, ComboboxList, ComboboxItem, Spinner, Alert, AlertDescription, FieldGroup, FieldSet, FieldLegend, FieldDescription, Field, FieldContent, FieldLabel, Badge, Switch, FieldSeparator, Progress, RadioGroup } from '../chunk-EJP7F42V.js';
3
- import { NativeSelect, NativeSelectOption } from '../chunk-FHM6VOPQ.js';
4
- import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '../chunk-XJJQAQWJ.js';
5
- import { Dialog, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from '../chunk-XWGYXLIA.js';
6
- import '../chunk-2HDU26FC.js';
2
+ import { Label, Combobox, ComboboxInput, ComboboxContent, ComboboxEmpty, ComboboxList, ComboboxItem, Spinner, Alert, AlertDescription, FieldGroup, FieldSet, FieldLegend, FieldDescription, Field, FieldContent, FieldLabel, Badge, FieldSeparator, Progress } from '../chunk-7MZ73OVI.js';
3
+ export { PreferenceScript } from '../chunk-7MZ73OVI.js';
4
+ import { NativeSelect, NativeSelectOption } from '../chunk-AM6UJ666.js';
5
+ export { useCompact, usePlate } from '../chunk-AIULLZYM.js';
6
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Switch } from '../chunk-RNKXFELK.js';
7
+ export { PlatePicker } from '../chunk-RNKXFELK.js';
8
+ export { BEARING_PLATES, PLATES, derivePlate, isPlate } from '../chunk-D7DMRCDY.js';
9
+ import '../chunk-VEWKPOMS.js';
10
+ import { Dialog, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from '../chunk-L4LQCVOF.js';
11
+ import '../chunk-VXW3K5O5.js';
7
12
  import { Button, Input } from '../chunk-VGOGWZCF.js';
8
13
  import { cn } from '../chunk-XH55BHUU.js';
9
14
  import * as React5 from 'react';
10
- import { createContext, useState, useContext, useCallback, useId, useSyncExternalStore, useEffect } from 'react';
11
- import { Slot, RadioGroup as RadioGroup$1 } from 'radix-ui';
15
+ import { createContext, useState, useContext, useCallback, useId } from 'react';
16
+ import { Slot } from 'radix-ui';
12
17
  import { FormProvider, Controller, useFormContext } from 'react-hook-form';
13
18
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
14
19
  import { ChevronRight, CheckIcon, CopyIcon, PlusIcon, FolderOpen, Folder, File } from 'lucide-react';
@@ -1284,154 +1289,6 @@ function LlmSettings({
1284
1289
  );
1285
1290
  }
1286
1291
 
1287
- // src/blocks/plate.ts
1288
- var PLATES = [
1289
- "pink",
1290
- "rose",
1291
- "crimson",
1292
- "rust",
1293
- "orange",
1294
- "ochre",
1295
- "amber",
1296
- "honey",
1297
- "gold",
1298
- "olive",
1299
- "lime",
1300
- "green",
1301
- "teal",
1302
- "cyan",
1303
- "azure",
1304
- "blue",
1305
- "indigo",
1306
- "violet",
1307
- "magenta"
1308
- ];
1309
- var BEARING_PLATES = [
1310
- "pink",
1311
- "rust",
1312
- "amber",
1313
- "olive",
1314
- "green",
1315
- "teal",
1316
- "azure",
1317
- "blue",
1318
- "violet"
1319
- ];
1320
- function isPlate(s) {
1321
- return PLATES.includes(s);
1322
- }
1323
- function derivePlate(id) {
1324
- let h = 2166136261;
1325
- for (let i = 0; i < id.length; i++) {
1326
- h ^= id.charCodeAt(i);
1327
- h = Math.imul(h, 16777619) >>> 0;
1328
- }
1329
- return BEARING_PLATES[h % BEARING_PLATES.length];
1330
- }
1331
- var NONE = "none";
1332
- function PlatePicker({ value, onChange, label, resetLabel, plateLabels, className }) {
1333
- const swatch = "size-7 shrink-0 rounded-none border outline-2 -outline-offset-[3px] outline-transparent focus-visible:ring-2 focus-visible:ring-ring";
1334
- return /* @__PURE__ */ jsxs(
1335
- RadioGroup,
1336
- {
1337
- "aria-label": label,
1338
- value: value ?? NONE,
1339
- onValueChange: (v) => onChange(isPlate(v) ? v : null),
1340
- className: cn("flex w-auto flex-wrap gap-2", className),
1341
- children: [
1342
- /* @__PURE__ */ jsx(
1343
- RadioGroup$1.Item,
1344
- {
1345
- value: NONE,
1346
- "aria-label": resetLabel,
1347
- title: resetLabel,
1348
- className: cn(swatch, "bg-muted border-border data-checked:outline-foreground")
1349
- }
1350
- ),
1351
- PLATES.map((p) => /* @__PURE__ */ jsx(
1352
- RadioGroup$1.Item,
1353
- {
1354
- value: p,
1355
- "aria-label": plateLabels?.[p] ?? p,
1356
- title: plateLabels?.[p] ?? p,
1357
- "data-plate": p,
1358
- className: cn(swatch, "bg-primary border-transparent data-checked:outline-primary-foreground")
1359
- },
1360
- p
1361
- ))
1362
- ]
1363
- }
1364
- );
1365
- }
1366
- var PLATE_KEY = "lyra.plate";
1367
- var COMPACT_KEY = "lyra.compact";
1368
- var listeners = /* @__PURE__ */ new Map();
1369
- function read(key) {
1370
- try {
1371
- return localStorage.getItem(key);
1372
- } catch {
1373
- return null;
1374
- }
1375
- }
1376
- function useStoredSetting(key) {
1377
- const subscribe = useCallback(
1378
- (onChange) => {
1379
- const set = listeners.get(key) ?? /* @__PURE__ */ new Set();
1380
- listeners.set(key, set);
1381
- set.add(onChange);
1382
- const onStorage = (e) => {
1383
- if (e.key === key) onChange();
1384
- };
1385
- window.addEventListener("storage", onStorage);
1386
- return () => {
1387
- set.delete(onChange);
1388
- window.removeEventListener("storage", onStorage);
1389
- };
1390
- },
1391
- [key]
1392
- );
1393
- const value = useSyncExternalStore(
1394
- subscribe,
1395
- () => read(key),
1396
- () => null
1397
- );
1398
- const store = useCallback((next) => {
1399
- try {
1400
- if (next === null) localStorage.removeItem(key);
1401
- else localStorage.setItem(key, next);
1402
- } catch {
1403
- }
1404
- listeners.get(key)?.forEach((l) => l());
1405
- }, [key]);
1406
- return [value, store];
1407
- }
1408
- function useRootAttribute(name, value) {
1409
- useEffect(() => {
1410
- const root = document.documentElement;
1411
- if (value === null) root.removeAttribute(name);
1412
- else root.setAttribute(name, value);
1413
- }, [name, value]);
1414
- }
1415
-
1416
- // src/blocks/use-plate.ts
1417
- function usePlate() {
1418
- const [stored, store] = useStoredSetting(PLATE_KEY);
1419
- const plate = stored !== null && isPlate(stored) ? stored : null;
1420
- useRootAttribute("data-plate", plate);
1421
- return [plate, store];
1422
- }
1423
- function useCompact() {
1424
- const [stored, store] = useStoredSetting(COMPACT_KEY);
1425
- const compact = stored === "true";
1426
- const setCompact = useCallback((next) => store(next ? "true" : null), [store]);
1427
- useRootAttribute("data-compact", compact ? "true" : null);
1428
- return [compact, setCompact];
1429
- }
1430
- var SCRIPT = `try{var d=document.documentElement,p=localStorage.getItem("${PLATE_KEY}");if(p)d.setAttribute("data-plate",p);if(localStorage.getItem("${COMPACT_KEY}")==="true")d.setAttribute("data-compact","true")}catch(e){}`;
1431
- function PreferenceScript() {
1432
- return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: SCRIPT } });
1433
- }
1434
-
1435
- export { BEARING_PLATES, ConfirmContext, ConfirmDialog, ConfirmProvider, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, LlmSettings, McpSettings, OptionPicker, PLATES, Panel, PanelCard, PlatePicker, PreferenceScript, TreeExpander, TreeIcon, TreeLabel, TreeLines, TreeNode, TreeNodeContent, TreeNodeTrigger, TreeProvider, TreeView, TzPicker, derivePlate, isPlate, useCompact, useConfirm, useFormField, usePlate };
1292
+ export { ConfirmContext, ConfirmDialog, ConfirmProvider, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, LlmSettings, McpSettings, OptionPicker, Panel, PanelCard, TreeExpander, TreeIcon, TreeLabel, TreeLines, TreeNode, TreeNodeContent, TreeNodeTrigger, TreeProvider, TreeView, TzPicker, useConfirm, useFormField };
1436
1293
  //# sourceMappingURL=index.js.map
1437
1294
  //# sourceMappingURL=index.js.map