@llmnative/react 1.23.0 → 1.25.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.css +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1856 -1706
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/Theme.d.ts +6 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/ui/Modal.d.ts +5 -4
- package/dist/types/src/components/ui/Tree.d.ts +47 -0
- package/llms-full.txt +18 -1
- package/package.json +1 -1
- package/themes/cyber.ts +6 -0
- package/themes/default.ts +6 -0
- package/themes/flat.ts +6 -0
|
@@ -340,6 +340,12 @@ export interface ThemeConfig {
|
|
|
340
340
|
wrapperClassName?: string;
|
|
341
341
|
className?: string;
|
|
342
342
|
};
|
|
343
|
+
Tree?: {
|
|
344
|
+
wrapperClassName?: string;
|
|
345
|
+
className?: string;
|
|
346
|
+
itemClassName?: string;
|
|
347
|
+
selectedClassName?: string;
|
|
348
|
+
};
|
|
343
349
|
DescriptionList?: {
|
|
344
350
|
wrapperClassName?: string;
|
|
345
351
|
className?: string;
|
|
@@ -16,6 +16,8 @@ export { default as Alert } from './ui/Alert';
|
|
|
16
16
|
export type { AlertProps } from './ui/Alert';
|
|
17
17
|
export { default as Badge } from './ui/Badge';
|
|
18
18
|
export { default as DescriptionList } from './ui/DescriptionList';
|
|
19
|
+
export { default as Tree, treeFromPaths } from './ui/Tree';
|
|
20
|
+
export type { TreeNode, TreeProps } from './ui/Tree';
|
|
19
21
|
export type { DescriptionListItem, DescriptionListLayout, DescriptionListColumns, DescriptionListProps } from './ui/DescriptionList';
|
|
20
22
|
export * from './ui/Badge';
|
|
21
23
|
export * from './ui/Buttons';
|
|
@@ -52,10 +52,11 @@ export interface ModalProps extends MotionUIProps {
|
|
|
52
52
|
*/
|
|
53
53
|
rightInset?: number;
|
|
54
54
|
/**
|
|
55
|
-
* When `true` this modal is visually "behind" another modal stacked on top
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* modal's backdrop
|
|
55
|
+
* When `true` this modal is visually "behind" another modal stacked on top, as in
|
|
56
|
+
* Google Tag Manager: it keeps its size and height, a side panel (`left`/`right`) slides
|
|
57
|
+
* inwards so a strip of it peeks out from behind the upper one, a veil dims it, its
|
|
58
|
+
* backdrop fades out (the upper modal's backdrop takes over) and it stops reacting to the
|
|
59
|
+
* pointer. Every change runs with the slide transition of the modal, both ways.
|
|
59
60
|
*/
|
|
60
61
|
stackedBehind?: boolean;
|
|
61
62
|
/**
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/** One node of a `<Tree>`: a leaf, or a branch with `children`. */
|
|
3
|
+
export interface TreeNode {
|
|
4
|
+
/** Unique in the tree: it is what `selectedId`, `expanded` and `onSelect` speak of. */
|
|
5
|
+
id: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Icon name; branches default to a folder, leaves to a file. */
|
|
8
|
+
icon?: string;
|
|
9
|
+
/** Shown after the label, e.g. a count or a status. */
|
|
10
|
+
badge?: React.ReactNode;
|
|
11
|
+
/** Muted text after the label, e.g. what a file is for. */
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
children?: TreeNode[];
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface TreeProps {
|
|
17
|
+
nodes: readonly TreeNode[];
|
|
18
|
+
/** Selected node (controlled). */
|
|
19
|
+
selectedId?: string | null;
|
|
20
|
+
/** Selected node at start (uncontrolled). */
|
|
21
|
+
defaultSelectedId?: string | null;
|
|
22
|
+
onSelect?: (node: TreeNode) => void;
|
|
23
|
+
/** Open branches (controlled). */
|
|
24
|
+
expanded?: readonly string[];
|
|
25
|
+
/** Open branches at start (uncontrolled); `true` opens them all. */
|
|
26
|
+
defaultExpanded?: readonly string[] | true;
|
|
27
|
+
onExpandedChange?: (expanded: string[]) => void;
|
|
28
|
+
/** Branches can be selected too, not only opened. Default `false`. */
|
|
29
|
+
selectableBranches?: boolean;
|
|
30
|
+
/** Accessible name of the tree. */
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
wrapperClassName?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
itemClassName?: string;
|
|
35
|
+
selectedClassName?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A tree of nodes (folders and files, a hierarchy), WAI-ARIA tree pattern: one tab stop, arrows to
|
|
39
|
+
* move, → / ← to open and close, Enter or Space to select. Branches open on click; leaves are
|
|
40
|
+
* selected. Expansion and selection work controlled or uncontrolled.
|
|
41
|
+
*/
|
|
42
|
+
export default function Tree({ nodes, selectedId, defaultSelectedId, onSelect, expanded, defaultExpanded, onExpandedChange, selectableBranches, ariaLabel, wrapperClassName, className, itemClassName, selectedClassName, }: TreeProps): React.JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* A tree from `a/b/c` paths: one branch per folder, one leaf per path (its id is the full path,
|
|
45
|
+
* folders get `path/`). Folders come before files, each sorted by name. `leaf` decorates a leaf.
|
|
46
|
+
*/
|
|
47
|
+
export declare function treeFromPaths(paths: readonly string[], leaf?: (path: string) => Partial<TreeNode>): TreeNode[];
|
package/llms-full.txt
CHANGED
|
@@ -578,7 +578,7 @@ Accessibilità: il dialog ha `role="dialog"`, `aria-modal="true"` (non con `stac
|
|
|
578
578
|
| `onSave` / `onDelete` | `(e) => Promise<boolean>` | |
|
|
579
579
|
| `allowFullscreen` | `boolean` | Toggle fullscreen |
|
|
580
580
|
| `showCancel` | `boolean` | Default `true` |
|
|
581
|
-
| `stackedBehind` | `boolean` |
|
|
581
|
+
| `stackedBehind` | `boolean` | Modale sotto un'altra (stile Google Tag Manager): resta a tutta altezza; se laterale scorre verso l'interno di 3rem, così ne sporge una striscia; un velo la scurisce, il suo backdrop sfuma e non riceve il puntatore. Senza scale né filter, con la stessa transizione dello slide, in entrata e in uscita |
|
|
582
582
|
| `closeOnBackdrop` | `boolean` | Default `true` |
|
|
583
583
|
| `closeOnEscape` | `boolean` | Default `true` — solo il modal in cima reagisce |
|
|
584
584
|
| `zIndex` | `number` | |
|
|
@@ -713,6 +713,23 @@ Coppie etichetta → valore in sola lettura (profilo, dati di un record, riepilo
|
|
|
713
713
|
| `truncate` | `boolean` | `false`; un valore testuale diventa il suo `title` |
|
|
714
714
|
| Classi | `wrapperClassName`, `className`, `itemClassName`, `labelClassName`, `valueClassName` | tema `DescriptionList` |
|
|
715
715
|
|
|
716
|
+
### Tree
|
|
717
|
+
Albero accessibile di nodi (cartelle e file, gerarchie): pattern WAI-ARIA tree, un solo tab stop, frecce per muoversi, → / ← per aprire e chiudere, Invio o Spazio per selezionare. Le cartelle si aprono al click, le foglie si selezionano.
|
|
718
|
+
```tsx
|
|
719
|
+
<Tree nodes={treeFromPaths(paths)} defaultExpanded selectedId={path} onSelect={(node) => setPath(node.id)} ariaLabel="File" />
|
|
720
|
+
<Tree nodes={[{ id: 'a', label: 'Docs', children: [{ id: 'a/1', label: 'README.md', badge: <Badge>new</Badge> }] }]} />
|
|
721
|
+
```
|
|
722
|
+
| Prop | Tipo | Note |
|
|
723
|
+
|---|---|---|
|
|
724
|
+
| `nodes` | `TreeNode[]` — `{ id, label, icon?, badge?, description?, children?, disabled? }` | `id` unico; con `children` è una cartella |
|
|
725
|
+
| `selectedId` + `onSelect` / `defaultSelectedId` | `string \| null` | selezione controllata o no |
|
|
726
|
+
| `expanded` + `onExpandedChange` / `defaultExpanded` | `string[]`; `defaultExpanded` anche `true` (tutto aperto) | apertura controllata o no |
|
|
727
|
+
| `selectableBranches` | `boolean` (default `false`) | anche le cartelle si selezionano |
|
|
728
|
+
| `ariaLabel` | `string` | nome accessibile |
|
|
729
|
+
| Classi | `wrapperClassName`, `className`, `itemClassName`, `selectedClassName` | tema `Tree` |
|
|
730
|
+
|
|
731
|
+
`treeFromPaths(paths, leaf?)` costruisce l'albero da percorsi `a/b/c`: cartelle prima dei file, ordinati; l'id di un file è il percorso, quello di una cartella `percorso/`; `leaf(path)` decora le foglie (label, icona, descrizione…).
|
|
732
|
+
|
|
716
733
|
### Dropdown
|
|
717
734
|
```tsx
|
|
718
735
|
<Dropdown trigger={<Icon name="menu" />} position="end">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmnative/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "LLM-native React framework for deterministic UI generation. Data-driven by default, schema-driven optional. Ultra-low token consumption — built for AI agents, not just humans.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
package/themes/cyber.ts
CHANGED
|
@@ -446,6 +446,12 @@ export const components: Theme = {
|
|
|
446
446
|
wrapperClassName: '',
|
|
447
447
|
className: '',
|
|
448
448
|
},
|
|
449
|
+
Tree: {
|
|
450
|
+
wrapperClassName: '',
|
|
451
|
+
className: '',
|
|
452
|
+
itemClassName: '',
|
|
453
|
+
selectedClassName: '',
|
|
454
|
+
},
|
|
449
455
|
DescriptionList: {
|
|
450
456
|
wrapperClassName: '',
|
|
451
457
|
className: '',
|
package/themes/default.ts
CHANGED
|
@@ -460,6 +460,12 @@ export const components: Theme = {
|
|
|
460
460
|
wrapperClassName: '',
|
|
461
461
|
className: '',
|
|
462
462
|
},
|
|
463
|
+
Tree: {
|
|
464
|
+
wrapperClassName: '',
|
|
465
|
+
className: '',
|
|
466
|
+
itemClassName: '',
|
|
467
|
+
selectedClassName: '',
|
|
468
|
+
},
|
|
463
469
|
DescriptionList: {
|
|
464
470
|
wrapperClassName: '',
|
|
465
471
|
className: '',
|
package/themes/flat.ts
CHANGED
|
@@ -446,6 +446,12 @@ export const components: Theme = {
|
|
|
446
446
|
wrapperClassName: '',
|
|
447
447
|
className: '',
|
|
448
448
|
},
|
|
449
|
+
Tree: {
|
|
450
|
+
wrapperClassName: '',
|
|
451
|
+
className: '',
|
|
452
|
+
itemClassName: '',
|
|
453
|
+
selectedClassName: '',
|
|
454
|
+
},
|
|
449
455
|
DescriptionList: {
|
|
450
456
|
wrapperClassName: '',
|
|
451
457
|
className: '',
|