@neo4j-ndl/react 4.16.8 → 4.16.9
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/package.json +5 -2
- package/skills/ndl-react/SKILL.md +152 -0
- package/skills/ndl-react/components/accordion.md +386 -0
- package/skills/ndl-react/components/ai/code-preview.md +128 -0
- package/skills/ndl-react/components/ai/file-tag.md +90 -0
- package/skills/ndl-react/components/ai/image-tag.md +91 -0
- package/skills/ndl-react/components/ai/more-files.md +73 -0
- package/skills/ndl-react/components/ai/presence.md +54 -0
- package/skills/ndl-react/components/ai/preview.md +498 -0
- package/skills/ndl-react/components/ai/prompt.md +362 -0
- package/skills/ndl-react/components/ai/reasoning.md +95 -0
- package/skills/ndl-react/components/ai/response.md +1109 -0
- package/skills/ndl-react/components/ai/suggestion.md +84 -0
- package/skills/ndl-react/components/ai/thinking.md +43 -0
- package/skills/ndl-react/components/ai/tool-call.md +43 -0
- package/skills/ndl-react/components/ai/user-bubble.md +187 -0
- package/skills/ndl-react/components/avatar.md +169 -0
- package/skills/ndl-react/components/banner.md +225 -0
- package/skills/ndl-react/components/box.md +39 -0
- package/skills/ndl-react/components/breadcrumbs.md +245 -0
- package/skills/ndl-react/components/checkbox.md +269 -0
- package/skills/ndl-react/components/clean-icon-button.md +294 -0
- package/skills/ndl-react/components/clipboard-button.md +154 -0
- package/skills/ndl-react/components/code-block.md +276 -0
- package/skills/ndl-react/components/code.md +68 -0
- package/skills/ndl-react/components/color-picker.md +131 -0
- package/skills/ndl-react/components/conditional-wrap.md +46 -0
- package/skills/ndl-react/components/data-grid.md +3121 -0
- package/skills/ndl-react/components/date-picker.md +652 -0
- package/skills/ndl-react/components/dialog.md +485 -0
- package/skills/ndl-react/components/dismissible-tag.md +136 -0
- package/skills/ndl-react/components/divider.md +96 -0
- package/skills/ndl-react/components/drawer.md +543 -0
- package/skills/ndl-react/components/dropdown-button.md +161 -0
- package/skills/ndl-react/components/dropzone.md +371 -0
- package/skills/ndl-react/components/filled-button.md +26 -0
- package/skills/ndl-react/components/flex.md +82 -0
- package/skills/ndl-react/components/graph-label.md +167 -0
- package/skills/ndl-react/components/icon-button-array.md +187 -0
- package/skills/ndl-react/components/icon-button.md +193 -0
- package/skills/ndl-react/components/inline-edit.md +209 -0
- package/skills/ndl-react/components/kbd.md +63 -0
- package/skills/ndl-react/components/loading-bar.md +43 -0
- package/skills/ndl-react/components/loading-spinner.md +57 -0
- package/skills/ndl-react/components/logo.md +57 -0
- package/skills/ndl-react/components/menu.md +993 -0
- package/skills/ndl-react/components/modal.md +27 -0
- package/skills/ndl-react/components/next/tree-view.md +966 -0
- package/skills/ndl-react/components/outlined-button.md +26 -0
- package/skills/ndl-react/components/popover.md +283 -0
- package/skills/ndl-react/components/progress-bar.md +70 -0
- package/skills/ndl-react/components/radio.md +150 -0
- package/skills/ndl-react/components/read-only-tag.md +96 -0
- package/skills/ndl-react/components/segmented-control.md +200 -0
- package/skills/ndl-react/components/select-icon-button.md +183 -0
- package/skills/ndl-react/components/select.md +530 -0
- package/skills/ndl-react/components/selectable-tag.md +203 -0
- package/skills/ndl-react/components/side-navigation.md +652 -0
- package/skills/ndl-react/components/skeleton.md +274 -0
- package/skills/ndl-react/components/slider.md +308 -0
- package/skills/ndl-react/components/spotlight.md +796 -0
- package/skills/ndl-react/components/status-indicator.md +57 -0
- package/skills/ndl-react/components/status-label.md +132 -0
- package/skills/ndl-react/components/switch.md +167 -0
- package/skills/ndl-react/components/tabs.md +433 -0
- package/skills/ndl-react/components/tag.md +91 -0
- package/skills/ndl-react/components/text-area.md +178 -0
- package/skills/ndl-react/components/text-button.md +25 -0
- package/skills/ndl-react/components/text-input.md +475 -0
- package/skills/ndl-react/components/text-link.md +119 -0
- package/skills/ndl-react/components/time-picker.md +137 -0
- package/skills/ndl-react/components/timezone-picker.md +496 -0
- package/skills/ndl-react/components/tooltip.md +478 -0
- package/skills/ndl-react/components/tree-view.md +545 -0
- package/skills/ndl-react/components/typography.md +72 -0
- package/skills/ndl-react/components/wizard.md +152 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# FileTag
|
|
2
|
+
|
|
3
|
+
Import: `import { FileTag } from '@neo4j-ndl/react/ai'`
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### FileTag
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Required | Default | Description |
|
|
10
|
+
|------|------|----------|---------|-------------|
|
|
11
|
+
| `fileName` | `string` | ✅ | | The name of the file |
|
|
12
|
+
| `fileType` | `string` | ✅ | | The type of the file, e.g. 'pdf', 'docx', 'txt', etc. |
|
|
13
|
+
| `icon` | `ReactNode` | ✅ | | The icon that represents the file type |
|
|
14
|
+
| `isLoading` | `boolean` | | `false` | Whether the file tag is loading |
|
|
15
|
+
| `isRemovable` | `boolean` | | `false` | Whether the file tag is removable |
|
|
16
|
+
| `onClick` | `((e: MouseEvent<HTMLElement, MouseEvent>) => void)` | | | Callback function triggered either when the file tag is clicked, or when the remove button is clicked (if isRemovable is true) |
|
|
17
|
+
| `ref` | `any` | | | A ref to apply to the root element. |
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### Chat
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
25
|
+
|
|
26
|
+
import { FileTag } from '@neo4j-ndl/react/ai';
|
|
27
|
+
import { DocumentIconOutline } from '@neo4j-ndl/react/icons';
|
|
28
|
+
|
|
29
|
+
const Component = () => {
|
|
30
|
+
return (
|
|
31
|
+
<FileTag
|
|
32
|
+
icon={<DocumentIconOutline />}
|
|
33
|
+
fileName="Science Fiction Bestsellers"
|
|
34
|
+
fileType="pdf"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Component;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Loading
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
46
|
+
|
|
47
|
+
import { FileTag } from '@neo4j-ndl/react/ai';
|
|
48
|
+
import { DocumentIconOutline } from '@neo4j-ndl/react/icons';
|
|
49
|
+
|
|
50
|
+
const Component = () => {
|
|
51
|
+
return (
|
|
52
|
+
<FileTag
|
|
53
|
+
isLoading={true}
|
|
54
|
+
icon={<DocumentIconOutline />}
|
|
55
|
+
fileName="Science Fiction Bestsellers"
|
|
56
|
+
fileType="pdf"
|
|
57
|
+
onClick={() => {
|
|
58
|
+
alert('remove file');
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Component;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Prompt
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
71
|
+
|
|
72
|
+
import { FileTag } from '@neo4j-ndl/react/ai';
|
|
73
|
+
import { DocumentIconOutline } from '@neo4j-ndl/react/icons';
|
|
74
|
+
|
|
75
|
+
const Component = () => {
|
|
76
|
+
return (
|
|
77
|
+
<FileTag
|
|
78
|
+
icon={<DocumentIconOutline />}
|
|
79
|
+
fileName="Science Fiction Bestsellers"
|
|
80
|
+
fileType="pdf"
|
|
81
|
+
isRemovable={true}
|
|
82
|
+
onClick={() => {
|
|
83
|
+
alert('remove file');
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default Component;
|
|
90
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# ImageTag
|
|
2
|
+
|
|
3
|
+
Import: `import { ImageTag } from '@neo4j-ndl/react/ai'`
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### ImageTag
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Required | Default | Description |
|
|
10
|
+
|------|------|----------|---------|-------------|
|
|
11
|
+
| `alt` | `string` | ✅ | | The alt text of the image |
|
|
12
|
+
| `fileName` | `string` | ✅ | | The name of the image |
|
|
13
|
+
| `fileType` | `string` | ✅ | | The type of the image, e.g. 'jpg', 'png', 'gif', etc. |
|
|
14
|
+
| `isLoading` | `boolean` | | `false` | Whether the image tag is loading |
|
|
15
|
+
| `isRemovable` | `boolean` | | `false` | Whether the image tag is removable |
|
|
16
|
+
| `onClick` | `((e: MouseEvent<HTMLElement, MouseEvent>) => void)` | | | Callback function triggered either when the image tag is clicked, or when the remove button is clicked (if isRemovable is true) |
|
|
17
|
+
| `ref` | `any` | | | A ref to apply to the root element. |
|
|
18
|
+
| `src` | `string` | ✅ | | The source of the image |
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
### Chat
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
26
|
+
|
|
27
|
+
import { ImageTag } from '@neo4j-ndl/react/ai';
|
|
28
|
+
|
|
29
|
+
const Component = () => {
|
|
30
|
+
return (
|
|
31
|
+
<ImageTag
|
|
32
|
+
src="https://plus.unsplash.com/premium_photo-1676496046182-356a6a0ed002?q=80&w=2952&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
|
33
|
+
alt="Landscape image"
|
|
34
|
+
fileName="Landscape image"
|
|
35
|
+
fileType="jpg"
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default Component;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Loading
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
47
|
+
|
|
48
|
+
import { ImageTag } from '@neo4j-ndl/react/ai';
|
|
49
|
+
|
|
50
|
+
const Component = () => {
|
|
51
|
+
return (
|
|
52
|
+
<ImageTag
|
|
53
|
+
isLoading={true}
|
|
54
|
+
src="https://plus.unsplash.com/premium_photo-1676496046182-356a6a0ed002?q=80&w=2952&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
|
55
|
+
alt="Landscape image"
|
|
56
|
+
fileName="Landscape image"
|
|
57
|
+
fileType="jpg"
|
|
58
|
+
onClick={() => {
|
|
59
|
+
alert('remove image');
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default Component;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Prompt
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
72
|
+
|
|
73
|
+
import { ImageTag } from '@neo4j-ndl/react/ai';
|
|
74
|
+
|
|
75
|
+
const Component = () => {
|
|
76
|
+
return (
|
|
77
|
+
<ImageTag
|
|
78
|
+
src="https://plus.unsplash.com/premium_photo-1676496046182-356a6a0ed002?q=80&w=2952&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
|
79
|
+
alt="Landscape image"
|
|
80
|
+
fileName="Landscape image"
|
|
81
|
+
fileType="jpg"
|
|
82
|
+
isRemovable={true}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
alert('remove image');
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default Component;
|
|
91
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# MoreFilesComponent
|
|
2
|
+
|
|
3
|
+
Import: `import { MoreFilesComponent } from '@neo4j-ndl/react/ai'`
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### MoreFilesComponent
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Required | Default | Description |
|
|
10
|
+
|------|------|----------|---------|-------------|
|
|
11
|
+
| `count` | `number` | ✅ | | The number of files to show |
|
|
12
|
+
| `isActive` | `boolean` | | | Whether the more files button is active. Should be true when it opens the menu of files. |
|
|
13
|
+
| `onClick` | `(() => void)` | | | Callback function triggered when the more files button is clicked |
|
|
14
|
+
| `ref` | `Ref<HTMLButtonElement>` | | | A ref to apply to the root element. |
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
### Default
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
|
|
23
|
+
import { Menu } from '@neo4j-ndl/react';
|
|
24
|
+
import { MoreFiles } from '@neo4j-ndl/react/ai';
|
|
25
|
+
import {
|
|
26
|
+
DocumentIconOutline,
|
|
27
|
+
PhotoIconOutline,
|
|
28
|
+
TableCellsIconOutline,
|
|
29
|
+
} from '@neo4j-ndl/react/icons';
|
|
30
|
+
import { useRef, useState } from 'react';
|
|
31
|
+
|
|
32
|
+
const Component = () => {
|
|
33
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
34
|
+
const anchorRef = useRef<HTMLButtonElement | null>(null);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<MoreFiles
|
|
39
|
+
count={3}
|
|
40
|
+
isActive={isMenuOpen}
|
|
41
|
+
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
|
42
|
+
ref={anchorRef}
|
|
43
|
+
/>
|
|
44
|
+
<Menu
|
|
45
|
+
isOpen={isMenuOpen}
|
|
46
|
+
anchorRef={anchorRef}
|
|
47
|
+
onClose={() => setIsMenuOpen(false)}
|
|
48
|
+
>
|
|
49
|
+
<Menu.Item
|
|
50
|
+
leadingVisual={<DocumentIconOutline />}
|
|
51
|
+
title="Science fiction bestseller"
|
|
52
|
+
description="PDF"
|
|
53
|
+
onClick={() => alert('Science fiction bestseller')}
|
|
54
|
+
/>
|
|
55
|
+
<Menu.Item
|
|
56
|
+
leadingVisual={<TableCellsIconOutline />}
|
|
57
|
+
title="MoviesDecade"
|
|
58
|
+
description="CSV"
|
|
59
|
+
onClick={() => alert('MoviesDecade')}
|
|
60
|
+
/>
|
|
61
|
+
<Menu.Item
|
|
62
|
+
leadingVisual={<PhotoIconOutline />}
|
|
63
|
+
title="Family photo"
|
|
64
|
+
description="JPG"
|
|
65
|
+
onClick={() => alert('Family photos')}
|
|
66
|
+
/>
|
|
67
|
+
</Menu>
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default Component;
|
|
73
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Presence
|
|
2
|
+
|
|
3
|
+
Import: `import { Presence } from '@neo4j-ndl/react/ai'`
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### Presence
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Required | Default | Description |
|
|
10
|
+
|------|------|----------|---------|-------------|
|
|
11
|
+
| `isThinking` | `boolean` | | `false` | Whether the AI is thinking. Animates the underlying SVG |
|
|
12
|
+
| `ref` | `Ref<SVGSVGElement>` | | | A ref to apply to the root element. |
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Ai Presence Default
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
20
|
+
|
|
21
|
+
import { FilledButton } from '@neo4j-ndl/react';
|
|
22
|
+
import { Presence } from '@neo4j-ndl/react/ai';
|
|
23
|
+
import { useState } from 'react';
|
|
24
|
+
|
|
25
|
+
const Component = () => {
|
|
26
|
+
const [isThinking, setIsThinking] = useState(false);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="n-flex n-gap-token-8">
|
|
30
|
+
<Presence className="n-size-token-32" isThinking={isThinking} />
|
|
31
|
+
<FilledButton onClick={() => setIsThinking(!isThinking)}>
|
|
32
|
+
Toggle Thinking
|
|
33
|
+
</FilledButton>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default Component;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Ai Presence Thinking
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
45
|
+
|
|
46
|
+
import { Presence } from '@neo4j-ndl/react/ai';
|
|
47
|
+
|
|
48
|
+
// TODO: consider this story when happo is ready
|
|
49
|
+
const Component = () => {
|
|
50
|
+
return <Presence isThinking className="n-size-token-32" />;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default Component;
|
|
54
|
+
```
|