@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.
Files changed (76) hide show
  1. package/package.json +5 -2
  2. package/skills/ndl-react/SKILL.md +152 -0
  3. package/skills/ndl-react/components/accordion.md +386 -0
  4. package/skills/ndl-react/components/ai/code-preview.md +128 -0
  5. package/skills/ndl-react/components/ai/file-tag.md +90 -0
  6. package/skills/ndl-react/components/ai/image-tag.md +91 -0
  7. package/skills/ndl-react/components/ai/more-files.md +73 -0
  8. package/skills/ndl-react/components/ai/presence.md +54 -0
  9. package/skills/ndl-react/components/ai/preview.md +498 -0
  10. package/skills/ndl-react/components/ai/prompt.md +362 -0
  11. package/skills/ndl-react/components/ai/reasoning.md +95 -0
  12. package/skills/ndl-react/components/ai/response.md +1109 -0
  13. package/skills/ndl-react/components/ai/suggestion.md +84 -0
  14. package/skills/ndl-react/components/ai/thinking.md +43 -0
  15. package/skills/ndl-react/components/ai/tool-call.md +43 -0
  16. package/skills/ndl-react/components/ai/user-bubble.md +187 -0
  17. package/skills/ndl-react/components/avatar.md +169 -0
  18. package/skills/ndl-react/components/banner.md +225 -0
  19. package/skills/ndl-react/components/box.md +39 -0
  20. package/skills/ndl-react/components/breadcrumbs.md +245 -0
  21. package/skills/ndl-react/components/checkbox.md +269 -0
  22. package/skills/ndl-react/components/clean-icon-button.md +294 -0
  23. package/skills/ndl-react/components/clipboard-button.md +154 -0
  24. package/skills/ndl-react/components/code-block.md +276 -0
  25. package/skills/ndl-react/components/code.md +68 -0
  26. package/skills/ndl-react/components/color-picker.md +131 -0
  27. package/skills/ndl-react/components/conditional-wrap.md +46 -0
  28. package/skills/ndl-react/components/data-grid.md +3121 -0
  29. package/skills/ndl-react/components/date-picker.md +652 -0
  30. package/skills/ndl-react/components/dialog.md +485 -0
  31. package/skills/ndl-react/components/dismissible-tag.md +136 -0
  32. package/skills/ndl-react/components/divider.md +96 -0
  33. package/skills/ndl-react/components/drawer.md +543 -0
  34. package/skills/ndl-react/components/dropdown-button.md +161 -0
  35. package/skills/ndl-react/components/dropzone.md +371 -0
  36. package/skills/ndl-react/components/filled-button.md +26 -0
  37. package/skills/ndl-react/components/flex.md +82 -0
  38. package/skills/ndl-react/components/graph-label.md +167 -0
  39. package/skills/ndl-react/components/icon-button-array.md +187 -0
  40. package/skills/ndl-react/components/icon-button.md +193 -0
  41. package/skills/ndl-react/components/inline-edit.md +209 -0
  42. package/skills/ndl-react/components/kbd.md +63 -0
  43. package/skills/ndl-react/components/loading-bar.md +43 -0
  44. package/skills/ndl-react/components/loading-spinner.md +57 -0
  45. package/skills/ndl-react/components/logo.md +57 -0
  46. package/skills/ndl-react/components/menu.md +993 -0
  47. package/skills/ndl-react/components/modal.md +27 -0
  48. package/skills/ndl-react/components/next/tree-view.md +966 -0
  49. package/skills/ndl-react/components/outlined-button.md +26 -0
  50. package/skills/ndl-react/components/popover.md +283 -0
  51. package/skills/ndl-react/components/progress-bar.md +70 -0
  52. package/skills/ndl-react/components/radio.md +150 -0
  53. package/skills/ndl-react/components/read-only-tag.md +96 -0
  54. package/skills/ndl-react/components/segmented-control.md +200 -0
  55. package/skills/ndl-react/components/select-icon-button.md +183 -0
  56. package/skills/ndl-react/components/select.md +530 -0
  57. package/skills/ndl-react/components/selectable-tag.md +203 -0
  58. package/skills/ndl-react/components/side-navigation.md +652 -0
  59. package/skills/ndl-react/components/skeleton.md +274 -0
  60. package/skills/ndl-react/components/slider.md +308 -0
  61. package/skills/ndl-react/components/spotlight.md +796 -0
  62. package/skills/ndl-react/components/status-indicator.md +57 -0
  63. package/skills/ndl-react/components/status-label.md +132 -0
  64. package/skills/ndl-react/components/switch.md +167 -0
  65. package/skills/ndl-react/components/tabs.md +433 -0
  66. package/skills/ndl-react/components/tag.md +91 -0
  67. package/skills/ndl-react/components/text-area.md +178 -0
  68. package/skills/ndl-react/components/text-button.md +25 -0
  69. package/skills/ndl-react/components/text-input.md +475 -0
  70. package/skills/ndl-react/components/text-link.md +119 -0
  71. package/skills/ndl-react/components/time-picker.md +137 -0
  72. package/skills/ndl-react/components/timezone-picker.md +496 -0
  73. package/skills/ndl-react/components/tooltip.md +478 -0
  74. package/skills/ndl-react/components/tree-view.md +545 -0
  75. package/skills/ndl-react/components/typography.md +72 -0
  76. package/skills/ndl-react/components/wizard.md +152 -0
@@ -0,0 +1,209 @@
1
+ # InlineEdit
2
+
3
+ Import: `import { InlineEdit } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### InlineEdit
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
12
+ | `blurBehavior` | `'cancel' \| 'confirm' \| 'none'` | | `confirm` | What the input should do on blur - "confirm" will confirm the value - "cancel" will cancel the value - "none" will do nothing |
13
+ | `defaultValue` | `string` | | | The default input value. Use for an uncontrolled component. |
14
+ | `hasEditIcon` | `boolean` | | `false` | If edit pencil icon should be visible on hover |
15
+ | `inputProps` | `HtmlAttributes<"input">` | | | props applied to the internal input element |
16
+ | `isDisabled` | `boolean` | | `false` | |
17
+ | `isEditing` | `boolean` | | `undefined` | If the input is in editing mode Used in a stateless inline edit |
18
+ | `isFluid` | `boolean` | | `false` | If the input is fluid |
19
+ | `label` | `ReactNode` | | | Label text |
20
+ | `onCancel` | `((event?: MouseEvent<HTMLElement, MouseEvent> \| KeyboardEvent<HTMLElement>) => void)` | | | Callback when cancel icon button is pressed |
21
+ | `onChange` | `((value: string) => void)` | | | Callback when the input value changes. Must be used when the component is controlled. |
22
+ | `onConfirm` | `((value: string, event?: MouseEvent<HTMLElement, MouseEvent> \| KeyboardEvent<HTMLElement>) => void)` | | | Callback when confirm icon button is pressed |
23
+ | `placeholder` | `string` | ✅ | | Placeholder text displayed when the input is empty. |
24
+ | `ref` | `any` | | | A ref to apply to the root element. |
25
+ | `typographyVariant` | `'body-large' \| 'body-medium' \| 'body-small' \| 'code' \| 'display' \| 'label' \| 'subheading-large' \| 'subheading-medium' \| 'subheading-small' \| 'title-1' \| 'title-2' \| 'title-3' \| 'title-4'` | | `subheading-medium` | The typographyVariant of the component applied to Typography as its variant. |
26
+ | `value` | `string` | | | The input value. Makes the component controlled. |
27
+
28
+ ## Accessibility
29
+
30
+ ## Implementation guidelines
31
+
32
+ The InlineEdit component provides an accessible inline editing experience. It includes proper ARIA labels, keyboard navigation support (Enter to confirm, Escape to cancel), and focus management. The component supports both controlled and uncontrolled modes, with appropriate screen reader announcements for state changes.
33
+
34
+ ## Examples
35
+
36
+ ### Default
37
+
38
+ ```tsx
39
+ import { InlineEdit } from '@neo4j-ndl/react';
40
+ import { useState } from 'react';
41
+
42
+ const Component = () => {
43
+ const [value, setValue] = useState('Database Name 1');
44
+
45
+ return (
46
+ <InlineEdit
47
+ label="Editable inline edit ✨"
48
+ placeholder="Placeholder"
49
+ defaultValue={value}
50
+ onConfirm={setValue}
51
+ />
52
+ );
53
+ };
54
+
55
+ export default Component;
56
+ ```
57
+
58
+ ### Controlled Editing
59
+
60
+ ```tsx
61
+ import { InlineEdit } from '@neo4j-ndl/react';
62
+
63
+ const Component = () => {
64
+ return (
65
+ <InlineEdit
66
+ isEditing={true}
67
+ label="Controlled Editing"
68
+ placeholder="Placeholder"
69
+ defaultValue="Database Name 1"
70
+ />
71
+ );
72
+ };
73
+
74
+ export default Component;
75
+ ```
76
+
77
+ ### Controlled Value
78
+
79
+ ```tsx
80
+ import { InlineEdit } from '@neo4j-ndl/react';
81
+ import { useRef, useState } from 'react';
82
+
83
+ const Component = () => {
84
+ const initialValue = 'Controlled Value';
85
+ const [value, setValue] = useState(initialValue);
86
+ const previousValueRef = useRef(initialValue);
87
+
88
+ return (
89
+ <InlineEdit
90
+ label="Controlled value"
91
+ placeholder="Placeholder"
92
+ value={value}
93
+ onChange={setValue}
94
+ onConfirm={(newValue, event) => {
95
+ previousValueRef.current = newValue;
96
+ event?.stopPropagation();
97
+ }}
98
+ onCancel={(event) => {
99
+ setValue(previousValueRef.current);
100
+ event?.stopPropagation();
101
+ }}
102
+ />
103
+ );
104
+ };
105
+
106
+ export default Component;
107
+ ```
108
+
109
+ ### Disabled
110
+
111
+ ```tsx
112
+ import { InlineEdit } from '@neo4j-ndl/react';
113
+
114
+ const Component = () => (
115
+ <InlineEdit
116
+ defaultValue="Database Name 1"
117
+ isDisabled={true}
118
+ label="Disabled inline edit ⛔"
119
+ placeholder="Placeholder"
120
+ />
121
+ );
122
+
123
+ export default Component;
124
+ ```
125
+
126
+ ### Fluid
127
+
128
+ ```tsx
129
+ import { InlineEdit } from '@neo4j-ndl/react';
130
+
131
+ const Component = () => {
132
+ return (
133
+ <InlineEdit
134
+ label="Inline edit with fluid width"
135
+ placeholder="Placeholder"
136
+ defaultValue="hello"
137
+ isFluid={true}
138
+ />
139
+ );
140
+ };
141
+
142
+ export default Component;
143
+ ```
144
+
145
+ ### Header
146
+
147
+ ```tsx
148
+ import { InlineEdit } from '@neo4j-ndl/react';
149
+
150
+ const Component = () => {
151
+ return (
152
+ <InlineEdit
153
+ defaultValue="Database Name 1"
154
+ typographyVariant="display"
155
+ placeholder="Placeholder"
156
+ />
157
+ );
158
+ };
159
+
160
+ export default Component;
161
+ ```
162
+
163
+ ### No Confirm On Blur
164
+
165
+ ```tsx
166
+ import { InlineEdit } from '@neo4j-ndl/react';
167
+
168
+ const Component = () => (
169
+ <InlineEdit
170
+ label="Doesn't confirm input on blur"
171
+ defaultValue="Database Name 1"
172
+ blurBehavior="none"
173
+ placeholder="Placeholder"
174
+ />
175
+ );
176
+
177
+ export default Component;
178
+ ```
179
+
180
+ ### With Edit Icon
181
+
182
+ ```tsx
183
+ import { InlineEdit } from '@neo4j-ndl/react';
184
+
185
+ const Component = () => (
186
+ <InlineEdit
187
+ defaultValue="Database Name 1"
188
+ hasEditIcon={true}
189
+ label="Inline Edit with Hover Icon"
190
+ placeholder="Placeholder"
191
+ />
192
+ );
193
+ export default Component;
194
+ ```
195
+
196
+ ### With Placeholder
197
+
198
+ ```tsx
199
+ import { InlineEdit } from '@neo4j-ndl/react';
200
+
201
+ const Component = () => (
202
+ <InlineEdit
203
+ placeholder="Placeholder text"
204
+ label="Placeholder is displayed when defaultValue is empty"
205
+ />
206
+ );
207
+
208
+ export default Component;
209
+ ```
@@ -0,0 +1,63 @@
1
+ # Kbd
2
+
3
+ Import: `import { Kbd } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### Kbd
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
12
+ | `keys` | `ReactNode[]` | | | The main keys to display in the keyboard shortcut. |
13
+ | `modifierKeys` | `KbdKey[]` | | | The modifier keys to display in the keyboard shortcut. |
14
+ | `os` | `'linux' \| 'mac' \| 'windows'` | | | Override the operating system detection for key symbols |
15
+ | `ref` | `any` | | | A ref to apply to the root element. |
16
+
17
+ ## Accessibility
18
+
19
+ ## WAI-ARIA roles and attributes
20
+
21
+ - Renders as a [`<kbd>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd) element by default, which is the semantic HTML element for keyboard input
22
+ - Visual key symbols (e.g. `⌘`, `⇧`) are marked with `aria-hidden="true"` so screen readers skip them
23
+ - A screen-reader-friendly text is generated automatically (e.g. "Shortcut: Command + Shift + K") and rendered in a visually hidden span
24
+
25
+ ## Implementation guidelines
26
+
27
+ - The component handles screen reader announcements internally so no additional ARIA attributes are needed
28
+ - If `modifierKeys` and `keys` are both omitted, the component renders an empty announcement. Always provide at least one of them
29
+ - When using custom `keys` content (e.g. React elements instead of strings), the screen reader text may not resolve correctly. Use string values where possible
30
+
31
+ ### Related WCAG criteria
32
+
33
+ - [1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html) (A): The visual key symbols are non-text content so the component provides a screen-reader-friendly text alternative automatically, but custom React element keys may result in an empty announcement
34
+
35
+ ## Examples
36
+
37
+ ### Default
38
+
39
+ ```tsx
40
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
41
+
42
+ import { Kbd } from '@neo4j-ndl/react';
43
+
44
+ const Component = () => {
45
+ return <Kbd modifierKeys={['meta', 'shift']} keys={['A']} />;
46
+ };
47
+
48
+ export default Component;
49
+ ```
50
+
51
+ ### Sequence
52
+
53
+ ```tsx
54
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
55
+
56
+ import { Kbd } from '@neo4j-ndl/react';
57
+
58
+ const Component = () => {
59
+ return <Kbd keys={['P', '1']} />;
60
+ };
61
+
62
+ export default Component;
63
+ ```
@@ -0,0 +1,43 @@
1
+ # LoadingBar
2
+
3
+ Import: `import { LoadingBar } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### LoadingBar
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
12
+ | `hasRail` | `boolean` | | `false` | |
13
+ | `ref` | `any` | | | A ref to apply to the root element. |
14
+
15
+ ## Examples
16
+
17
+ ### Default
18
+
19
+ ```tsx
20
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
21
+
22
+ import { LoadingBar } from '@neo4j-ndl/react';
23
+
24
+ const Component = () => {
25
+ return <LoadingBar />;
26
+ };
27
+
28
+ export default Component;
29
+ ```
30
+
31
+ ### With Rail
32
+
33
+ ```tsx
34
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
35
+
36
+ import { LoadingBar } from '@neo4j-ndl/react';
37
+
38
+ const Component = () => {
39
+ return <LoadingBar hasRail />;
40
+ };
41
+
42
+ export default Component;
43
+ ```
@@ -0,0 +1,57 @@
1
+ # LoadingSpinner
2
+
3
+ Import: `import { LoadingSpinner } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### LoadingSpinner
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
12
+ | `ref` | `any` | | | A ref to apply to the root element. |
13
+ | `size` | `'large' \| 'medium' \| 'small'` | | `small` | |
14
+
15
+ ## Accessibility
16
+
17
+ ## Implementation guidelines
18
+
19
+ The loading spinner component uses `role='status'` and `aria-label='Loading content'` to notify assistive technologies that a background process is occurring. The `aria-live='polite'` setting ensures screen readers announce the message non-intrusively when the spinner appears or updates. This informs users that content is loading without interrupting their workflow.
20
+
21
+ ## Examples
22
+
23
+ ### Default
24
+
25
+ ```tsx
26
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
27
+
28
+ import { LoadingSpinner } from '@neo4j-ndl/react';
29
+
30
+ const Component = () => {
31
+ return <LoadingSpinner />;
32
+ };
33
+
34
+ export default Component;
35
+ ```
36
+
37
+ ### Sizes
38
+
39
+ ```tsx
40
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
41
+
42
+ import { LoadingSpinner } from '@neo4j-ndl/react';
43
+
44
+ const Component = () => {
45
+ return (
46
+ <div className="n-flex n-gap-token-16">
47
+ <LoadingSpinner size="small" />
48
+
49
+ <LoadingSpinner size="medium" />
50
+
51
+ <LoadingSpinner size="large" />
52
+ </div>
53
+ );
54
+ };
55
+
56
+ export default Component;
57
+ ```
@@ -0,0 +1,57 @@
1
+ # Logo
2
+
3
+ Import: `import { Logo } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### Logo
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `color` | `'black' \| 'color' \| 'white'` | | | |
12
+ | `ref` | `Ref<SVGSVGElement>` | | | A ref to apply to the root element. |
13
+ | `type` | `'full' \| 'icon'` | | `full` | |
14
+
15
+ ## Examples
16
+
17
+ ### Default
18
+
19
+ ```tsx
20
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
21
+
22
+ import { Logo } from '@neo4j-ndl/react';
23
+
24
+ const Component = () => {
25
+ return <Logo className="n-w-24" />;
26
+ };
27
+
28
+ export default Component;
29
+ ```
30
+
31
+ ### Black
32
+
33
+ ```tsx
34
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
35
+
36
+ import { Logo } from '@neo4j-ndl/react';
37
+
38
+ const Component = () => {
39
+ return <Logo className="n-w-24" color="black" />;
40
+ };
41
+
42
+ export default Component;
43
+ ```
44
+
45
+ ### Icon
46
+
47
+ ```tsx
48
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
49
+
50
+ import { Logo } from '@neo4j-ndl/react';
51
+
52
+ const Component = () => {
53
+ return <Logo className="n-w-24" type="icon" />;
54
+ };
55
+
56
+ export default Component;
57
+ ```